query
stringlengths
7
355k
document
stringlengths
9
341k
metadata
dict
negatives
sequencelengths
0
101
negative_scores
sequencelengths
0
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Update mouse position and play a sound
function mousePressed() { // Store mouse position when pressed mouse = [mouseX, mouseY]; // Hirajoshi scale in C // https://www.pianoscales.org/hirajoshi.html const notes = ["C", "Db", "F", "Gb", "Bb"]; const octaves = [2, 3, 4]; const octave = random(octaves); const note = random(notes); synth.triggerAttackRelease(note + octave, "8n"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function mousePressed() {\n screamSound.play();\n}", "playSound() {\n let d = dist(width / 2, height / 2, mouseX, mouseY);\n if (d < defaultSoloSize) {\n (this.sound).play();\n } else {\n (this.sound).stop(); // stop the sound if the user hovers away from the planet\n }\n }", "function mousePressed() {\n setInterval(playSong, 500);\n}", "function mousePressed() {\n userStartAudio();\n}", "function onMouseMove(e){\n if (mouseDown === true){\n let x1 = e.clientX;\n let y1 = e.clientY;\n if (Math.abs(x1-x) >= delta || Math.abs(y1-y) >= delta){\n x = x1;\n y = y1;\n triggerSynthSound(x,y);\n pop(x, y, numParticles);\n }\n }\n}", "function mousePressed(){\n if(mouseX<205&&mouseX>195&&mouseY<205&&mouseY>195&&state==\"1\"){\n state=\"2\";\n }else if(mouseX<205&&mouseX>195&&mouseY<205&&mouseY>195&&state==\"2\"){\n state=\"1\"; \n song.play();\n }\n}", "function playSound() {\n // play the source now\n soundSource.noteOn(context.currentTime);\n }", "function mousePressed(){\n //stretch foreo\n off();\n sound.play();\n }", "function mousePressed() {\n\t\tfire.play();\n\t \n\tappend(xNotes, mouseX);\n\tappend(yNotes, mouseY);\n\tappend(radiusNotes, 1);\n}", "function onMouseDown(e){\n mouseDown = true;\n x = e.clientX;\n y = e.clientY;\n triggerSynthSound(x,y);\n pop(x, y, numParticles);\n}", "update(){\n if(this.microphone){\n Howler.pos(this.pos.x, this.pos.y, this.pos.z);\n } \n if(this.positional){\n this.sound.pos(this.pos.x, this.pos.y, this.pos.z);\n } \n }", "update(){\n if(this.microphone){\n Howler.pos(this.pos.x, this.pos.y, this.pos.z);\n } \n if(this.positional){\n this.sound.pos(this.pos.x, this.pos.y, this.pos.z);\n } \n }", "function mousePressed(){\n userStartAudio();\n \n //let tempH = hPosition;\n /*\n if (mouseX < width*0.5){\n program();\n return;\n }\n \n //hPosition = tempH;\n \n if (mouseY < height*0.5) {\n if (hPosition>=1)hPosition--;}\n else hPosition++;\n \n */\n}", "function mousePressed() {\n let d = dist(mouseX, mouseY, bottonX, bottonY);\n if (d < 50) {\n playGame = \"P\";\n //put the sound on loop \n gameSound.loop();\n }\n}", "function mousePressed() {\n // if the song is not playing\n if (!song.isPlaying()) {\n song.play(); // play the song\n }\n}", "function triggerSynthSound(x, y){\n // Deterministically generate a note and its octave based on the (x,y) of mouse position\n var note = notes[x % notes.length];\n var octave = octaves[y % octaves.length];\n var fullNote = note + octave;\n console.log(fullNote + \" \" + x + \" \" + y);\n synth.triggerAttackRelease(fullNote, \"16n\");\n}", "function mouseWheel() {\n song.play();\n song.loop();\n song.volume(5);\n}", "function mousePressed() {\n mode++;\n song.play();\n}", "function moveSound () {\n var snd = new Audio(\"audio/move.wav\");\n snd.play();\n }", "function mousePressed() {\n console.log(\"mouse pressed at \" + mouseX + \" and \" + mouseY)\n // DROP DOWN MENU\n if (mouseX < windowWidth && mouseX > windowWidth-220) {\n if (mouseY < 50) {\n if (menuDown == true) {\n menuDown = false; \n }\n else {\n menuDown = true; \n }\n }\n else if (menuDown == true) {\n if (mouseY >= 50 && mouseY < 70) {\n if (curSong) {curSong.stop();}\n curSong = sametome;\n curSong.play();\n playing = true; \n } \n else if (mouseY >= 80 && mouseY < 100) {\n if (curSong) {curSong.stop();}\n curSong = beginning;\n curSong.play();\n playing = true; \n }\n else if (mouseY >= 110 && mouseY < 140) {\n if (curSong) {curSong.stop();}\n curSong = endofp;\n curSong.play();\n playing = true; \n }\n else if (mouseY >= 140 && mouseY < 170) {\n if (curSong) {curSong.stop();}\n curSong = getup;\n curSong.play();\n playing = true; \n }\n else if (mouseY >= 170 && mouseY < 200) {\n if (curSong) {curSong.stop();}\n curSong = greenlight;\n curSong.play();\n playing = true; \n }\n else if (mouseY >= 200 && mouseY < 230) {\n if (curSong) {curSong.stop();}\n curSong = itslikethat;\n curSong.play();\n playing = true; \n }\n else if (mouseY >= 230 && mouseY < 260) {\n if (curSong) {curSong.stop();}\n curSong = willhe;\n curSong.play();\n playing = true; \n }\n }\n }\n // PLAY PAUSE\n else if (mouseY<= 60 && mouseX <= 60) {\n if (playing == false) {\n if (curSong) {\n curSong.play(); \n playing = true; \n }\n }\n else {\n if (curSong) {\n curSong.pause(); \n playing = false; \n }\n }\n }\n // REMOVE INSTRUCTIONS\n if (INSTR == true) {\n INSTR = false; \n console.log(\"instr down\"); \n }\n // INFO CLICK\n if (mouseX > width-60 && mouseY > height-60) {\n console.log(\"instr up\"); \n INSTR = true; \n }\n}", "function mousePressed() {\n if(!song.isPlaying()){ song.play(); } else{ song.pause(); }}", "function playSynth() {\n// // What's this thing do?\n// userStartAudio();\n//\n// // note duration (in seconds)\n// let note_dur = 0.5;\n//\n// // time from right now\n// let time = 0;\n//\n// // velocity for some reason?\n// let vel = 0.1;\n//\n// // What's going on all in here then now?\n// polySynth.play('C3', vel, 0, note_dur);\n\n const note = floor(map(mouseX/4, 0, 400, 20, 80));\n const freq = midiToFreq(note);\n oscillator.freq(freq);\n envelope.triggerAttack();\n}", "function mousePressed() {\r\n target.position.x = mouseX;\r\n target.position.y = mouseY;\r\n recordtime = lifetime;\r\n}", "function mousePressed() {\n if (audioUFO.isPlaying()) {\n audioUFO.pause();\n } else {\n audioUFO.play();\n }\n if (audioCows.isPlaying()) {\n audioCows.pause();\n } else {\n audioCows.play();\n }\n}", "function mouseClicked(){\n mouse_bool = true; \n music_bool = true; \n\n}", "function mousePressed() {\r\n\tif (song.isPlaying()) {\r\n\t song.stop();\r\n\t} else {\r\n\t song.play();\r\n\t}\r\n }", "function mousePressed() {\n\t// if(frequency_index < chosenFrequencies.length-1){\n\t// \tfrequency_index++;\n\t// } else {\n\t// \tfrequency_index = 0;\n\t// }\n\t// osc.freq(chosenFrequencies[frequency_index]);\n\tif(localDebug){\n\t\tconsole.log(\"mousepress\");\n\t}\n\tif(!started){\n\t\t//Should already be looping from above loopSilence function\n\t\tsilencesamp.play();\n\t\tif(localDebug){\n\t\t\tconsole.log(\"start user interaction audio\");\n\t\t}\n\t\t//Enables no sleep, which keeps the phone screen alive as an extra precaution\n\t\tnoSleep.enable();\n\t\t//Ensures this does not run again\n\t\tstarted = true;\n\t}\n\t\n}", "function mousePressed() {\n // Here's Wispy to keep you company while I work on oscillation.\n // wispy.activate(\n // 50, // amplitude\n // 10, // period\n // 10 // delay\n // )\n\n for (let particle of particles) {\n particle.activate(\n 16, // amplitude\n 8, // period\n particle.originalX // delay. This should change as the\n // particles get farther from the origin's x-coordinate. I can\n // also subtract the\n )\n }\n}", "function mousePressed() {\n if (song1.isPlaying()) {\n // .isPlaying() returns a boolean\n song1.stop();\n background(255, 0, 0);\n } else {\n song1.play();\n background(0, 255, 0);\n }\n }", "function soundEvent(event, s) { //now that i've reviewed our code, passing in the type of event is completely unnecessary wth was i thinking\n //debugging\n print(\"you're in sector \" + s.x + \", \" + s.y + \"!\")\n if (event == ' ') {\n print(\"mouse event recieved!\");\n \n } else {\n print(event + \" key event recieved!\");\n }\n \n if (s.x == 0){\n if (s.y == 0) {\n sfx[0].play();\n } else if (s.y == 1) {\n sfx[1].play();\n } else if (s.y == 2) {\n sfx[2].play();\n } else if (s.y == 3) {\n sfx[3].play();\n }\n } else if (s.x == 1) {\n if (s.y == 0) {\n sfx[4].play();\n } else if (s.y == 1) {\n sfx[5].play();\n } else if (s.y == 2) {\n sfx[6].play();\n } else if (s.y == 3) {\n sfx[7].play();\n }\n } else if (s.x == 2) {\n if (s.y == 0) {\n sfx[8].play();\n } else if (s.y == 1) {\n sfx[9].play();\n } else if (s.y == 2) {\n sfx[10].play();\n } else if (s.y == 3) {\n sfx[11].play();\n }\n } else if (s.x == 3) {\n if (s.y == 0) {\n sfx[12].play();\n } else if (s.y == 1) {\n sfx[13].play();\n } else if (s.y == 2) {\n sfx[14].play();\n } else if (s.y == 3) {\n sfx[15].play();\n }\n } else {\n sfx[16].play();\n }\n \n \n}", "function mousePressed(event) {\n\t// number below chooses the pitch of the note played\n playNote(62);\n}", "function mousePressed() {\n let d = dist(mouseX, mouseY, bottonX, bottonY);\n if (d < 50) {\n startGame = true;\n //put the sound on loop\n gameSound.loop();\n }\n}", "function mousePressed() {\n if (state === `start`) {\n backgroundMusic.play();\n backgroundMusic.loop();\n state = `game`;\n } else if (state === `game`) {\n gamestop.mousePressed();\n }\n}", "setupBGMusic(){\n\t\t\tthis.bgMusicAudio = new Audio(); \n\t\t\tthis.bgMusicAudio.src = \"assets/Sounds/polka_train.ogg\";\n\t\t\tthis.addToContainer(this.bgMusicAudio);\n\t\t\t\n\t\t\tvar bgMusicAudio = this.bgMusicAudio;\n\t\t\t\n\t\t\tthis.container.addEventListener(\"mousemove\", function () {\n \t\t\tbgMusicAudio.play();\n\n \t\t});\n\t\t}", "function mousePressed() {\n for (let i = 0; i < musicBlocks.length; i++) {\n let musicBlock = musicBlocks[i];\n\n musicBlock.mousePressed(width / 2, height / 2);\n\n }\n}", "function PlayHitSound() { \n \n hitSound.play()\n console.log(\"play\")\n}", "function updateSeekBar() {\r\n if(!mouseDown) {\r\n seekbar.value = audio.currentTime;\r\n currentTime.innerHTML = toMinSec(audio.currentTime);\r\n }\r\n}", "function mousePressed() {\n if (song.isPlaying()) {\n // .isPlaying() returns a boolean\n song.stop();\n \n } else {\n song.play();\n \n }\n}", "function pacSound(){\n //const move = new Audio('pacman_chomp.wav')\n //move.play()\n }", "function updateHowlerPosition() {\n\tlet cameraPosition = (new THREE.Vector3(0, 1.6, 0)).add(document.querySelector(\"a-scene\").camera.position);\n\tHowler.pos(cameraPosition.x, cameraPosition.y, cameraPosition.z, radioPlayingSound);\n}", "function mouseReleased() {\n // if the song is playing\n if (song.isPlaying()) {\n song.pause(); // pause the song\n }\n}", "function mousePressed() {\n if (!tg1Song.isPlaying()) {\n tg1Song.play();\n } else {\n tg1Song.pause();\n }\n}", "function useMouse (){\n\t\tstage.removeChild (chooseS);\n\t\tc.Ticker.addEventListener (\"tick\", foreverMouse);\t\n\t\t handleMouseBool = true;\n\t\t\tstartedBool = true;\n\t\t startGame ();\n\t\t\t\n\t\t\t\t\n\t\t //console.log (\"mouse gameplay\");\n\t\t\n\t\t\n\t\t}", "function playStartSound() {\n\tg_resourceLoader.soundEffects[7].currentTime = 0;\n\tg_resourceLoader.soundEffects[7].play();\n}", "function mouseDragged(){\r\n Matter.Body.setPosition(particle, {x: mouseX , y: mouseY});\r\n}", "function playSound()\r\n {\r\n try\r\n {\r\n intel.xdk.player.playSound(\"sounds/flute_play.wav\"); \r\n }\r\n catch(e) { } \r\n }", "function mousePressed() {\n background(0);\n noStroke();\n spellSound.play();\n}", "function mousePressed() {\n // Start an interval for the notes\n setInterval(playNote,NOTE_TEMPO);\n // Start an interval for the drums\n setInterval(playDrum,DRUM_TEMPO);\n}", "update() {\n if (this.pressed) {\n this.x = mouseX;\n this.y = mouseY;\n }\n }", "function mouseClicked() {\n displayTriangles(); // display main triangles\n opacity = 0;\n moveTriangles();\n if (playMode == 0) {\n music.play();\n playMode = 'sustain';\n }\n}", "playSound() {\n if (this.sound) {\n this._soundID = this.sound.play(this.playheadSoundOffsetMS + this.cropSoundOffsetMS, this.soundVolume);\n }\n }", "function addMouseEvent() {\n document.addEventListener('mousemove', updateScreenCoords);\n\n // gsap's RAF, falls back to set timeout\n gsap.ticker.add(animateFace);\n\n blink.play();\n }", "function playSound()\n {\n // Stop and rewind the sound if it already happens to be playing.\n audio.pause();\n audio.currentTime = 0;\n // Play the sound.\n audio.play();\n }", "function mousePressed() {\n // Map mouse to the key index\n var key = floor(map(mouseX, 0, width, 0, notes.length));\n playNote(notes[key]);\n}", "function bounceSound() {\n\tAudioSource.PlayClipAtPoint(bounce, gameObject.transform.position);\n}", "play() {\n\t\t\t//console.log('pressed');\n\t\t\tif(!this.active) {\n\t\t\t\tthis.active = true;\n\t\t\t\tMIDI.noteOn(0, this.note, this.velocity, this.delay);\n\t\t\t\tthis.renderOn();\n\t\t\t}\n\t\t}", "function fireSound() {\n eatSound.play();\n eatSound.volume = 1;\n}", "function playSample(_sound) {\n Soccer.sound[_sound].play();\n }", "play() {\n this._source.play();\n }", "function touchStarted(){\n song.play();\n}", "function checkPosition(){\r\n\t\tvar audio = new Audio('sounds/glove.mp3');\r\n\taudio.play();\t\r\n}", "function playNote(cursor, noteRect, sound) {\n const cursorRect = cursor.getBoundingClientRect();\n\n if (cursorRect.right >= noteRect.left) {\n playSound(sound);\n } else {\n window.requestAnimationFrame(()=> {\n playNote(cursor, noteRect, sound);\n });\n }\n}", "function updateMouse() {\n mouse.x = random(mouse.rX);\n mouse.y = random(mouse.rY);\n}", "function playTShootAudio()\n\t{\n\n\t}", "function touchStarted() {\n\n if (soundButton.checkClick()) {\n toggleSound();\n return;\n }\n //launch_wave = true;\n //Play sound\n //if (sndTap) sndTap.play();\n}", "function onClick(event) {\n var pos = new vec2d(event.clientX, event.clientY);\n var coords = \"X coords: \" + pos.x + \", Y coords: \" + pos.y;\n document.getElementById(\"demo\").innerHTML = coords;\n\t//var bleep = new Audio();\n //bleep.src = \"dustyroom_multimedia_positve_correct_complete_ping.mp3\";\n if (!Buttons.map && pos.dist(new vec2d(center_w - 240, center_h + 260)) < 40) {\n \tButtons.map = true;\n \tButtons.engi = false;\n \tunactivate_butts(ctx);\n \tdraw_map_butt(ctx, true);\n\t //bleep.play();\n }\n else if (!Buttons.engi && center_w-350<pos.x && pos.x<center_w-300 && center_h+213<pos.y && pos.y<center_h+300) {\n \tButtons.engi = true;\n \tButtons.map = false;\n \tunactivate_butts(ctx);\n \tdraw_engi_butt(ctx, true);\n\t //bleep.play();\n }\n}", "function update(){\n winSong.pause();\n soundtrack.play();\n gameLoop = requestAnimationFrame(update);\n getInput();\n enemyMovement();\n physics();\n wrapPlayers();\n drawGame();\n}", "function whistleButton(){\n var whistleSound= document.getElementById(\"whistle\");\n whistleSound.currentTime=0;\n whistleSound.play();\n console.log(whistleSound.currentTime);\n }", "function playSFXGunClick (event) {\n sfxGunClick.currentTime = 0;\n $(sfxGunClick).each(function(){this.play(); $(this).animate({volume:1},1000)});\n }", "function playSound(sound)\r\n{\r\n sound.currentTime = 0;\r\n sound.play();\r\n}", "function mousePressed() {\n \n var key = floor(map(mouseX, 0, width, 0, midiNotes.length));\n console.log(key);\n // playNote(notes[key]);\n playNote(midiNotes[0]);\n }", "function playPShootAudio()\n\t{\n\t\tpShootAudio.pause();\n\t\tpShootAudio.currentTime = 0;\n\t\tpShootAudio.play();\n\t}", "function _play()\n {\n timeout_handle = requestAnimationFrame(function(timestamp) {\n update(timestamp);\n interpolate(timestamp);\n draw();\n \n if (currentIndexPosition == _fileLength()-1)\n {\n _pause();\n }\n _play();\n });\n }", "function launchSound() {\n soundEffect(\n 523.25, //frequency\n 0.05, //attack\n 0.2, //decay\n \"sine\", //waveform\n 3, //volume\n 0.8, //pan\n 0, //wait before playing\n 600, //pitch bend amount\n true, //reverse\n 100, //random pitch range\n 0, //dissonance\n undefined, //echo: [delay, feedback, filter]\n undefined //reverb: [duration, decay, reverse?]\n );\n}", "function playELEVATOR(){\r\n mySound = new sound(\"ELEVATOR.mp3\");\r\n mySound.play();\r\n }", "function seekBarMouseUp() {\r\n audio.currentTime = seekbar.value;\r\n mouseDown = false;\r\n}", "function playStation(){\r\n mySound = new sound (\"us-lab-background.mp3\");\r\n mySound.play();\r\n }", "play() {\n\t\tthis.trigger('play', this);\n\t}", "play() {\n\t\tthis.trigger('play', this);\n\t}", "function playSoundX(s) {\n if (Settings.sounds) top.soundWrapX(s);\n}", "function Sound(){\n\t\t\n\t\tif(screen == 3){\n\t\t\tBackgroundMusic.play();\n\t\t}\n\t\tif(sound[0] == true){\n\t\t\tLaserSound.play();\n\t\t}\n\t\t\n\t\tif(sound[1] == true){\n\t\t\tCannonSound.play();\n\t\t}\n\t}", "function playSample(sample){\n\tsample.play();\n}", "function playSound() {\n setupSound();\n setPlaybackControls(\"play\");\n sound.start(0);\n sound.onended = function () {\n setPlaybackControls(\"stop\");\n }\n}", "function mousePressed() {\n startMouseX = mouseX;\n startMouseY = mouseY;\n }", "function mousePressed() {\r\n if (!released) {\r\n return;\r\n }\r\n\r\n var bound_top;\r\n var bound_bot;\r\n var bound_left;\r\n var bound_right;\r\n\r\n mouseX = mouseX - innerWidth / 2;\r\n mouseY = mouseY - innerHeight / 2;\r\n\r\n var d = dist(mouseX, mouseY, 0, 0);\r\n if (d < 3 * pixelSize && !loading) {\r\n playPauseDream();\r\n }\r\n\r\n if (!loading) {\r\n bound_top = 270;\r\n bound_bot = 300;\r\n bound_left = -350;\r\n bound_right = -250;\r\n if (\r\n mouseX >= bound_left &&\r\n mouseX <= bound_right &&\r\n mouseY >= bound_top &&\r\n mouseY <= bound_bot\r\n ) {\r\n console.log(\"Soul\");\r\n soul();\r\n }\r\n\r\n bound_top = 270;\r\n bound_bot = 300;\r\n bound_left = -150;\r\n bound_right = -50;\r\n if (\r\n mouseX >= bound_left &&\r\n mouseX <= bound_right &&\r\n mouseY >= bound_top &&\r\n mouseY <= bound_bot\r\n ) {\r\n console.log(\"Rap\");\r\n rap();\r\n }\r\n\r\n bound_top = 270;\r\n bound_bot = 300;\r\n bound_left = 50;\r\n bound_right = 150;\r\n if (\r\n mouseX >= bound_left &&\r\n mouseX <= bound_right &&\r\n mouseY >= bound_top &&\r\n mouseY <= bound_bot\r\n ) {\r\n console.log(\"Rnb\");\r\n rnb();\r\n }\r\n\r\n bound_top = 270;\r\n bound_bot = 300;\r\n bound_left = 250;\r\n bound_right = 350;\r\n if (\r\n mouseX >= bound_left &&\r\n mouseX <= bound_right &&\r\n mouseY >= bound_top &&\r\n mouseY <= bound_bot\r\n ) {\r\n console.log(\"Neo-Soul\");\r\n neoSoul();\r\n }\r\n }\r\n\r\n released = false;\r\n}", "show(){\n this.image.x=0;\n this.sound.play();\n }", "function draw() {\n // A nice green background\n background(100,200,100);\n\n // Calculate the distance to the dog from the mouse\n var d = dist(mouseX,mouseY,dog.x,dog.y);\n\n // If the mouse if over the dog, we found it\n if (d < dog.image.height/2) {\n // Display the invisible dog (tinted to transparent because it's invisible, ha ha)\n push();\n tint(255,0);\n image(dog.image,dog.x,dog.y);\n pop();\n // And display a nice yellow circle around it so you know where it is\n push();\n strokeWeight(0.5);\n stroke(255,255,0);\n noFill();\n ellipse(dog.x,dog.y,dog.image.width,dog.image.height);\n pop();\n }\n\n // Calculate and set volume of barking sound based on distance\n var newVolume = map(d,0,width/2,1,0);\n dog.sound.setVolume(newVolume);\n\n // Calculate and set pan of barking sound based on distance\n var dx = dog.x - mouseX;\n var newPan = map(dx,-maxPanDistance,maxPanDistance,-1,1);\n newPan = constrain(newPan,-1,1);\n dog.sound.pan(newPan);\n}", "playWinSound() {\n this.winSound.play();\n }", "function Pause()\n{\n\tTime.timeScale = 0.0F;\n\tpaused = true;\n\t\n\tNGUITools.SetActive(ui, false); \n\t \n\tAudioSource.PlayClipAtPoint(sound, transform.position); \n}", "function mousePressed() {\n if (gameState === 0) {\n gameState = 1; // start the game when mouse is clicked\n backMusic.setVolume(0.5);\n backMusic.loop(); // play music when game starts\n }\n // giving a choice to restart the game when it is over\n else if (gameState === 2) { // when game is over\n clear();\n gameState = 0; // reset gamestate\n setup(); // reset\n }\n}", "start(){\n\t\t//ok\n\t\tsnd_track = new Audio('./snd/soundtrack.mp3'); \n\t\tif (typeof snd_track.loop == 'boolean'){\n\t\t\tsnd_track.loop = true;\n\t\t}\n\t\telse{\n\t\t\tsnd_track.addEventListener('ended', function() {\n\t\t\t\tthis.currentTime = 0;\n\t\t\t\tthis.play();\n\t\t\t}, false);\n\t\t}\n\t\tsnd_track.play();\n\t\tsetTimeout(function(){gradle.hideSplash()}, 2000);\n\t}", "function trackPosition(e) {\n\tmouse.x = e.pageX;\n\tmouse.y = e.pageY;\n}", "_start_mouse_track() {\n\t\t\tthis.current_mouse_movement = [];\n\t\t\tvar self = this;\n\t\t\tvar coord_scaling = this.selection_board.scale_to_source_size();\n\t\t\t// start tracking loop\n\t\t\tthis.track_id = setInterval(function() {\n\t\t\t\tlet mousePos = document.get_mouse_pos();\n\t\t\t\t// save a single time-coordinate pair of the current mouse position\n\t\t\t\tself.current_mouse_movement.push({time: self._time_passed(),\n\t\t\t\t\t\t\t\t\t\t\t\tx: Math.floor(mousePos.x * coord_scaling),\n\t\t\t\t\t\t\t\t\t\t\t\ty: Math.floor(mousePos.y * coord_scaling)});\n\t\t\t\t}, this.track_interval);\n\t\t}", "function playSoundTrack() {\n if (gdpjam3.sounds && gdpjam3.sounds.soundtrackMenu) {\n gdpjam3.sounds.soundtrackMenu.setVolume(5).fadeIn(3000).play();\n }\n }", "function monoSynth() {\n userStartAudio();\n\n // let level = amplitude.getLevel();\n // let size = map(level, 0,1,0,200);\n\n if(soundLoop.isPlaying) {\n soundLoop.stop();\n } else {\n soundLoop.start();\n }\n}", "function playSound(sound) {\n sound.currentTime = 0;\n sound.play();\n}", "function playJump(){\n all_audio[0].play();\n all_audio[0].currentTime = 0;\n}", "function onMouseDown (event) {\n if (enableControls_3D) {\n if (event.buttons === 1 && blocker.style.display === 'none') {\n scene_3D.shoot();\n shooting_3D = true;\n var listener = new THREE.AudioListener();\n\t\tcamera_3D.add(listener);\n\t\tvar audioLoader = new THREE.AudioLoader();\n\t\tvar sound3 = new THREE.PositionalAudio( listener );\n\t\taudioLoader.load( \"/src/sounds/Steam-hiss-sound-effect.mp3\", function ( buffer ) {\n\n\t\t\tsound3.setBuffer( buffer );\n\t\t\tsound3.setRefDistance( 20 );\n\t\t\tsound3.setLoop( false );\n\t\t\tsound3.setVolume( 0.4 );\n\t\t\tsound3.play();\n\n\t\t} );\n\t\tscene_3D.add(sound3);\n }\n }\n}", "function draw() {\n background(0);\n\n //Display the player\n player = new Player(mouseX, mouseY);\n player.display();\n\n for (let i = 0; i < musicBlocks.length; i++) {\n let musicBlock = musicBlocks[i];\n musicBlock.display();\n\n }\n\n}", "update() {\n\t\tlet prob = Math.random().toFixed(2);\n\n\t\tif (prob < 0.5) {\n\t\t\t//move randomly\n\t\t\tthis.moveRandomly();\n\t\t} else {\n\t\t\t//work out direction of the mouse from current position and move towards it.\n\t\t\tthis.moveToMouse();\n\t\t}\n\t}" ]
[ "0.7222558", "0.7173278", "0.70272183", "0.6942484", "0.6900766", "0.6871986", "0.6851138", "0.6815783", "0.67965746", "0.67890954", "0.67423", "0.67423", "0.6655546", "0.6620155", "0.6600297", "0.6587625", "0.6529811", "0.6520023", "0.64978886", "0.647848", "0.6453655", "0.645128", "0.6435564", "0.6408107", "0.6404347", "0.63799983", "0.6377894", "0.6375876", "0.63732755", "0.6338968", "0.6332678", "0.6321576", "0.6314471", "0.6307036", "0.6281259", "0.6271035", "0.6262614", "0.62403727", "0.6229178", "0.62164694", "0.62121695", "0.62008727", "0.61969346", "0.61911374", "0.61868536", "0.61740893", "0.6159121", "0.61410445", "0.61405015", "0.6118003", "0.6116424", "0.61016107", "0.60946244", "0.6092718", "0.6069781", "0.606938", "0.60691917", "0.6053993", "0.6047658", "0.603554", "0.6028651", "0.6027834", "0.60229087", "0.6020535", "0.60135037", "0.60108304", "0.600914", "0.6006296", "0.5998768", "0.5994434", "0.59885484", "0.5976366", "0.5974939", "0.596977", "0.59689206", "0.5967575", "0.5963491", "0.596208", "0.596208", "0.59580123", "0.59517485", "0.59505355", "0.5942269", "0.594065", "0.5936211", "0.59343654", "0.592659", "0.5925217", "0.59177154", "0.59159654", "0.5911253", "0.5907814", "0.5907048", "0.5904786", "0.5904336", "0.5902858", "0.58860976", "0.5878241", "0.58717126", "0.5870217" ]
0.60563874
57
Draw a basic polygon, handles triangles, squares, pentagons, etc
function polygon(x, y, radius, sides = 3, angle = 0) { beginShape(); for (let i = 0; i < sides; i++) { const a = angle + TWO_PI * (i / sides); let sx = x + cos(a) * radius; let sy = y + sin(a) * radius; vertex(sx, sy); } endShape(CLOSE); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function drawPolygon() {\n clearGeometry();\n drawingTools.setShape('polygon');\n drawingTools.draw();\n}", "function Render_polygon(ctx, x1, y1, x2, y2, x3, y3, x4, y4, color) {\n ctx.fillStyle = color;\n ctx.beginPath();\n ctx.moveTo(x1, y1);\n ctx.lineTo(x2, y2);\n ctx.lineTo(x3, y3);\n ctx.lineTo(x4, y4);\n ctx.closePath();\n ctx.fill();\n }", "function polygon(type){\n if(!type){\n type = 'polygon';\n var att = ['fill-opacity', 'stroke-width', 'points'];\n }\n else{\n type = 'polyline';\n var att = ['opacity', 'stroke-width', 'points'];\n }\n var object = shape(type, att);\n\n // To store the last mouse coordinates, to recognize a double click\n object.x = -1;\n object.y = -1;\n\n /* A single click adds a point, a double click closes the\n * polygon */\n object.mousedown = function(x, y){\n // If the polygon is open, add a point or close the polygon\n if(this.open){\n // If this point is the same of the previous, close the\n // polygon (this.x and x are strange objects in the svgweb\n // environment, so they must be converted)\n if(parseInt(this.x) == parseInt(x) &&\n parseInt(this.y) == parseInt(y))\n this.end_shape();\n // If this point is different from the previous, add it to the\n // points and vertexes list and store mouse coordinates to wait\n // a double click\n else{\n this.points += ' '+x+','+y;\n this.vertexes.push({'x':x, 'y':y});\n object.x = x;\n object.y = y;\n }\n }\n // If the polygon isn't open, start a new one\n else{\n // An array to hold the polygon points\n this.vertexes = new Array();\n if(this.edit){\n // Transform points string to an array, adding the\n // translation to each point\n var pairs = this.points.split(' ');\n // Chrome's native renderer has a different syntax for points,\n // they are all divided just by whitespaces as in \"2 3 2 4 5 6\"\n if (sniff() == 'chrome' && svgweb.getHandlerType() == 'native')\n // pairs.length is always even here\n for(var i=0; i<pairs.length-1; i=i+2){\n var vx = parseInt(pairs[i] ) + this.offset_x;\n var vy = parseInt(pairs[i+1]) + this.offset_y;\n this.vertexes.push({'x': vx, 'y': vy});\n }\n // For all other configurations, points are pairs of comma\n // separated values separated by whitespaces as in \"2,3 2,4 5,6\"\n else\n for(var i=0; i<pairs.length; i++){\n pair = pairs[i].split(',');\n var vx = parseInt(pair[0]) + this.offset_x;\n var vy = parseInt(pair[1]) + this.offset_y;\n this.vertexes.push({'x': vx, 'y': vy});\n }\n // Store the nearest index\n this.edit_nearest =\n nearest_vertex(this.vertexes, {'x':x, 'y':y});\n }\n // If not editing\n else{\n this.points = x+','+y;\n this.vertexes.push({'x':x, 'y':y});\n if(this.type=='polyline')\n this.fill = 'none';\n }\n this.start_shape();\n if(this.edit)\n this.mousemove(x, y);\n }\n };\n object.mousemove = function(x, y){\n if(!this.open)\n return;\n if(this.edit){\n this.vertexes[this.edit_nearest] = {'x':x, 'y':y};\n var points = this.points_from_vertexes();\n }\n else\n var points = this.points+' '+x+','+y;\n this.element.setAttribute('points', points);\n };\n // This shapes ends on mouseup when it is edited, but it ends in a\n // special case of mousedown when it's created\n object.mouseup = function(){\n if(this.edit)\n this.end_shape();\n };\n // Due to chrome's different point syntax, end_shape must be\n // overridden\n object.end_shape = function(){\n var params = [];\n for(a in this.att){\n if(this.att[a]=='points' && sniff() == 'chrome'\n && svgweb.getHandlerType() == 'native')\n params.push(this.points_from_vertexes());\n else\n params.push(this.element.getAttribute(this.att[a]));\n }\n // Add the element in the array that will be sent to the server.\n sender_add(this.type, params, this.id);\n this.close_shape();\n };\n object.points_from_vertexes = function(){\n var points = '';\n for(i=0; i<this.vertexes.length; i++)\n points += this.vertexes[i]['x'] +','+ this.vertexes[i]['y']+' ';\n // Get rid of trailing white space\n points = points.slice(0, -1);\n return points;\n };\n return object;\n}", "drawPolygon() {\n // Transform canvas\n context.translate(this.x, this.y);\n context.rotate(this.rotation);\n // Draw\n if (this.numberOfSides < 3) {\n rc.circle(0, 0, this.radius, {\n fill: this.color,\n fillStyle: this.fillStyle,\n fillWeight: this.fillWeight,\n });\n } else {\n rc.path(this.path, {\n fill: this.color,\n fillStyle: this.fillStyle,\n fillWeight: this.fillWeight,\n });\n }\n // Transform canvas\n context.rotate(-this.rotation);\n context.translate(-this.x, -this.y);\n }", "function draw() {\n ellipse(100, 100, 100, 100)\n rect(30, 20, 55, 55)\n triangle(30, 75, 58, 20, 86, 75)\n }", "function doPolygon() {\n\n\n\tvar sides = getIntegerInput(\"Draw a polygon with how many sides? (>=3)\");\n\t//var sides=event.target.value;\n\tvar radius = 100;\n\tc.translate(radius*1.2, radius*1.2); // move the drawing origin away from the top-right.\n\tdrawPolygon(sides, radius);\n}", "function drawPolygon(radius=150, sides=7, r=185, g=185, b=15){\n\n context.translate(canvas.width/2, canvas.height/2);\n var a = ((Math.PI * 2)/sides);\n context.beginPath();\n context.moveTo(radius, 0);\n for(var i=1; i<sides; i++){\n context.lineTo(radius*Math.cos(a*i), radius*Math.sin(a*i));\n }\n context.closePath();\n context.lineWidth = 3;\n context.strokeStyle = 'rgba('+r+','+g+','+b+',1.0';\n context.fillStyle = 'rgba('+r+','+g+','+b+',0.0';\n context.fill();\n context.stroke();\n context.translate(-1*canvas.width/2, -1*canvas.height/2);\n}", "function DrawPoly(cx, cy, sides, edge, orient, onclick, id)\n{\n var inradius = (edge / 2) * cot( Math.PI / sides );\n var circumradius = inradius * sec( Math.PI / sides );\n\n var points = '';\n for (var s = 0; sides >= s; s++)\n {\n var angle = (2.0 * Math.PI * s / sides);\n if (orient == 'y')\n angle += 11;\n var x = ( circumradius * Math.cos(angle) ) + cx;\n var y = ( circumradius * Math.sin(angle) ) + cy;\n\n points += x + ',' + y + ' ';\n }\n\n var poly = SVGDocument.createElementNS(svgns, 'polygon');\n poly.setAttributeNS(null,'id', id);\n poly.setAttributeNS(null,'points', points);\n poly.setAttributeNS(null,'stroke', 'blue');\n poly.setAttributeNS(null,'onclick', onclick);\n poly.setAttributeNS(null,'fill', 'cornflowerblue');\n poly.setAttributeNS(null,'poly_type', POLY_TYPE_EMPTY);\n\n board.polyChangeType(poly, POLY_TYPE_EMPTY);\n\n SVGRoot.appendChild(poly);\n\n return poly;\n}", "addPolygon(points) {\n const ctx = this._ctx;\n ctx.moveTo(points[0].x, points[0].y);\n for (let i = 1; i < points.length; i++) {\n ctx.lineTo(points[i].x, points[i].y);\n }\n ctx.closePath();\n }", "function drawFilledPolygon( ctx, shape ) {\n ctx.beginPath();\n ctx.moveTo(shape[0][0],shape[0][1]);\n for( p in shape ) {\n if ( p > 0 ) {\n ctx.lineTo(shape[p][0],shape[p][1]);\n }\n }\n ctx.lineTo(shape[0][0],shape[0][1]);\n //ctx.fill();\n ctx.stroke();\n}", "function drawPolygon(polygon) {\n var path = svg.append(\"g\").selectAll(\"path\");\n\n path = path\n .data(polygon, polygonF);\n path.exit()\n path.enter()\n .append(\"path\")\n .attr(\"class\", function(d, i) {\n return \"celula q\" + (i % 9) + \"-9\";\n })\n .attr(\"d\", polygonF);\n\n path.order();\n}", "function draw() \r\n{\r\n // you do not need to modify this function\r\n // this is help function\r\n // Boilerplate code to setup the canvas\r\n var canvas = document.getElementById('canvas');\r\n if (!canvas.getContext)\r\n {\r\n alert(\"Your browser is too old! Please upgrade to a canvas-capable browser.\");\r\n }\r\n var ctx = canvas.getContext('2d');\r\n // clear canvas so we can draw a new frame\r\n ctx.clearRect(0, 0, canvas.width, canvas.height);\r\n // set global line width and smooth lines\r\n ctx.lineWidth = 2;\r\n ctx.lineJoin = 'round';\r\n ctx.lineCap = 'round';\r\n // draw a small axis to demonstrate the inverted coordinate system\r\n drawAxis(ctx);\r\n // draw the current Penguin\r\n drawPenguin(ctx);\r\n\r\n // var leg_poly = [[15, 53], [20, 52], [ 20, 52], [ 12, 53]];\r\n // console.log('main:', leg_poly);\r\n\r\n // transformPolygon(leg_poly, [[1,0,10],[0,1,10]]);\r\n // console.log('main:', leg_poly);\r\n\r\n // drawLineSegment(ctx,100,100,100,100);\r\n // drawLineSegment(ctx,250,250,251,250);\r\n\r\n //drawCircle(ctx, 200, 200, 10);\r\n\r\n // var torso_poly = [[129, 116], [69, 71], [36, 196]];\r\n // drawPolygon(ctx,torso_poly);\r\n // var xxx = transformPolygon(torso_poly, rotationAboutPoint(-Math.PI/2,[129, 116]));\r\n // console.log(xxx);\r\n // var kk = transformPolygon(xxx, translateByOffset([20,0]));\r\n // drawPolygon(ctx,kk);\r\n // drawPolygon(ctx,xxx);\r\n // console.log('point:', transformPoint([20,10],rotationAboutPoint(-Math.PI/2,[10,10])));\r\n // console.log('point:', transformPoint([0,0],rotationAboutPoint(-Math.PI/2,[10,10])));\r\n // console.log('cos:', ~~Math.cos(Math.PI/2));\r\n\r\n // console.log(~~Math.sin(Math.PI*3/4));\r\n\r\n}", "function getPolygon() {\r\n let polygonPoints = getPolygonPoints()\r\n ctx.beginPath()\r\n ctx.moveTo(polygonPoints[0].x, polygonPoints[0].y)\r\n for (let i = 1; i < polygonSides; i++) {\r\n ctx.lineTo(polygonPoints[i].x, polygonPoints[i].y)\r\n }\r\n ctx.closePath()\r\n\r\n if (fillState == true) {\r\n ctx.stroke();\r\n ctx.fill();\r\n } else {\r\n ctx.stroke();\r\n }\r\n}", "function polygon()\n{\n\tthis.poly = new Array();\n\tthis.normals = new Array();\n\tthis.uvs = new Array();\n\tthis.end = 0;\n}", "startPoly() {\n if (this.currentPath) {\n var points = this.currentPath.points;\n var len = this.currentPath.points.length;\n if (len > 2) {\n this.drawShape(this.currentPath);\n this.currentPath = new Polygon_1.Polygon();\n this.currentPath.closeStroke = false;\n this.currentPath.points.push(points[len - 2], points[len - 1]);\n }\n }\n else {\n this.currentPath = new Polygon_1.Polygon();\n this.currentPath.closeStroke = false;\n }\n }", "function drawPolygon(svgCanvas, zone) {\n\n var isDrawing = false;\n var isDragging = false;\n\n var polyPoints = zone.points;\n d3.select('g.outline').remove();\n\n // Create polygon\n gPoly = svgCanvas.append('g')\n .classed(\"polygon\", true)\n .classed(\"zone-\" + zone.id, true);\n // Add drag behavior\n var dragBehavior = d3.drag().on(\"drag\", alterPolygon);\n\n // Not needed while drawing them all at first.\n // polyPoints.splice(polyPoints.length - 1);\n //console.log(polyPoints);\n\n var polyEl = gPoly.append(\"polygon\")\n .attr(\"points\", polyPoints);\n\n for (var i = 0; i < polyPoints.length; i++) {\n gPoly.append('circle')\n .attr(\"cx\", polyPoints[i][0])\n .attr(\"cy\", polyPoints[i][1])\n .attr(\"r\", 4)\n .call(dragBehavior);\n }\n\n var bbox = polyEl._groups[0][0].getBBox();\n var bbox2 = gPoly._groups[0][0].getBBox();\n\n bbox.x = 0;\n bbox.y = 0;\n bbox.width = 50;\n bbox.height = 50;\n\n // Set translate variable data;\n gPoly.datum({\n x: 0,\n y: 0\n });\n\n // Set translate elem attribute defaults\n gPoly.attr(\"transform\", function (d) {\n return \"translate(\" + d.x + \",\" + d.y + \")\"\n });\n\n // Add Transform for mouse drag\n gPoly.call(d3.drag().on(\"drag\", function (d) {\n d3.select(this).attr(\"transform\", \"translate(\" + (d.x = d3.event.x) + \",\" + (d.y = d3.event.y) + \")\")\n }));\n\n // Add context menu\n gPoly.on('contextmenu', d3.contextMenu(menu));\n\n // Add label text\n var gPolyCentroid = d3.polygonCentroid(polyPoints);\n addLabel(zone.name, gPolyCentroid, \"zone-\" + zone.id + '-text');\n\n }", "function drawPoly(ctx, path, sc, lw, fc, mousePos, withPoints){\n\t\tif(path.length == 0) return;\n\t\tvar startPoint = path[0];\n\t\t\n\t\t//then, we draw the lines that connect the points\n\t\tctx.beginPath();\n\t\tctx.moveTo(startPoint['x'], startPoint['y']);\n\t\tctx.strokeStyle = sc || ctx.strokeStyle;\n\t\tctx.fillStyle = fc || ctx.fillStyle\n\t\tctx.lineWidth = lw;\n\t\tfor(i = 1; i < path.length; i++){\n\t\t\tctx.lineTo(path[i]['x'], path[i]['y']);\n\t\t}\n\t\t\n\t\t//if we are in the drawing mode (so, mousePos is not zero), we draw the line that connects the last point with the current mouse position.\n\t\tif(mousePos) \n\t\t\tctx.lineTo(mousePos['x'], mousePos['y']);\n\t\t\t\n\t\t//finally, we connect the last/current point to the first one, to close the polygon\n\t\tctx.lineTo(startPoint['x'], startPoint['y']);\n\t\t\n\t\tctx.closePath();\n\t\tctx.fill();\n\t\tctx.stroke();\n\t\t\n\t\t//if we are drawing the poly, we draw all the points, using the parameters set in the M object. We draw a point as a filled circle with a given radius: the point is the center of the filled circle.\n\t\tif( (path.status == 'drawing') || (withPoints)){\n\t\t\t$.each(path, function(idx, center){\n\t\t\t\tvar radius = withPoints ? 4 : M.radius;\n\t\t\t\tsetPoint(ctx, center, radius, M.curColor, M.lineWidth, M.curColor);\n\t\t\t});\n\t\t}\n\t}", "function polygon(x, y, radius, npoints) {\n let angle = TWO_PI / npoints;\n beginShape();\n for (let a = 0; a < TWO_PI; a += angle) {\n let sx = x + cos(a) * radius;\n let sy = y + sin(a) * radius;\n vertex(sx, sy);\n }\n endShape(CLOSE);\n}", "function Polygon (sides) {\n this.sides = sides\n}", "function SimplePoly(scene, vertices, is_equiangular=false, track_point=null) {\n\n // general\n this.id = Nickel.UTILITY.assign_id();\n this.type = 'SimplePoly';\n this.scene = scene;\n this.canvas = scene.canvas;\n this.context = this.canvas.getContext(\"2d\");\n\n // style\n this.stroke_width = 1;\n this.stroke_dash_length = 0;\n this.stroke_gap_length = 0;\n this.stroke_fill = null;\n this.stroke_color = null;\n\n // pos of first vertex\n this.x = vertices[0][0];\n this.y = vertices[0][1];\n\n // pos of each vertex\n this.vertices = vertices;\n\n // pos of extra point to be tracked\n // (helps with origin related computation)\n // (usually set to center of shape)\n this.tracker = track_point;\n\n // other\n this.dead = false;\n this.visibility = true;\n this.equiangular = is_equiangular;\n\n this.update = function() {\n //-- Called every frame.\n //-- Updates changing parameters.\n //--\n\n // skip if marked for deletion\n if (this.dead == true) {\n return;\n }\n\n // user custom update\n this.update_more();\n\n // render graphics\n this.draw();\n }\n\n this.draw = function() {\n //-- Called every frame. Processes graphics\n //-- based on current parameters.\n //--\n\n // skip if marked for invisibility\n if (this.visibility == false || this.dead == true) {\n return;\n }\n\n // skip if no stroke color\n if (!this.stroke_color) {\n return;\n }\n\n // draw\n var ctx = this.context;\n ctx.save();\n\n // stroke properties\n ctx.lineWidth = this.stroke_width;\n ctx.setLineDash([this.stroke_dash_length, this.stroke_gap_length]);\n ctx.fillStyle = this.stroke_fill;\n ctx.strokeStyle = this.stroke_color;\n\n // draw polygon\n ctx.beginPath();\n ctx.moveTo(this.x, this.y);\n for (var i=1; i<this.vertices.length; i++) {\n ctx.lineTo(this.vertices[i][0], this.vertices[i][1]);\n }\n ctx.lineTo(this.x, this.y);\n ctx.stroke();\n if (this.stroke_fill)\n ctx.fill();\n\n ctx.restore();\n }\n\n this.destroy = function() {\n //-- Marks current instance for deletion\n //--\n\n this.dead = true;\n this.visibility = false;\n }\n\n this.hide = function() {\n //-- Marks current instance's visibility to hidden\n //--\n\n this.visibility = false;\n }\n\n this.show = function() {\n //-- Marks current instance's visibility to shown\n //--\n\n this.visibility = true;\n }\n\n this.is_visible = function() {\n //-- Returns if self is visible\n //--\n\n return this.visibility;\n }\n\n this.update_more = function() {\n //-- Called in update. Meant to be over-ridden.\n //--\n\n }\n\n this.get_tracker = function() {\n //-- Returns track point\n //--\n\n return this.tracker;\n }\n\n this.set_tracker = function(track_point) {\n //-- Sets a new track point\n //--\n\n this.tracker = track_point;\n }\n\n this.get_center = function() {\n //-- Returns average vertex position\n //--\n\n var avg = [0,0];\n for(var i in this.vertices) {\n avg[0] += this.vertices[i][0];\n avg[1] += this.vertices[i][1];\n }\n avg[0] /= this.vertices.length;\n avg[1] /= this.vertices.length;\n return avg;\n }\n\n this.set_center = function(new_center) {\n //-- Centers self onto a position (expensive)\n //--\n\n var center = this.get_center();\n this.shift_pos(new_center[0]-center[0], new_center[1]-center[1]);\n }\n\n this.shift_pos = function(shiftx, shifty) {\n //-- Shifts all vertices in the x and y dircections\n //--\n\n for (var i in this.vertices) {\n this.vertices[i][0] += shiftx;\n this.vertices[i][1] += shifty;\n }\n\n this.x = this.vertices[0][0];\n this.y = this.vertices[0][1];\n\n if (this.tracker) {\n this.tracker[0] += shiftx;\n this.tracker[1] += shifty;\n }\n }\n\n // TODO: TEST\n this.set_pos = function(point) {\n //-- Translates self where 1st vertex\n //-- is at the given point\n //--\n\n var diff = [point[0] - this.x, point[1] - this.y];\n\n for (var i in this.vertices) {\n this.vertices[i][0] += diff[0];\n this.vertices[i][1] += diff[1];\n }\n\n this.x = point[0];\n this.y = point[1];\n\n if (this.tracker) {\n this.tracker[0] += diff[0];\n this.tracker[1] += diff[1];\n }\n }\n\n this.scale_around = function(scale, point) {\n //-- Scales x,y position of vertices from/to a point\n //--\n\n this.scale_around2(scale, scale, point);\n }\n\n this.scale_around2 = function(scalex, scaley, point) {\n //-- Scales x,y position of vertices from/to a point\n //--\n\n for (var i in this.vertices) {\n this.vertices[i][0] = scalex * (this.vertices[i][0] - point[0]) + point[0];\n this.vertices[i][1] = scaley * (this.vertices[i][1] - point[1]) + point[1];\n }\n\n this.x = this.vertices[0][0];\n this.y = this.vertices[0][1];\n\n if (this.tracker) {\n this.tracker[0] = scalex * (this.tracker[0] - point[0]) + point[0];\n this.tracker[1] = scaley * (this.tracker[1] - point[1]) + point[1];\n }\n }\n\n this.rotate_around = function(degrees, point) {\n //-- Applies a rotation transformation to all\n //-- vertices of the polygon\n //--\n\n var radians = degrees*Math.PI/180*-1;\n\n for (i in this.vertices) {\n\n var tmpx = this.vertices[i][0] - point[0];\n var tmpy = this.vertices[i][1] - point[1];\n this.vertices[i][0] = tmpx * Math.cos(radians) - tmpy * Math.sin(radians) + point[0];\n this.vertices[i][1] = tmpx * Math.sin(radians) + tmpy * Math.cos(radians) + point[1];\n }\n\n this.x = this.vertices[0][0];\n this.y = this.vertices[0][1];\n\n if (this.tracker) {\n\n var tmpx = this.tracker[0] - point[0];\n var tmpy = this.tracker[1] - point[1];\n this.tracker[0] = tmpx * Math.cos(radians) - tmpy * Math.sin(radians) + point[0];\n this.tracker[1] = tmpx * Math.sin(radians) + tmpy * Math.cos(radians) + point[1];\n }\n }\n \n this.copy_base = function() {\n //-- Copies self using basic properties\n //--\n \n var verts = [];\n for (var i in this.vertices) {\n verts.push([\n this.vertices[i][0],\n this.vertices[i][1]\n ]);\n }\n \n var new_tracker = [this.tracker[0], this.tracker[1]];\n var new_poly = new SimplePoly(this.scene,verts,this.equiangular,new_tracker);\n new_poly.stroke_width = this.stroke_width;\n new_poly.stroke_dash_length = this.stroke_dash_length;\n new_poly.stroke_gap_length = this.stroke_gap_length;\n new_poly.stroke_fill = this.stroke_fill;\n new_poly.stroke_color = this.stroke_color;\n new_poly.update_more = this.update_more;\n return new_poly;\n }\n\n //\n // proxy functions:\n //\n\n this.offset_position = function(offx, offy) {\n //-- shift_pos proxy\n //--\n\n this.shift_pos(offx, offy);\n }\n\n this.offset_turn = function(angle, point) {\n //-- rotate_around proxy\n //--\n\n this.rotate_around(angle, point);\n }\n\n this.offset_scale = function(scale, point) {\n //-- scale_around proxy\n //--\n\n this.scale_around(scale, point);\n }\n}//end SimplePoly", "function polygon(x, y, radius, npoints) {\n var angle = TWO_PI / npoints;\n beginShape();\n for (var a = 0; a < TWO_PI; a += angle) {\n var sx = x + cos(a) * radius;\n var sy = y + sin(a) * radius;\n vertex(sx, sy);\n }\n endShape(CLOSE);\n}", "function polygon(x, y, radius, npoints) {\n var angle = TWO_PI / npoints;\n beginShape();\n for (var a = 0; a < TWO_PI; a += angle) {\n var sx = x + cos(a) * radius;\n var sy = y + sin(a) * radius;\n vertex(sx, sy);\n }\n endShape(CLOSE);\n}", "function polygon(ctx, x, y, radius, sides, startAngle, anticlockwise) {\n if (sides < 3) return;\n var a = (Math.PI * 2)/sides;\n a = anticlockwise?-a:a;\n ctx.save();\n ctx.translate(x,y);\n ctx.rotate(startAngle);\n ctx.moveTo(radius,0);\n for (var i = 1; i < sides; i++) {\n ctx.lineTo(radius*Math.cos(a*i),radius*Math.sin(a*i));\n }\n ctx.closePath();\n ctx.restore();\n}", "function PolygonEdge() {\n}", "function drawPoly(a, b, c, d, col) {\n drawLine(a, b);\n drawLine(b, c);\n drawLine(c, d);\n drawLine(d, a);\n\n var a = fixPoint(a);\n var b = fixPoint(b);\n var c = fixPoint(c);\n var d = fixPoint(d);\n\n var path = new Path;\n path.add(a);\n path.add(b);\n path.add(c);\n path.add(d);\n path.fillColor = col;\n}", "function draw_triangles(){\n //draw k\n draw_poly(1,6);\n draw_poly(1,7);\n draw_poly(2,5);\n draw_poly(2,6);\n draw_poly(3,4);\n draw_poly(3,5);\n draw_poly(4,3);\n draw_poly(4,4);\n draw_poly(4,5);\n draw_poly(4,6);\n draw_poly(4,7);\n draw_poly(4,8);\n draw_poly(5,2);\n draw_poly(5,3);\n draw_poly(5,5);\n draw_poly(5,6);\n draw_poly(6,1);\n draw_poly(6,2);\n draw_poly(6,6);\n draw_poly(6,7);\n\n //draw y\n draw_poly(4,12);\n draw_poly(4,13);\n draw_poly(5,13);\n draw_poly(5,14);\n draw_poly(6,14);\n draw_poly(4,17);\n draw_poly(4,18);\n draw_poly(5,16);\n draw_poly(5,17);\n draw_poly(6,15);\n draw_poly(6,16);\n draw_poly(7,14);\n draw_poly(7,15);\n draw_poly(8,13);\n draw_poly(8,14);\n draw_poly(9,12);\n draw_poly(9,13);\n \n //draw l\n draw_poly(6,19);\n draw_poly(6,20);\n draw_poly(5,20);\n draw_poly(5,21);\n draw_poly(4,21);\n draw_poly(4,22);\n draw_poly(3,22);\n draw_poly(3,23);\n draw_poly(2,23);\n draw_poly(2,24);\n draw_poly(1,24);\n draw_poly(1,25);\n\n //draw e\n draw_poly(6,26);\n draw_poly(6,27);\n draw_poly(5,25);\n draw_poly(5,26);\n draw_poly(4,25);\n draw_poly(4,26);\n draw_poly(4,27);\n draw_poly(3,26);\n draw_poly(3,27);\n draw_poly(3,28);\n draw_poly(3,29);\n draw_poly(3,30);\n draw_poly(4,30);\n draw_poly(4,29);\n draw_poly(5,29);\n\n //draw m\n draw_poly(6,35);\n draw_poly(6,36);\n draw_poly(5,36);\n draw_poly(5,37);\n draw_poly(4,37);\n draw_poly(4,38);\n draw_poly(3,38);\n draw_poly(4,39);\n draw_poly(4,40);\n draw_poly(4,41);\n draw_poly(5,41);\n draw_poly(5,40);\n draw_poly(6,40);\n draw_poly(6,39);\n draw_poly(4,43);\n draw_poly(4,44);\n draw_poly(4,45);\n draw_poly(5,45);\n draw_poly(5,44);\n draw_poly(6,44);\n draw_poly(6,43);\n\n //draw a\n draw_poly(6,48);\n draw_poly(6,49);\n draw_poly(6,50);\n draw_poly(6,52);\n draw_poly(5,48);\n draw_poly(5,49);\n draw_poly(5,51);\n draw_poly(5,52);\n draw_poly(4,49);\n draw_poly(4,50);\n draw_poly(4,51);\n\n //draw r\n draw_poly(6,55);\n draw_poly(6,56);\n draw_poly(5,56);\n draw_poly(5,57);\n draw_poly(4,57);\n draw_poly(4,58);\n draw_poly(4,59);\n draw_poly(4,60);\n\n //draw x\n draw_poly(3,63);\n draw_poly(3,64);\n draw_poly(3,66);\n draw_poly(3,67);\n draw_poly(4,64);\n draw_poly(4,65);\n draw_poly(4,66);\n draw_poly(5,64);\n draw_poly(5,65);\n draw_poly(5,66);\n draw_poly(6,63);\n draw_poly(6,64);\n draw_poly(6,66);\n draw_poly(6,67);\n\n //scale the name drawn\n// $('#main').attr('transform', \"scale(0.125)\");\n}", "function Polygon(obj){\n var func;\n if (obj.points && obj.points instanceof Array && obj.points.length > 2 && !obj.sides && !obj.radius){\n func = function(i){ return obj.points[i] };\n }\n else if(typeof obj.radius === \"number\" && obj.sides && obj.sides > 2 && !obj.points){\n func = function(){ return obj.radius };\n }\n else{\n throw \"Invalid arguments\"\n }\n \n this.center = obj.center || {x: 0, y: 0};\n this.sides = obj.sides || obj.points.length;\n this.innerAngle = (2*Math.PI) / this.sides;\n this.points = [];\n for(var i=0; i < this.sides; i++){\n this.points.push({\n x: this.center.x + func(i)*Math.cos((Math.PI/2) - (i * this.innerAngle)),\n y: this.center.y + func(i)*Math.sin((Math.PI/2) - (i * this.innerAngle))\n });\n }\n }", "function drawControlPolygon(ctx, points) {\n // draw dashed lines between control points\n // A possible improvement would be to only draw the last two edges of the control polygon as dashed...\n ctx.strokeStyle = 'darkgray';\n ctx.setLineDash([]);\n ctx.beginPath();\n\n let w2s = _model.viewport.getXform(_rhino3dm.CoordinateSystem.World, _rhino3dm.CoordinateSystem.Screen)\n for (let i = 0; i < points.count; i++) {\n let world_point = points.get(i);\n let screen_point = _rhino3dm.Point3d.transform(world_point, w2s);\n if (0 === i)\n ctx.moveTo(screen_point[0], screen_point[1]);\n else\n ctx.lineTo(screen_point[0], screen_point[1]);\n }\n ctx.stroke();\n ctx.setLineDash([4, 4]);\n if (points.count > 2) {\n let world_point = points.get(0);\n let screen_point = _rhino3dm.Point3d.transform(world_point, w2s);\n ctx.lineTo(screen_point[0], screen_point[1]);\n }\n\n ctx.stroke();\n\n // draw control points\n ctx.setLineDash([]);\n ctx.fillStyle = 'white';\n ctx.strokeStyle = 'black';\n for (let i = 0; i < points.count; i++) {\n let world_point = points.get(i);\n let screen_point = _rhino3dm.Point3d.transform(world_point, w2s);\n let [x, y, z] = screen_point;\n ctx.fillRect(x - 1, y - 1, 3, 3);\n ctx.strokeRect(x - 2, y - 2, 5, 5);\n }\n w2s.delete();\n}", "function drawPolygon(numSides, radius) {\n\tvar x, y;\n\tvar angle = 2*Math.PI/numSides;\n\t\n\tc.beginPath();\n\tfor (var i=0; i<=numSides; i++) {\n\t\tx = radius * Math.cos(i * angle );\n\t\ty = radius * Math.sin(i * angle);\n\t\tif (i===0) {\n\t\t\tc.moveTo(x, y);\n\t\t}\n\t\telse {\n\t\t\tc.lineTo(x, y);\n\t\t}\n\t}\n\tc.stroke();\n}", "function draw(end, perimeter) {\n ctx.lineWidth = 1;\n ctx.strokeStyle = \"white\";\n ctx.lineCap = \"square\";\n ctx.beginPath();\n for (var i = 0; i < perimeter.length; i++) {\n if (i == 0) {\n ctx.moveTo(perimeter[i]['x'], perimeter[i]['y']);\n end || point(perimeter[i]['x'], perimeter[i]['y']);\n } else {\n ctx.lineTo(perimeter[i]['x'], perimeter[i]['y']);\n end || point(perimeter[i]['x'], perimeter[i]['y']);\n }\n }\n if (end) {\n ctx.lineTo(perimeter[0]['x'], perimeter[0]['y']);\n ctx.closePath();\n ctx.fillStyle = 'rgba(255, 0, 0, 0.5)';\n ctx.fill();\n ctx.strokeStyle = 'blue'; // Change colours for different polygons??\n complete = true;\n // Enable submit button and draw polygon\n $(\"#submitButton\").removeAttr(\"disabled\"); // We should include a hover or perminant display of the tag\n }\n ctx.stroke();\n // print coordinates\n if (perimeter.length == 0) {\n document.getElementById('coordinates').value = '';\n } else {\n document.getElementById('coordinates').value = JSON.stringify(perimeter);\n }\n}", "function Polygon(sides) {\n this.sides = sides;\n this.perimeter = perim;\n}", "function drawTriangle() {\n ctx.beginPath();\n ctx.moveTo(75, 50);\n ctx.lineTo(100, 75);\n ctx.lineTo(100, 25);\n ctx.fill();\n }", "function poly(ctx, points) {\n points.forEach((pt, i) => {\n if (i === 0) ctx.moveTo(pt[0], pt[1])\n else ctx.lineTo(pt[0], pt[1])\n })\n}", "function PolygonShape(vertices) {\n if (!(this instanceof PolygonShape)) {\n return new PolygonShape(vertices);\n }\n PolygonShape._super.call(this);\n this.m_type = PolygonShape.TYPE;\n this.m_radius = Settings.polygonRadius;\n this.m_centroid = Vec2.zero();\n this.m_vertices = [];\n // Vec2[Settings.maxPolygonVertices]\n this.m_normals = [];\n // Vec2[Settings.maxPolygonVertices]\n this.m_count = 0;\n if (vertices && vertices.length) {\n this._set(vertices);\n }\n}", "function demoPolygon()\n{\n\tvar latOffset = 0.01;\n\tvar lonOffset = 0.01;\n\n\tvar polygon = new GPolygon([\n\t new GLatLng( DEFAULT_LAT, DEFAULT_LNG - lonOffset),\n\t new GLatLng( DEFAULT_LAT + latOffset, DEFAULT_LNG),\n\t new GLatLng( DEFAULT_LAT, DEFAULT_LNG + lonOffset),\n\t new GLatLng( DEFAULT_LAT - latOffset, DEFAULT_LNG),\n\t new GLatLng( DEFAULT_LAT, DEFAULT_LNG - lonOffset) // identic with first - filled area!\n\t], \"#f33f00\", 5, 1, \"#ff0000\", 0.2);\n\t\n\tmap.addOverlay( polygon );\n}", "function draw_poly(row, column) {\n var poly = document.createElementNS(\"http://www.w3.org/2000/svg\",\"polygon\");\n poly.setAttribute(\"class\", 'name');\n points = get_poly_points(row, column);\n poly.setAttribute(\"points\", points);\n \n $('#main').append(poly);\n}", "function polygon_object(rgb){\n this.rgb = rgb ;\n this.points = [] ;\n this.raw_points = [] ;\n this.close = true ;\n this.line_opacity = 0.1 ;\n this.hot = false ;\n this.add_point = function(x, y, z){\n var v = make_point(x,y,z) ;\n this.points.push(v) ;\n this.raw_points.push(v) ;\n }\n}", "function drawQuad(x0, y0, x1, y1, x2, y2, x3, y3) {\n\tbeginShape();\n\tvertex(x0, y0);\n\tvertex(x1, y1);\n\tvertex(x2, y2);\n\tvertex(x3, y3);\n\tendShape(CLOSE);\n}", "function render() {\n var points;\n var type;\n var ne = new google.maps.LatLng(shp.maxY, shp.maxX);\n var sw = new google.maps.LatLng(shp.minY, shp.minX);\n var bounds = new google.maps.LatLngBounds(sw, ne);\n map.fitBounds(bounds);\n for (var i = 0; i < shp.records.length; i++) {\n var shape = shp.records[i].shape;\n switch (shape.type) {\n case 1:\n var marker = new google.maps.Marker({\n position: new google.maps.LatLng(shape.content.y,shape.content.x),\n map: map\n });\n break;\n\n case 3:\n points = pathToMVCArray(shape.content.points);\n break;\n\n case 5:\n\n // split into rings\n var polygonPoints = new google.maps.MVCArray();\n var parts = shape.content.parts;\n if (parts.length === 1) {\n polygonPoints.push(pathToMVCArray(shape.content.points));\n } else {\n var j;\n for (j = 0; j < parts.length - 1; j++) {\n polygonPoints.push(pathToMVCArray(shape.content.points.subarray(\n 2 * parts[j], 2 * parts[j + 1])));\n if (2 * parts[j + 1] > shape.content.points.length) {\n throw new Error('part index beyond points array end');\n }\n }\n }\n // create a polygon.\n var polygon = new google.maps.Polygon({\n strokeWeight: .3,\n fillOpacity: .2,\n paths: polygonPoints,\n map: map\n });\n polygon.tractId = i;\n\n // Create InfoWindow at click point and put data in side panel.\n google.maps.event.addListener(polygon, 'click', function(e) {\n if (typeof infowindow != 'undefined') {\n infowindow.close();\n }\n var htmlContent = recordHtmlContent(dbf.records[this.tractId]);\n infowindow = new google.maps.InfoWindow({\n content: htmlContent,\n position: e.latLng,\n map: map\n });\n document.getElementById('side').innerHTML = htmlContent;\n });\n }\n }\n}", "function drawShape(ctx, shape, sc, lw, fc, mousePos, withPoints){//sc = strokeStyle color, lw = lineWidth\n\t\tvar withPoints = withPoints || false;\n\t\tswitch(shape.type){\n\t\t\tcase 'poly':\n\t\t\t\tdrawPoly(ctx, shape, sc, lw, fc, mousePos, withPoints);\n\t\t\t\tbreak;\n\t\t\tcase 'rect':\n\t\t\t\t//setPoint(ctx, shape.point1, M.radius, M.curColor, M.lineWidth, M.curColor);\n\t\t\t\tdrawRect(ctx, shape.point1, shape.point2, sc, lw, fc, mousePos, withPoints);\n\t\t\t\tbreak;\n\t\t\tcase 'circle':\n\t\t\t\t//optionally draw the center point\n\t\t\t\t//setPoint(ctx, shape['center'], M.radius, M.curColor, M.lineWidth, M.curColor);\n\t\t\t\tdrawCircle(ctx, shape['center'], shape['radius'], sc, lw, fc, mousePos, withPoints);\n\t\t\t\tbreak;\n\t\t\tdefault: break;\n\t\t}\n\t}", "function DrawPoly( object, n )\n{\n\tconsole.log( \"started DrawPoly!\" );\n\tfor ( i = 0; i < object.drawCommands.length; i++ ) {\t// For %numberOfCommands% do %commands%\n\t\tif ( object.drawCommands[i] == \"beginPath\" ) {\n\t\t\tctx.beginPath();\n\t\t}\n\t\telse if ( object.drawCommands[i] == \"moveTo\")\n\t\t{\n\t\t\tctx.moveTo( object.drawParams[0], object.drawParams[1] );\n\t\t}\n\t\telse if ( object.drawCommands[i] == \"fill\")\n\t\t{\n\t\t\tctx.fillStyle = object.drawParams;\n\t\t\tctx.fill();\n\t\t}\n\t\telse if ( object.drawCommands[i] == \"stroke\")\n\t\t{\n\t\t\tconsole.debug(\"under construction. info: DrawLib.js/DrawPoly.stroke\")\n\t\t}\n\t\telse {\n\t\t\tconsole.debug( \"Unknown command received by DrawPoly \"\n\t\t\t+ \"function in DrawLib.js file by MK. \"\n\t\t\t+ \"Additional informanion on received object:\"\n\t\t\t+ object )\n\t\t}\n\t};\n}", "display() {\n push();\n fill(255, 255, 0);\n let angle = TWO_PI / this.points;\n let halfAngle = angle / 2.0;\n beginShape();\n for (let a = 0; a < TWO_PI; a += angle) {\n let sx = this.x + cos(a) * this.outerRadius;\n let sy = this.y + sin(a) * this.outerRadius;\n vertex(sx, sy);\n sx = this.x + cos(a + halfAngle) * this.innerRadius;\n sy = this.y + sin(a + halfAngle) * this.innerRadius;\n vertex(sx, sy);\n }\n endShape(CLOSE);\n pop();\n }", "function redrawPolygon(polygon) {\n polygon\n .attr(\"d\", function(d) { return d ? \"M\" + d.join(\",\") + \"Z\" : null; })\n}", "function makePolygonStyleLayer(ref) {\n var style = ref.style;\n var styleIndex = ref.styleIndex;\n var draw = ref.draw;\n var xyz = ref.xyz;\n var xyzLayerIndex = ref.xyzLayerIndex;\n\n // Polygon fill\n var tgFillDrawGroupName = (style.type) + \"_\" + styleIndex + \"_fill\";\n draw[tgFillDrawGroupName] = {\n interactive: true,\n style: 'XYZ_polygons',\n color: style.fill,\n blend_order: getBlendOrder(style, xyz.layers, xyzLayerIndex)\n };\n\n // Polygon stroke\n var tgStrokeDrawGroupName = (style.type) + \"_\" + styleIndex + \"_stroke\";\n draw[tgStrokeDrawGroupName] = {\n interactive: true,\n style: 'XYZ_lines',\n color: style.stroke,\n width: ((style.strokeWidth) + \"px\"),\n cap: style.strokeLinecap,\n join: style.strokeLinejoin,\n blend_order: getBlendOrder(style, xyz.layers, xyzLayerIndex)\n };\n\n if (hasDash(style.strokeDasharray)) {\n draw[tgStrokeDrawGroupName].dash = style.strokeDasharray;\n }\n }", "Draw() {\n // Set drawing settings\n fill(this.color.r, this.color.g, this.color.b, this.color.a);\n noStroke();\n\n // Calculate corners of the triangle indicating this boid\n var left = Vector.PerpendicularCounterClockwise(this.forward);\n var right = Vector.PerpendicularClockwise(this.forward)\n var backLeftCorner = Vector.Add(Vector.Sub(this.position, Vector.Scale(this.forward, this.drawSize)), Vector.Scale(left, this.drawSize));\n var backRightCorner = Vector.Add(Vector.Sub(this.position, Vector.Scale(this.forward, this.drawSize)), Vector.Scale(right, this.drawSize));\n var frontCorner = Vector.Add(this.position, Vector.Scale(this.forward, this.drawSize));\n\n // Draw the triangle to the screen\n triangle(\n backLeftCorner.x,\n backLeftCorner.y,\n backRightCorner.x,\n backRightCorner.y,\n frontCorner.x,\n frontCorner.y\n );\n }", "function RegularPolygon(x, y, radius, vertexCount, fillStyle, strokeStyle) {\n if (x === void 0) { x = 0; }\n if (y === void 0) { y = 0; }\n if (radius === void 0) { radius = 0; }\n if (vertexCount === void 0) { vertexCount = 0; }\n if (fillStyle === void 0) { fillStyle = color_7.default.black; }\n if (strokeStyle === void 0) { strokeStyle = color_7.default.white; }\n var _this = _super.call(this, x, y, fillStyle, strokeStyle) || this;\n _this._rotation = 0;\n _this._radius = 0;\n _this._vertexCount = 0;\n _this._vertices = [];\n _this.noUpdate = false;\n /**\n * Reacts to the changes of the position property.\n */\n _this.positionOnChanged = function (sender) {\n _this.update();\n };\n _this.radius = radius;\n _this._vertexCount = vertexCount;\n _this.update();\n return _this;\n }", "function ShapeEdge(polygon, vertex1, vertex2) {\n this.init(polygon, vertex1, vertex2);\n}", "function polygon(feature, ring) {\n\t\t\tvar area = document.createElement(\"area\");\n\t\t\tarea.setAttribute(\"shape\", \"poly\");\n\t\t\tarea.setAttribute(\"coords\", ring.map(function(c) {\n\t\t\t\tvar p = proj({lon: c[0], lat: c[1]});\n\t\t\t\treturn p.x + \",\" + p.y;\n\t\t\t}).join(\",\"));\n\t\t\treturn area;\n\t\t}", "function draw() {\n\t// set up background\n\tdraw_background();\n\t// draw all pre-square shapes that are occluded by square\n\tdraw_shapes(pre_shapes);\n\t// draw background-colored square\n\tvar bg_sqr = {w_square_bg: new Shape(\"square\", width * .47, height * .95 / 2, \n\t\t\twidth * .3, null, colors.bg)};\n\tdraw_shapes(bg_sqr);\n\t// draw all post-square shapes that overlap square\n\tdraw_shapes(post_shapes);\n}", "function ksfCanvas_drawPolygon(xList, yList, lastx, lasty, startRadius, alpha)\n{\n\t// Stop drawing if there is only a single point.\n\tif (xList.length < 1)\n\t{\n\t\treturn;\n\t}\n\t// Draw first/final large joint.\n\tcontext.beginPath();\n\tcontext.fillStyle = \"rgba(255, 0, 0, \" + alpha / 2 + \")\";\n\tcontext.arc(xList[0], yList[0], startRadius, 0, Math.PI*2);\n\tcontext.fill();\n\tcontext.closePath();\n\t// Stop drawing if there are only two points.\n\tif (((lastx === null || lasty === null) && xList.length < 2))\n\t{\n\t\treturn;\n\t}\n\t// Draw joints.\n\tcontext.fillStyle = \"rgba(255, 0, 0, 0.2)\";\n\tfor (var i = 1; i < xList.length; i++)\n\t{\n\t\tcontext.beginPath();\n\t\tcontext.arc(xList[i], yList[i], 4, 0, Math.PI*2);\n\t\tcontext.fill();\n\t\tcontext.closePath();\n\t}\n\t// Draw polygon lines.\n\tcontext.beginPath();\n\tcontext.moveTo(xList[0], yList[0]);\n\tfor (var i = 1; i < xList.length; i++)\n\t{\n\t\tcontext.lineTo(xList[i], yList[i]);\n\t}\n\t// Close polygon.\n\tif (lastx !== null || lasty !== null)\n\t{\n\t\tcontext.lineTo(lastx, lasty);\n\t}\n\t// End path.\n\tcontext.stroke();\n\tcontext.closePath();\n}", "function Polygon2D (points) {\n const cag = fromPoints(points)\n this.sides = cag.sides\n}", "function drawShapes() {\n // Access the html canvas.\n var canvas = document.getElementById(\"gl-canvas\");\n // Init WebGL\n var gl = WebGLUtils.setupWebGL(canvas);\n // Inform the user if WebGL could not be accessed.\n if (!gl) {\n alert(\"WebGL is not available.\");\n }\n\n // Define the clipping space.\n gl.viewport(0, 0, 720, 720);\n // Assign the desired clipspace color and update.\n gl.clearColor(.4, .4, .8, 1.0);\n gl.clear(gl.COLOR_BUFFER_BIT);\n\n // Holds the vertices to be drawn.\n var arrayOfVertices = [];\n // Variables to specify the number of vertices for each shap.\n var nOctogon = 8;\n var nEllipseAndCardioid = 128;\n // Call the add function for each shape.\n arrayOfVertices = addOctogonVertices(arrayOfVertices, nOctogon, -1, 1);\n arrayOfVertices = addEllipseVertices(arrayOfVertices, nEllipseAndCardioid, -1, -1);\n arrayOfVertices = addCardioidVertices(arrayOfVertices, nEllipseAndCardioid, 2.25, 0);\n\n // Intialize the buffer.\n var bufferId = gl.createBuffer();\n // Bind the buffer the type ARRAY_BUFFER.\n gl.bindBuffer(gl.ARRAY_BUFFER, bufferId);\n // Fill the buffer with the flattened version of the vertex array.\n gl.bufferData(gl.ARRAY_BUFFER, flatten(arrayOfVertices), gl.STATIC_DRAW);\n\n // Initialize both shader programs.\n var shaderProgram = initShaders(gl, \"vertex-shader\", \"fragment-shader\");\n // Start the shader program.\n gl.useProgram(shaderProgram);\n\n // Uniform variable to scale the vertices.\n var scale = gl.getUniformLocation(shaderProgram, \"scale\");\n gl.uniform1f(scale, .5);\n // Uniform variable to specify the fragment color for a set of vertices.\n var color = gl.getUniformLocation(shaderProgram, \"color\");\n\n // Enable the vertex shader to access vertex position information.\n var myPosition = gl.getAttribLocation(shaderProgram, \"myPosition\");\n gl.vertexAttribPointer(myPosition, 2, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(myPosition);\n\n // Sets the line width for LINE_LOOP.\n gl.lineWidth(5);\n\n // Draw an octogon with the desired color (not filled).\n gl.uniform4f(color, 0.5, 0.9, 0.5, 1.0);\n gl.drawArrays(gl.LINE_LOOP, 0, nOctogon);\n // Draw an ellipse with the desired color.\n gl.uniform4f(color, 1.0, 0.5, 0.6, 1.0);\n gl.drawArrays(gl.TRIANGLE_FAN, nOctogon, nEllipseAndCardioid);\n // Change scale value for the next shape.\n gl.uniform1f(scale, 0.35);\n // Draw a cardioid with the desired color.\n gl.uniform4f(color, 0.0, 1.0, 1.0, 1.0);\n gl.drawArrays(gl.TRIANGLE_FAN, nOctogon + nEllipseAndCardioid, nEllipseAndCardioid);\n}", "function Polygon2D (points) {\n const cag = CAG.fromPoints(points)\n this.sides = cag.sides\n}", "function drawBabyzenomorph(x, y) {\n fill('grey')\n stroke('grey')\n strokeWeight(5)\n ellipse(x, y, w)\n ellipse(x, y - 20, w + 5, 25)\n\n beginShape(LINES);\n vertex(x, y);\n vertex(x - 25, y - 25);\n vertex(x - 25, y - 25);\n vertex(x - 20, y - 35)\n endShape();\n\n beginShape(LINES);\n vertex(x, y);\n vertex(x + 25, y - 25);\n vertex(x + 25, y - 25);\n vertex(x + 20, y - 35);\n endShape();\n\n beginShape(LINES);\n vertex(x, y);\n vertex(x + 30, y - 15);\n vertex(x + 30, y - 15);\n vertex(x + 40, y);\n endShape();\n\n beginShape(LINES);\n vertex(x, y);\n vertex(x - 30, y - 15);\n vertex(x - 30, y - 15);\n vertex(x - 40, y);\n endShape();\n\n beginShape(LINES);\n vertex(x, y);\n vertex(x - 35, y + 5);\n vertex(x - 35, y + 5);\n vertex(x - 40, y + 20);\n endShape();\n\n beginShape(LINES);\n vertex(x, y);\n vertex(x + 35, y + 5);\n vertex(x + 35, y + 5);\n vertex(x + 40, y + 20);\n endShape();\n\n beginShape(LINES);\n vertex(x, y);\n vertex(x - 10, y - 50);\n vertex(x - 10, y - 50);\n vertex(x - 25, y - 60);\n endShape();\n\n beginShape(LINES);\n vertex(x, y);\n vertex(x + 10, y - 50);\n vertex(x + 10, y - 50);\n vertex(x + 25, y - 60);\n endShape();\n\n beginShape(TRIANGLES)\n vertex(x - 10, y);\n vertex(x + 10, y);\n vertex(x, y + 50);\n vertex(x - 5, y + 40);\n vertex(x + 5, y + 40);\n vertex(x, y + 75);\n endShape();\n }", "function draw() {\n gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);\n gl.drawArrays(gl.TRIANGLES, 0, pointsPositions.length/size);\n}", "function draw() {\n background(147,112,219);\n\n drawRects();\n drawCircles();\n drawEllipse();\n noStroke();\n drawTri();\n\n fill(204);\n quad(100,100,200,100,200,250,140,230);\n//white half of circle\n fill(255);\n arc(480,500,100,100,PI,TWO_PI);\n//larger arc \n fill(100,23,45);\n arc(480,650,200,200,0,PI + QUARTER_PI);\n\n //gray square with lining\n fill(120,120,120);\n stroke(23);\n strokeWeight(7);\n square(800,600,120);\n}", "function polygon(d) {\n var coords = d.coordinates || [];\n var o = importPolygon(coords);\n applyStyleAttributes(o, 'polygon', d);\n return o;\n }", "function makePolygon() {\n //Create new polygon\n var polygon = new google.maps.Polygon({\n paths: getPosArrayFromMarkers(tmpPolygonMarkers),\n strokeColor: \"#FF00FF\",\n strokeOpacity: 0.5,\n strokeWeight: 1,\n fillColor: \"#00FF00\",\n fillOpacity: 0.20,\n map: map,\n zIndex: 1000,\n draggable: true,\n clickable: true,\n editable: true,\n geodesic: true\n });\n polygons.push(polygon);\n activateElement(polygon); \n google.maps.event.addListener(polygon.getPath(), 'set_at', function(index) {\n activateElement(polygon);\n updatePolygonMeasures(polygon);\n });\n google.maps.event.addListener(polygon.getPath(), 'insert_at', function(index) {\n activateElement(polygon);\n updatePolygonMeasures(polygon);\n });\n google.maps.event.addListener(polygon, 'click', function(index) {\n activateElement(polygon);\n updatePolygonMeasures(polygon); \n });\n google.maps.event.addListener(polygon, 'rightclick', function(index) {\n polygon.label.close();\n polygon.setMap(null);\n var idx = polygons.indexOf(polygon);\n if (idx > -1) {polygons.splice(idx, 1);} else {console.log(\"Couldn't remove polygon from polygons array\");}\n if (selectedElement === polygon) {nullifyPolygonMeasures();}\n polygon.setDraggable(false); // Neded to stop annoying box that follows mouse around after removing object\n });\n polygon.updateLengthFromPolygon = function() {\n polygon.overallLength = 0;\n var vertices = polygon.getPath();\n for (var i = 0; i < vertices.getLength() -1; i++) {\n var pos1 = vertices.getAt(i);\n var pos2 = vertices.getAt(i+1);\n polygon.overallLength += google.maps.geometry.spherical.computeDistanceBetween(pos1,pos2);\n }\n this.overallLength += google.maps.geometry.spherical.computeDistanceBetween(vertices.getAt(i),vertices.getAt(0));\n };\n polygon.updateAreaFromPolygon = function() {\n polygon.overallArea = google.maps.geometry.spherical.computeArea(polygon.getPath());\n \n };\n polygon.label = new InfoBox({\n content: \"<strong>Length:</strong> <br />\" + getlengthText(polygon.overallLength) + \"<br />\" + \n \"<strong>Area:</strong> <br />\" + getAreaText(polygon.overallArea),\n position: getCenterOfLatLngArray(getPosArrayFromPolyPath(polygon.getPath())),\n isHidden: false,\n pane: \"mapPane\",\n enableEventPropagation: true,\n pixelOffset: new google.maps.Size(-25,-50, \"px\", \"px\")\n });\n updatePolygonMeasures(polygon);\n polygon.label.open(map, polygon.getPath[0]);\n //Remove lines & markers that made up polyline\n tmpPolygonCloseLine.setMap(null);\n tmpPolygonCloseLine = null;\n tmpPolyline.setMap(null);\n removetmpPolygonMarkers();\n}", "draw(){\n const panel = document.getElementById('graphpanel')\n const diamond = document.createElementNS('http://www.w3.org/2000/svg', 'polygon')\n\t let xMid = this.x + (this.size / 2)\n let yMid = this.y + (this.size / 2)\n\t let xLong = this.x + this.size\n\t let yLong = this.y + this.size\n\t let str = String(xMid) + ' ' + String(this.y) + ', ' + String(xLong) + ' ' + String(yMid) + ', ' + String(xMid) + ' ' + String(yLong) + ', ' + String(this.x) + ' ' + String(yMid)\n\t diamond.setAttribute('points', str) \n\t diamond.setAttribute('fill', this.color)\n panel.appendChild(diamond)\n }", "setMainPolygon (w,h) { this.polygons[0] = new Polygon( ...Utils.atoc([0,0, w,0, w,h, 0,h]) ); }", "function draw() {\n\n background(0)\n strokeWeight(1)\n\n beginShape()\n\n curveVertex(217,84)\n curveVertex(215,118)\n curveVertex(215,133)\n curveVertex(211,159)\n curveVertex(208,183)\n curveVertex(207,206)\n curveVertex(206,226)\n curveVertex(205,249)\n curveVertex(204,279)\n curveVertex(202,295)\n curveVertex(233,294)\n curveVertex(261,293)\n curveVertex(293,295)\n curveVertex(295,291)\n curveVertex(296,290)\n curveVertex(302,231)\n curveVertex(304,194)\n curveVertex(309,157)\n curveVertex(310,127)\n curveVertex(312,70)\n\nstrokeWeight(0)\nfill(243, 240, 245)\n endShape(CLOSE)\n\n //left side of painting\n beginShape()\n fill(200, 164, 224)\n\n vertex(0,58)\n vertex(42,67)\n vertex(92,75)\n vertex(143,81)\n vertex(181,81)\n vertex(207,83)\n vertex(220,83)\n vertex(220,112)\n vertex(216,134)\n vertex(216,158)\n vertex(214,184)\n vertex(213,214)\n vertex(212,250)\n vertex(212,279)\n vertex(213,193)\n vertex(207,291)\n vertex(128,292)\n vertex(88,290)\n vertex(65,280)\n vertex(43,275)\n vertex(17,273)\n vertex(0,278)\n\n endShape(CLOSE)\n\n //right side of painting\n\n beginShape()\n vertex(313,69)\n vertex(326,61)\n vertex(354,50)\n vertex(398,48)\n vertex(463,43)\n vertex(525,37)\n vertex(582,29)\n vertex(627,19)\n vertex(640,21)\n vertex(640,248)\n vertex(563,252)\n vertex(501,255)\n vertex(445,258)\n vertex(408,264)\n vertex(363,275)\n vertex(332,275)\n vertex(311,278)\n vertex(298,278)\n vertex(300,208)\n vertex(304,161)\n vertex(301,115)\n vertex(307,77)\n vertex(311,69)\n\n endShape(CLOSE)\n\n //green on right side\n\n beginShape()\nfill(70, 128, 86)\n vertex(294,300)\n vertex(298,276)\n vertex(318,276)\n vertex(331,272)\n vertex(356,272)\n vertex(379,266)\n vertex(420,258)\n vertex(444,254)\n vertex(483,253)\n vertex(530,249)\n vertex(584,247)\n vertex(616,245)\n vertex(640,247)\n vertex(640,300)\n vertex(601,300)\n vertex(536,300)\n vertex(429,300)\n vertex(348,300)\n vertex(295,300)\n\n endShape(CLOSE)\n\n //left green\n\n beginShape()\n vertex(244,358)\n vertex(218,336)\n vertex(176,307)\n vertex(145,295)\n vertex(110,288)\n vertex(77,279)\n vertex(41,273)\n vertex(8,270)\n vertex(0,270)\n vertex(1,480)\n vertex(177,480)\n vertex(244,384)\n\n endShape(CLOSE)\n\n // right green under bridge\n\n beginShape()\n stroke(61, 117, 77, 128)\n vertex(427,278)\n vertex(369,323)\n vertex(359,335)\n vertex(370,354)\n vertex(387,368)\n vertex(400,392)\n vertex(406,420)\n vertex(406,446)\n vertex(408,480)\n vertex(640,480)\n vertex(640,293)\n\n endShape(CLOSE)\n\n\n\n //bridge\n fill(237, 217, 255)\n beginShape()\n vertex(101,283)\n vertex(203,279)\n vertex(304,280)\n vertex(383,279)\n vertex(429,278)\n vertex(369,326)\n vertex(333,307)\n vertex(314,301)\n vertex(292,298)\n vertex(262,298)\n vertex(234,308)\n vertex(207,328)\n vertex(101,282)\n\n endShape(CLOSE)\n\n //blue uner right side of bright\n\n beginShape()\n fill(85, 108, 166)\n vertex(302,322)\n vertex(272,343)\n vertex(254,365)\n vertex(245,380)\n vertex(271,374)\n vertex(292,364)\n vertex(316,344)\n vertex(329,330)\n vertex(344,321)\n vertex(351,316)\n\n endShape(CLOSE)\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n}", "drawShape(...shapes) {\n shapes = shapes.map((s) => {\n if (s instanceof Shape) return s;\n return new Shape(this.POLYGON, undefined, s);\n });\n this.currentShape = shapes[0].copy();\n for (let i = 1; i < shapes.length; i++) {\n this.currentShape.merge(shapes[i]);\n }\n this.end();\n }", "function showPolygon(id) {\n if (DEBUG) {\n console.log('Displaying alert polygon for id', id);\n }\n \n //Parse polygon\n //find the right polygon\n\n var polygonVertices = parsePolyStrings(alertRulesArray[alertArrayIndexByID(id)].polygon);\n\n //Draw the polygon on the map\n if (polygonVertices.length) {\n alertPolygon.setPaths(polygonVertices);\n alertPolygon.setMap(map);\n }\n }", "function is_basic_polygon() {\r\n\t\t\tif (inForceTrapezoidation)\treturn\tfalse;\r\n\t\t\treturn\t( myPolygonData.nbPolyChains() == 1 );\r\n\t\t}", "function is_basic_polygon() {\r\n\t\t\tif (inForceTrapezoidation)\treturn\tfalse;\r\n\t\t\treturn\t( myPolygonData.nbPolyChains() == 1 );\r\n\t\t}", "function Polygon2D(points) {\n const cag = fromPoints(points);\n this.sides = cag.sides;\n}", "function completePolygon() {\n d3.select('g.outline').remove();\n\n gPoly = svgCanvas.append('g')\n .classed(\"polygon\", true)\n .classed(\"zone-\" + zone.id, true);\n\n polyPoints.splice(polyPoints.length - 1);\n //console.log(polyPoints);\n\n polyEl = gPoly.append(\"polygon\")\n .attr(\"points\", polyPoints);\n\n for (var i = 0; i < polyPoints.length; i++) {\n gPoly.append('circle')\n .attr(\"cx\", polyPoints[i][0])\n .attr(\"cy\", polyPoints[i][1])\n .attr(\"r\", 4)\n .call(dragBehavior);\n }\n\n isDrawing = false;\n isDragging = true;\n\n bbox = polyEl._groups[0][0].getBBox();\n var bbox2 = gPoly._groups[0][0].getBBox();\n\n\n bbox.x = 0;\n bbox.y = 0;\n bbox.width = 50;\n bbox.height = 50;\n\n\n // Set translate variable defaults;\n gPoly.datum({\n x: 0,\n y: 0\n });\n\n // Set translate elem attribute defaults\n gPoly.attr(\"transform\", function (d) {\n return \"translate(\" + d.x + \",\" + d.y + \")\"\n });\n\n // polyEL.attr(\"transform\", \"translate(\" + 0 + \",\" + 0 + \")\");\n //\n gPoly.call(d3.drag().on(\"drag\", function (d) {\n d3.select(this).attr(\"transform\", \"translate(\" + (d.x = d3.event.x) + \",\" + (d.y = d3.event.y) + \")\")\n }));\n\n // Add context menu\n gPoly.on('contextmenu', d3.contextMenu(menu))\n\n // Add label text\n var gPolyCentroid = d3.polygonCentroid(polyPoints);\n addLabel(gPoly, zone.name, gPolyCentroid);\n\n }", "function renderPolygonGeometry(olGeom, olStyle, polyGeom, lineGeom) {\n if (!olStyle) {\n return;\n }\n\n const ends = olGeom.getEnds();\n if (ends.length === 0) {\n return null;\n }\n\n const stride = olGeom.getStride();\n const flatCoordinates = olGeom.getFlatCoordinates();\n\n // get parameters from style\n const fillColor = olStyle.getFill()\n ? olcolor.asArray(olStyle.getFill().getColor())\n : [0, 0, 0, 0];\n const strokeColor = olStyle.getStroke()\n ? olcolor.asArray(olStyle.getStroke().getColor())\n : null;\n const lineJoin = olStyle.getStroke()\n ? olStyle.getStroke().getLineJoin()\n : null;\n const lineWidth = olStyle.getStroke() ? olStyle.getStroke().getWidth() : null;\n const lineCap = olStyle.getStroke() ? olStyle.getStroke().getLineCap() : null;\n const lineMiterLimit = olStyle.getStroke()\n ? lineJoin === 'bevel'\n ? 0\n : olStyle.getStroke().getMiterLimit() || 10.0\n : null;\n const lineParams = {\n join: lineJoin,\n cap: lineCap,\n miterLimit: lineMiterLimit,\n closed: true\n };\n\n let outerStart,\n outerEnd,\n ringStart,\n ringEnd,\n holeEnds = [];\n\n for (let i = 0; i < ends.length; i++) {\n if (ends[i] === ends[i - 1]) {\n continue;\n }\n\n ringStart = i > 0 ? ends[i - 1] : 0;\n ringEnd = ends[i];\n\n // render rings\n strokeColor &&\n lineGeom.pushLine(\n lineParams,\n lineWidth,\n strokeColor,\n flatCoordinates,\n ringStart,\n ringEnd,\n stride\n );\n\n // this is an outer ring: generate the previous polygon and initiate new one\n // TODO: USE A PARAMETER FOR THIS\n if (!isClockWise(flatCoordinates, ringStart, ringEnd, stride)) {\n if (outerStart !== undefined) {\n polyGeom.pushPolygon(\n fillColor,\n stride,\n flatCoordinates,\n outerStart,\n outerEnd,\n holeEnds\n );\n }\n outerStart = ringStart;\n outerEnd = ringEnd;\n holeEnds.length = 0;\n } else if (outerStart !== undefined) {\n holeEnds.push(ringEnd);\n }\n }\n\n // generate the last pending polygon\n if (outerStart !== undefined) {\n polyGeom.pushPolygon(\n fillColor,\n stride,\n flatCoordinates,\n outerStart,\n outerEnd,\n holeEnds\n );\n }\n}", "draw(){\n push();\n\n beginShape();\n texture(this.texture);\n textureWrap(MIRROR);\n //draw as a rectangle, divide by 2 for width and height\n vertex(this.getX() - (this.w/2.0), this.getY() - (this.h/2.0),CENTER,TOP_EDGE); //bottom right, CCW, Need UV coordinates for texture mapping\n vertex(this.getX() + (this.w/2.0), this.getY() - (this.h/2.0),RIGHT_EDGE,TOP_EDGE); //for some reason this starts on bottom right?\n vertex(this.getX() + (this.w/2.0), this.getY() + (this.h/2.0),RIGHT_EDGE,CENTER);\n vertex(this.getX() - (this.w/2.0), this.getY() + (this.h/2.0),CENTER,CENTER);\n\n endShape(CLOSE);\n\n pop();\n }", "function graphics(div_attach, name) {\n\t\t\n // *******************************************\n // Private variables:\n // *******************************************\t\n this.name = name;\n this.div_attach = div_attach;\n \n var drawn_obj;\n\t\t\n // *******************************************\n // Public methods:\n // *******************************************\n \n // Draw a polygon given an array of control points X and Y.\n // returns the polygon element\n this.DrawPolygon = function(X,Y, color, scale,obj_name) {\n var num_Points = X.length; \t\n var poly_points = \"\";\n \n for(i = 0; i < num_Points; i++) {\n var x_Coord = X[i];\n var y_Coord = Y[i];\n poly_points = poly_points + (X[i]*scale) + \"px,\" + (Y[i]*scale) + \"px,\";\n }\n \n poly_points = poly_points + (X[0]*scale) + \"px,\" + (Y[0]*scale) + \"px\";\n \n var VML_str = '<v:polyline id=\"' + this.name + '\" title=\"' + obj_name + '\" points=\"' + poly_points + '\" strokecolor=\"'+ color +'\" strokeweight=\"4px\" filled=\"false\" fillcolor=\"red\" style=\"position:absolute;left:0pt;top:0pt;\" />';\n InsertAfterDiv(VML_str, this.div_attach);\n \n this.drawn_obj = document.getElementById(this.name);\t\n };\n\n\n // Draw a polyline given an array of control points X and Y.\n // returns the polyline element\n this.DrawPolyLine = function(X,Y, color, scale) {\n var num_Points = X.length; \t\n var poly_points = \"\";\n \n for(i = 0; i < num_Points; i++) {\n var x_Coord = X[i];\n var y_Coord = Y[i];\n poly_points = poly_points + (X[i]*scale) + \"px,\" + (Y[i]*scale) + \"px,\";\n }\n \n \n \n var VML_str = '<v:polyline id=\"' + this.name + '\" points=\"' + poly_points + '\" strokecolor=\"'+ color +'\" strokeweight=\"4px\" filled=\"false\" fillcolor=\"red\" style=\"position:absolute;left:0pt;top:0pt;\" />';\n InsertAfterDiv(VML_str, this.div_attach);\n \n this.drawn_obj = document.getElementById(this.name);\t\n };\n\n \t\t\n // Fill the drawn object.\n this.FillPolygon = function () {\n this.drawn_obj = document.getElementById(this.name);\n this.drawn_obj.setAttribute(\"filled\",\"true\");\n this.drawn_obj.setAttribute(\"fillcolor\",\"red\");\n \n if (document.getElementById(this.name + \"_fill\") == null) {\n var fill=document.createElement(\"v:fill\");\n fill.setAttribute(\"id\", this.name + \"_fill\");\n fill.setAttribute(\"opacity\", \"0.5\");\n this.drawn_obj.appendChild(fill);\n }\n };\n\n // Unfill the drawn object.\n this.UnfillPolygon = function () {\n this.drawn_obj = document.getElementById(this.name);\n this.drawn_obj.setAttribute(\"filled\",\"false\");\n };\n \n // Draw a line given starting coordinates and ending coordinates\n this.DrawLineSegment = function(x1,y1,x2,y2, scale, color) {\n var VML_str = '<v:line id=\"' + this.name + '\" from=\"' + (x1*scale) + 'px,' + (y1*scale) + 'px\" to=\"'+ (x2*scale) + 'px,' + (y2*scale) + 'px\" strokecolor=\"' + color + '\" strokeweight=\"4px\" style=\"position:absolute;left:0pt;top:0pt;\" />';\n InsertAfterDiv(VML_str, this.div_attach);\n this.drawn_obj = document.getElementById(this.name);\n };\n\t\n // Draw a point given coordinates\n this.DrawPoint = function(x,y, color, width) {\n var VML_str = '<v:oval id=\"' + this.name + '\" fillcolor=\"' + color + '\" style=\"position:absolute;left:' + (x-width) + 'px;top:' + (y-width) + 'px;width:' + (2*width) + 'px;height:' + (2*width) + 'px;\" strokecolor=\"#ffffff\" strokeweight=\"' + (width/2) + '\" oncontextmenu=\"return false;\" />';\n InsertAfterDiv(VML_str, this.div_attach);\n this.drawn_obj = document.getElementById(this.name);\n };\n\n // Clear all drawings related to this object.\n this.ClearDrawing = function () {\n var q = document.getElementById(this.name);\n if(q) q.parentNode.removeChild(q);\n this.drawn_obj = null;\n };\n \n // Sets an attribute for the drawn object.\n this.SetAttribute = function(field,value) {\n switch(field) {\n case 'style':\n var f = value.substring(0,value.indexOf(':'));\n var v = value.substring(value.indexOf(':')+1,value.length-1);\n this.drawn_obj.style.setAttribute(f,v);\n break;\n default:\n this.drawn_obj.setAttribute(field,value);\n }\n };\n\n // Move this drawn element to the top in the depth ordering.\n this.MoveToTop = function () {\n var q = document.getElementById(this.name);\n if(q) q.parentNode.appendChild(q);\n };\n\n // Change the canvas.\n this.ChangeCanvas = function (div_attach) {\n this.div_attach = div_attach;\n };\n\n // *******************************************\n // Private methods:\n // *******************************************\n}", "function drawTriangle(context, elem, xp, yp, zp) {\n let y = pc(yp, elem.height);\n let x = pc(xp, elem.width);\n let z = pc(zp, elem.width);\n context.moveTo(x + z, y);\n context.lineTo(x + z*2, y + z*2);\n context.lineTo(x, y + z*2);\n context.closePath();\n}", "function SVGShape() {}", "function Triangle() {\n var that = this;\n\n if (typeof Triangle.layer == 'undefined')\n Triangle.layer = new paper.Layer();\n\n this.path = new paper.Path();\n this.path.strokeColor = 'black';\n this.vertices = [];\n this.isFinished = false;\n\n /***********/\n this.addVertex = function(vertex) {\n if (that.isFinished) {\n return true;\n }\n\n vertex.isUsedForTriangle = true;\n vertex.setVisible(true);\n\n vertex.addTriangle(that);\n that.vertices.push(vertex);\n that.path.add(vertex.position);\n\n if (that.vertices.length == 3) {\n for (var i = 0; i < that.vertices.length; ++i) {\n that.vertices[i].isUsedForTriangle = false;\n that.vertices[i].setVisible(false);\n }\n\n that.isFinished = true;\n that.path.closed = true;\n that.path.fillColor = 'red';\n that.path.strokeWidth = 0;\n Triangle.layer.addChild(that.path);\n return true;\n }\n else {\n return false;\n }\n }\n\n /***********/\n this.erase = function() {\n var currentVertices = that.vertices.slice(0);\n for (var i = 0; i < currentVertices.length; ++i) {\n currentVertices[i].removeFrom(that);\n }\n\n that.vertices = [];\n that.path.remove();\n }\n\n /***********/\n this.movePointTo = function(x1, y1, x2, y2) {\n for (var i = 0; i < that.path.segments.length; i++) {\n if (that.path.segments[i].point.x == x1 || that.path.segments[i].point.y == x2) {\n that.path.segments[i].point.x = x2;\n that.path.segments[i].point.y = y2;\n }\n }\n }\n \n /***********/\n this.setColorFromRaster = function(raster) {\n var center = new paper.Point(0, 0);\n for (var i = 0; i < that.vertices.length; i++) {\n center.x += that.vertices[i].position[0];\n center.y += that.vertices[i].position[1];\n }\n center.x /= 3;\n center.y /= 3;\n\n that.path.fillColor = raster.getPixel(center.x, center.y);\n }\n}", "function calculateAndDrawPolygon(polylines, circles, ssids) {\n var points = [];\n\n for (var i=0; i < circles.length; i++) {\n var paths = circles[i].getPath().getArray();\n for(var c = 0; c < paths.length; c++) {\n points.push(paths[c]);\n }\n }\n points.sort(sortPointY);\n points.sort(sortPointX);\n\n // DrawHull(polylines, points, ssids);\n}", "function is_basic_polygon() {\n\t\t\tif (inForceTrapezoidation)\treturn\tfalse;\n\t\t\treturn\t( myPolygonData.nbPolyChains() == 1 );\n\t\t}", "function is_basic_polygon() {\n\t\t\tif (inForceTrapezoidation)\treturn\tfalse;\n\t\t\treturn\t( myPolygonData.nbPolyChains() == 1 );\n\t\t}", "function createPolygonSelection( polygon, addTo )\n{\n\tvar i;\n\tvar desc = new ActionDescriptor();\n\tvar ref = new ActionReference();\n\tvar listDesc = new ActionDescriptor();\n\tvar pointList = new ActionList();\n addTo = (typeof addTo === \"undefined\") ? false : addTo;\n\t\n\tref.putProperty( typeChannel, charIDToTypeID('fsel') );\t// What's fsel?\n\tdesc.putReference( typeNULL, ref );\n\n\tfor (i in polygon)\n\t{\n\t\tvar pointDesc = new ActionDescriptor();\n\t\tpointDesc.putUnitDouble( keyHorizontal, unitPixels, polygon[i].fX );\n\t\tpointDesc.putUnitDouble( keyVertical, unitPixels, polygon[i].fY );\n\t\tpointList.putObject( classPoint, pointDesc );\n\t}\n\n\tlistDesc.putList( keyPoints, pointList );\n\tdesc.putObject( keyTo, classPolygon, listDesc );\n\tdesc.putBoolean( keyAntiAlias, true );\n var event = addTo ? stringIDToTypeID(\"addTo\") : eventSet;\n\texecuteAction( event, desc, DialogModes.NO );\n}", "function render()\n{\n //clear canvas\n gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);\n\n //to draw points that havent yet formed a polygon\n if (tempPoints.length > 0){\n // Bind the color buffer.\n gl.bindBuffer( gl.ARRAY_BUFFER, colorBuffer );\n // this tells the attribute how to get data out of color buffer\n gl.vertexAttribPointer( vertexColor, 4, gl.FLOAT, false, 0, 0 );\n gl.bufferData( gl.ARRAY_BUFFER, flatten(tempColors), gl.STATIC_DRAW );\n // Bind the vertex position buffer.\n gl.bindBuffer( gl.ARRAY_BUFFER, vertexBuffer );\n // this tells the attribute how to get data out of vertex buffer\n gl.vertexAttribPointer( vertexPosition, 4, gl.FLOAT, false, 0, 0 );\n gl.bufferData( gl.ARRAY_BUFFER, flatten(tempPoints), gl.STATIC_DRAW );\n gl.drawArrays(gl.POINTS, 0, tempPoints.length);\n }\n\n // Bind the color buffer.\n gl.bindBuffer( gl.ARRAY_BUFFER, colorBuffer );\n // this tells the attribute how to get data out of color buffer\n gl.vertexAttribPointer( vertexColor, 4, gl.FLOAT, false, 0, 0 );\n gl.bufferData( gl.ARRAY_BUFFER, flatten(colors), gl.STATIC_DRAW );\n // Bind the vertex position buffer.\n gl.bindBuffer( gl.ARRAY_BUFFER, vertexBuffer );\n // this tells the attribute how to get data out of vertex buffer\n gl.vertexAttribPointer( vertexPosition, 4, gl.FLOAT, false, 0, 0 );\n gl.bufferData( gl.ARRAY_BUFFER, flatten(points), gl.STATIC_DRAW );\n\n //if quad mode and points still being drawn then dont draw the last points\n //(because the last points may make up a triangle)\n if (mode == QUAD_MODE && tempPoints.length < 4) {\n gl.drawArrays( gl.TRIANGLES, 0, points.length - tempPoints.length);\n }\n\n else {\n gl.drawArrays( gl.TRIANGLES, 0, points.length);\n }\n\n requestAnimationFrame(render);\n}", "function drawIMesh (){\n\tvar vertexBufferData = triangleBufferDataFromVertices(letterVertices);\n\n\t// Setup the color buffer for the vertex colors.\n\tvar vertexColorBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, vertexColorBuffer);\n var colorSet = [\n \t\t[1.0, 0.0, 0.0, 1.0],\n \t[0.0, 1.0, 0.0, 1.0],\n \t[0.0, 0.0, 1.0, 1.0]];\n var colors = [];\n for (var i=0; i<vertexBufferData.lines.length; i++){\n \tcolors = colors.concat(colorSet[i % 3]);\n }\n\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(colors), gl.STATIC_DRAW);\n gl.vertexAttribPointer(vertexColorAttribute,\n \t\t2 /* attribute size */,\n \t\tgl.FLOAT,\n \t\tfalse /* normalized */,\n \t\t0 /* stride */,\n\t\t\t0 /* offset */);\n \n\t// Setup the position buffer for the shape's vertices.\n\tvar vertexPositionBuffer = gl.createBuffer();\n\tgl.bindBuffer(gl.ARRAY_BUFFER, vertexPositionBuffer);\n\tgl.vertexAttribPointer(\n\t\t\tvertexPositionAttribute,\n\t\t\t2 /* attribute size */,\n\t\t\tgl.FLOAT,\n\t\t\tfalse /* normalized */,\n\t\t\t0 /* stride */,\n\t\t\t0 /* offset */);\n\n\tif (!app.wireframe){\n\t\t// Draw the vertices using the TRIANGLE_STRIP method.\n\t\tgl.bufferData(gl.ARRAY_BUFFER, new Float32Array(vertexBufferData.top), gl.STATIC_DRAW);\n\t\tgl.drawArrays(gl.TRIANGLE_STRIP, 0 /* firstIndex */, vertexBufferData.top.length / 2);\n\n\t\tgl.bufferData(gl.ARRAY_BUFFER, new Float32Array(vertexBufferData.trunk), gl.STATIC_DRAW);\n\t\tgl.drawArrays(gl.TRIANGLE_STRIP, 0 /* firstIndex */, vertexBufferData.trunk.length / 2);\n\n\t\tgl.bufferData(gl.ARRAY_BUFFER, new Float32Array(vertexBufferData.bottom), gl.STATIC_DRAW);\n\t\tgl.drawArrays(gl.TRIANGLE_STRIP, 0 /* firstIndex */, vertexBufferData.bottom.length / 2);\n\t} else {\n\t\t// Draw the wireframe lines.\n\t\tgl.bufferData(gl.ARRAY_BUFFER, new Float32Array(vertexBufferData.lines), gl.STATIC_DRAW)\n\t\tgl.drawArrays(gl.LINE_STRIP, 0 /* firstIndex */, vertexBufferData.lines.length / 2);\n\t}\n}", "draw(){\n noStroke();\n if(this.getHover() || this.getSelected()){\n fill(BLUE_5); //needs a constant\n }\n else{\n fill(this.col);\n }\n \n push();\n beginShape(); //CCW\n vertex(this.getX() - (this.w)/2.0, this.getY() + (this.h)/2.0); //top left\n vertex(this.getX() - (this.w)/2.0, this.getY() - (this.h)/2.0);\n vertex(this.getX() + (this.w)/2.0, this.getY() - (this.h)/2.0);\n vertex(this.getX() + (this.w)/2.0, this.getY() + (this.h)/2.0);\n\n endShape(CLOSE);\n pop();\n }", "function drawPolygon(pWidth)\n{\n var point = stackPoints.pop();\n\n var pol = paper.path(drawPol(point[0], point[1], polygon['sides'], polygon['length']));\n pol.attr({fill: 'rgb(' + [paintColor[0],paintColor[1],paintColor[2]].join(',') + ')', stroke: \"None\", 'stroke-width': pWidth});\n\n if(Object.keys(animObj).length > 0)\n {\n var _transformedPath = Raphael.transformPath('M100 100L190 190', 'T400,0');\n pol.animate({path: _transformedPath, fill: 'rgb(' + [animObj['red'],animObj['green'],animObj['blue']].join(',') + ')'}, 1000);\n animObj = {};\n }\n polygon = {};\n}", "static regular_polygon(x, y, r, n, rot=0) {\n\t\tlet pos = createVector(x, y);\n\t\tlet vert = [];\n\t\tfor (let i = 0; i < n; i++) {\n\t\t\tlet ang = i * TWO_PI / n + rot;\n\t\t\tlet vec = p5.Vector.fromAngle(ang).mult(r);\n\t\t\tvert.push(p5.Vector.add(vec, pos));\n\t\t}\n\t\treturn new Shape(vert);\n\t}", "function draw() {\n // We slowly clear each frame\n const opacity = 0.05;\n background(0, 0, 0, opacity * 255);\n\n if (!active) {\n const dim = min(width, height);\n noStroke();\n fill(255);\n polygon(width / 2, height / 2, dim * 0.05, 3);\n }\n}", "function Polygon (vectors, color) {\n this.vectors = vectors\n this._color = this.color = color || [255, 255, 255] // Underscore is for read only\n }", "function drawGraphics(obj) {\r\n var shape = new createjs.Shape();\r\n obj.x = obj.x ? parseFloat(obj.x) : 0;\r\n obj.y = obj.y ? parseFloat(obj.y) : 0;\r\n\r\n switch (obj.subType) {\r\n case \"ARROW\":\r\n shape = new ArrowComp(obj);\r\n break;\r\n case \"LINE\":\r\n obj.stroke = obj.stroke ? obj.stroke : 1;\r\n obj.strokeColor = obj.strokeColor ? obj.strokeColor : \"#000\";\r\n shape.graphics.setStrokeStyle(obj.stroke).beginStroke(obj.strokeColor).lineTo(obj.x, obj.y).lineTo(obj.x1, obj.y1).endStroke();\r\n obj.x = 0;\r\n obj.y = 0;\r\n break;\r\n case \"RECT\":\r\n obj.stroke = obj.stroke ? obj.stroke : 0;\r\n obj.strokeColor = obj.strokeColor ? obj.strokeColor : \"\";\r\n obj.color = obj.color ? obj.color : \"\";\r\n obj.corner = obj.corner ? obj.corner : 0;\r\n shape.graphics.setStrokeStyle(obj.stroke).beginStroke(obj.strokeColor);\r\n shape.graphics.beginFill(obj.color).drawRoundRect(0, 0, parseFloat(obj.width), parseFloat(obj.height), obj.corner);\r\n break;\r\n case \"CIRCLE\":\r\n var width, height, ratio;\r\n width = parseFloat(obj.width);\r\n height = parseFloat(obj.height);\r\n ratio = width < height ? height / 2 : width / 2;\r\n obj.stroke = obj.stroke ? obj.stroke : 0;\r\n obj.strokeColor = obj.strokeColor ? obj.strokeColor : \"\";\r\n obj.color = obj.color ? obj.color : \"\";\r\n shape.graphics.setStrokeStyle(obj.stroke).beginStroke(obj.strokeColor);\r\n shape.graphics.beginFill(obj.color).drawCircle(0, 0, ratio);\r\n if (width < height) {\r\n shape.scaleX = width / (ratio * 2);\r\n } else {\r\n shape.scaleY = height / (ratio * 2);\r\n }\r\n obj.x = obj.x + ratio + 5;\r\n obj.y = obj.y + ratio - 15;\r\n break;\r\n default:\r\n break;\r\n }\r\n if (obj.rotation) shape.rotation = obj.rotation;\r\n shape.x = obj.x;\r\n shape.y = obj.y;\r\n return shape;\r\n}", "display() {\n fill('#323230');\n noStroke();\n if(this.shape === 'rect') {\n rectMode(CENTER);\n rect(this.x, this.y, this.size, this.size);\n } else if(this.shape === 'circle') {\n circle(this.x, this.y, this.size);\n } else {\n triangle(this.x - this.size / 2, this.y + this.size / 2, this.x + this.size / 2, this.y + this.size / 2, this.x, this.y - this.size / 2);\n }\n }", "function draw() {\n const dim = Math.min(width, height);\n\n // Instead of drawing black, we draw with\n // transparent black to give a 'ghosting' effect\n const opacity = 0.085;\n background(0, 0, 0, opacity * 255);\n\n // If we have a mouse position, draw it\n if (mouse) {\n noFill();\n stroke(255);\n strokeWeight(dim * 0.01);\n circle(mouse[0], mouse[1], dim * 0.2);\n\n // Clear position so we stop drawing it,\n // this will make it fade away\n mouse = null;\n }\n\n // Draw a 'play' button\n noStroke();\n fill(255);\n polygon(width / 2, height / 2, dim * 0.1, 3);\n}", "function Shape4(){}", "rasterize () {\n // Important notes:\n // - Transform and round the vertices first\n // - Feel free to use floating point arithmetic (DDA is recommended)\n // - Take care to hand the filled vs. non-filled cases\n // - Don't forget to pass this.color to setPixel or rasterizeLine calls\n // - Be sure to test your code with all the unusual cases:\n // > Degenerate triangles (all the same point, all in a line)\n // > Triangles where sides are perfectly horizontal or vertical\n // (and combinations of vertical and horizontal)\n\n // NOTE: These lines are temporary, remove them once you are done.\n setPixel(this.P1, this.color)\n setPixel(this.P2, this.color)\n setPixel(this.P3, this.color)\n }", "constructor({ length = .5, height = .5, width = .5}) {\n super();\n\n /* Bottom front left */\n this.vertices.push([width, length, 2]);\n\n /* 1) Bottom front right */\n this.vertices.push([width, length * 2, 2]);\n\n /* 2) top front right */\n this.vertices.push([width, length * 2, height + 2]);\n\n /* 3) top front left */\n this.vertices.push([width, length, height + 2]);\n\n /* 4) Bottom back right */\n this.vertices.push([0, length * 2, 2]);\n\n /* 5) Bottom back left */\n this.vertices.push([0, length, 2]);\n\n /* 6) top back right */\n this.vertices.push([0, length * 2, height + 2]);\n\n /* 7) top back left */\n this.vertices.push([0, length, height + 2]);\n\n // Pushing the triangles\n // Triangle 1 front bottom\n this.triangles.push([0, 1, 2]);\n\n //Triangle 2 front top\n this.triangles.push([0, 2, 3]);\n\n // Triangle 3 right bottom\n this.triangles.push([1, 4, 6]);\n\n // Triangle 4 right top\n this.triangles.push([1, 6, 2]);\n\n // Triangle 5 back bottom\n this.triangles.push([4, 5, 7]);\n\n // Triangle 6 back top\n this.triangles.push([4, 7, 6]);\n\n // Triangle 7 left bottom\n this.triangles.push([5, 0, 3]);\n\n // Triangle 8 left top\n this.triangles.push([5, 3, 7]);\n\n // Triangle 9 top bottom\n this.triangles.push([3, 2, 6]);\n\n // Triangle 10 top top\n this.triangles.push([3, 6, 7]);\n\n // Triangle 11 bottom bottom\n this.triangles.push([1, 0, 5]);\n\n // Triangle 12 bottom top\n this.triangles.push([1, 5, 4]);\n }", "function Polygon(fillStyle, strokeStyle) {\n if (fillStyle === void 0) { fillStyle = color_2.default.black; }\n if (strokeStyle === void 0) { strokeStyle = color_2.default.white; }\n var _this = _super.call(this, null, null, fillStyle, strokeStyle) || this;\n _this._vertices = [];\n _this._xyRange = new xyRange_1.default(0, 0, 0, 0);\n _this.update();\n return _this;\n }", "constructor({ width = 1.0, height = 1.0, length = 1.0 }) {\n super();\n /* Points 0, 1, 2, 3 are on the left.\n * Points 4, 5, 6, 7 are on the right.\n * x = width, y = length, z = height*/\n const topLeftOut = [(width / 2), 0, (height / 2)];\n const botLeftOut = [(width / 2), 0, -(height / 2)];\n const topLeftIn = [-(width / 2), 0, (height / 2)];\n const botLeftIn = [-(width / 2), 0, -(height / 2)];\n const topRightOut = [(width / 2), length, (height / 2)];\n const botRightOut = [(width / 2), length, -(height / 2)];\n const topRightIn = [-(width / 2), length, (height / 2)];\n const botRightIn = [-(width / 2), length, -(height / 2)];\n this.vertices.push(topLeftOut);\n this.vertices.push(botLeftOut);\n this.vertices.push(topLeftIn);\n this.vertices.push(botLeftIn);\n this.vertices.push(topRightOut);\n this.vertices.push(botRightOut);\n this.vertices.push(topRightIn);\n this.vertices.push(botRightIn);\n\n // Left side face\n this.triangles.push([0, 1, 2]);\n this.triangles.push([2, 3, 1]);\n // Back side face\n this.triangles.push([2, 3, 6]);\n this.triangles.push([3, 6, 7]);\n // Right side face\n this.triangles.push([4, 5, 6]);\n this.triangles.push([5, 6, 7]);\n // Bottom face\n this.triangles.push([3, 5, 1]);\n this.triangles.push([5, 6, 3]);\n // Front side face\n this.triangles.push([1, 5, 4]);\n this.triangles.push([0, 1, 4]);\n // Top face\n this.triangles.push([0, 2, 4]);\n this.triangles.push([2, 4, 6]);\n }", "function drawn_polygon(feature) {\n // We can get WKT with obj.geometry.toString()\n // This polygon is in Google projection.\n\n precis.destroyFeatures();\n resetSr(Cdp.search);\n // We clear the scientific name field to show it's map search OR sn search\n $(\"sn\").value = '';\n // We clear the previous markers\n markers.clearMarkers();\n \n Cdp.search.filters = new Object(); // Reset global object to remove previous filters\n Cdp.search.filters.polygon = feature.geometry.toString();\n loadMyResults(Cdp.search);\n \n}", "function drawVertices (ctx, style, points) {\r\n for (var i = 0; i < points.length; i++) {\r\n var p = points[i];\r\n ctx.lineWidth = style.point.width;\r\n ctx.strokeStyle = style.point.color;\r\n ctx.fillStyle = style.point.fill;\r\n ctx.beginPath();\r\n ctx.arc(p.x, p.y, style.point.radius, style.point.arc1, style.point.arc2, true);\r\n ctx.fill();\r\n ctx.stroke();\r\n }\r\n }", "drawFinish(){\n reset();\n drawPolygonLines(this.hull, \"red\", true);\n for(let i=0;i<this.points.length;i++){\n this.points[i].draw();\n }\n\n for(let i=0;i<this.hull.length;i++){\n this.hull[i].draw(5,\"red\");\n }\n }", "function draw (gl,canvas,a_Position,vertices,linewidth){ \r\n let vert = [] \r\n let ind = []\r\n let colors = []\r\n let normie = []\r\n for (var i =0; i<vertices.length;i+=2){\r\n let point = []\r\n vert.push(vertices[i]) \r\n vert.push(vertices[i+1]) \r\n vert.push(0)\r\n point.push(vertices[i]) \r\n point.push(vertices[i+1]) \r\n point.push(0)\r\n colors.push(1)\r\n colors.push(1)\r\n colors.push(0)\r\n colors.push(1-(200/255))\r\n // normalize point \r\n point = normalize(point)\r\n normie.push(0) \r\n normie.push(0) \r\n normie.push(1) \r\n }\r\n var n = initVertexBuffers(gl,vert,colors,normie,ind)\r\n if (n<0){\r\n console.log('failed to set vert info')\r\n return\r\n }\r\n ind.push(0)\r\n ind.push(1)\r\n ind.push(2)\r\n ind.push(0)\r\n // Set the clear color and enable the depth test\r\n gl.enable(gl.DEPTH_TEST);\r\n initAttrib(gl,canvas,-1.0)\r\n //draw the linestrip!\r\n gl.drawElements(gl.TRIANGLES, n, gl.UNSIGNED_BYTE, 0);\r\n var n = initVertexBuffers(gl,vert,colors,normie,ind)\r\n if (n<0){\r\n console.log('failed to set vert info')\r\n return\r\n }\r\n // Set the clear color and enable the depth test\r\n gl.enable(gl.DEPTH_TEST);\r\n initAttrib(gl,canvas,-1.0)\r\n //draw the linestrip!\r\n gl.drawElements(gl.LINE_STRIP, n, gl.UNSIGNED_BYTE, 0);\r\n}", "function drawTriangle(x, y, size, ctx) {\n ctx.beginPath();\n ctx.moveTo(x+(size/2),y);\n ctx.lineTo(x+size,y+size);\n ctx.lineTo(x,y+size);\n ctx.closePath();\n ctx.fill();\n}", "function drawVertices (ctx, style, points) {\r\n for (var i = 0; i < points.length; i++) {\r\n var p = points[i];\r\n ctx.lineWidth = style.point.width;\r\n ctx.strokeStyle = style.point.color;\r\n ctx.fillStyle = style.point.fill;\r\n ctx.beginPath();\r\n ctx.arc(x_scale*p.x, y_scale*p.y, style.point.radius, style.point.arc1, style.point.arc2, true);\r\n ctx.fill();\r\n ctx.stroke();\r\n }\r\n }" ]
[ "0.80510575", "0.7665781", "0.7639658", "0.75640893", "0.7378882", "0.7263126", "0.7262371", "0.7224503", "0.71760076", "0.7068137", "0.69390583", "0.68976253", "0.68759745", "0.6777351", "0.6777085", "0.6768707", "0.67679286", "0.675576", "0.6754173", "0.6753531", "0.6744336", "0.6744336", "0.66898876", "0.6643929", "0.66108376", "0.65739524", "0.65622896", "0.6553852", "0.6553307", "0.6538297", "0.651375", "0.64644694", "0.64571106", "0.6456636", "0.64503956", "0.6438814", "0.63935095", "0.63811845", "0.63601196", "0.63032556", "0.62812835", "0.6272851", "0.6207188", "0.620463", "0.61792535", "0.61781293", "0.6177917", "0.61684036", "0.6156282", "0.614516", "0.61354965", "0.61279386", "0.61263514", "0.6116162", "0.60991377", "0.6097328", "0.6096917", "0.6096119", "0.60826176", "0.6079823", "0.6073477", "0.6064137", "0.60626346", "0.6053777", "0.6053777", "0.60494506", "0.6049166", "0.6042515", "0.6035053", "0.603465", "0.60196453", "0.6001761", "0.6000583", "0.5998726", "0.5997195", "0.5997195", "0.59887457", "0.59832627", "0.5982569", "0.5974346", "0.5971242", "0.59712106", "0.59640646", "0.596185", "0.5955346", "0.5954209", "0.59429514", "0.5939741", "0.5936241", "0.5935708", "0.59300995", "0.5927362", "0.59265727", "0.59209436", "0.5917531", "0.5906412", "0.5905005", "0.58970255" ]
0.66326207
26
Get items from source
getItems() { this.axios.get(this.sourceUrl).then((response) => { // Load HTML if (response.status === 200) { const html = response.data, $ = this.cheerio.load(html); let items = []; let counter = 0; // Search HTML and collect values $('.headlines_content ul').first().find('li').each((i, element) => { // Create item object items[i] = { id: '', title: $(element).children('a').text().trim(), url: $(element).children('a').attr('href').trim(), date: '', author: '', image: { url: '', alt: '' }, content: '' } // Get single item content this.getItemContent(items[i].url).then((response) => { items[i].id = Date.now(); items[i].date = response.date; items[i].image = { url: response.image.url, alt: response.image.alt }; items[i].content = response.content; // Increment counter counter++; console.log(this.chalk.yellow(`Scraping item ${counter}`)); // Save to JSON file when counter is equal to items array if (counter == items.length) { console.log('\n'); // Save items to JSON file this.saveJson(items); } }); }); } }, (error) => this.errorHandler(error)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getSources() {\n return query(\n `SELECT id, name\n FROM source\n WHERE deleted_at IS NULL\n ORDER BY name;`\n );\n}", "get sources() {\n const sources = []\n for (let i = 0; i < this._sections.length; i++) {\n for (let j = 0; j < this._sections[i].consumer.sources.length; j++) {\n sources.push(this._sections[i].consumer.sources[j])\n }\n }\n return sources\n }", "async loadItems() {\n const keys = await AsyncStorage.getAllKeys();\n const values = await AsyncStorage.multiGet(keys);\n\n this.data = this.data.set('source', fromJS(values));\n }", "function findSourceResources(aSelectorFn) {\n result=[];\n //print(ttl + \"..findSourceResources() \" + \"from settings.svrURL: \" + settings.svrURL + \"/@resources\\n\" +\n // \"...using settings.intToken: \" + JSON.stringify(settings.intToken));\n var resourceNamesString = listenerUtil.restGet(\n settings.svrURL + \"/v1/@resources\", null, settings.intToken);\n var resourceNames = JSON.parse(resourceNamesString);\n // print(ttl + \"..resourceNames[]: \" + JSON.stringify(resourceNames));\n for (var i = 0 ; i < resourceNames.length ; i++) {\n var eachResourceSummary = resourceNames[i];\n var eachResourceDef = common_iPack_util.getResourceNamed(eachResourceSummary.name);\n var extProps = eachResourceDef.extendedProperties;\n var hasExtProps = extProps && 'object' === typeof extProps && ! Array.isArray(extProps);\n var syncProps = null;\n if (hasExtProps) {\n syncProps = extProps[settings.sourceResourceExtPropName];\n }\n // on post to ProcessRequestResource, store json into SystemQueue, for async processing via timer\n if (syncProps !== null && typeof syncProps !== 'undefined') {\n if (aSelectorFn(eachResourceDef))\n result.push(eachResourceDef);\n } else {\n // print(ttl + \" not processed: \" + JSON.stringify(eachResourceDef));\n }\n }\n return result;\n}", "function getEachForSource(source) {\n if (source.length < 40) {\n return UniqueArrayWrapper.prototype.eachNoCache;\n } else if (source.length < 100) {\n return UniqueArrayWrapper.prototype.eachArrayCache;\n } else {\n return UniqueArrayWrapper.prototype.eachSetCache;\n }\n }", "async getItems() {\n const self = this;\n const sku = await this.contract.methods\n .sku()\n .call({ from: this.currentAddress })\n .then((_sku) => parseInt(_sku));\n\n if (sku > 0) {\n const skus = Array.from(Array(sku).keys()).filter((item) => item > 0);\n return await Promise.all(\n skus.map(async (_sku) => {\n const item = await this.getItemDetails(_sku);\n const { timestamp: harvestTimestamp, txHash } = await self.getEvent(\n \"Harvested\",\n item.itemUPC\n );\n return {\n ...item,\n harvestTimestamp,\n txHash,\n };\n })\n );\n } else {\n return [];\n }\n }", "function getSources(){\n\taxios.get(\"https://newsapi.org/v1/sources?language=en\")\n\t.then((response) => {\n\t\tlet sources = response.data.sources;\n\t\t// sourceList.push(sources);\n\t\t// console.log(sourceList);\n\t\tfor (let i = 0; i < sources.length; i++) {\n\t\t\t// let opt = sources[i].name + sources[i].id;\n\t\t\t// idList.push(sources[i].id);\n\t\t\tlet el = document.createElement(\"option\");\n\t\t\t\tel.textContent = sources[i].name;\n\t\t\t\tel.value = sources[i].id;\n\t\t\t\tselect[0].appendChild(el);\n\t\t}\n\t})\n}", "get items() {\n if (!this.target) {\n return [];\n }\n var nodes = this.target !== this ? (this.itemsSelector ? \n this.target.querySelectorAll(this.itemsSelector) : \n this.target.children) : this.$.items.getDistributedNodes();\n return Array.prototype.filter.call(nodes, this.itemFilter);\n }", "compareSources(compareSource) {\n let data = [];\n for (let source in sourceArray) {\n if (sourceArray[source].id === compareSource) {\n data.push(sourceArray[source].name, sourceArray[source].url);\n return data;\n }\n }\n}", "function readSource(source) {\n\t\tthis.sourceList = [];\n var tempSource = source.split(\"\\n\");\n\t\ttry {\n for(i=0; i<tempSource.length; i++){\n sourceList.push(tempSource[i]);\n }\n\t\t} catch (err) {\n\t\t\tconsole.log(err);\n\t\t}\n\t\treturn;\n\t}", "get items() {\n return this.data.items ? getItems(this.data.items, this.entryDate) : [];\n }", "function getItems() {\n\t\tvar newItems = get('get-items.php?startDate='+$scope.startDate+';duration='+$scope.duration);\n\t\tconsole.log(newItems);\n\t}", "function getAllItems() {\n // load query details to json object\n var oWebsite = context.get_web();\n context.load(oWebsite);\n var tasksEntries = [];\n\n context.executeQueryAsync(function () {\n\n var itemsCount = collListItem.get_count();\n for (var i = 0; i < itemsCount; i++) {\n var item = collListItem.itemAt(i);\n var taskEntry = item.get_fieldValues();\n\n taskEntry.SourceURL = context.get_web().get_serverRelativeUrl() + \"/Lists/\" + options.listName + \"/\" + taskEntry.DocumentName;\n tasksEntries.push(helperService.parse(taskEntry, options.fields.mappingFromSP));\n\n }\n\n deferred.resolve(tasksEntries);\n\n\n });\n\n\n\n }", "function getSourceDataList(el, response) {\n if (el.settings.sourceObject.settings.aggregation) {\n // Aggregated data so use the buckets.\n return indiciaFns.findValue(response.aggregations, 'buckets');\n }\n // A standard list of records.\n return response.hits.hits;\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}", "function _fetchResourceSource(source, currentView) {\n var resources = source.resources;\n \n if (resources) {\n if ($.isFunction(resources)) {\n return resources();\n }\n } else {\n var url = source.url;\n if (url) {\n var data={};\n if (typeof currentView == 'object') {\n var startParam = options.startParam;\n var endParam = options.endParam;\n if (startParam) {\n data[startParam] = Math.round(+currentView.visStart / 1000);\n }\n if (endParam) {\n data[endParam] = Math.round(+currentView.visEnd / 1000);\n }\n }\n\n $.ajax($.extend({}, source, {\n data: data,\n dataType: 'json',\n cache: false,\n success: function(res) {\n res = res || [];\n resources = res;\n },\n error: function() {\n alert(\"ajax error getting json from \"+url);\n },\n async: false // too much work coordinating callbacks so dumb it down\n }));\n }\n }\n return resources;\n }", "function getSource (results) {\n const sanitizedResults = _.map(results, (o) => {\n return o._source\n })\n\n return sanitizedResults\n}", "function getSources() {\n MediaStreamTrack.getSources(function(sources) {\n returnToTest(JSON.stringify(sources));\n });\n}", "get items() {\n const that = this;\n\n if (that._filteredItems) {\n return that._filteredItems;\n }\n\n return that._items;\n }", "function availableSources(kind) {\t\n var sources = $.Sources[kind];\n return _.compact(_.map(sources, function(source) {\n //if (source.available) return sourceMapping(source);\n \treturn sourceMapping(source);\n }));\n }", "function api_getItems(request, reply) {\n dbHelper.getRecords(db, 'items', 'items_index', function(result) {\n reply(result);\n });\n}", "function get() {\n return Promise.try(function () {\n if (cached) {\n return cached;\n }\n return getData(source).then(function (data) {\n data.forEach(function (item, index) {\n item.order = index;\n item.searchable = {\n label: item.label.toLowerCase()\n };\n });\n cached = data;\n return cached;\n });\n });\n }", "function getSources() {\n var checkboxes = document.getElementsByName('source');\n for (var i = 0; i < checkboxes.length; i++) {\n if (checkboxes[i].checked) {\n sources.push(checkboxes[i].id);\n }\n }\n}", "getItems() {\n return this.items$;\n }", "sourceContentFor(aSource, nullOnMissing) {\n for (let i = 0; i < this._sections.length; i++) {\n const section = this._sections[i]\n\n const content = section.consumer.sourceContentFor(aSource, true)\n if (content) {\n return content\n }\n }\n if (nullOnMissing) {\n return null\n }\n throw new Error('\"' + aSource + '\" is not in the SourceMap.')\n }", "function listSourceFilters() {\n const requestOptions = {\n method: 'GET',\n headers: { 'Content-Type': 'application/json' },\n };\n\n const handleResponse = response => response.json().then((data) => {\n if (!response.ok) {\n const error = (data && data.email);\n return Promise.reject(error);\n }\n\n return data;\n });\n\n return fetch(`${apiUrl}/sources/`, requestOptions)\n .then(handleResponse)\n .then(sourceFilters => sourceFilters);\n}", "getSources() {\n fetch('/api/search/sources').then(res => res.json()).then((data) => {\n this.setState({\n ...this.state,\n sources: data,\n });\n });\n }", "get_all(name) {\n let ret = [];\n for(let item of this.data) {\n if(item.name === name) {\n ret.push(item);\n }\n }\n return ret;\n }", "function getItems() {\n connection.query(\"SELECT item FROM itemList \"),\n function(error, results, fields) {\n if (error) throw error;\n console.log(results);\n };\n }", "getItems() {\n return this.items;\n }", "getItems() {\n return this.items;\n }", "getItems() {\n return this.items;\n }", "getItems() {\n return this.items;\n }", "allItems() {\n return this.filterDuplicates(this.cachedItems.concat(this.items));\n }", "allItems() {\n return this.filterDuplicates(this.cachedItems.concat(this.items));\n }", "_getData(source) {\n return __awaiter(this, void 0, void 0, function* () {\n let data;\n try {\n if (source.startsWith('{')) {\n data = JSON.parse(source);\n }\n else if (source.startsWith('/') ||\n source.match(/^https?\\:\\/\\//)) {\n data = yield fetch(source).then((response) => response.json());\n }\n else {\n const $template = document.querySelector(`template#${source}, template${source}`);\n if ($template) {\n // @ts-ignore\n data = JSON.parse($template.content.textContent);\n }\n }\n }\n catch (e) { }\n // warn if no data\n if (!data) {\n throw new Error(`[SCarpenterAppComponent] The passed source \"${source}\" does not provide any valid data...`);\n }\n // filter the \"ghosts\"\n if (!this.props.ghostSpecs && data.specs) {\n data.specs = __filterObject(data.specs, (key, item) => {\n return !item.ghost;\n });\n }\n data.specsByTypes = {};\n for (let [namespace, specObj] of Object.entries(data.specs)) {\n const parts = namespace.split('.');\n let type;\n parts.forEach((part) => {\n if (type)\n return;\n if (part !== 'views') {\n type = part;\n }\n });\n if (!data.specsByTypes[type]) {\n data.specsByTypes[type] = {};\n }\n data.specsByTypes[type][namespace] = specObj;\n }\n return data;\n });\n }", "get items() {\n let store = [];\n let itemCount = this.itemCount;\n for (let i = 0; i < itemCount; i++) {\n store.push(this.getItemAtIndex(i));\n }\n return store;\n }", "getAuctionItems() {\r\n return this._httpClient.get(this.getUrl + \"/auctionItems\").pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_0__[\"map\"])(response => response));\r\n }", "all() {\n return this.items;\n }", "function gotItems(items, request) {\n\t\tvar i;\n\t\tfor (i = 0; i < items.length; i++) {\n\t\t\tvar item = items[i];\n\t\t\titemsToProcess.push(item);\n\t\t}\n\t}", "getAll() {\n\t\treturn this.dao.all(`SELECT * FROM items`);\n\t}", "getItem(...selects) {\r\n const q = this.listItemAllFields;\r\n return q.select.apply(q, selects).get().then((d) => {\r\n return extend(new Item(odataUrlFrom(d)), d);\r\n });\r\n }", "function getAllSources() {\r\n\t$.ajax({\r\n\t\ttype: \"GET\",\r\n\t\turl: \"/getAllSources\",\r\n\t\tsuccess: function(response) {\r\n\t\t\tsources = response[\"sources\"]\r\n\t\t\taddSourcesToView(sources)\r\n\t\t},\r\n\t\terror: function(chr) {\r\n\t\t \tconsole.log(\"Error!\")\r\n\t\t}\r\n\t});\r\n}", "getAllSources() {\n fetch('https://newsapi.org/v1/sources')\n .then(response => response.json())\n .then(response => {\n this.setState({\n sources: response.sources,\n });\n });\n }", "function getData(search_param) {\n resourceRepo.getList(search_param).then(function success(response) {\n if (angular.isDefined(response.data.items)) {\n vm.itemsList = response.data.items;\n }\n }, function failure(response) {\n var t = response;\n })\n }", "function getList(objSource) {\r\n var oSource = objSource;\r\n var strFields = \"\";\r\n var len = oSource.length;\r\n for (i = 0; i < len; i++) {\r\n text = oSource.item(i).text; \r\n strFields = strFields + text + \",\";\r\n }\r\n if(strFields != \"\") {\r\n strFields = strFields.substring(0,strFields.length - 1);\r\n } \r\n return strFields\r\n}", "function retrieveRows() {\n var sourceTable = CodaAPI.getTable(SOURCE_DOC_ID, SOURCE_TABLE_ID);\n var sourceRows = [];\n var pageToken;\n var sourceColumns = CodaAPI.listColumns(SOURCE_DOC_ID, SOURCE_TABLE_ID).items.map(function(item) { return item.name; });\n \n do {\n var response = CodaAPI.listRows(SOURCE_DOC_ID, SOURCE_TABLE_ID, {limit: 500, pageToken: pageToken, useColumnNames: true, sortBy: 'natural'});\n var sourceRows = sourceRows.concat(response.items);\n pageToken = response.nextPageToken;\n } while (pageToken);\n \n var upsertBodyRows = sourceRows.map(function(row) {\n var cells = sourceColumns.map(function(colName) {\n return {\n column: colName,\n value: row.values[colName],\n };\n });\n cells.push({column: TARGET_SHEET_SOURCE_ROW_COLUMN, value: row.browserLink});\n return {cells: cells};\n }); \n return upsertBodyRows;\n}", "async getSources(category, country, language) {\n let url = '/sources?';\n\n if (!_.isNil(country)) {\n url = `${url}country=${country}&`;\n }\n\n if (!_.isNil(category)) {\n url = `${url}category=${category}&`;\n }\n\n if (!_.isNil(language)) {\n url = `${url}language=${language}&`;\n }\n\n try {\n const result = await NewsApiClient.getInstance().get(url);\n if (!result || !result.sources || result.status.toLowerCase() !== 'ok') {\n Logger.error(`Response from ${url} is invalid`, result);\n return this.getErrorResponse('unexpectedError');\n }\n\n delete result.status;\n return this.getSuccessResponse(result.sources);\n } catch (error) {\n Logger.error(`Response from ${url} is invalid`, error);\n const errorMessage = handleErrorMessage(error);\n return this.getErrorResponse(errorMessage);\n }\n }", "function sources(){ // get all sources using existing session\n\treturn Promise.all([cookies, targetCollector]).then(function(args){\n\t\tvar cookies = args[0],\n\t\t collector = args[1],\n\t\t url = \"https://\"+apiUrl+\"collectors/\"+collector.id+\"/sources?limit=\"+pageLimit+\"&offset=0\",\n\t\t headers = new (fetch.Headers)()\n\t\tfor(var i in cookies){\n\t\t\theaders.append(\"cookie\", cookies[i])\n\t\t}\n\t\treturn fetch(url, {headers})\n\t})\n}", "getAllItems() {\n return this.inventory.flattenInventory();\n }", "resolve(source, args, context) {\n return context.nodeModel.getNodesByIds({ ids: source.metadata, type: 'Metadata' });\n }", "getDropContainers() {\n let dropContainers = [];\n for (let source in this.sources) {\n if (this.sources[source].container) {\n dropContainers.push(Game.getObjectById(this.sources[source].container));\n } else {\n if (source.room) {\n let myContainer = source.pos.findInRange(FIND_STRUCTURES, 1, {\n filter: {structureType: STRUCTURE_CONTAINER}\n })[0];\n if (myContainer) {\n this.sources[source].container = myContainer.id;\n droContainers.push(myContainer);\n }\n }\n }\n }\n return dropContainers;\n }", "function getListItems() {\n var request = $http({\n method: \"get\",\n url: \"/api/documents\",\n params: {\n action: \"get\"\n }\n });\n\n return(request.then(handleSuccess, handleError));\n }", "getItem(...selects) {\n return __awaiter(this, void 0, void 0, function* () {\n const q = yield this.listItemAllFields.select(...selects)();\n return assign(Item(odataUrlFrom(q)), q);\n });\n }", "get items() {\n return this.getAllElements('item');\n }", "function getAllSourcesAndTweet(){\n\tvar sources = [];\n\tconsole.log('getting sources...')\n\trequest({\n\t\t\turl: 'https://newsapi.org/v2/sources?apiKey=YOUR_NEWS_API_KEY',\n\t\t\t\tmethod: 'GET'\n\t\t},\n\t\tfunction (error, response, body) {\n\t\t\t//response is from the bot\n\t\t\tif (!error && response.statusCode == 200) {\n\t\t\t\t// Print out the response body\n\t\t\t\tvar botResponse = JSON.parse(body);\n\t\t\t\tfor (var i = 0; i < botResponse.sources.length;\n\t\t\t\t\ti++){\n\t\t\t\t\tconsole.log('adding.. ' +\n\t\t\t\t\t\tbotResponse.sources[i].id)\n\t\t\t\t\tsources.push(botResponse.sources[i].id)\n\t\t\t\t}\n\t\t\t\ttweetFromRandomSource(sources, null, null);\n\t\t\t} else {\n\t\t\t\tconsole.log('Sorry. No news sources!');\n\t\t\t}\n\t\t});\n}", "getItem(...selects) {\r\n const q = this.listItemAllFields;\r\n return q.select.apply(q, selects).get().then((d) => {\r\n return extend((new Item(odataUrlFrom(d))).configureFrom(this), d);\r\n });\r\n }", "function where(collection, source) {\n var arr = [];\n arr = collection.filter(function(item){\n \tvar keys = Object.keys(source);\n return keys.every(function(item2){\n \treturn item.hasOwnProperty(item2) && item[item2] == source[item2];;\n });\n });\n return arr;\n}", "get source() {\n\t\treturn this._source;\n\t}", "async getItems(searchKeyword) {\n const searchPattern = `%${searchKeyword}%`;\n const result = await this.pool.query(\n 'SELECT DISTINCT items.id, items.title, items.description, items.favourite '\n + 'FROM items '\n + 'JOIN keywords '\n + 'ON items.id = keywords.itemid '\n + 'WHERE keywords.keyword LIKE $1', [searchPattern],\n );\n const items = [];\n for (let i = 0; i < result.rows.length; i += 1) {\n const data = result.rows[i];\n items.push(new Item(data.id, data.title, data.description, data.favourite));\n }\n return items;\n }", "function getItemsFromFile(path) {\n\t$.get(path, function(data) {\n\t var xml = $(data);\n\t arrangeXMLItems(xml);\n\t},\n\t'xml');\n}", "get(id) {\n const index = this.indexOfId(id);\n if (index > -1) return this.items[index];\n }", "function itemToSourceStreams (addedItem, itemsState$) {\n const itemStateInfinite$ = itemsState$\n .map(items =>\n items.find(item => item[idAttribute] === addedItem[idAttribute])\n );\n // if an item isn't present if a new snapshot, it shall be destroyed\n const _destroy$ = itemStateInfinite$.filter(item => !item).take(1);\n const itemState$ = itemStateInfinite$.endWhen(_destroy$);\n\n return Object.keys(addedItem)\n .reduce((sources, key) => {\n // skip idAttribute\n if (key === idAttribute) {\n return sources;\n }\n\n const stream$ = itemState$\n .map(state => state[key])\n .startWith(addedItem[key])\n // skip the snapshot if the value didn't change\n .compose(dropRepeats(compareJSON))\n .remember();\n\n const sourceKey = transformKey ? transformKey(key) : key;\n\n return {\n ...sources,\n [sourceKey]: adapt(stream$)\n };\n }, {\n _destroy$\n });\n }", "function where(collection, source) {\n var arr = [];\n\n for (var i = 0; i < collection.length; i++) {\n var obj = collection[i];\n if ((obj.name.toLowerCase().search(source.name.toLowerCase())) >= 0) {\n arr.push(obj);\n }\n }\n return arr;\n}", "get source () {\n\t\treturn this._source;\n\t}", "get source () {\n\t\treturn this._source;\n\t}", "getAll() {\n if (this._cache.length < this.size) {\n for (var i = 0; i < this.size; i++) {\n this.getObjectAt(i);\n }\n }\n return this._cache.slice();\n }", "getAll() {\n if (this._cache.length < this.size) {\n for (var i = 0; i < this.size; i++) {\n this.getObjectAt(i);\n }\n }\n return this._cache.slice();\n }", "get items() {\r\n return new Items(this);\r\n }", "onItemLoad(src) {\r\n this.runCallbacks(this.onAfterItemLoadCallbacks, [src]);\r\n this.runCallbacks(this.onAfterItemCallbacks, [src]);\r\n this.loaded.push(src);\r\n this.cleanUp();\r\n this.start();\r\n }", "function getItems() {\n return httpService.get(\"api/putaway/getitems\",\n {\n WarehouseCode: vm.warehouseCode,\n SupplierCode: vm.supplierCode\n })\n .then(function (items) {\n vm.itemList.splice(0,vm.itemList.length);\n items.forEach(item => {\n item.IsSelected = (item.IsSelected == 1 ? true : false);\n vm.itemList.push(item);\n });\n });\n }", "function get () {\n return blocks.map((bl) => bl.get())\n }", "get items() {\n // Send the request\n return this._cartRequest('cart/items', {}, 'GET');\n }", "function getItems(that){\n return {\n protocol: that.protocol || \"\",\n hostname: that.hostname || \"\",\n port: that.port || \"\",\n file: that.file || \"\",\n context: that.context || \"\",\n pathinfo: that.pathinfo || \"\",\n search: that.search || \"\",\n query: that.query || \"\"\n }\n }", "function createInternalItemsSource() {\n internalItemsSource = options.itemsSource;\n internalItemsSource = setupSorting(internalItemsSource);\n internalItemsSource = setupFilters(internalItemsSource);\n internalItemsSource = setupIndex(internalItemsSource);\n }", "function createInternalItemsSource() {\n internalItemsSource = options.itemsSource;\n internalItemsSource = setupSorting(internalItemsSource);\n internalItemsSource = setupFilters(internalItemsSource);\n internalItemsSource = setupIndex(internalItemsSource);\n }", "_getItemsArray() {\n return this._items instanceof _angular_core__WEBPACK_IMPORTED_MODULE_0__.QueryList ? this._items.toArray() : this._items;\n }", "getCoffeeSources() {\r\n\t\r\n }", "get items() {\n const that = this;\n\n if (that.isReady) {\n return that._items.filter(item => item.opened).concat(that.getAutoHideItems());\n }\n }", "getAll() {\n return this._get(1);\n }", "getAll() {\n return this.getDataFromServer(this.path);\n }", "fetchItems(){\n\t\tfetch(Constants.restApiPath+'items')\n\t\t.then(function(res){\n\t\t\tif(res.ok){\n\t\t\t\tres.json().then(function(res){\n\t\t\t\t\tdispatcher.dispatch({\n\t\t\t\t\t\ttype: \t\"FETCH_ITEMS_FROM_API\",\n\t\t\t\t\t\tres,\n\t\t\t\t\t});\n\t\t\t\t})\n\t\t\t}\n\t\t\telse{\n\t\t\t\tconsole.log(Strings.error.restApi);\n\t\t\t\tconsole.log(res);\n\t\t\t}\n\t\t});\n\t}", "function getItems(routeName, mileStart, mileEnd, countyLine, interChange, rrXing, bridge, stream, sign, culv) {\r\n getRoadStats(routeName);\r\n if (culv != null) {\r\n culverts = getCulverts(routeName, mileStart, mileEnd,culv);\r\n }\r\n if (countyLine != null) {\r\n county_lines = getCountyLines(routeName, mileStart, mileEnd, countyLine);\r\n }\r\n if (interChange != null) {\r\n interchanges = getXchanges(routeName, mileStart, mileEnd, interChange);\r\n }\r\n if (rrXing != null) {\r\n rrCrossings = getrrXings(routeName, mileStart, mileEnd, rrXing);\r\n }\r\n if (bridge != null) {\r\n bridges = getBridges(routeName, mileStart, mileEnd, bridge);\r\n }\r\n if (stream != null) {\r\n streams = getStreams(routeName, mileStart, mileEnd, stream);\r\n }\r\n if (sign != null) {\r\n signs = getSigns(routeName, mileStart, mileEnd, sign);\r\n }\r\n \r\n \r\n}", "function getAllItems () {\n return Item.find()\n}", "function getAllItems() {\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 item = 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 }", "async function fetchSources (request, response) {\n const url = `https://newsapi.org/v2/sources?apiKey=${process.env.NEWS_API}`;\n \n const newsData = await superagent.get(url);\n console.log(newsData.body.sources);\n response.send(newsData.body.sources);\n}", "getItemsFromData(data) {\n let items = false;\n if (typeof data.items !== 'undefined' && _.isArray(data.items)) {\n items = data.items;\n }\n return items;\n }", "async function loadSources() {\n let res = await fetch(\"./sources.json\");\n let json = await res.json();\n return json;\n}", "getHandImages(){\n let handImageSources = [];\n this.hand.forEach(element => handImageSources.push(element.getImageSource()));\n return handImageSources;\n }", "async function getData(source) {\n\ttry {\n\t\tlet res = await fetch(source);\n\t\treturn await res.json();\n\t} catch (error) {\n\t\tconsole.log(error);\n\t\tlet res = await fetch(sampleUrl);\n\t\treturn await res.json();\n\t}\n}", "function getNewsSource(sourceId) {\n return $http.get('assets/data/feeds/' + sourceId + '.xml')\n .then(getNewsSourceComplete)\n .catch(getNewsSourceFailed);\n\n function getNewsSourceComplete(response) {\n return x2js.xml_str2json(response.data);\n }\n\n function getNewsSourceFailed(error) {\n $log.error('XHR Failed for getNewsSource.' + error.data);\n }\n }", "items() {\n return new algorithm_1.ArrayIterator(this._items);\n }", "function getItems(...items) {\n const el = [];\n for (let i of items) {\n for (let j of data) {\n if (i == j.title) el.push(j);\n }\n }\n return el;\n}", "function getItems(){\n appFactory.getItems().then(function(response){\n // console.log(response);\n $scope.items = response;\n });\n }", "function fetchArticles(source) {\n if (source === 'mashable') {\n return fetchMashableArticles()\n } else if (source === 'reddit') {\n return fetchRedditArticles()\n } else if (source === 'digg') {\n return fetchDiggArticles()\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 loadItems() {\n return fetch(\"data/data.json\")\n .then((res) => res.json())\n .then((json) => json.items);\n}", "function subset_link(result, x){\n if (x['visible']){\n var item = {\n \"source\": x[\"source\"][\"name\"],\n \"target\": x[\"target\"][\"name\"],\n }\n return result.concat(item);\n } else {\n return result;\n }\n}", "function getJSON (source) {\n var url = '';\n\n // WIKIPEDIA API CALL\n if (source === 'wikipedia') {\n url = 'https://en.wikipedia.org/w/api.php?action=opensearch&search=';\n\n $.ajax({\n url: url + SEARCH_STR,\n dataType: 'jsonp',\n method: 'GET',\n success: function (data) {\n // give API data to getSavedUrls, just to pass it on to loadResults later\n getSavedUrls(data, source);\n },\n error: function (err) {\n throw err;\n }\n });\n\n // NEW YORK TIMES API CALL\n } else if (source === 'nyt') {\n url = 'https://api.nytimes.com/svc/search/v2/articlesearch.json';\n url += '?' + $.param({\n 'api-key': '1a6e15371cf94b97a62802a17d365145',\n 'q': SEARCH_STR,\n 'begin_date': '20140101'\n });\n\n $.ajax({\n url: url,\n dataType: 'json',\n method: 'GET',\n success: function (data) {\n getSavedUrls(data, source);\n },\n error: function (err) {\n throw err;\n }\n });\n\n // THE GUARDIAN API CALL\n } else if (source === 'guardian') {\n url = 'http://content.guardianapis.com/search';\n url += '?' + $.param({\n 'api-key': 'e8eb4ddb-47ce-4400-9edc-42c41e3f2a2f',\n 'q': SEARCH_STR,\n 'from-date': '2014-01-01',\n 'section': 'news'\n });\n\n $.ajax({\n url: url,\n dataType: 'json',\n method: 'GET',\n success: function (data) {\n getSavedUrls(data, source);\n },\n error: function (err) {\n throw err;\n }\n });\n }\n }", "getValue(source) {\n Observable.track(source, this.name);\n return source[this.fieldName];\n }", "function resolve_sources(srcs) {\n if (_.isArray(srcs)) {\n return srcs.map(this.resolve_src).reduce((memo, i) => memo.concat(i), []);\n } else if (_.isString(srcs)) {\n return _.map(srcs.split(','), subsrc => this.resolve_src(subsrc.trim()));\n } else if (jt.instance_of(srcs, '$Collection.$Timestep.SrcType')) { // nested indicator\n return this.resolve_src(srcs);\n } else if (_.isEmpty(srcs)) {\n return [];\n } else {\n throw new Error('Unexpected type given for \"sources\": ' + JSON.stringify(srcs));\n }\n }" ]
[ "0.6102924", "0.6084613", "0.60445184", "0.5909613", "0.5880532", "0.584124", "0.5810234", "0.57554483", "0.57515776", "0.5740675", "0.56999546", "0.56923884", "0.56791073", "0.56773186", "0.5670293", "0.56588316", "0.56317973", "0.562852", "0.5619583", "0.55745125", "0.55726683", "0.555861", "0.55164975", "0.5506775", "0.550101", "0.55008173", "0.54966974", "0.5487989", "0.5464891", "0.5461791", "0.5461791", "0.5461791", "0.54518527", "0.5437441", "0.5437441", "0.54318416", "0.5419047", "0.5399088", "0.5365652", "0.5349645", "0.5346636", "0.5345659", "0.534328", "0.5337191", "0.5334409", "0.53327304", "0.53326637", "0.5324866", "0.5321794", "0.53174776", "0.53048354", "0.5276434", "0.52659154", "0.5263455", "0.5258234", "0.5252762", "0.52505916", "0.523928", "0.5228619", "0.52261794", "0.522496", "0.52084225", "0.5207803", "0.5194141", "0.5189924", "0.5189924", "0.518167", "0.518167", "0.51791716", "0.5166795", "0.5166058", "0.5165745", "0.5162252", "0.51591134", "0.51560926", "0.51560926", "0.51464266", "0.51426923", "0.51424253", "0.5137332", "0.5124479", "0.51240605", "0.5118911", "0.51170564", "0.5116948", "0.51116097", "0.5109421", "0.509859", "0.5095194", "0.5093919", "0.50938153", "0.5090464", "0.5089403", "0.50823545", "0.50787127", "0.5075531", "0.50738627", "0.5058758", "0.50548667", "0.5054587", "0.50531894" ]
0.0
-1
Creates a Constructor for an Immutable object from a schema.
function Immutable (originalSchema) { var schema = {}, blueprint, prop, propCtor; if (!originalSchema) { return new InvalidArgumentException(new Error('A schema object, and values are required')); } // Convert any objects that aren't validatable by Blueprint into Immutables for (prop in originalSchema) { if (!originalSchema.hasOwnProperty(prop)) { continue; } else if (prop === '__skipValidation') { continue; } else if (prop === '__skipValdation') { schema.__skipValidation = originalSchema.skipValdation; } if ( is.object(originalSchema[prop]) && !Blueprint.isValidatableProperty(originalSchema[prop]) && !originalSchema[prop].__immutableCtor ) { schema[prop] = new Immutable(originalSchema[prop]); } else { schema[prop] = originalSchema[prop]; } if (schema[prop].__immutableCtor) { // Add access to the Immutable on the Parent Immutable propCtor = prop.substring(0,1).toUpperCase() + prop.substring(1); Constructor[propCtor] = schema[prop]; } } // This is the blueprint that the Immutable will be validated against blueprint = new Blueprint(schema); /* // The Constructor is returned by this Immutable function. Callers can // then use it to create new instances of objects that they expect to // meet the schema, set forth by this Immutable. */ function Constructor (values) { var propName, // we return self - it will provide access to the getters and setters self = {}; values = values || {}; if ( // you can override initial validation by setting // `schema.__skipValidation: true` originalSchema.__skipValidation !== true && !Blueprint.validate(blueprint, values).result ) { var err = new InvalidArgumentException( new Error(locale.errors.initialValidationFailed), Blueprint.validate(blueprint, values).errors ); config.onError(err); return err; } try { // Enumerate the schema, and create immutable properties for (propName in schema) { if (!schema.hasOwnProperty(propName)) { continue; } else if (propName === '__blueprintId') { continue; } if (is.nullOrUndefined(values[propName])) { makeReadOnlyNullProperty(self, propName); continue; } makeImmutableProperty(self, schema, values, propName); } Object.freeze(self); } catch (e) { return new InvalidArgumentException(e); } return self; } // /Constructor /* // Makes a new Immutable from an existing Immutable, replacing // values with the properties in the mergeVals argument // @param from: The Immutable to copy // @param mergeVals: The new values to overwrite as we copy */ setReadOnlyProp(Constructor, 'merge', function (from, mergeVals, callback) { if (typeof callback === 'function') { async.runAsync(function () { merge(Constructor, from, mergeVals, callback); }); } else { var output; merge(Constructor, from, mergeVals, function (err, merged) { output = err || merged; }); return output; } }); /* // Copies the values of an Immutable to a plain JS Object // @param from: The Immutable to copy */ setReadOnlyProp(Constructor, 'toObject', function (from, callback) { return objectHelper.cloneObject(from, true, callback); }); /* // Validates an instance of an Immutable against it's schema // @param instance: The instance that is being validated */ setReadOnlyProp(Constructor, 'validate', function (instance, callback) { return Blueprint.validate(blueprint, instance, callback); }); /* // Validates an instance of an Immutable against it's schema // @param instance: The instance that is being validated */ setReadOnlyProp(Constructor, 'validateProperty', function (instance, propertyName, callback) { if (!instance && is.function(callback)) { callback([locale.errors.validatePropertyInvalidArgs], false); } else if (!instance) { return { errors: [locale.errors.validatePropertyInvalidArgs], result: false }; } return Blueprint.validateProperty(blueprint, propertyName, instance[propertyName], callback); }); /* // Prints an immutable to the console, in a more readable way // @param instance: The Immutable to print */ setReadOnlyProp(Constructor, 'log', function (instance) { if (!instance) { console.log(null); } else { console.log(Constructor.toObject(instance)); } }); /* // Returns a copy of the original schema */ setReadOnlyProp(Constructor, 'getSchema', function (callback) { return objectHelper.cloneObject(originalSchema, true, callback); }); /* // Returns a this Immutable's blueprint */ setReadOnlyProp(Constructor, 'blueprint', blueprint); setReadOnlyProp(Constructor, '__immutableCtor', true); return Constructor; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Constructor (values) {\n var propName,\n // we return self - it will provide access to the getters and setters\n self = {};\n\n values = values || {};\n\n if (\n // you can override initial validation by setting\n // `schema.__skipValidation: true`\n originalSchema.__skipValidation !== true &&\n !Blueprint.validate(blueprint, values).result\n ) {\n var err = new InvalidArgumentException(\n new Error(locale.errors.initialValidationFailed),\n Blueprint.validate(blueprint, values).errors\n );\n\n config.onError(err);\n\n return err;\n }\n\n try {\n // Enumerate the schema, and create immutable properties\n for (propName in schema) {\n if (!schema.hasOwnProperty(propName)) {\n continue;\n } else if (propName === '__blueprintId') {\n continue;\n }\n\n if (is.nullOrUndefined(values[propName])) {\n makeReadOnlyNullProperty(self, propName);\n continue;\n }\n\n makeImmutableProperty(self, schema, values, propName);\n }\n\n Object.freeze(self);\n } catch (e) {\n return new InvalidArgumentException(e);\n }\n\n return self;\n }", "function buildModel(name, schema) {\n class Model extends BaseModel {\n constructor(data) {\n if (data !== undefined) {\n Object.entries(data).forEach(([key, value]) => {\n if (schema[key]) {\n Joi.attempt(value, schema[key]);\n }\n });\n }\n super(data);\n }\n\n _set(key, value) {\n if (schema[key]) {\n Joi.attempt(value, schema[key]);\n }\n return super._set(key, value);\n }\n }\n Object.defineProperty(Model, 'name', { value: name });\n Object.keys(schema).forEach(key =>\n Object.defineProperty(Model.prototype, key, {\n // `function` is used rather than `=>` to work around context problem with `this`\n /* eslint-disable func-names, object-shorthand */\n get: function () {\n return this._get(key);\n },\n set: function (value) {\n this._set(key, value);\n },\n /* eslint-enable func-names, object-shorthand */\n }));\n return Model;\n}", "static fromSchema(schema) {\n if (typeof schema === \"string\") {\n return AvroType.fromStringSchema(schema);\n }\n else if (Array.isArray(schema)) {\n return AvroType.fromArraySchema(schema);\n }\n else {\n return AvroType.fromObjectSchema(schema);\n }\n }", "static fromSchema(schema) {\n if (typeof schema === \"string\") {\n return AvroType.fromStringSchema(schema);\n }\n else if (Array.isArray(schema)) {\n return AvroType.fromArraySchema(schema);\n }\n else {\n return AvroType.fromObjectSchema(schema);\n }\n }", "function makeImmutableProperty (self, schema, values, propName) {\n var Model, dateCopy;\n\n if (schema[propName].__immutableCtor && is.function(schema[propName])) {\n // this is a nested immutable\n Model = schema[propName];\n self[propName] = new Model(values[propName]);\n } else if (isDate(values[propName])) {\n dateCopy = new Date(values[propName]);\n\n Object.defineProperty(self, propName, {\n get: function () {\n return new Date(dateCopy);\n },\n enumerable: true,\n configurable: false\n });\n\n Object.freeze(self[propName]);\n } else {\n objectHelper.setReadOnlyProperty(\n self,\n propName,\n // TODO: is it really necessary to clone the value if it isn't an object?\n objectHelper.copyValue(values[propName]),\n // typeof values[propName] === 'object' ? objectHelper.copyValue(values[propName]) : values[propName],\n makeSetHandler(propName)\n );\n\n if (Array.isArray(values[propName])) {\n Object.freeze(self[propName]);\n }\n }\n }", "newInstance(schema) {\n const instance = {};\n for (const field of schema) {\n if (field.def !== undefined) {\n instance[field.name] = klona(field.def);\n } else {\n // All fields should have an initial value in the database\n instance[field.name] = null;\n }\n }\n return instance;\n }", "static create (input) {\n // SCHEMA: this is the ideal place to throw on schema failure\n // const input = this.validate(input, Message.create)\n\n const instance = new this()\n Object.assign(instance, input)\n return instance\n }", "_createSchemaValidators(schema) {\n if (typeof schema === 'string') {\n schema = { type: schema };\n }\n\n if (schema.type && typeof schema.type === 'string') {\n // is item schema\n return new this.constructor(\n Object.assign({}, schema, {\n name: this.name,\n path: this.path,\n model: this.model\n })\n );\n }\n\n return Object.keys(schema).reduce((validators, key) => {\n let name;\n let path;\n let config = schema[key];\n\n if (typeof config === 'string') {\n config = { type: config };\n }\n\n if (typeof config === 'object') {\n name = key;\n path = `${this.path}.${name}`;\n } else {\n // if config is not an object, then it's invalid. the Field constructor\n // will therefore throw an error; with the next line, we just ensure it\n // throws the right error\n name = this.name;\n }\n\n validators[name] = new this.constructor(\n Object.assign({}, config, {\n name,\n path,\n model: this.model\n })\n );\n return validators;\n }, {});\n }", "function Schema(id, firstName, lastName, title){\n this.id = id;\n this.firstName = firstName;\n this.lastName = lastName;\n this.title = title;\n}", "function getModelFromSchema(schema) {\n var data = {\n name: schema.id,\n schema: {}\n }\n\n var newSchema = {}\n var tmp = null\n _.each(schema.properties, function (v, propName) {\n if (v['$ref'] != null) {\n tmp = {\n type: Schema.ObjectId,\n ref: v['$ref']\n }\n } else {\n tmp = translateComplexType(v) //{}\n }\n newSchema[propName] = tmp\n })\n data.schema = new Schema(newSchema)\n return data\n}", "function makeValidator(schema) {\n return ajv.compile(schema);\n}", "function constructFromDb(model, row) {\n\t var o = new model();\n\t console.assert(o instanceof Instance);\n\t for (var col in row) {\n\t var val = row[col];\n\t var _col = '_' + col;\n\t // TODO: refactor this into column class\n\t switch (model.columns[col].type) {\n\t case Updraft.ColumnType.json:\n\t o[_col] = JSON.parse(val);\n\t break;\n\t case Updraft.ColumnType.date:\n\t case Updraft.ColumnType.datetime:\n\t o[_col] = new Date(val * 1000);\n\t break;\n\t case Updraft.ColumnType.enum:\n\t var enumClass = o._model.columns[col].enum;\n\t console.assert(enumClass != null);\n\t if (typeof enumClass === 'object' && typeof enumClass.get == 'function') {\n\t o[_col] = enumClass.get(val);\n\t }\n\t else {\n\t console.assert(val in enumClass);\n\t o[_col] = enumClass[val];\n\t }\n\t break;\n\t case Updraft.ColumnType.set:\n\t o[_col].push(val);\n\t break;\n\t default:\n\t o[_col] = val;\n\t break;\n\t }\n\t }\n\t o._isInDb = true;\n\t console.assert(o._changeMask === 0);\n\t return o;\n\t }", "schema() { }", "create (props) {\n const { clone, dynamic } = props || {}\n Schema.prototype.create.call(this, props)\n setKeyAndName(this, clone, dynamic)\n }", "clone(schema) {\n const copy = Object.create(Object.getPrototypeOf(this), Object.getOwnPropertyDescriptors(this));\n if (schema)\n copy.schema = schema;\n copy.items = copy.items.map(it => identity.isNode(it) || identity.isPair(it) ? it.clone(schema) : it);\n if (this.range)\n copy.range = this.range.slice();\n return copy;\n }", "function makeImmutableObject(obj) {\n\t if (!globalConfig.use_static) {\n\t addPropertyTo(obj, \"merge\", merge);\n\t addPropertyTo(obj, \"replace\", objectReplace);\n\t addPropertyTo(obj, \"without\", without);\n\t addPropertyTo(obj, \"asMutable\", asMutableObject);\n\t addPropertyTo(obj, \"set\", objectSet);\n\t addPropertyTo(obj, \"setIn\", objectSetIn);\n\t addPropertyTo(obj, \"update\", update);\n\t addPropertyTo(obj, \"updateIn\", updateIn);\n\t addPropertyTo(obj, \"getIn\", getIn);\n\t }\n\n\t return makeImmutable(obj, mutatingObjectMethods);\n\t }", "function makeImmutableObject(obj) {\n\t if (!globalConfig.use_static) {\n\t addPropertyTo(obj, \"merge\", merge);\n\t addPropertyTo(obj, \"replace\", objectReplace);\n\t addPropertyTo(obj, \"without\", without);\n\t addPropertyTo(obj, \"asMutable\", asMutableObject);\n\t addPropertyTo(obj, \"set\", objectSet);\n\t addPropertyTo(obj, \"setIn\", objectSetIn);\n\t addPropertyTo(obj, \"update\", update);\n\t addPropertyTo(obj, \"updateIn\", updateIn);\n\t addPropertyTo(obj, \"getIn\", getIn);\n\t }\n\n\t return makeImmutable(obj, mutatingObjectMethods);\n\t }", "function makeImmutableObject(obj) {\n\t if (!globalConfig.use_static) {\n\t addPropertyTo(obj, \"merge\", merge);\n\t addPropertyTo(obj, \"replace\", objectReplace);\n\t addPropertyTo(obj, \"without\", without);\n\t addPropertyTo(obj, \"asMutable\", asMutableObject);\n\t addPropertyTo(obj, \"set\", objectSet);\n\t addPropertyTo(obj, \"setIn\", objectSetIn);\n\t addPropertyTo(obj, \"update\", update);\n\t addPropertyTo(obj, \"updateIn\", updateIn);\n\t addPropertyTo(obj, \"getIn\", getIn);\n\t }\n\t\n\t return makeImmutable(obj, mutatingObjectMethods);\n\t }", "function Model(schema) {\n this.schema = schema;\n this.id = null;\n\n for(var key in schema) {\n this[key] = null;\n }\n if (!DataStore.store.hasOwnProperty(this.constructor.name)) {\n DataStore.store[this.constructor.name] = [];\n }\n}", "function objectCreate(proto) {\n // create a new object\n const obj = {};\n // set the prototype\n Object.setPrototypeOf(obj, proto);\n // return a object\n return obj;\n}", "constructor({ fieldpath, schema, deserializedDefault = [], serializedDefault = [] }) {\n super({ fieldpath, deserializedDefault, serializedDefault });\n this.schema = schema;\n this.schemaKeys = Object.keys(this.schema);\n }", "function makeImmutableObject(obj) {\n if (!globalConfig.use_static) {\n addPropertyTo(obj, \"merge\", merge);\n addPropertyTo(obj, \"replace\", objectReplace);\n addPropertyTo(obj, \"without\", without);\n addPropertyTo(obj, \"asMutable\", asMutableObject);\n addPropertyTo(obj, \"set\", objectSet);\n addPropertyTo(obj, \"setIn\", objectSetIn);\n addPropertyTo(obj, \"update\", update);\n addPropertyTo(obj, \"updateIn\", updateIn);\n addPropertyTo(obj, \"getIn\", getIn);\n }\n\n return makeImmutable(obj, mutatingObjectMethods);\n }", "function compileSchema (schema) {\n return (payload) => {\n return Joi.validate(payload, schema)\n }\n}", "function asCtor(constr) {\n return primFreeze(asCtorOnly(constr));\n }", "clone(schema) {\n const copy = Object.create(Object.getPrototypeOf(this), Object.getOwnPropertyDescriptors(this));\n if (schema)\n copy.schema = schema;\n copy.items = copy.items.map(it => isNode(it) || isPair(it) ? it.clone(schema) : it);\n if (this.range)\n copy.range = this.range.slice();\n return copy;\n }", "withSchema(schema) {\n return new QueryCreator({\n ...this.#props,\n executor: this.#props.executor.withPluginAtFront(new with_schema_plugin_js_1.WithSchemaPlugin(schema)),\n });\n }", "static fromSchema(schema) {\n return schema.cached.domParser || (schema.cached.domParser = new DOMParser(schema, DOMParser.schemaRules(schema)));\n }", "static from(schema, obj, ctx) {\n const { keepUndefined, replacer } = ctx;\n const map = new this(schema);\n const add = (key, value) => {\n if (typeof replacer === 'function')\n value = replacer.call(obj, key, value);\n else if (Array.isArray(replacer) && !replacer.includes(key))\n return;\n if (value !== undefined || keepUndefined)\n map.items.push(Pair.createPair(key, value, ctx));\n };\n if (obj instanceof Map) {\n for (const [key, value] of obj)\n add(key, value);\n }\n else if (obj && typeof obj === 'object') {\n for (const key of Object.keys(obj))\n add(key, obj[key]);\n }\n if (typeof schema.sortMapEntries === 'function') {\n map.items.sort(schema.sortMapEntries);\n }\n return map;\n }", "get convertedSchema() {\n let schema = {\n $schema: \"http://json-schema.org/schema#\",\n title: this.label,\n type: \"object\",\n required: [],\n properties: this.fieldsToSchema(this.fields),\n };\n return schema;\n }", "clone() {\n return schema(this);\n }", "function Schema_from_swagger(schema_content) {\n 'use strict';\n // use new\n\n this.resolve = (input_json_obj) => {\n //const schema = getSwaggerV2Schema(schema_content, '/default_endpoint')\n const schema = schema_content;\n const ok = schemaValidator(schema, input_json_obj);\n if (ok) {\n return input_json_obj;\n } else {\n throw new Error('mismatch: The constraint aspect of template failed');\n }\n };\n\n this.generate = (obj) => this.resolve(obj);\n}", "function ConstructorBuilder(module, tlSchema, notRegisterByName) {\n this.module = module;\n if (!this.module) {\n logger.warn(' Target \\'module\\' parameter is mandatory!');\n console.trace();\n return;\n }\n this.tlSchema = tlSchema;\n if (!this.tlSchema) {\n logger.warn('\\'tlSchema\\' parameter is mandatory!');\n return;\n }\n this._methods = [];\n this._type = build.call(this);\n registerTypeById(this._type);\n if (!notRegisterByName) {\n registerTypeByName(this._type);\n }\n}", "function create(proto) {\n function Ctor() {}\n Ctor.prototype = proto;\n return new Ctor();\n }", "getSchemaValidator() {\n const ajv = new Ajv__default[\"default\"]({ strict: true, strictTuples: true, strictTypes: true });\n ajv.addMetaSchema(ajvSchemaDraft);\n ajv.addKeyword(ajvRegexpKeyword);\n ajv.addKeyword({ keyword: \"copyable\" });\n return ajv.compile(this.schema);\n }", "function connect(schema) {\n _opts.url = schema + '.json';\n let _schema = {};\n _modelsPath = schema.replace('/_schemas', '/db/');\n\n if (h.isValidPath(schema + '.json')) {\n _schema.url = schema + '.json';\n _schema.content = require(_schema.url);\n _self._schema = _schema;\n if (_schema.content) {\n _self = loadCollections(_schema.content, _self);\n }\n\n return _self;\n } else {\n throw new Error(`The schema url:\n [${_opts.url}]\ndoes not seem to be valid. Recheck the path and try again`);\n }\n}", "function Schema(descriptor) {\n this.rules = null;\n this._messages = _messages2.messages;\n this.define(descriptor);\n}", "function Schema(descriptor) {\n this.rules = null;\n this._messages = _messages2.messages;\n this.define(descriptor);\n}", "function Schema(descriptor) {\n this.rules = null;\n this._messages = _messages2.messages;\n this.define(descriptor);\n}", "function Schema(descriptor) {\n this.rules = null;\n this._messages = _messages2.messages;\n this.define(descriptor);\n}", "function Schema(descriptor) {\n this.rules = null;\n this._messages = _messages2.messages;\n this.define(descriptor);\n}", "function Schema(descriptor) {\n this.rules = null;\n this._messages = _messages2.messages;\n this.define(descriptor);\n}", "function Schema(descriptor) {\n this.rules = null;\n this._messages = _messages2.messages;\n this.define(descriptor);\n}", "function Schema(descriptor) {\n this.rules = null;\n this._messages = _messages2.messages;\n this.define(descriptor);\n}", "function Schema(descriptor) {\n this.rules = null;\n this._messages = _messages2.messages;\n this.define(descriptor);\n}", "function Schema(descriptor) {\n this.rules = null;\n this._messages = _messages2.messages;\n this.define(descriptor);\n}", "defineSchema() {\n\n }", "_parseFrom(schema) {\n const parsed = {};\n Object.entries(schema.properties).forEach(([pName, prop]) => {\n let p = prop;\n let name = pName;\n if (typeof p === 'string') {\n p = {\n type: p\n };\n }\n if (name === 'id')\n name = '_id';\n parsed[name] = p;\n if (p.type instanceof Array) {\n parsed[name].type = mongoose_1.default.Schema.Types.Mixed;\n }\n else {\n switch (p.type) {\n case 'email':\n parsed[name].type = String;\n break;\n case 'uuid':\n parsed[name].type = String;\n parsed[name].default = () => v4_1.default();\n break;\n }\n }\n if (p.unique) {\n parsed[name].index = {\n unique: true\n };\n }\n });\n parsed.createdAt = { type: Date, required: true, default: Date.now };\n parsed.updatedAt = Date;\n parsed.deletedAt = Date;\n return parsed;\n }", "function Schema(descriptor) {\n this.rules = null;\n this._messages = messages;\n this.define(descriptor);\n }", "function Schema(descriptor){this.rules=null;this._messages=_messages2.messages;this.define(descriptor);}", "function Schema(descriptor){this.rules=null;this._messages=_messages2.messages;this.define(descriptor);}", "function Schema(descriptor){this.rules=null;this._messages=_messages2.messages;this.define(descriptor);}", "function Schema(descriptor) {\n this.rules = null;\n this._messages = messages;\n this.define(descriptor);\n}", "function Schema(descriptor) {\n this.rules = null;\n this._messages = messages;\n this.define(descriptor);\n}", "function Schema(descriptor) {\n this.rules = null;\n this._messages = messages;\n this.define(descriptor);\n}", "function Schema(descriptor) {\n this.rules = null;\n this._messages = messages;\n this.define(descriptor);\n}", "function Schema(descriptor) {\n this.rules = null;\n this._messages = messages;\n this.define(descriptor);\n}", "function Schema(descriptor) {\n this.rules = null;\n this._messages = messages;\n this.define(descriptor);\n}", "function Schema(descriptor) {\n this.rules = null;\n this._messages = messages;\n this.define(descriptor);\n}", "function Schema(descriptor) {\n this.rules = null;\n this._messages = messages;\n this.define(descriptor);\n}", "function Schema(descriptor) {\n this.rules = null;\n this._messages = messages;\n this.define(descriptor);\n}", "function Schema(descriptor) {\n this.rules = null;\n this._messages = messages;\n this.define(descriptor);\n}", "function Schema(descriptor) {\n this.rules = null;\n this._messages = messages;\n this.define(descriptor);\n}", "function Schema(descriptor) {\n this.rules = null;\n this._messages = messages;\n this.define(descriptor);\n}", "function Schema(descriptor) {\n this.rules = null;\n this._messages = messages;\n this.define(descriptor);\n}", "function Schema(descriptor) {\n this.rules = null;\n this._messages = messages;\n this.define(descriptor);\n}", "function Schema(descriptor) {\n this.rules = null;\n this._messages = messages;\n this.define(descriptor);\n}", "function createObject(proto) {\n var f = function () { };\n f.prototype = proto;\n return new f();\n }", "function Schema(descriptor) {\n this.rules = null;\n this._messages = __WEBPACK_IMPORTED_MODULE_4__messages__[\"a\" /* messages */];\n this.define(descriptor);\n}", "function Schema(descriptor) {\n this.rules = null;\n this._messages = __WEBPACK_IMPORTED_MODULE_4__messages__[\"a\" /* messages */];\n this.define(descriptor);\n}", "function Schema(descriptor) {\n this.rules = null;\n this._messages = __WEBPACK_IMPORTED_MODULE_4__messages__[\"a\" /* messages */];\n this.define(descriptor);\n}", "function Schema(descriptor) {\n this.rules = null;\n this._messages = __WEBPACK_IMPORTED_MODULE_4__messages__[\"a\" /* messages */];\n this.define(descriptor);\n}", "function Schema(descriptor) {\n this.rules = null;\n this._messages = __WEBPACK_IMPORTED_MODULE_4__messages__[\"a\" /* messages */];\n this.define(descriptor);\n}", "function Schema(descriptor) {\n this.rules = null;\n this._messages = __WEBPACK_IMPORTED_MODULE_4__messages__[\"a\" /* messages */];\n this.define(descriptor);\n}", "function Schema(descriptor) {\n this.rules = null;\n this._messages = __WEBPACK_IMPORTED_MODULE_4__messages__[\"a\" /* messages */];\n this.define(descriptor);\n}", "function Schema(descriptor) {\n this.rules = null;\n this._messages = __WEBPACK_IMPORTED_MODULE_4__messages__[\"a\" /* messages */];\n this.define(descriptor);\n}", "function Schema(descriptor) {\n this.rules = null;\n this._messages = __WEBPACK_IMPORTED_MODULE_4__messages__[\"a\" /* messages */];\n this.define(descriptor);\n}", "function Schema(descriptor) {\n this.rules = null;\n this._messages = __WEBPACK_IMPORTED_MODULE_4__messages__[\"a\" /* messages */];\n this.define(descriptor);\n}", "static fromSchema(schema) {\n return schema.cached.domSerializer || (schema.cached.domSerializer = new DOMSerializer(this.nodesFromSchema(schema), this.marksFromSchema(schema)));\n }", "function Schema(descriptor) {\n\t this.rules = null;\n\t this._messages = _messages2.messages;\n\t this.define(descriptor);\n\t}", "function Schema(descriptor) {\n\t this.rules = null;\n\t this._messages = _messages2.messages;\n\t this.define(descriptor);\n\t}", "function Schema(descriptor) {\n\t this.rules = null;\n\t this._messages = _messages2.messages;\n\t this.define(descriptor);\n\t}", "function createObject(proto) {\n\t\tvar f = function() {};\n\t\tf.prototype = proto;\n\t\treturn new f();\n\t}", "function Schema(descriptor) {\n\t this.rules = null;\n\t this._messages = messages;\n\t this.define(descriptor);\n\t}", "function Schema(descriptor) {\n this.rules = null;\n this._messages = __WEBPACK_IMPORTED_MODULE_4__messages__[\"messages\"];\n this.define(descriptor);\n}", "function beget(proto) {\n var o = Object.create(proto);\n var args = Array.prototype.slice.call(arguments, 1);\n proto.constructor && proto.constructor.apply(o, args);\n return o;\n }", "function Schema(descriptor) {\n\t\t this.rules = null;\n\t\t this._messages = _messages2.messages;\n\t\t this.define(descriptor);\n\t\t}", "function Schema(descriptor) {\n this.rules = null;\n this._messages = messages;\n this.define(descriptor);\n }", "function Schema(descriptor) {\n this.rules = null;\n this._messages = _messages__WEBPACK_IMPORTED_MODULE_4__[\"messages\"];\n this.define(descriptor);\n}", "function Schema(descriptor) {\n this.rules = null;\n this._messages = _messages__WEBPACK_IMPORTED_MODULE_4__[\"messages\"];\n this.define(descriptor);\n}", "function Schema(descriptor) {\n this.rules = null;\n this._messages = _messages__WEBPACK_IMPORTED_MODULE_4__[\"messages\"];\n this.define(descriptor);\n}", "function Schema(descriptor) {\n this.rules = null;\n this._messages = _messages__WEBPACK_IMPORTED_MODULE_4__[\"messages\"];\n this.define(descriptor);\n}", "constructor(obj, parent = null) {\n // cloning\n if (obj instanceof Model) {\n let clone = obj;\n this.attributeDefinitions = clone.attributeDefinitions;\n this.elementAttributes = clone.elementAttributes;\n this.attributes = clone.attributes;\n this.parent = parent;\n this.xml = clone.xml;\n\n // attribute values\n for (name in clone.attributeDefinitions)\n this[name] = clone[name];\n\n // child elements\n for (let name of clone.elementAttributes)\n this[name] = clone[name];\n\n // allow the model to assign further attributes\n obj.clone(this);\n\n // new from xml\n } else {\n let xml = obj;\n this.attributeDefinitions = {};\n this.elementAttributes = [];\n this.attributes = xml.attributes;\n this.parent = parent;\n this.xml = xml;\n this.setup();\n }\n\n // setup is only called on models instantiated from xml,\n // postSetup is called on these models and clones\n this.postSetup();\n }", "copy({ type = this.type, value = this.value } = {}) {\n const { id, lbp, rules, unknown, ignored } = this;\n return new this.constructor(id, {\n lbp,\n rules,\n unknown,\n ignored,\n type,\n value,\n original: this,\n });\n }", "function createObject(proto) {\n\tvar f = function() {};\n\tf.prototype = proto;\n\treturn new f();\n}", "function createObject(proto) {\n\tvar f = function() {};\n\tf.prototype = proto;\n\treturn new f();\n}", "function createObject(proto) {\n\tvar f = function() {};\n\tf.prototype = proto;\n\treturn new f();\n}", "function createObject(proto) {\n\tvar f = function() {};\n\tf.prototype = proto;\n\treturn new f();\n}", "function createObject(proto) {\n\tvar f = function() {};\n\tf.prototype = proto;\n\treturn new f();\n}", "function createObject(proto) {\n\tvar f = function() {};\n\tf.prototype = proto;\n\treturn new f();\n}", "function createObject(proto) {\n\tvar f = function() {};\n\tf.prototype = proto;\n\treturn new f();\n}" ]
[ "0.64946556", "0.6098677", "0.6028341", "0.6028341", "0.5984513", "0.5890175", "0.5673409", "0.5543228", "0.5372351", "0.5367328", "0.5352167", "0.5319163", "0.52733094", "0.5245628", "0.5244429", "0.52235764", "0.52235764", "0.519638", "0.5193204", "0.51500684", "0.51453054", "0.5145128", "0.5144299", "0.51356655", "0.5133827", "0.5083103", "0.5064168", "0.50540876", "0.50474197", "0.50386643", "0.50375015", "0.50350904", "0.5012653", "0.49243057", "0.48973227", "0.48784786", "0.48784786", "0.48784786", "0.48784786", "0.48784786", "0.48784786", "0.48784786", "0.48784786", "0.48784786", "0.48784786", "0.48547432", "0.4851883", "0.48373646", "0.48330092", "0.48330092", "0.48330092", "0.48302236", "0.48302236", "0.48302236", "0.48302236", "0.48302236", "0.48302236", "0.48302236", "0.48302236", "0.48302236", "0.48302236", "0.48302236", "0.48302236", "0.48302236", "0.48302236", "0.48302236", "0.48297533", "0.48191503", "0.48191503", "0.48191503", "0.48191503", "0.48191503", "0.48191503", "0.48191503", "0.48191503", "0.48191503", "0.48191503", "0.48177528", "0.48162946", "0.48162946", "0.48162946", "0.48104334", "0.47923568", "0.47884047", "0.47795132", "0.47564402", "0.47453734", "0.47406182", "0.47406182", "0.47406182", "0.47406182", "0.47208086", "0.47198525", "0.4717219", "0.4717219", "0.4717219", "0.4717219", "0.4717219", "0.4717219", "0.4717219" ]
0.67670506
0
The Constructor is returned by this Immutable function. Callers can then use it to create new instances of objects that they expect to meet the schema, set forth by this Immutable.
function Constructor (values) { var propName, // we return self - it will provide access to the getters and setters self = {}; values = values || {}; if ( // you can override initial validation by setting // `schema.__skipValidation: true` originalSchema.__skipValidation !== true && !Blueprint.validate(blueprint, values).result ) { var err = new InvalidArgumentException( new Error(locale.errors.initialValidationFailed), Blueprint.validate(blueprint, values).errors ); config.onError(err); return err; } try { // Enumerate the schema, and create immutable properties for (propName in schema) { if (!schema.hasOwnProperty(propName)) { continue; } else if (propName === '__blueprintId') { continue; } if (is.nullOrUndefined(values[propName])) { makeReadOnlyNullProperty(self, propName); continue; } makeImmutableProperty(self, schema, values, propName); } Object.freeze(self); } catch (e) { return new InvalidArgumentException(e); } return self; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Immutable (originalSchema) {\n var schema = {}, blueprint, prop, propCtor;\n\n if (!originalSchema) {\n return new InvalidArgumentException(new Error('A schema object, and values are required'));\n }\n\n // Convert any objects that aren't validatable by Blueprint into Immutables\n for (prop in originalSchema) {\n if (!originalSchema.hasOwnProperty(prop)) {\n continue;\n } else if (prop === '__skipValidation') {\n continue;\n } else if (prop === '__skipValdation') {\n schema.__skipValidation = originalSchema.skipValdation;\n }\n\n if (\n is.object(originalSchema[prop]) &&\n !Blueprint.isValidatableProperty(originalSchema[prop]) &&\n !originalSchema[prop].__immutableCtor\n ) {\n schema[prop] = new Immutable(originalSchema[prop]);\n } else {\n schema[prop] = originalSchema[prop];\n }\n\n if (schema[prop].__immutableCtor) {\n // Add access to the Immutable on the Parent Immutable\n propCtor = prop.substring(0,1).toUpperCase() + prop.substring(1);\n Constructor[propCtor] = schema[prop];\n }\n }\n\n // This is the blueprint that the Immutable will be validated against\n blueprint = new Blueprint(schema);\n\n /*\n // The Constructor is returned by this Immutable function. Callers can\n // then use it to create new instances of objects that they expect to\n // meet the schema, set forth by this Immutable.\n */\n function Constructor (values) {\n var propName,\n // we return self - it will provide access to the getters and setters\n self = {};\n\n values = values || {};\n\n if (\n // you can override initial validation by setting\n // `schema.__skipValidation: true`\n originalSchema.__skipValidation !== true &&\n !Blueprint.validate(blueprint, values).result\n ) {\n var err = new InvalidArgumentException(\n new Error(locale.errors.initialValidationFailed),\n Blueprint.validate(blueprint, values).errors\n );\n\n config.onError(err);\n\n return err;\n }\n\n try {\n // Enumerate the schema, and create immutable properties\n for (propName in schema) {\n if (!schema.hasOwnProperty(propName)) {\n continue;\n } else if (propName === '__blueprintId') {\n continue;\n }\n\n if (is.nullOrUndefined(values[propName])) {\n makeReadOnlyNullProperty(self, propName);\n continue;\n }\n\n makeImmutableProperty(self, schema, values, propName);\n }\n\n Object.freeze(self);\n } catch (e) {\n return new InvalidArgumentException(e);\n }\n\n return self;\n } // /Constructor\n\n /*\n // Makes a new Immutable from an existing Immutable, replacing\n // values with the properties in the mergeVals argument\n // @param from: The Immutable to copy\n // @param mergeVals: The new values to overwrite as we copy\n */\n setReadOnlyProp(Constructor, 'merge', function (from, mergeVals, callback) {\n if (typeof callback === 'function') {\n async.runAsync(function () {\n merge(Constructor, from, mergeVals, callback);\n });\n } else {\n var output;\n\n merge(Constructor, from, mergeVals, function (err, merged) {\n output = err || merged;\n });\n\n return output;\n }\n });\n\n /*\n // Copies the values of an Immutable to a plain JS Object\n // @param from: The Immutable to copy\n */\n setReadOnlyProp(Constructor, 'toObject', function (from, callback) {\n return objectHelper.cloneObject(from, true, callback);\n });\n\n /*\n // Validates an instance of an Immutable against it's schema\n // @param instance: The instance that is being validated\n */\n setReadOnlyProp(Constructor, 'validate', function (instance, callback) {\n return Blueprint.validate(blueprint, instance, callback);\n });\n\n /*\n // Validates an instance of an Immutable against it's schema\n // @param instance: The instance that is being validated\n */\n setReadOnlyProp(Constructor, 'validateProperty', function (instance, propertyName, callback) {\n if (!instance && is.function(callback)) {\n callback([locale.errors.validatePropertyInvalidArgs], false);\n } else if (!instance) {\n return {\n errors: [locale.errors.validatePropertyInvalidArgs],\n result: false\n };\n }\n\n return Blueprint.validateProperty(blueprint, propertyName, instance[propertyName], callback);\n });\n\n /*\n // Prints an immutable to the console, in a more readable way\n // @param instance: The Immutable to print\n */\n setReadOnlyProp(Constructor, 'log', function (instance) {\n if (!instance) {\n console.log(null);\n } else {\n console.log(Constructor.toObject(instance));\n }\n });\n\n /*\n // Returns a copy of the original schema\n */\n setReadOnlyProp(Constructor, 'getSchema', function (callback) {\n return objectHelper.cloneObject(originalSchema, true, callback);\n });\n\n /*\n // Returns a this Immutable's blueprint\n */\n setReadOnlyProp(Constructor, 'blueprint', blueprint);\n\n setReadOnlyProp(Constructor, '__immutableCtor', true);\n return Constructor;\n }", "constructor() {\n copy(this, create());\n }", "static create (input) {\n // SCHEMA: this is the ideal place to throw on schema failure\n // const input = this.validate(input, Message.create)\n\n const instance = new this()\n Object.assign(instance, input)\n return instance\n }", "create() {\n return this.new();\n }", "constructor() {\n\n _data.set( this, new Map() );\n _validity.set( this, new Map() );\n\n // Immutable object.\n Object.freeze( this );\n }", "new() {\n let newInstance = Object.create(this);\n\n newInstance.init(...arguments);\n\n return newInstance;\n }", "function Constructor() {}", "function Constructor() {}", "function Constructor() {}", "function makeImmutableProperty (self, schema, values, propName) {\n var Model, dateCopy;\n\n if (schema[propName].__immutableCtor && is.function(schema[propName])) {\n // this is a nested immutable\n Model = schema[propName];\n self[propName] = new Model(values[propName]);\n } else if (isDate(values[propName])) {\n dateCopy = new Date(values[propName]);\n\n Object.defineProperty(self, propName, {\n get: function () {\n return new Date(dateCopy);\n },\n enumerable: true,\n configurable: false\n });\n\n Object.freeze(self[propName]);\n } else {\n objectHelper.setReadOnlyProperty(\n self,\n propName,\n // TODO: is it really necessary to clone the value if it isn't an object?\n objectHelper.copyValue(values[propName]),\n // typeof values[propName] === 'object' ? objectHelper.copyValue(values[propName]) : values[propName],\n makeSetHandler(propName)\n );\n\n if (Array.isArray(values[propName])) {\n Object.freeze(self[propName]);\n }\n }\n }", "create (props) {\n const { clone, dynamic } = props || {}\n Schema.prototype.create.call(this, props)\n setKeyAndName(this, clone, dynamic)\n }", "static create(params) {\n return {type: `${this.prefix}${this.name}`, _instance: new this(params)}; //eslint-disable-line\n }", "constructur() {}", "static create () {}", "constructor() {\n this.initStore(this.constructor.fields());\n this.registerFields();\n }", "clone() {\n\t\tlet data = JSON.parse(JSON.stringify(this.Serialize()));\n\t\treturn new this.constructor(data);\n\t}", "function build() {\n var Constructor, Instance;\n\n Constructor = function() {\n // Initialize a new instance, which won't do nothing but\n // inheriting the prototype.\n var instance = new Instance();\n\n // Apply the initializer on the given instance.\n instance.initialize.apply(instance, arguments);\n\n return instance;\n };\n\n // Define the function that will be used to\n // initialize the instance.\n Instance = function() {};\n Instance.prototype = Constructor.prototype;\n\n // Save some typing and make an alias to the prototype.\n Constructor.fn = Constructor.prototype;\n\n // Define a noop initializer.\n Constructor.fn.initialize = function() {};\n\n return Constructor;\n }", "function build() {\n var Constructor, Instance;\n\n Constructor = function() {\n // Initialize a new instance, which won't do nothing but\n // inheriting the prototype.\n var instance = new Instance();\n\n // Apply the initializer on the given instance.\n instance.initialize.apply( instance, arguments );\n\n return instance;\n };\n\n // Define the function that will be used to\n // initialize the instance.\n Instance = function() {};\n Instance.prototype = Constructor.prototype;\n\n // Save some typing and make an alias to the prototype.\n Constructor.fn = Constructor.prototype;\n\n // Define a noop initializer.\n Constructor.fn.initialize = function() {};\n\n return Constructor;\n }", "function construct() { }", "function Constructor() {\n // All construction is actually done in the init method\n if ( this.initialize )\n this.initialize.apply(this, arguments);\n }", "function Builder() {}", "function Builder() {}", "function build() {\n // Start creating the body of the new Type constructor, first calling super()\n var _ret = buildIdentity.call(this);\n var typeId = _ret.typeId;\n var typeName = _ret.typeName;\n var body =\n '\\tvar opts = options ? options : {};\\n' +\n '\\tthis.constructor.util._extend(this, opts.props);\\n' +\n '\\tthis.constructor.super_.call(this, opts.buffer, opts.offset' +\n (typeId ? '' : ', true') +\n ');\\n';\n // Init fields\n body += _ret.body;\n buildFlags.call(this);\n body += buildSerialize.call(this);\n body += buildDeserialize.call(this);\n // Add to body all the read/write methods\n for (var i = 0; i < this._methods.length; i++) {\n body += this._methods[i];\n }\n if (logger.isDebugEnabled()) {\n logger.debug('Body for %s type constructor:', typeName);\n logger.debug('\\n' + body);\n }\n return createConstructor(body, typeId, typeName);\n}", "function makeImmutableObject(obj) {\n\t if (!globalConfig.use_static) {\n\t addPropertyTo(obj, \"merge\", merge);\n\t addPropertyTo(obj, \"replace\", objectReplace);\n\t addPropertyTo(obj, \"without\", without);\n\t addPropertyTo(obj, \"asMutable\", asMutableObject);\n\t addPropertyTo(obj, \"set\", objectSet);\n\t addPropertyTo(obj, \"setIn\", objectSetIn);\n\t addPropertyTo(obj, \"update\", update);\n\t addPropertyTo(obj, \"updateIn\", updateIn);\n\t addPropertyTo(obj, \"getIn\", getIn);\n\t }\n\n\t return makeImmutable(obj, mutatingObjectMethods);\n\t }", "function makeImmutableObject(obj) {\n\t if (!globalConfig.use_static) {\n\t addPropertyTo(obj, \"merge\", merge);\n\t addPropertyTo(obj, \"replace\", objectReplace);\n\t addPropertyTo(obj, \"without\", without);\n\t addPropertyTo(obj, \"asMutable\", asMutableObject);\n\t addPropertyTo(obj, \"set\", objectSet);\n\t addPropertyTo(obj, \"setIn\", objectSetIn);\n\t addPropertyTo(obj, \"update\", update);\n\t addPropertyTo(obj, \"updateIn\", updateIn);\n\t addPropertyTo(obj, \"getIn\", getIn);\n\t }\n\n\t return makeImmutable(obj, mutatingObjectMethods);\n\t }", "function makeImmutableObject(obj) {\n\t if (!globalConfig.use_static) {\n\t addPropertyTo(obj, \"merge\", merge);\n\t addPropertyTo(obj, \"replace\", objectReplace);\n\t addPropertyTo(obj, \"without\", without);\n\t addPropertyTo(obj, \"asMutable\", asMutableObject);\n\t addPropertyTo(obj, \"set\", objectSet);\n\t addPropertyTo(obj, \"setIn\", objectSetIn);\n\t addPropertyTo(obj, \"update\", update);\n\t addPropertyTo(obj, \"updateIn\", updateIn);\n\t addPropertyTo(obj, \"getIn\", getIn);\n\t }\n\t\n\t return makeImmutable(obj, mutatingObjectMethods);\n\t }", "clone() {\n return new this.constructor(this);\n }", "copy({ type = this.type, value = this.value } = {}) {\n const { id, lbp, rules, unknown, ignored } = this;\n return new this.constructor(id, {\n lbp,\n rules,\n unknown,\n ignored,\n type,\n value,\n original: this,\n });\n }", "function Ctor() {}", "constructor() {\n if (new.target === MatrixBase) {\n throw new TypeError('Cannot construct MatrixBase instances directly');\n }\n }", "copy()\n\t{\n\t\treturn this.constructor.createNewInstance(this);\n\t}", "static create() {\n\t\tlet name, muts, tag, attr\n\n\t\tcl(`Creating new atom. \"Ctrl+c\" to exit`.gray);\n\n\t\trl.question(`Name » `.green, atomName => {\n\t\t\tname = atomName;\n\n\t\t\trl.question(`Mutates » `.green, atomMutate => {\n\t\t\t\tmuts = atomMutate.split(' ');\n\n\t\t\t\trl.question(`Tag » `.green, atomTag => {\n\t\t\t\t\ttag = atomTag;\n\n\t\t\t\t\trl.question(`Attributes » `.green, atomAttr => {\n\t\t\t\t\t\tattr = atomAttr.split(' ');\n\n\t\t\t\t\t\tvar atom = new Atom(name, muts, tag, attr);\n\n\t\t\t\t\t\tAtom.save(atom);\n\t\t\t\t\t\trl.close();\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t});\n\t\t});\n\t}", "function Ctor() {\r\n }", "_copy () {\n return new this.constructor()\n }", "_copy () {\n return new this.constructor()\n }", "initialize(data) {\n this.$exists = false;\n this.$changed = {};\n this.$attributes = {};\n this.fill(data);\n this.$initialized = true;\n\n return this;\n }", "function build(prop) {\n var Constructor, Instance;\n\n Constructor = function() {\n // Initialize a new instance, which won't do nothing but\n // inheriting the prototype.\n var instance = new Instance();\n\n // Apply the initializer on the given instance.\n instance.initialize.apply(instance, arguments);\n\n return instance;\n };\n\t\n\t\n\t// Define the function that will be used to\n // initialize the instance.\n Instance = function() {};\n Instance.prototype = Constructor.prototype;\n\n // Save some typing and make an alias to the prototype.\n try {\n Object.defineProperty(Constructor, 'fn', {\n configurable: false,\n enumerable: false,\n writable: false,\n value: Constructor.prototype\n });\n } catch (error) {\n Constructor.fn = Constructor.prototype;\n }\n\n\t// Copy the properties over onto the new prototype\n if(typeof prop=='object'){\n\t\tfor (var name in prop) {\n\t\t\tConstructor.prototype[name]=prop[name];\n\t\t}\n\t}\n\t\n // Define a noop initializer.\n if(typeof Constructor.fn.initialize==='undefined'){\n\t\tConstructor.fn.initialize = function() {};\n\t}\n\t\n\t// The dummy class constructor\n function Constructor() {\n // All construction is actually done in the init method\n if ( this.initialize )\n this.initialize.apply(this, arguments);\n }\n\t\n\tConstructor.prototype.constructor = Constructor;\n\t\n return Constructor;\n }", "async init() {\n return this;\n }", "clone() {\n const clone = new this.constructor(this.model);\n clone.config = Object.assign(clone.config, this.config);\n clone.options = Object.assign(clone.options, this.options);\n return clone;\n }", "newInstance(schema) {\n const instance = {};\n for (const field of schema) {\n if (field.def !== undefined) {\n instance[field.name] = klona(field.def);\n } else {\n // All fields should have an initial value in the database\n instance[field.name] = null;\n }\n }\n return instance;\n }", "constructor() {\n\t\tif (!instance) { instance = this }\n\n\t\treturn instance\n\t}", "construct (target, args) {\n return new target(...args)\n }", "clone() {\n return schema(this);\n }", "build() {\n const state = Immutable.from(this.state);\n this.setState(state);\n return state.asMutable();\n }", "newModel(arg) {\n const Model = this.Model;\n return new Model(arg);\n }", "newModel(arg) {\n const Model = this.Model;\n return new Model(arg);\n }", "consructor() {\n }", "function _constructor(dom) {\n\t\tthis.dom = dom;\n\t\t// capture 'this'\n\t\tlet thiz = this;\n\n\t\t_init.call(thiz);\n\n\t\t_setObserver.call(thiz);\n\n\t\t_getOptions.call(thiz);\n\n\t\t_setListeners.call(thiz);\n\n\t\treturn thiz;\n\t}", "function makeImmutableObject(obj) {\n if (!globalConfig.use_static) {\n addPropertyTo(obj, \"merge\", merge);\n addPropertyTo(obj, \"replace\", objectReplace);\n addPropertyTo(obj, \"without\", without);\n addPropertyTo(obj, \"asMutable\", asMutableObject);\n addPropertyTo(obj, \"set\", objectSet);\n addPropertyTo(obj, \"setIn\", objectSetIn);\n addPropertyTo(obj, \"update\", update);\n addPropertyTo(obj, \"updateIn\", updateIn);\n addPropertyTo(obj, \"getIn\", getIn);\n }\n\n return makeImmutable(obj, mutatingObjectMethods);\n }", "static studentBuilder() {\n // return new this('Ihor Kohut', 'qc')); // ---> object\n return new Student('Ihor Kohut', 'qc'); // ---> object\n }", "constructor(obj, parent = null) {\n // cloning\n if (obj instanceof Model) {\n let clone = obj;\n this.attributeDefinitions = clone.attributeDefinitions;\n this.elementAttributes = clone.elementAttributes;\n this.attributes = clone.attributes;\n this.parent = parent;\n this.xml = clone.xml;\n\n // attribute values\n for (name in clone.attributeDefinitions)\n this[name] = clone[name];\n\n // child elements\n for (let name of clone.elementAttributes)\n this[name] = clone[name];\n\n // allow the model to assign further attributes\n obj.clone(this);\n\n // new from xml\n } else {\n let xml = obj;\n this.attributeDefinitions = {};\n this.elementAttributes = [];\n this.attributes = xml.attributes;\n this.parent = parent;\n this.xml = xml;\n this.setup();\n }\n\n // setup is only called on models instantiated from xml,\n // postSetup is called on these models and clones\n this.postSetup();\n }", "function buildModel(name, schema) {\n class Model extends BaseModel {\n constructor(data) {\n if (data !== undefined) {\n Object.entries(data).forEach(([key, value]) => {\n if (schema[key]) {\n Joi.attempt(value, schema[key]);\n }\n });\n }\n super(data);\n }\n\n _set(key, value) {\n if (schema[key]) {\n Joi.attempt(value, schema[key]);\n }\n return super._set(key, value);\n }\n }\n Object.defineProperty(Model, 'name', { value: name });\n Object.keys(schema).forEach(key =>\n Object.defineProperty(Model.prototype, key, {\n // `function` is used rather than `=>` to work around context problem with `this`\n /* eslint-disable func-names, object-shorthand */\n get: function () {\n return this._get(key);\n },\n set: function (value) {\n this._set(key, value);\n },\n /* eslint-enable func-names, object-shorthand */\n }));\n return Model;\n}", "create() {}", "create() {}", "constructor( ) {}", "static $new(data) {\n\t\tvar className = this;\n\t\tvar instance = new className();\n\t\tvar defaultProps = className.$properties();\n\t\t// bind data\n\t\tif(_.isPlainObject(defaultProps)){\n\t\t\tvar propNames = Object.getOwnPropertyNames(defaultProps);\n\t\t\tfor(let propName of propNames) {\n\t\t\t\tvar propVal\n\t\t\t\tif(_.isPlainObject(data) && data[propName] !== undefined){\n\t\t\t\t\tpropVal = data[propName];\n\t\t\t\t} else if(typeof defaultProps[propName] === 'function'){\n\t\t\t\t\tpropVal = defaultProps[propName].apply(instance, [data]);\n\t\t\t\t} else {\n\t\t\t\t\tpropVal = defaultProps[propName];\n\t\t\t\t}\n\t\t\t\tinstance[propName] = propVal;\n\t\t\t}\n\t\t}\n\t\t// Object.seal(instance)\n\t\treturn instance;\n\t}", "function _ctor() {\n\t}", "function create() {\n var ret = Object.create(fastSet);\n ret.data = createMapObject();\n ret.size = 0;\n return ret;\n }", "constructor() {\n\t\t// ...\n\t}", "constructor(name){\n // if(Person.instance){\n // return Person.instance;\n // }\n // Person.instance = this;\n this.name = name;\n }", "function create(c) {\n return new c();\n}", "function create(c) {\n return new c();\n}", "function create(c) {\n return new c();\n}", "function create(c) {\n return new c();\n}", "function classCreate() {\n return function() {\n this.initialize.apply(this, arguments);\n }\n}", "function constructFromDb(model, row) {\n\t var o = new model();\n\t console.assert(o instanceof Instance);\n\t for (var col in row) {\n\t var val = row[col];\n\t var _col = '_' + col;\n\t // TODO: refactor this into column class\n\t switch (model.columns[col].type) {\n\t case Updraft.ColumnType.json:\n\t o[_col] = JSON.parse(val);\n\t break;\n\t case Updraft.ColumnType.date:\n\t case Updraft.ColumnType.datetime:\n\t o[_col] = new Date(val * 1000);\n\t break;\n\t case Updraft.ColumnType.enum:\n\t var enumClass = o._model.columns[col].enum;\n\t console.assert(enumClass != null);\n\t if (typeof enumClass === 'object' && typeof enumClass.get == 'function') {\n\t o[_col] = enumClass.get(val);\n\t }\n\t else {\n\t console.assert(val in enumClass);\n\t o[_col] = enumClass[val];\n\t }\n\t break;\n\t case Updraft.ColumnType.set:\n\t o[_col].push(val);\n\t break;\n\t default:\n\t o[_col] = val;\n\t break;\n\t }\n\t }\n\t o._isInDb = true;\n\t console.assert(o._changeMask === 0);\n\t return o;\n\t }", "constructor () {\n this.storage = immutable.Map()\n }", "function Class() {\n \n if(!(this instanceof arguments.callee)) {\n //return new arguments.callee(options);\n throw new Error('Please used \"new\" keyword to create object!');\n }\n\n // All construction is actually done in the init method\n if (/* !initializing && */this.init )\n this.init.apply(this, arguments);\n }", "function Ctor() {\n\t// Empty...\n}", "function create(proto) {\n function Ctor() {}\n Ctor.prototype = proto;\n return new Ctor();\n }", "create () {}", "create () {}", "static async create() {\n let comp = Reflect.construct(this, arguments);\n // build default required components\n await Promise.all(resolveRequiredComponents(comp)\n .map(c => comp.addComponent(c)));\n return comp;\n }", "constructor (){}", "function constructor(spec){\n // 1. initialize own members from spec\n let {member} = spec;\n\n // 2. composition with other objects\n // you can select only the parts that you want to use\n // you only \"inherit\" the stuff that you need\n let {other} = other_constructor(spec);\n\n // 3. methods\n let method = function(){ // close over other methods, variables and spec };\n\n // 4. Expose public API\n // Note new ES6 that lets you define object properties like this:\n // {method, other}\n // instea of\n // { method : method, other : other}\n return Object.freeze({ // immutable (see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/freeze)\n method,\n other\n });\n }\n}", "function create() {\n var ret = Object.create(fastMap);\n ret.data = createMapObject();\n ret.size = 0;\n return ret;\n }", "function Class() {\r\n // All construction is actually done in the init method\r\n if ( !initializing && this.init ) {\r\n // create new store\r\n this.init.apply(this, arguments);\r\n }\r\n }", "function CTOR() {\n this.name = 'Instance';\n}", "constructor(){}", "constructor(){}", "constructor(){}", "constructor(){}", "constructor(){}", "constructor(){}", "constructor(){}", "function Constructor() {\n // All construction is actually done in the init method.\n if (!initializing) {\n return this.constructor !== Constructor && arguments.length ?\n // We are being called without `new` or we are extending.\n arguments.callee.extend.apply(arguments.callee, arguments) :\n // We are being called with `new`.\n this.constructor.newInstance.apply(this.constructor, arguments);\n }\n }", "function make_class(){\n\tvar isInternal;\n\tvar constructor = function(args){\n if ( this instanceof constructor ) {\n\t\tif ( typeof this.init == \"function\" ) {\n this.init.apply( this, isInternal ? args : arguments );\n\t\t}\n } else {\n\t\tisInternal = true;\n\t\tvar instance = new constructor( arguments );\n\t\tisInternal = false;\n\t\treturn instance;\n }\n\t};\n\treturn constructor;\n }", "function make_class(){\n\tvar isInternal;\n\tvar constructor = function(args){\n if ( this instanceof constructor ) {\n\t\tif ( typeof this.init == \"function\" ) {\n this.init.apply( this, isInternal ? args : arguments );\n\t\t}\n } else {\n\t\tisInternal = true;\n\t\tvar instance = new constructor( arguments );\n\t\tisInternal = false;\n\t\treturn instance;\n }\n\t};\n\treturn constructor;\n }", "function Class() {\n // All construction is actually done in the init method\n if (!initializing && this.ctor)\n this.ctor.apply(this, arguments);\n }", "constructor (data) {\n super(data, InstanceModel)\n }", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}" ]
[ "0.6791926", "0.6657413", "0.6598576", "0.63822585", "0.6093695", "0.60557866", "0.5974791", "0.5974791", "0.5974791", "0.5880356", "0.5854953", "0.58489996", "0.57926", "0.5789543", "0.57499486", "0.5741624", "0.5736388", "0.5665391", "0.5631423", "0.56235254", "0.56166756", "0.56166756", "0.56047165", "0.5564811", "0.5564811", "0.55611134", "0.55455977", "0.55314827", "0.5519729", "0.5516238", "0.5507478", "0.5502909", "0.5489403", "0.5489024", "0.5489024", "0.54877234", "0.5476124", "0.5460886", "0.545312", "0.5428439", "0.54278165", "0.5424281", "0.5421812", "0.5413434", "0.5407951", "0.5407951", "0.539785", "0.53869474", "0.53778356", "0.53400517", "0.53352326", "0.5332805", "0.5331813", "0.5331813", "0.53295696", "0.53287995", "0.5315486", "0.5299964", "0.5289024", "0.5278224", "0.5269628", "0.5269628", "0.5269628", "0.5269628", "0.52665544", "0.5266415", "0.5262577", "0.5261471", "0.52518165", "0.524814", "0.52423215", "0.52423215", "0.5236733", "0.5218666", "0.52154917", "0.5208764", "0.52059716", "0.5203967", "0.52010846", "0.52010846", "0.52010846", "0.52010846", "0.52010846", "0.52010846", "0.52010846", "0.51916695", "0.5187882", "0.5187882", "0.5187379", "0.518653", "0.5184008", "0.5184008", "0.5184008", "0.5184008", "0.5184008", "0.5184008", "0.5184008", "0.5184008", "0.5184008", "0.5184008" ]
0.67129695
1
Immutable / Creates a copy of the value, and creates a readonly property on `self`
function makeImmutableProperty (self, schema, values, propName) { var Model, dateCopy; if (schema[propName].__immutableCtor && is.function(schema[propName])) { // this is a nested immutable Model = schema[propName]; self[propName] = new Model(values[propName]); } else if (isDate(values[propName])) { dateCopy = new Date(values[propName]); Object.defineProperty(self, propName, { get: function () { return new Date(dateCopy); }, enumerable: true, configurable: false }); Object.freeze(self[propName]); } else { objectHelper.setReadOnlyProperty( self, propName, // TODO: is it really necessary to clone the value if it isn't an object? objectHelper.copyValue(values[propName]), // typeof values[propName] === 'object' ? objectHelper.copyValue(values[propName]) : values[propName], makeSetHandler(propName) ); if (Array.isArray(values[propName])) { Object.freeze(self[propName]); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "copyable(newValue = true) {\n this.value.copyable = newValue;\n return this;\n }", "set(value) {\n if (value === this._value) {\n return this;\n }\n\n return new ImmutableAccessor(value, this.path);\n }", "get shallowCopy() {\n return this.shallowCopy$();\n }", "copy() {\n return new this.constructor(\n this.power,\n this.value,\n (this.next != null) ? this.next.copy() : null,\n );\n }", "set(name, value) {\n return this.clone({\n name,\n value,\n op: 's'\n });\n }", "get readonly() { return this._readonly; }", "copy({ type = this.type, value = this.value } = {}) {\n const { id, lbp, rules, unknown, ignored } = this;\n return new this.constructor(id, {\n lbp,\n rules,\n unknown,\n ignored,\n type,\n value,\n original: this,\n });\n }", "copy() {\n return Object.assign(Object.create(this), JSON.parse(JSON.stringify(this)))\n }", "get deepCopy() {\n return this.deepCopy$();\n }", "set(name, value) {\n return this.clone({ name, value, op: 's' });\n }", "set(name, value) {\n return this.clone({ name, value, op: 's' });\n }", "set(name, value) {\n return this.clone({ name, value, op: 's' });\n }", "set(name, value) {\n return this.clone({ name, value, op: 's' });\n }", "set(name, value) {\n return this.clone({ name, value, op: 's' });\n }", "function immutableObjectTest(){\n\nlet test= {'name': 'vishal', 'age':27};\n//Object.freeze(test);\nlet test2= test;\n\ntest.age = 26;\nconsole.log(test);\nconsole.log(test2);\nconsole.log(test === test2);\n\n\n\n\n}", "set(value) {\n this.value = value\n if (this.autoUpdate) {\n this.update()\n }\n return this // chain me up baby\n }", "function Self(value){\n\t\tthis._value = value;\n\t}", "function castImmutable(value) {\n return value;\n}", "clone() {\n const copy = Object.create(Object.getPrototypeOf(this), Object.getOwnPropertyDescriptors(this));\n if (this.range)\n copy.range = this.range.slice();\n return copy;\n }", "clone() {\n const copy = Object.create(Object.getPrototypeOf(this), Object.getOwnPropertyDescriptors(this));\n if (this.range)\n copy.range = this.range.slice();\n return copy;\n }", "function boundCopy() {\n var args, val;\n args = Array.prototype.slice.call(arguments);\n val = this.valueOf(); // jshint ignore:line\n return copy(val);\n }", "function boundCopy() {\n var args, val;\n args = Array.prototype.slice.call(arguments);\n val = this.valueOf(); // jshint ignore:line\n return copy(val);\n }", "copy()\n\t{\n\t\treturn this.constructor.createNewInstance(this);\n\t}", "function overwritable(value) {\n return function (target, propertyName) {\n var newDescriptor = {\n //this prevents every writing access, even the constructor\n writable: value\n };\n return newDescriptor;\n };\n}", "clone() {\n const copy = Object.create(Object.getPrototypeOf(this), Object.getOwnPropertyDescriptors(this));\n if (this.range)\n copy.range = this.range.slice();\n return copy;\n }", "evaluate () {\n this.value = this.get()\n this.dirty = false\n }", "build() {\n const state = Immutable.from(this.state);\n this.setState(state);\n return state.asMutable();\n }", "evaluate () {\n this.value = this.get();\n this.dirty = false;\n }", "mirror(val) {\n this._mirror = val;\n return this;\n }", "function toImmutable(arg) {\n\t\t return (isImmutable(arg))\n\t\t ? arg\n\t\t : Immutable.fromJS(arg)\n\t\t}", "get readonly() {\n return this._readonly;\n }", "set(_value) {\n this.value = _value;\n }", "set(_value) {\n this.value = _value;\n }", "_cloneValue() {\n const that = this;\n\n if (that._value !== null) {\n return that._value.clone();\n }\n else {\n return null;\n }\n }", "clone() {\n return Object.assign(Object.create(this), this)\n }", "function shallowReadonly(target) {\r\n return createReactiveObject(target, true, shallowReadonlyHandlers, shallowReadonlyCollectionHandlers, shallowReadonlyMap);\r\n}", "function shallowReadonly(target) {\r\n return createReactiveObject(target, true, shallowReadonlyHandlers, shallowReadonlyCollectionHandlers, shallowReadonlyMap);\r\n}", "function shallowReadonly(target) {\r\n return createReactiveObject(target, true, shallowReadonlyHandlers, shallowReadonlyCollectionHandlers, shallowReadonlyMap);\r\n}", "function setter() {\n throw new Error('vuex getter properties are read-only.');\n }", "copy () {\n return new Dot({\n x: this.x,\n y: this.y,\n z: this.z\n })\n }", "function shallowReadonly(target) {\n return createReactiveObject(target, true, shallowReadonlyHandlers, shallowReadonlyCollectionHandlers, shallowReadonlyMap);\n}", "function shallowReadonly(target) {\n return createReactiveObject(target, true, shallowReadonlyHandlers, shallowReadonlyCollectionHandlers, shallowReadonlyMap);\n}", "function shallowReadonly(target) {\n return createReactiveObject(target, true, shallowReadonlyHandlers, shallowReadonlyCollectionHandlers, shallowReadonlyMap);\n}", "function shallowReadonly(target) {\n return createReactiveObject(target, true, shallowReadonlyHandlers, shallowReadonlyCollectionHandlers, shallowReadonlyMap);\n}", "function shallowReadonly(target) {\n return createReactiveObject(target, true, shallowReadonlyHandlers, shallowReadonlyCollectionHandlers, shallowReadonlyMap);\n}", "function shallowReadonly(target) {\n return createReactiveObject(target, true, shallowReadonlyHandlers, shallowReadonlyCollectionHandlers, shallowReadonlyMap);\n}", "function shallowReadonly(target) {\n return createReactiveObject(target, true, shallowReadonlyHandlers, shallowReadonlyCollectionHandlers, shallowReadonlyMap);\n}", "function propertyConstant() {\n this[name] = value;\n }", "function toImmutable(arg) {\n\t return (isImmutable(arg))\n\t ? arg\n\t : Immutable.fromJS(arg)\n\t}", "s(_value) {\n this.value = _value;\n this.refresh();\n }", "s(_value) {\n this.value = _value;\n this.refresh();\n }", "function shallowReadonly(target) {\r\n return createReactiveObject(target, true, shallowReadonlyHandlers, readonlyCollectionHandlers);\r\n}", "function setter() {\n\t throw new Error('vuex getter properties are read-only.');\n\t }", "function makeImmutableObject(obj) {\n\t if (!globalConfig.use_static) {\n\t addPropertyTo(obj, \"merge\", merge);\n\t addPropertyTo(obj, \"replace\", objectReplace);\n\t addPropertyTo(obj, \"without\", without);\n\t addPropertyTo(obj, \"asMutable\", asMutableObject);\n\t addPropertyTo(obj, \"set\", objectSet);\n\t addPropertyTo(obj, \"setIn\", objectSetIn);\n\t addPropertyTo(obj, \"update\", update);\n\t addPropertyTo(obj, \"updateIn\", updateIn);\n\t addPropertyTo(obj, \"getIn\", getIn);\n\t }\n\t\n\t return makeImmutable(obj, mutatingObjectMethods);\n\t }", "set readOnly(value) {\n this._readonly = value;\n }", "function makeImmutableObject(obj) {\n\t if (!globalConfig.use_static) {\n\t addPropertyTo(obj, \"merge\", merge);\n\t addPropertyTo(obj, \"replace\", objectReplace);\n\t addPropertyTo(obj, \"without\", without);\n\t addPropertyTo(obj, \"asMutable\", asMutableObject);\n\t addPropertyTo(obj, \"set\", objectSet);\n\t addPropertyTo(obj, \"setIn\", objectSetIn);\n\t addPropertyTo(obj, \"update\", update);\n\t addPropertyTo(obj, \"updateIn\", updateIn);\n\t addPropertyTo(obj, \"getIn\", getIn);\n\t }\n\n\t return makeImmutable(obj, mutatingObjectMethods);\n\t }", "function makeImmutableObject(obj) {\n\t if (!globalConfig.use_static) {\n\t addPropertyTo(obj, \"merge\", merge);\n\t addPropertyTo(obj, \"replace\", objectReplace);\n\t addPropertyTo(obj, \"without\", without);\n\t addPropertyTo(obj, \"asMutable\", asMutableObject);\n\t addPropertyTo(obj, \"set\", objectSet);\n\t addPropertyTo(obj, \"setIn\", objectSetIn);\n\t addPropertyTo(obj, \"update\", update);\n\t addPropertyTo(obj, \"updateIn\", updateIn);\n\t addPropertyTo(obj, \"getIn\", getIn);\n\t }\n\n\t return makeImmutable(obj, mutatingObjectMethods);\n\t }", "function shallowReadonly(target) {\n return createReactiveObject(target, true, shallowReadonlyHandlers, readonlyCollectionHandlers);\n }", "function shallowReadonly(target) {\n return createReactiveObject(target, true, shallowReadonlyHandlers, readonlyCollectionHandlers);\n }", "get value() { return this.#val; }", "clone() {\n return new Token(this.path, this.value, this.uid, this.id);\n }", "get value() { return this._value; }", "get value() { return this._value; }", "get value() { return this._value; }", "get value() { return this._value; }", "get value() { return this._value; }", "get value() { return this._value; }", "get value() { return this._value; }", "get value() { return this._value; }", "get value() { return this._value; }", "function shallowReadonly(target) {\n return createReactiveObject(target, true, shallowReadonlyHandlers, readonlyCollectionHandlers);\n}", "function shallowReadonly(target) {\n return createReactiveObject(target, true, shallowReadonlyHandlers, readonlyCollectionHandlers);\n}", "toSync() {\n return this.value;\n }", "toSync() {\n return this.value;\n }", "set(newVal) {\n // not used\n // don't allow for two-way setting\n this.value = newVal;\n }", "function propertyConstant() {\n this[name] = value;\n }", "function propertyConstant() {\n this[name] = value;\n }", "function reactiveProperty(newValue){\n \n // Check for too many arguments.\n if(arguments.length > 1) {\n throw Error(errors.tooManyArgsSetter);\n }\n \n // This implements the setter part of the setter-getter.\n if(arguments.length === 1){\n\n // Grab the old value for passing into the listener.\n var oldValue = value;\n\n // Track the new value internally.\n value = newValue;\n\n // Notify registered listeners.\n if(listeners){\n for(var i = 0; i < listeners.length; i++){\n listeners[i](newValue, oldValue);\n }\n }\n\n // Support method chaining by returning 'this'.\n return this;\n }\n\n // This implements the getter part of the setter-getter.\n return value;\n }", "_setAsSideEffect(value, forceAssignmentIfUnloaded=false) {\n // If the relation is valueless, we haven't loaded it yet so there's\n // no need for other side effects to worry about it. The caller can\n // disable this behavior, which is leveraged by many-side relations\n // taking the opportunity to load their corresponding one-side during\n // load.\n if (!this.loaded && !forceAssignmentIfUnloaded) return;\n\n this._value = value;\n }", "_copy () {\n return new this.constructor()\n }", "_copy () {\n return new this.constructor()\n }", "copy() {\n let shallowList = this;\n return shallowList;\n }", "shallowCopy$() {\n const ret = super.shallowCopy$();\n return new ExtConfig(ret);\n }", "get value(){ return this._value; }", "function makeImmutableObject(obj) {\n if (!globalConfig.use_static) {\n addPropertyTo(obj, \"merge\", merge);\n addPropertyTo(obj, \"replace\", objectReplace);\n addPropertyTo(obj, \"without\", without);\n addPropertyTo(obj, \"asMutable\", asMutableObject);\n addPropertyTo(obj, \"set\", objectSet);\n addPropertyTo(obj, \"setIn\", objectSetIn);\n addPropertyTo(obj, \"update\", update);\n addPropertyTo(obj, \"updateIn\", updateIn);\n addPropertyTo(obj, \"getIn\", getIn);\n }\n\n return makeImmutable(obj, mutatingObjectMethods);\n }", "set(param, value) {\n return this.clone({\n param,\n value,\n op: 's'\n });\n }", "get() {\n return this._value;\n }", "copy() {\n return new Car(this.brain);\n }", "setX(x) { this.x = x; return this; }", "get value() {\n return this._value;\n }", "get value() {\n return this._value;\n }", "get value () {\n return this._value\n }", "Readonly(item) {\r\n return { ...item, modifier: exports.ReadonlyModifier };\r\n }", "static createProperty(e,t=defaultPropertyDeclaration){// Do not generate an accessor if the prototype already has one, since\n// it would be lost otherwise and that would never be the user's intention;\n// Instead, we expect users to call `requestUpdate` themselves from\n// user-defined accessors. Note that if the super has an accessor we will\n// still overwrite it\nif(this._ensureClassProperties(),this._classProperties.set(e,t),t.noAccessor||this.prototype.hasOwnProperty(e))return;const n=\"symbol\"==typeof e?Symbol():`__${e}`;Object.defineProperty(this.prototype,e,{// tslint:disable-next-line:no-any no symbol in index\nget(){return this[n]},set(t){const r=this[e];this[n]=t,this._requestUpdate(e,r)},configurable:!0,enumerable:!0})}", "clone() {\r\n return _.cloneDeep(this)\r\n }", "clone() {\n return new this.constructor(this);\n }", "clone() {\n\t\tlet data = JSON.parse(JSON.stringify(this.Serialize()));\n\t\treturn new this.constructor(data);\n\t}", "constructor() {\n copy(this, create());\n }", "get asSetter() {\n return setter(this.over)\n }", "get() {\n return this.value;\n }" ]
[ "0.670268", "0.64647347", "0.619443", "0.61899436", "0.6068771", "0.60651004", "0.60070676", "0.5987902", "0.5985432", "0.5942874", "0.5942874", "0.5942874", "0.5942874", "0.5942874", "0.5887968", "0.58343893", "0.57599264", "0.5753789", "0.57491195", "0.57491195", "0.57408905", "0.57408905", "0.57277435", "0.5722222", "0.5711244", "0.567428", "0.5673136", "0.56577873", "0.5639052", "0.56362647", "0.56286776", "0.56097054", "0.56097054", "0.5609224", "0.5608802", "0.56084776", "0.56084776", "0.56084776", "0.5584495", "0.5567133", "0.55601084", "0.55601084", "0.55601084", "0.55601084", "0.55601084", "0.55601084", "0.55601084", "0.5559405", "0.5541374", "0.5535159", "0.5535159", "0.55323803", "0.5521021", "0.55158406", "0.55146325", "0.55128956", "0.55128956", "0.5502768", "0.5502768", "0.54916626", "0.54796505", "0.54774266", "0.54774266", "0.54774266", "0.54774266", "0.54774266", "0.54774266", "0.54774266", "0.54774266", "0.54774266", "0.5473818", "0.5473818", "0.54537517", "0.54537517", "0.5451186", "0.5450007", "0.5450007", "0.5423933", "0.54199183", "0.5406796", "0.5406796", "0.54031813", "0.54001725", "0.5398526", "0.538412", "0.5378794", "0.5371883", "0.5360219", "0.53584236", "0.5347391", "0.5347391", "0.53439814", "0.53029925", "0.5300075", "0.52933073", "0.52890396", "0.52875704", "0.52856004", "0.5284275", "0.52801025" ]
0.6560574
1
makeImmutableProperty / make a readonly property that returns null
function makeReadOnlyNullProperty (self, propName) { objectHelper.setReadOnlyProperty(self, propName, null, makeSetHandler(propName)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function internalProperty(options) {\n return property({ attribute: false, hasChanged: options === null || options === void 0 ? void 0 : options.hasChanged });\n}", "function internalProperty(options){return property({attribute:false,hasChanged:options===null||options===void 0?void 0:options.hasChanged});}", "function makeImmutableProperty (self, schema, values, propName) {\n var Model, dateCopy;\n\n if (schema[propName].__immutableCtor && is.function(schema[propName])) {\n // this is a nested immutable\n Model = schema[propName];\n self[propName] = new Model(values[propName]);\n } else if (isDate(values[propName])) {\n dateCopy = new Date(values[propName]);\n\n Object.defineProperty(self, propName, {\n get: function () {\n return new Date(dateCopy);\n },\n enumerable: true,\n configurable: false\n });\n\n Object.freeze(self[propName]);\n } else {\n objectHelper.setReadOnlyProperty(\n self,\n propName,\n // TODO: is it really necessary to clone the value if it isn't an object?\n objectHelper.copyValue(values[propName]),\n // typeof values[propName] === 'object' ? objectHelper.copyValue(values[propName]) : values[propName],\n makeSetHandler(propName)\n );\n\n if (Array.isArray(values[propName])) {\n Object.freeze(self[propName]);\n }\n }\n }", "function propertyNull() {\n delete this[name];\n }", "function propertyNull() {\n delete this[name];\n }", "function makeImmutableObject(obj) {\n\t if (!globalConfig.use_static) {\n\t addPropertyTo(obj, \"merge\", merge);\n\t addPropertyTo(obj, \"replace\", objectReplace);\n\t addPropertyTo(obj, \"without\", without);\n\t addPropertyTo(obj, \"asMutable\", asMutableObject);\n\t addPropertyTo(obj, \"set\", objectSet);\n\t addPropertyTo(obj, \"setIn\", objectSetIn);\n\t addPropertyTo(obj, \"update\", update);\n\t addPropertyTo(obj, \"updateIn\", updateIn);\n\t addPropertyTo(obj, \"getIn\", getIn);\n\t }\n\t\n\t return makeImmutable(obj, mutatingObjectMethods);\n\t }", "function makeImmutableObject(obj) {\n if (!globalConfig.use_static) {\n addPropertyTo(obj, \"merge\", merge);\n addPropertyTo(obj, \"replace\", objectReplace);\n addPropertyTo(obj, \"without\", without);\n addPropertyTo(obj, \"asMutable\", asMutableObject);\n addPropertyTo(obj, \"set\", objectSet);\n addPropertyTo(obj, \"setIn\", objectSetIn);\n addPropertyTo(obj, \"update\", update);\n addPropertyTo(obj, \"updateIn\", updateIn);\n addPropertyTo(obj, \"getIn\", getIn);\n }\n\n return makeImmutable(obj, mutatingObjectMethods);\n }", "function makeImmutableObject(obj) {\n\t if (!globalConfig.use_static) {\n\t addPropertyTo(obj, \"merge\", merge);\n\t addPropertyTo(obj, \"replace\", objectReplace);\n\t addPropertyTo(obj, \"without\", without);\n\t addPropertyTo(obj, \"asMutable\", asMutableObject);\n\t addPropertyTo(obj, \"set\", objectSet);\n\t addPropertyTo(obj, \"setIn\", objectSetIn);\n\t addPropertyTo(obj, \"update\", update);\n\t addPropertyTo(obj, \"updateIn\", updateIn);\n\t addPropertyTo(obj, \"getIn\", getIn);\n\t }\n\n\t return makeImmutable(obj, mutatingObjectMethods);\n\t }", "function makeImmutableObject(obj) {\n\t if (!globalConfig.use_static) {\n\t addPropertyTo(obj, \"merge\", merge);\n\t addPropertyTo(obj, \"replace\", objectReplace);\n\t addPropertyTo(obj, \"without\", without);\n\t addPropertyTo(obj, \"asMutable\", asMutableObject);\n\t addPropertyTo(obj, \"set\", objectSet);\n\t addPropertyTo(obj, \"setIn\", objectSetIn);\n\t addPropertyTo(obj, \"update\", update);\n\t addPropertyTo(obj, \"updateIn\", updateIn);\n\t addPropertyTo(obj, \"getIn\", getIn);\n\t }\n\n\t return makeImmutable(obj, mutatingObjectMethods);\n\t }", "constructor() {\n\t\tproperties.set(this, Object.setPrototypeOf({}, null));\n\t}", "makeProp(prop, value) {\n\t\tObject.defineProperty(this, prop, {\n\t\t\tvalue,\n\t\t\tenumerable: false,\n\t\t\twritable: true,\n\t\t\tconfigurable: true\n\t\t});\n\t}", "function readOnlyAttr (obj, name, value) {\n Object.defineProperty(obj, name, {\n value: value,\n writable: false\n })\n}", "function property(e){// tslint:disable-next-line:no-any decorator\nreturn(t,n)=>n===void 0?standardProperty(e,t):legacyProperty(e,t,n)}", "function propertyNull() {\n delete this[name];\n }", "set None(value) {}", "set None(value) {}", "set None(value) {}", "set None(value) {}", "function MakeRef() {\n return { value: false };\n}", "function MakeRef() {\n return { value: false };\n}", "function MakeRef() {\n return { value: false };\n}", "function MakeRef() {\n return { value: false };\n}", "function readOnlyEnumProp(value) {\n return {\n enumerable: true,\n configurable: false,\n writable: false,\n value: value\n };\n }", "computedProp() {\n\t\treturn null\n\t}", "get None() {}", "get None() {}", "get None() {}", "get None() {}", "function createNullWriter() {\n return freezeObject({\n startRender: noOp,\n endRender: noOp,\n startElement: noOp,\n selfCloseElement: noOp,\n endElement: noOp,\n comment: noOp,\n docType: noOp,\n content: noOp,\n rawContent: noOp\n });\n}", "function fixedProp(obj, name, value) {\n\t Object.defineProperty(obj, name, {\n\t configurable: true,\n\t enumerable: false,\n\t value: value,\n\t writable: false\n\t });\n\t}", "get readonly() { return this._readonly; }", "function overwritable(value) {\n return function (target, propertyName) {\n var newDescriptor = {\n //this prevents every writing access, even the constructor\n writable: value\n };\n return newDescriptor;\n };\n}", "get nullify () {\n\t\treturn this._nullify;\n\t}", "function shallowReadonly(target) {\n return createReactiveObject(target, true, shallowReadonlyHandlers, shallowReadonlyCollectionHandlers, shallowReadonlyMap);\n}", "function shallowReadonly(target) {\n return createReactiveObject(target, true, shallowReadonlyHandlers, shallowReadonlyCollectionHandlers, shallowReadonlyMap);\n}", "function shallowReadonly(target) {\n return createReactiveObject(target, true, shallowReadonlyHandlers, shallowReadonlyCollectionHandlers, shallowReadonlyMap);\n}", "function shallowReadonly(target) {\n return createReactiveObject(target, true, shallowReadonlyHandlers, shallowReadonlyCollectionHandlers, shallowReadonlyMap);\n}", "function shallowReadonly(target) {\n return createReactiveObject(target, true, shallowReadonlyHandlers, shallowReadonlyCollectionHandlers, shallowReadonlyMap);\n}", "function shallowReadonly(target) {\n return createReactiveObject(target, true, shallowReadonlyHandlers, shallowReadonlyCollectionHandlers, shallowReadonlyMap);\n}", "function shallowReadonly(target) {\n return createReactiveObject(target, true, shallowReadonlyHandlers, shallowReadonlyCollectionHandlers, shallowReadonlyMap);\n}", "function shallowReadonly(target) {\r\n return createReactiveObject(target, true, shallowReadonlyHandlers, shallowReadonlyCollectionHandlers, shallowReadonlyMap);\r\n}", "function shallowReadonly(target) {\r\n return createReactiveObject(target, true, shallowReadonlyHandlers, shallowReadonlyCollectionHandlers, shallowReadonlyMap);\r\n}", "function shallowReadonly(target) {\r\n return createReactiveObject(target, true, shallowReadonlyHandlers, shallowReadonlyCollectionHandlers, shallowReadonlyMap);\r\n}", "function property(options){// tslint:disable-next-line:no-any decorator\nreturn(protoOrDescriptor,name)=>name!==void 0?legacyProperty(options,protoOrDescriptor,name):standardProperty(options,protoOrDescriptor)}", "function never() {\n return struct('never', () => false);\n}", "function never() {\n return struct('never', () => false);\n}", "function makeReflect(propName, descriptor) {\n if (!descriptor.reflectAttribute) {\n return noop;\n }\n\n var attrName = descriptor.attribute || propName;\n\n return function doReflect(value, silent) {\n // Reflect the property\n if (value === false || value === null) {\n // Non-truthy attributes should be destroyed\n this.removeAttribute(attrName);\n }\n else {\n // Boolean true for a value just means the property should exist\n if (value === true) {\n value = '';\n }\n\n // Only perform the set if the attribute is of a different value\n // This avoids triggering mutation observers unnecessarily\n if (this.getAttribute(attrName) !== value) {\n this.setAttribute(attrName, value);\n }\n }\n };\n }", "function createXNodeReadOnlyProperty(propertyName) {\n\t\tObject.defineProperty(XNode.prototype, propertyName, {\n\t\t\tget: function() {\n\t\t\t\treturn this.node[propertyName];\n\t\t\t}\n\t\t});\n\t}", "get readonly() {\n return this._readonly;\n }", "_upgradeProperty(prop) {\n // https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties\n // https://developers.google.com/web/fundamentals/web-components/examples/howto-checkbox\n /* eslint no-prototype-builtins: 0 */\n if (this.hasOwnProperty(prop)) {\n const value = this[prop];\n // get rid of the property that might shadow a setter/getter\n delete this[prop];\n // this time if a setter was defined it will be properly called\n this[prop] = value;\n // if a getter was defined, it will be called from now on\n }\n }", "static createProperty(e,t=defaultPropertyDeclaration){// Do not generate an accessor if the prototype already has one, since\n// it would be lost otherwise and that would never be the user's intention;\n// Instead, we expect users to call `requestUpdate` themselves from\n// user-defined accessors. Note that if the super has an accessor we will\n// still overwrite it\nif(this._ensureClassProperties(),this._classProperties.set(e,t),t.noAccessor||this.prototype.hasOwnProperty(e))return;const n=\"symbol\"==typeof e?Symbol():`__${e}`;Object.defineProperty(this.prototype,e,{// tslint:disable-next-line:no-any no symbol in index\nget(){return this[n]},set(t){const r=this[e];this[n]=t,this._requestUpdate(e,r)},configurable:!0,enumerable:!0})}", "function readonly(target) {\n return createReactiveObject(target, true, readonlyHandlers, readonlyCollectionHandlers, readonlyMap);\n}", "function readonly(target) {\n return createReactiveObject(target, true, readonlyHandlers, readonlyCollectionHandlers, readonlyMap);\n}", "function readonly(target) {\n return createReactiveObject(target, true, readonlyHandlers, readonlyCollectionHandlers, readonlyMap);\n}", "function readonly(target) {\n return createReactiveObject(target, true, readonlyHandlers, readonlyCollectionHandlers, readonlyMap);\n}", "function readonly(target) {\n return createReactiveObject(target, true, readonlyHandlers, readonlyCollectionHandlers, readonlyMap);\n}", "function readonly(target) {\n return createReactiveObject(target, true, readonlyHandlers, readonlyCollectionHandlers, readonlyMap);\n}", "function readonly(target) {\n return createReactiveObject(target, true, readonlyHandlers, readonlyCollectionHandlers, readonlyMap);\n}", "function readonly(target) {\n return createReactiveObject(target, true, readonlyHandlers, readonlyCollectionHandlers, readonlyMap);\n}", "static set property(){}", "get not() {\n this.negate = !this.negate;\n return this;\n }", "function readonly(target) {\n return createReactiveObject(target, true, readonlyHandlers, readonlyCollectionHandlers, readonlyMap);\n}", "function readonly(target) {\r\n return createReactiveObject(target, true, readonlyHandlers, readonlyCollectionHandlers, readonlyMap);\r\n}", "function readonly(target) {\r\n return createReactiveObject(target, true, readonlyHandlers, readonlyCollectionHandlers, readonlyMap);\r\n}", "function readonly(target) {\r\n return createReactiveObject(target, true, readonlyHandlers, readonlyCollectionHandlers, readonlyMap);\r\n}", "function shallowReadonly(target) {\r\n return createReactiveObject(target, true, shallowReadonlyHandlers, readonlyCollectionHandlers);\r\n}", "function addNonEnumerableProperty(obj, name, value) {\n Object.defineProperty(obj, name, {\n // enumerable: false, // the default, so we can save on bundle size by not explicitly setting it\n value: value,\n writable: true,\n configurable: true,\n });\n }", "function readonly(obj) {\n\n return reactiveMembrane.getReadOnlyProxy(obj);\n }", "function shallowReadonly(target) {\n return createReactiveObject(target, true, shallowReadonlyHandlers, readonlyCollectionHandlers);\n}", "function shallowReadonly(target) {\n return createReactiveObject(target, true, shallowReadonlyHandlers, readonlyCollectionHandlers);\n}", "function addNonEnumerableProperty(obj, name, value) {\n Object.defineProperty(obj, name, {\n // enumerable: false, // the default, so we can save on bundle size by not explicitly setting it\n value: value,\n writable: true,\n configurable: true,\n });\n}", "static get NOTHING() {\n return \"xx\";\n }", "nullable() {\n return this.ofType;\n }", "function makeSetHandler (propName) {\n return function () {\n var err = new Exception(locale.errorTypes.readOnlyViolation, new Error('Cannot set `' + propName + '`. This object is immutable'));\n config.onError(err);\n return err;\n };\n }", "function setter() {\n throw new Error('vuex getter properties are read-only.');\n }", "function fakeSetOrMap() {\n return {\n add: noop,\n delete: noop,\n get: noop,\n set: noop,\n has: function (k) {\n return false;\n }\n };\n } // Safe hasOwnProperty", "function shallowProperty(key) {\n return function(obj) {\n return obj == null ? void 0 : obj[key];\n };\n }", "function shallowProperty(key) {\n return function(obj) {\n return obj == null ? void 0 : obj[key];\n };\n }", "function shallowProperty(key) {\n return function(obj) {\n return obj == null ? void 0 : obj[key];\n };\n }", "function shallowProperty(key) {\n return function(obj) {\n return obj == null ? void 0 : obj[key];\n };\n }", "function shallowProperty(key) {\n return function(obj) {\n return obj == null ? void 0 : obj[key];\n };\n }", "function shallowProperty(key) {\n return function(obj) {\n return obj == null ? void 0 : obj[key];\n };\n }", "function shallowProperty(key) {\n return function(obj) {\n return obj == null ? void 0 : obj[key];\n };\n }", "function shallowProperty(key) {\n return function(obj) {\n return obj == null ? void 0 : obj[key];\n };\n }", "function shallowProperty(key) {\n return function(obj) {\n return obj == null ? void 0 : obj[key];\n };\n }", "function setter() {\n\t throw new Error('vuex getter properties are read-only.');\n\t }", "function makePropertyMetadata(key) {\n if (key === '__proto__') {\n throw new Error(\n '__proto__ has a special meaning that is incompatible with POJOs');\n }\n const rawProperty = rawProperties[key];\n const property = {};\n setPrototypeOf(property, null);\n properties[key] = property;\n\n const hasDefault = hasOwn(rawProperty, 'default');\n const defaultValue = hasDefault ? rawProperty.default : null;\n if (hasDefault) {\n defaultKeys.push(key);\n property.default = defaultValue;\n }\n\n property.required = hasOwn(rawProperty, 'required') ?\n rawProperty.required === true :\n !hasDefault;\n if (property.required) {\n requiredKeys.push(key);\n }\n\n if (hasOwn(rawProperty, 'value')) {\n property.value = rawProperty.value;\n }\n\n if (hasOwn(rawProperty, 'recurse') ?\n rawProperty.recurse === true :\n // Do not recurse by default to fields with mandated values.\n !hasOwn(rawProperty, 'value')) {\n recurseToKeys.push(key);\n }\n\n let rawConvert = hasOwn(rawProperty, 'convert') ?\n rawProperty.convert : null;\n if (typeof rawConvert !== 'function') {\n rawConvert = null;\n }\n\n const hasInnocuous = hasOwn(rawProperty, 'innocuous');\n const requireTrusted = hasOwn(rawProperty, 'trusted') ?\n rawProperty.trusted === true :\n hasInnocuous;\n\n let type = hasOwn(rawProperty, 'type') ?\n rawProperty.type : null;\n if (typeof type !== 'string' && typeof type !== 'function') {\n type = null;\n }\n\n const requiresValue = hasOwn(rawProperty, 'value');\n const requiredValue = requiresValue && rawProperty.value;\n\n const innocuous = hasInnocuous ?\n rawProperty.innocuous : defaultValue;\n\n if (requireTrusted || type || requiresValue) {\n property.convert = function convert(value, trusted, userContext, notApplicable) {\n if (requiresValue) {\n // TODO: NaN\n if (requiredValue !== value) {\n return notApplicable;\n }\n } else if (type) {\n switch (typeof type) {\n case 'string':\n if (type !== typeof value) {\n return notApplicable;\n }\n break;\n case 'function':\n // TODO: substitute Array for isArray, etc.\n if (!(value && value instanceof type)) {\n return notApplicable;\n }\n break;\n default:\n }\n }\n const tvalue = requireTrusted && !trusted ? innocuous : value;\n return (rawConvert) ?\n rawConvert(tvalue, trusted, userContext, notApplicable) : tvalue;\n };\n } else if (rawConvert) {\n property.convert = rawConvert;\n }\n if (property.convert) {\n convertKeys.push(key);\n }\n }", "get asOptional() {\n return optional(this.get, this.set)\n }", "function readonly(target) {\n return createReactiveObject(target, true, readonlyHandlers, readonlyCollectionHandlers);\n}", "function isImmutable(obj) {\n return isObject(obj) && !!obj['@@__IMMUTABLE_ITERABLE__@@'];\n}", "function def(obj, name, value, enumerable) {\n Object.defineProperty(obj, name, {\n value: value,\n enumerable: !! enumerable,\n writable: false,\n configurable: false\n });\n return value;\n}", "function def(obj, name, value, enumerable) {\n Object.defineProperty(obj, name, {\n value: value,\n enumerable: !! enumerable,\n writable: false,\n configurable: false\n });\n return value;\n}", "function makeHash() {\n return Object.create(null)\n}", "function canDefineNonEnumerableProperties() {\n var testObj = {};\n var testPropName = \"t\";\n\n try {\n Object.defineProperty(testObj, testPropName, {\n enumerable: false,\n value: testObj\n });\n\n for (var k in testObj) {\n if (k === testPropName) {\n return false;\n }\n }\n } catch (e) {\n return false;\n }\n\n return testObj[testPropName] === testObj;\n }", "get none() {\n return this.any.not;\n }", "get none() {\n return this.any.not;\n }", "get none() {\n return this.any.not;\n }", "notNull() {\n return new ColumnDefinitionBuilder(ColumnDefinitionNode.cloneWith(this.#node, { notNull: true }));\n }", "function shallowReadonly(target) {\n return createReactiveObject(target, true, shallowReadonlyHandlers, readonlyCollectionHandlers);\n }", "function shallowReadonly(target) {\n return createReactiveObject(target, true, shallowReadonlyHandlers, readonlyCollectionHandlers);\n }" ]
[ "0.6054209", "0.59780294", "0.5920431", "0.5707005", "0.5707005", "0.5630741", "0.562664", "0.5625052", "0.5625052", "0.56013256", "0.55963504", "0.5557508", "0.55510676", "0.55313903", "0.5501012", "0.5501012", "0.5501012", "0.5501012", "0.5448218", "0.5448218", "0.5448218", "0.5448218", "0.5444262", "0.5379232", "0.537009", "0.537009", "0.537009", "0.537009", "0.53672093", "0.5315163", "0.5299616", "0.5283846", "0.5272769", "0.5259536", "0.5259536", "0.5259536", "0.5259536", "0.5259536", "0.5259536", "0.5259536", "0.52535725", "0.52535725", "0.52535725", "0.5243322", "0.5224318", "0.5224318", "0.52213687", "0.5143481", "0.5081271", "0.5076542", "0.507143", "0.5065359", "0.5065359", "0.5065359", "0.5065359", "0.5065359", "0.5065359", "0.5065359", "0.5065359", "0.5061908", "0.50595474", "0.5056244", "0.5040813", "0.5040813", "0.5040813", "0.5036777", "0.50355065", "0.50306493", "0.50253636", "0.50253636", "0.4993126", "0.4991738", "0.49857485", "0.49853572", "0.4982592", "0.49799052", "0.49792808", "0.49792808", "0.49792808", "0.49792808", "0.49792808", "0.49792808", "0.49792808", "0.49792808", "0.49792808", "0.49466923", "0.4935337", "0.4935027", "0.49275059", "0.4919673", "0.490971", "0.490971", "0.49055222", "0.49040368", "0.4901911", "0.4901911", "0.4901911", "0.49016535", "0.48990315", "0.48990315" ]
0.6763025
0
makeReadOnlyNullProperty / make a set handler that returns an exception
function makeSetHandler (propName) { return function () { var err = new Exception(locale.errorTypes.readOnlyViolation, new Error('Cannot set `' + propName + '`. This object is immutable')); config.onError(err); return err; }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function makeReadOnlyNullProperty (self, propName) {\n objectHelper.setReadOnlyProperty(self, propName, null, makeSetHandler(propName));\n }", "function setter() {\n\t throw new Error('vuex getter properties are read-only.');\n\t }", "set booking(stuff){\n throw \"sorry you cannot do this\"\n }", "function setter() {\n throw new Error('vuex getter properties are read-only.');\n }", "function property(e){// tslint:disable-next-line:no-any decorator\nreturn(t,n)=>n===void 0?standardProperty(e,t):legacyProperty(e,t,n)}", "static set property(){}", "set FastButNoExceptions(value) {}", "function e(r) {\n return r ? r.__accessor__ ? r.__accessor__ : r.propertyInvalidated ? r : null : null;\n }", "function setterError() {\n console.error('[Litex][error] : Cannot mutate state property outside of a mutation');\n}", "set property(){}", "_set(key) {\n throw Error(\"Needs implementation\");\n }", "function safeSetStyle(el, property, value) {\n if (property in el.style) {\n el.style[property] = value;\n }\n else {\n // tslint:disable-next-line:no-console\n console.warn(new Error(`Trying to set non-existing style ` +\n `${property} = ${value} on a <${el.tagName.toLowerCase()}>.`));\n }\n}", "set None(value) {}", "set None(value) {}", "set None(value) {}", "set None(value) {}", "function wrapproperty(obj,prop,message){if(!obj||(typeof obj==='undefined'?'undefined':(0,_typeof3.default)(obj))!=='object'&&typeof obj!=='function'){throw new TypeError('argument obj must be object');}var descriptor=(0,_getOwnPropertyDescriptor2.default)(obj,prop);if(!descriptor){throw new TypeError('must call property on owner object');}if(!descriptor.configurable){throw new TypeError('property must be configurable');}}", "defineGetterPropertyValue(prop, instance, getterHandler) {\n if (prop && getterHandler) {\n if (prop.propertyName) {\n Object.defineProperty(instance, prop.propertyName, {\n get: () => { var _a; return getterHandler(prop.propertyName, (_a = prop.metadata) !== null && _a !== void 0 ? _a : {}, instance); },\n configurable: true,\n enumerable: true,\n });\n }\n }\n }", "function test() {\n var obj = {};\n Object.defineProperty(obj, 'prop', {\n get: Math.random,\n set: function() { throw Error('setter'); }\n });\n\n var val = obj.prop;\n if (typeof val === 'number') {\n print('val is a number');\n } else {\n print('val is not a number');\n }\n}", "set hotels(_) {\n throw new Error('You can not overwrite hotels!'); \n }", "function validMember (obj, key, validator, def) {\n Object.defineProperty(obj, key, (function () {\n var val = def;\n return {\n set : function (v) { val = validator(v); },\n get : function () { return val }\n };\n })());\n}", "function setup_property(obj, prop, opts, failsafe) {\n\ttry {\n\t\t_setup_property(obj, prop, opts);\n\t} catch (err) {\n\t\tobj[prop] = failsafe;\n\t}\n}", "_redefineProperty(propertyName) {\n const that = this;\n\n Object.defineProperty(that, propertyName, {\n get: function () {\n return that.properties[propertyName].value;\n },\n set(value) {\n function replacer(key, value) {\n if (value instanceof JQX.Utilities.BigNumber) {\n return value.toString();\n }\n\n return value;\n }\n\n const oldValue = that.properties[propertyName].value,\n stringifiedOldValue = JSON.stringify(oldValue, replacer),\n stringifiedValue = JSON.stringify(value, replacer);\n\n if (stringifiedOldValue === stringifiedValue) {\n return;\n }\n\n that.properties[propertyName].value = value;\n\n if (that.isReady && (!that.ownerElement || (that.ownerElement && that.ownerElement.isReady)) && that.context !== that) {\n const context = that.context;\n\n that.context = that;\n that.propertyChangedHandler(propertyName, oldValue, value);\n that.context = context;\n }\n }\n });\n }", "_upgradeProperty(prop) {\n // https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties\n // https://developers.google.com/web/fundamentals/web-components/examples/howto-checkbox\n /* eslint no-prototype-builtins: 0 */\n if (this.hasOwnProperty(prop)) {\n const value = this[prop];\n // get rid of the property that might shadow a setter/getter\n delete this[prop];\n // this time if a setter was defined it will be properly called\n this[prop] = value;\n // if a getter was defined, it will be called from now on\n }\n }", "function no_set_attr(klass, attr){\n if(klass[attr] !== undefined){\n throw _b_.AttributeError.$factory(\"'\" + klass.__name__ +\n \"' object attribute '\" + attr + \"' is read-only\")\n }else{\n throw $B.attr_error(attr, klass)\n }\n}", "function _set(property, value) {\n var stringValue = value === null ? \"\" : value.toString();\n (0, _kolmafia.setProperty)(property, stringValue);\n}", "function wrapproperty(obj, prop, message) {\n\t if (!obj || (typeof obj !== 'object' && typeof obj !== 'function')) {\n\t throw new TypeError('argument obj must be object')\n\t }\n\n\t var descriptor = Object.getOwnPropertyDescriptor(obj, prop)\n\n\t if (!descriptor) {\n\t throw new TypeError('must call property on owner object')\n\t }\n\n\t if (!descriptor.configurable) {\n\t throw new TypeError('property must be configurable')\n\t }\n\n\t return\n\t}", "function _defineProperty(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}", "function defineProperty(key,handler,value){Object.defineProperty(ctrl,key,{get:function get(){return value;},set:function set(newValue){var oldValue=value;value=newValue;handler&&handler(newValue,oldValue);}});}", "get value() {\n throw new TypeError('`value` can’t be accessed in an abstract instance of Maybe.Just');\n }", "function useSetHandler(obj, name, setHandler) {\n obj[name + '_setter___'] = setHandler;\n }", "function defineProperty(key,handler,value){Object.defineProperty(ctrl,key,{get:function get(){return value;},set:function set(newValue){var oldValue=value;value=newValue;handler(newValue,oldValue);}});}", "function _defineProperty(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}", "function _defineProperty(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}", "function setExceptionHandler(handler) {\r\n var old = Private.exceptionHandler;\r\n Private.exceptionHandler = handler;\r\n return old;\r\n }", "function raise(value, name) {\n throw new Error('Invalid value `' + value + '` for setting `' + name + '`');\n}", "setItemProperty(key, prop, value) {\n let item = this.retrieveItem(key)\n\n if (item === null) return\n // TODO: Alternatively we could throw an error or log this...\n // Fail silently for now, it shouldn't pose any issues\n\n //if (item.hasOwnProperty(prop)) {\n // TODO: Maybe a notification that we are setting a property that doesn't exist?\n item[prop] = value\n //}\n }", "function property(key){\n return lenz(\n function(obj){\n if(typeof(obj)===\"object\" && obj !== null && _.has(obj, key)){\n return obj[key];\n }\n else{\n return new Error(String(obj) + ' is not an object or does not have property ' + key);\n }\n },\n function(obj, v){\n var nobj = _.clone(obj);\n if(typeof(obj)===\"object\" && obj !== null && _.has(obj, key)){\n nobj[key] = v;\n }\n else{\n nobj[key] = new Error(String(obj) + ' is not an object or does not have property ' + key);\n }\n return nobj;\n }\n );\n }", "function set(target, key, val) {\n if (\n (isUndef(target) || isPrimitive(target))) {\n warn(\"Cannot set reactive property on undefined, null, or primitive value: \" + (target));\n }\n // 替换数组item\n if (Array.isArray(target) && isValidArrayIndex(key)) {\n key = key;\n target.length = Math.max(target.length, key);\n target.splice(key, 1, val);\n return val;\n }\n if (key in target && !(key in Object.prototype)) {\n target[key] = val;\n return val;\n }\n // vue 实例 && $data 不允许set\n var ob = target.__ob__;\n if (target._isVue || (ob && ob.vmCount)) {\n warn('Avoid adding reactive properties to a Vue instance or its root $data ' +\n 'at runtime - declare it upfront in the data option.');\n return val;\n }\n // 不接受未ob对象\n if (!ob) {\n target[key] = val;\n return val;\n }\n // 为新属性创建拦截器\n defineReactive(ob.value, key, val);\n ob.dep.notify();\n return val;\n }", "function wrapproperty (obj, prop, message) {\n if (!obj || (typeof obj !== 'object' && typeof obj !== 'function')) {\n throw new TypeError('argument obj must be object')\n }\n\n var descriptor = Object.getOwnPropertyDescriptor(obj, prop)\n\n if (!descriptor) {\n throw new TypeError('must call property on owner object')\n }\n\n if (!descriptor.configurable) {\n throw new TypeError('property must be configurable')\n }\n}", "function wrapproperty (obj, prop, message) {\n if (!obj || (typeof obj !== 'object' && typeof obj !== 'function')) {\n throw new TypeError('argument obj must be object')\n }\n\n var descriptor = Object.getOwnPropertyDescriptor(obj, prop)\n\n if (!descriptor) {\n throw new TypeError('must call property on owner object')\n }\n\n if (!descriptor.configurable) {\n throw new TypeError('property must be configurable')\n }\n}", "function wrapproperty (obj, prop, message) {\n if (!obj || (typeof obj !== 'object' && typeof obj !== 'function')) {\n throw new TypeError('argument obj must be object')\n }\n\n var descriptor = Object.getOwnPropertyDescriptor(obj, prop)\n\n if (!descriptor) {\n throw new TypeError('must call property on owner object')\n }\n\n if (!descriptor.configurable) {\n throw new TypeError('property must be configurable')\n }\n}", "function wrapproperty (obj, prop, message) {\n if (!obj || (typeof obj !== 'object' && typeof obj !== 'function')) {\n throw new TypeError('argument obj must be object')\n }\n\n var descriptor = Object.getOwnPropertyDescriptor(obj, prop)\n\n if (!descriptor) {\n throw new TypeError('must call property on owner object')\n }\n\n if (!descriptor.configurable) {\n throw new TypeError('property must be configurable')\n }\n}", "static createProperty(e,t=defaultPropertyDeclaration){// Do not generate an accessor if the prototype already has one, since\n// it would be lost otherwise and that would never be the user's intention;\n// Instead, we expect users to call `requestUpdate` themselves from\n// user-defined accessors. Note that if the super has an accessor we will\n// still overwrite it\nif(this._ensureClassProperties(),this._classProperties.set(e,t),t.noAccessor||this.prototype.hasOwnProperty(e))return;const n=\"symbol\"==typeof e?Symbol():`__${e}`;Object.defineProperty(this.prototype,e,{// tslint:disable-next-line:no-any no symbol in index\nget(){return this[n]},set(t){const r=this[e];this[n]=t,this._requestUpdate(e,r)},configurable:!0,enumerable:!0})}", "_get () {\n throw new Error('_get not implemented')\n }", "function overwritable(value) {\n return function (target, propertyName) {\n var newDescriptor = {\n //this prevents every writing access, even the constructor\n writable: value\n };\n return newDescriptor;\n };\n}", "function MANDATORY_SETTER_FUNCTION(name) {\n function SETTER_FUNCTION(value) {\n var m = peekMeta(this);\n if (!m.isInitialized(this)) {\n m.writeValues(name, value);\n } else {\n true && !false && emberDebug.assert('You must use set() to set the `' + name + '` property (of ' + this + ') to `' + value + '`.', false);\n }\n }\n\n SETTER_FUNCTION.isMandatorySetter = true;\n return SETTER_FUNCTION;\n }", "function MANDATORY_SETTER_FUNCTION(name) {\n function SETTER_FUNCTION(value) {\n var m = peekMeta(this);\n if (!m.isInitialized(this)) {\n m.writeValues(name, value);\n } else {\n true && !false && emberDebug.assert('You must use set() to set the `' + name + '` property (of ' + this + ') to `' + value + '`.', false);\n }\n }\n\n SETTER_FUNCTION.isMandatorySetter = true;\n return SETTER_FUNCTION;\n }", "function MANDATORY_SETTER_FUNCTION(name) {\n function SETTER_FUNCTION(value) {\n var m = peekMeta(this);\n if (!m.isInitialized(this)) {\n m.writeValues(name, value);\n } else {\n true && !false && emberDebug.assert('You must use set() to set the `' + name + '` property (of ' + this + ') to `' + value + '`.', false);\n }\n }\n\n SETTER_FUNCTION.isMandatorySetter = true;\n return SETTER_FUNCTION;\n }", "function fakeSetOrMap() {\n return {\n add: noop,\n delete: noop,\n get: noop,\n set: noop,\n has: function (k) {\n return false;\n }\n };\n } // Safe hasOwnProperty", "function MANDATORY_SETTER_FUNCTION(name) {\n function SETTER_FUNCTION(value) {\n var m = exports.peekMeta(this);\n if (!m.isInitialized(this)) {\n m.writeValues(name, value);\n } else {\n true && !false && emberDebug.assert('You must use Ember.set() to set the `' + name + '` property (of ' + this + ') to `' + value + '`.', false);\n }\n }\n\n SETTER_FUNCTION.isMandatorySetter = true;\n return SETTER_FUNCTION;\n }", "function MANDATORY_SETTER_FUNCTION(name) {\n return function SETTER_FUNCTION(value) {\n _emberMetalCore.default.assert('You must use Ember.set() to set the `' + name + '` property (of ' + this + ') to `' + value + '`.', false);\n };\n }", "function MANDATORY_SETTER_FUNCTION(name) {\n return function SETTER_FUNCTION(value) {\n _emberMetalCore.default.assert('You must use Ember.set() to set the `' + name + '` property (of ' + this + ') to `' + value + '`.', false);\n };\n }", "function set (target, key, val) {\n if (false\n ) {\n warn((\"Cannot set reactive property on undefined, null, or primitive value: \" + ((target))));\n }\n if (Array.isArray(target) && isValidArrayIndex(key)) {\n target.length = Math.max(target.length, key);\n target.splice(key, 1, val);\n return val\n }\n if (key in target && !(key in Object.prototype)) {\n target[key] = val;\n return val\n }\n var ob = (target).__ob__;\n if (target._isVue || (ob && ob.vmCount)) {\n \"production\" !== 'production' && warn(\n 'Avoid adding reactive properties to a Vue instance or its root $data ' +\n 'at runtime - declare it upfront in the data option.'\n );\n return val\n }\n if (!ob) {\n target[key] = val;\n return val\n }\n defineReactive$$1(ob.value, key, val);\n ob.dep.notify();\n return val\n}", "function set (target, key, val) {\n if (false\n ) {\n warn((\"Cannot set reactive property on undefined, null, or primitive value: \" + ((target))));\n }\n if (Array.isArray(target) && isValidArrayIndex(key)) {\n target.length = Math.max(target.length, key);\n target.splice(key, 1, val);\n return val\n }\n if (key in target && !(key in Object.prototype)) {\n target[key] = val;\n return val\n }\n var ob = (target).__ob__;\n if (target._isVue || (ob && ob.vmCount)) {\n \"production\" !== 'production' && warn(\n 'Avoid adding reactive properties to a Vue instance or its root $data ' +\n 'at runtime - declare it upfront in the data option.'\n );\n return val\n }\n if (!ob) {\n target[key] = val;\n return val\n }\n defineReactive$$1(ob.value, key, val);\n ob.dep.notify();\n return val\n}", "function set (target, key, val) {\n if (false\n ) {\n warn((\"Cannot set reactive property on undefined, null, or primitive value: \" + ((target))));\n }\n if (Array.isArray(target) && isValidArrayIndex(key)) {\n target.length = Math.max(target.length, key);\n target.splice(key, 1, val);\n return val\n }\n if (key in target && !(key in Object.prototype)) {\n target[key] = val;\n return val\n }\n var ob = (target).__ob__;\n if (target._isVue || (ob && ob.vmCount)) {\n \"production\" !== 'production' && warn(\n 'Avoid adding reactive properties to a Vue instance or its root $data ' +\n 'at runtime - declare it upfront in the data option.'\n );\n return val\n }\n if (!ob) {\n target[key] = val;\n return val\n }\n defineReactive$$1(ob.value, key, val);\n ob.dep.notify();\n return val\n}", "function set (target, key, val) {\n if (false\n ) {\n warn((\"Cannot set reactive property on undefined, null, or primitive value: \" + ((target))));\n }\n if (Array.isArray(target) && isValidArrayIndex(key)) {\n target.length = Math.max(target.length, key);\n target.splice(key, 1, val);\n return val\n }\n if (key in target && !(key in Object.prototype)) {\n target[key] = val;\n return val\n }\n var ob = (target).__ob__;\n if (target._isVue || (ob && ob.vmCount)) {\n \"production\" !== 'production' && warn(\n 'Avoid adding reactive properties to a Vue instance or its root $data ' +\n 'at runtime - declare it upfront in the data option.'\n );\n return val\n }\n if (!ob) {\n target[key] = val;\n return val\n }\n defineReactive$$1(ob.value, key, val);\n ob.dep.notify();\n return val\n}", "function set (target, key, val) {\n if (false\n ) {\n warn((\"Cannot set reactive property on undefined, null, or primitive value: \" + ((target))));\n }\n if (Array.isArray(target) && isValidArrayIndex(key)) {\n target.length = Math.max(target.length, key);\n target.splice(key, 1, val);\n return val\n }\n if (key in target && !(key in Object.prototype)) {\n target[key] = val;\n return val\n }\n var ob = (target).__ob__;\n if (target._isVue || (ob && ob.vmCount)) {\n \"production\" !== 'production' && warn(\n 'Avoid adding reactive properties to a Vue instance or its root $data ' +\n 'at runtime - declare it upfront in the data option.'\n );\n return val\n }\n if (!ob) {\n target[key] = val;\n return val\n }\n defineReactive$$1(ob.value, key, val);\n ob.dep.notify();\n return val\n}", "function set (target, key, val) {\n if (false\n ) {\n warn((\"Cannot set reactive property on undefined, null, or primitive value: \" + ((target))));\n }\n if (Array.isArray(target) && isValidArrayIndex(key)) {\n target.length = Math.max(target.length, key);\n target.splice(key, 1, val);\n return val\n }\n if (key in target && !(key in Object.prototype)) {\n target[key] = val;\n return val\n }\n var ob = (target).__ob__;\n if (target._isVue || (ob && ob.vmCount)) {\n \"production\" !== 'production' && warn(\n 'Avoid adding reactive properties to a Vue instance or its root $data ' +\n 'at runtime - declare it upfront in the data option.'\n );\n return val\n }\n if (!ob) {\n target[key] = val;\n return val\n }\n defineReactive$$1(ob.value, key, val);\n ob.dep.notify();\n return val\n}", "function set (target, key, val) {\n if (false\n ) {\n warn((\"Cannot set reactive property on undefined, null, or primitive value: \" + ((target))));\n }\n if (Array.isArray(target) && isValidArrayIndex(key)) {\n target.length = Math.max(target.length, key);\n target.splice(key, 1, val);\n return val\n }\n if (key in target && !(key in Object.prototype)) {\n target[key] = val;\n return val\n }\n var ob = (target).__ob__;\n if (target._isVue || (ob && ob.vmCount)) {\n \"production\" !== 'production' && warn(\n 'Avoid adding reactive properties to a Vue instance or its root $data ' +\n 'at runtime - declare it upfront in the data option.'\n );\n return val\n }\n if (!ob) {\n target[key] = val;\n return val\n }\n defineReactive$$1(ob.value, key, val);\n ob.dep.notify();\n return val\n}", "function set (target, key, val) {\n if (false\n ) {\n warn((\"Cannot set reactive property on undefined, null, or primitive value: \" + ((target))));\n }\n if (Array.isArray(target) && isValidArrayIndex(key)) {\n target.length = Math.max(target.length, key);\n target.splice(key, 1, val);\n return val\n }\n if (key in target && !(key in Object.prototype)) {\n target[key] = val;\n return val\n }\n var ob = (target).__ob__;\n if (target._isVue || (ob && ob.vmCount)) {\n \"production\" !== 'production' && warn(\n 'Avoid adding reactive properties to a Vue instance or its root $data ' +\n 'at runtime - declare it upfront in the data option.'\n );\n return val\n }\n if (!ob) {\n target[key] = val;\n return val\n }\n defineReactive$$1(ob.value, key, val);\n ob.dep.notify();\n return val\n}", "function set (target, key, val) {\n if (false\n ) {\n warn((\"Cannot set reactive property on undefined, null, or primitive value: \" + ((target))));\n }\n if (Array.isArray(target) && isValidArrayIndex(key)) {\n target.length = Math.max(target.length, key);\n target.splice(key, 1, val);\n return val\n }\n if (key in target && !(key in Object.prototype)) {\n target[key] = val;\n return val\n }\n var ob = (target).__ob__;\n if (target._isVue || (ob && ob.vmCount)) {\n \"production\" !== 'production' && warn(\n 'Avoid adding reactive properties to a Vue instance or its root $data ' +\n 'at runtime - declare it upfront in the data option.'\n );\n return val\n }\n if (!ob) {\n target[key] = val;\n return val\n }\n defineReactive(ob.value, key, val);\n ob.dep.notify();\n return val\n}", "function set (target, key, val) {\n if (false\n ) {\n warn((\"Cannot set reactive property on undefined, null, or primitive value: \" + ((target))));\n }\n if (Array.isArray(target) && isValidArrayIndex(key)) {\n target.length = Math.max(target.length, key);\n target.splice(key, 1, val);\n return val\n }\n if (key in target && !(key in Object.prototype)) {\n target[key] = val;\n return val\n }\n var ob = (target).__ob__;\n if (target._isVue || (ob && ob.vmCount)) {\n \"production\" !== 'production' && warn(\n 'Avoid adding reactive properties to a Vue instance or its root $data ' +\n 'at runtime - declare it upfront in the data option.'\n );\n return val\n }\n if (!ob) {\n target[key] = val;\n return val\n }\n defineReactive(ob.value, key, val);\n ob.dep.notify();\n return val\n}", "function set (target, key, val) {\n if (false\n ) {\n warn((\"Cannot set reactive property on undefined, null, or primitive value: \" + ((target))));\n }\n if (Array.isArray(target) && isValidArrayIndex(key)) {\n target.length = Math.max(target.length, key);\n target.splice(key, 1, val);\n return val\n }\n if (key in target && !(key in Object.prototype)) {\n target[key] = val;\n return val\n }\n var ob = (target).__ob__;\n if (target._isVue || (ob && ob.vmCount)) {\n \"production\" !== 'production' && warn(\n 'Avoid adding reactive properties to a Vue instance or its root $data ' +\n 'at runtime - declare it upfront in the data option.'\n );\n return val\n }\n if (!ob) {\n target[key] = val;\n return val\n }\n defineReactive(ob.value, key, val);\n ob.dep.notify();\n return val\n}", "function set (target, key, val) {\n if (false\n ) {\n warn((\"Cannot set reactive property on undefined, null, or primitive value: \" + ((target))));\n }\n if (Array.isArray(target) && isValidArrayIndex(key)) {\n target.length = Math.max(target.length, key);\n target.splice(key, 1, val);\n return val\n }\n if (key in target && !(key in Object.prototype)) {\n target[key] = val;\n return val\n }\n var ob = (target).__ob__;\n if (target._isVue || (ob && ob.vmCount)) {\n \"production\" !== 'production' && warn(\n 'Avoid adding reactive properties to a Vue instance or its root $data ' +\n 'at runtime - declare it upfront in the data option.'\n );\n return val\n }\n if (!ob) {\n target[key] = val;\n return val\n }\n defineReactive(ob.value, key, val);\n ob.dep.notify();\n return val\n}", "function set (target, key, val) {\n\t if (false\n\t ) {\n\t warn((\"Cannot set reactive property on undefined, null, or primitive value: \" + ((target))));\n\t }\n\t if (Array.isArray(target) && isValidArrayIndex(key)) {\n\t target.length = Math.max(target.length, key);\n\t target.splice(key, 1, val);\n\t return val\n\t }\n\t if (key in target && !(key in Object.prototype)) {\n\t target[key] = val;\n\t return val\n\t }\n\t var ob = (target).__ob__;\n\t if (target._isVue || (ob && ob.vmCount)) {\n\t (\"production\") !== 'production' && warn(\n\t 'Avoid adding reactive properties to a Vue instance or its root $data ' +\n\t 'at runtime - declare it upfront in the data option.'\n\t );\n\t return val\n\t }\n\t if (!ob) {\n\t target[key] = val;\n\t return val\n\t }\n\t defineReactive(ob.value, key, val);\n\t ob.dep.notify();\n\t return val\n\t}", "function set (target, key, val) {\n if (\n (isUndef(target) || isPrimitive(target))\n ) {\n warn((\"Cannot set reactive property on undefined, null, or primitive value: \" + ((target))));\n }\n if (Array.isArray(target) && isValidArrayIndex(key)) {\n target.length = Math.max(target.length, key);\n target.splice(key, 1, val);\n return val\n }\n if (key in target && !(key in Object.prototype)) {\n target[key] = val;\n return val\n }\n var ob = (target).__ob__;\n if (target._isVue || (ob && ob.vmCount)) {\n warn(\n 'Avoid adding reactive properties to a Vue instance or its root $data ' +\n 'at runtime - declare it upfront in the data option.'\n );\n return val\n }\n if (!ob) {\n target[key] = val;\n return val\n }\n defineReactive$$1(ob.value, key, val);\n ob.dep.notify();\n return val\n }", "function defineAccessControl(target, key, val) {\r\n if (key === '__ob__')\r\n return;\r\n if (isRaw(target[key]))\r\n return;\r\n var getter;\r\n var setter;\r\n var property = Object.getOwnPropertyDescriptor(target, key);\r\n if (property) {\r\n if (property.configurable === false) {\r\n return;\r\n }\r\n getter = property.get;\r\n setter = property.set;\r\n if ((!getter || setter) /* not only have getter */ &&\r\n arguments.length === 2) {\r\n val = target[key];\r\n }\r\n }\r\n setupAccessControl(val);\r\n Object.defineProperty(target, key, {\r\n enumerable: true,\r\n configurable: true,\r\n get: function getterHandler() {\r\n var value = getter ? getter.call(target) : val;\r\n // if the key is equal to RefKey, skip the unwrap logic\r\n if (key !== RefKey && isRef(value)) {\r\n return value.value;\r\n }\r\n else {\r\n return value;\r\n }\r\n },\r\n set: function setterHandler(newVal) {\r\n if (getter && !setter)\r\n return;\r\n var value = getter ? getter.call(target) : val;\r\n // If the key is equal to RefKey, skip the unwrap logic\r\n // If and only if \"value\" is ref and \"newVal\" is not a ref,\r\n // the assignment should be proxied to \"value\" ref.\r\n if (key !== RefKey && isRef(value) && !isRef(newVal)) {\r\n value.value = newVal;\r\n }\r\n else if (setter) {\r\n setter.call(target, newVal);\r\n }\r\n else {\r\n val = newVal;\r\n }\r\n setupAccessControl(newVal);\r\n },\r\n });\r\n}", "function defineAccessControl(target, key, val) {\r\n if (key === '__ob__')\r\n return;\r\n if (isRaw(target[key]))\r\n return;\r\n var getter;\r\n var setter;\r\n var property = Object.getOwnPropertyDescriptor(target, key);\r\n if (property) {\r\n if (property.configurable === false) {\r\n return;\r\n }\r\n getter = property.get;\r\n setter = property.set;\r\n if ((!getter || setter) /* not only have getter */ &&\r\n arguments.length === 2) {\r\n val = target[key];\r\n }\r\n }\r\n setupAccessControl(val);\r\n Object.defineProperty(target, key, {\r\n enumerable: true,\r\n configurable: true,\r\n get: function getterHandler() {\r\n var value = getter ? getter.call(target) : val;\r\n // if the key is equal to RefKey, skip the unwrap logic\r\n if (key !== RefKey && isRef(value)) {\r\n return value.value;\r\n }\r\n else {\r\n return value;\r\n }\r\n },\r\n set: function setterHandler(newVal) {\r\n if (getter && !setter)\r\n return;\r\n var value = getter ? getter.call(target) : val;\r\n // If the key is equal to RefKey, skip the unwrap logic\r\n // If and only if \"value\" is ref and \"newVal\" is not a ref,\r\n // the assignment should be proxied to \"value\" ref.\r\n if (key !== RefKey && isRef(value) && !isRef(newVal)) {\r\n value.value = newVal;\r\n }\r\n else if (setter) {\r\n setter.call(target, newVal);\r\n }\r\n else {\r\n val = newVal;\r\n }\r\n setupAccessControl(newVal);\r\n },\r\n });\r\n}", "function $wVXT$var$wrapproperty(obj, prop, message) {\n if (!obj || typeof obj !== 'object' && typeof obj !== 'function') {\n throw new TypeError('argument obj must be object');\n }\n\n var descriptor = Object.getOwnPropertyDescriptor(obj, prop);\n\n if (!descriptor) {\n throw new TypeError('must call property on owner object');\n }\n\n if (!descriptor.configurable) {\n throw new TypeError('property must be configurable');\n }\n}", "function set (target, key, val) {\n if (isUndef(target) || isPrimitive(target)\n ) {\n warn((\"Cannot set reactive property on undefined, null, or primitive value: \" + ((target))));\n }\n if (Array.isArray(target) && isValidArrayIndex(key)) {\n target.length = Math.max(target.length, key);\n target.splice(key, 1, val);\n return val\n }\n if (key in target && !(key in Object.prototype)) {\n target[key] = val;\n return val\n }\n var ob = (target).__ob__;\n if (target._isVue || (ob && ob.vmCount)) {\n warn(\n 'Avoid adding reactive properties to a Vue instance or its root $data ' +\n 'at runtime - declare it upfront in the data option.'\n );\n return val\n }\n if (!ob) {\n target[key] = val;\n return val\n }\n defineReactive$$1(ob.value, key, val);\n ob.dep.notify();\n return val\n }", "function set (target, key, val) {\n if (isUndef(target) || isPrimitive(target)\n ) {\n warn((\"Cannot set reactive property on undefined, null, or primitive value: \" + ((target))));\n }\n if (Array.isArray(target) && isValidArrayIndex(key)) {\n target.length = Math.max(target.length, key);\n target.splice(key, 1, val);\n return val\n }\n if (key in target && !(key in Object.prototype)) {\n target[key] = val;\n return val\n }\n var ob = (target).__ob__;\n if (target._isVue || (ob && ob.vmCount)) {\n warn(\n 'Avoid adding reactive properties to a Vue instance or its root $data ' +\n 'at runtime - declare it upfront in the data option.'\n );\n return val\n }\n if (!ob) {\n target[key] = val;\n return val\n }\n defineReactive$$1(ob.value, key, val);\n ob.dep.notify();\n return val\n }", "function set (target, key, val) {\n if (isUndef(target) || isPrimitive(target)\n ) {\n warn((\"Cannot set reactive property on undefined, null, or primitive value: \" + ((target))));\n }\n if (Array.isArray(target) && isValidArrayIndex(key)) {\n target.length = Math.max(target.length, key);\n target.splice(key, 1, val);\n return val\n }\n if (key in target && !(key in Object.prototype)) {\n target[key] = val;\n return val\n }\n var ob = (target).__ob__;\n if (target._isVue || (ob && ob.vmCount)) {\n warn(\n 'Avoid adding reactive properties to a Vue instance or its root $data ' +\n 'at runtime - declare it upfront in the data option.'\n );\n return val\n }\n if (!ob) {\n target[key] = val;\n return val\n }\n defineReactive$$1(ob.value, key, val);\n ob.dep.notify();\n return val\n }", "function CreateDataPropertyOrThrow(O, P, V) { // eslint-disable-line no-unused-vars\n\t\t// 1. Assert: Type(O) is Object.\n\t\t// 2. Assert: IsPropertyKey(P) is true.\n\t\t// 3. Let success be ? CreateDataProperty(O, P, V).\n\t\tvar success = CreateDataProperty(O, P, V);\n\t\t// 4. If success is false, throw a TypeError exception.\n\t\tif (!success) {\n\t\t\tthrow new TypeError('Cannot assign value `' + Object.prototype.toString.call(V) + '` to property `' + Object.prototype.toString.call(P) + '` on object `' + Object.prototype.toString.call(O) + '`');\n\t\t}\n\t\t// 5. Return success.\n\t\treturn success;\n\t}", "function VerifyToPropertyKey(key) {\n var obj = {};\n console.log(obj.hasOwnProperty(key));\n\n try {\n Object.defineProperty(obj, key, {\n value: 'something',\n enumerable: true\n });\n } catch (e) {\n ;\n }\n\n console.log(obj.hasOwnProperty(key));\n console.log(obj.propertyIsEnumerable(key));\n console.log(undefined, Object.getOwnPropertyDescriptor(obj, key));\n obj = {};\n\n obj.__defineGetter__(key, () => {\n return 2;\n });\n\n console.log(obj.hasOwnProperty(key));\n obj = {};\n\n obj.__defineSetter__(key, () => {\n return 2;\n });\n\n console.log(obj.hasOwnProperty(key));\n var count = 0;\n obj = Object.defineProperty({}, key, {\n set(v) {\n console.log(v);\n count++;\n }\n\n });\n\n var set = obj.__lookupSetter__(key);\n\n console.log('function', typeof set);\n set('abc');\n console.log(1, count);\n obj = Object.defineProperty({}, key, {\n get() {\n return 'abc';\n }\n\n });\n\n var get = obj.__lookupGetter__(key);\n\n console.log('function', typeof get);\n console.log('abc', get());\n obj = {};\n\n try {\n Reflect.set(obj, key, 'abc');\n } catch (e) {\n ;\n }\n\n console.log('abc', Reflect.get(obj, key));\n console.log(Reflect.deleteProperty(obj, key));\n console.log(Reflect.has(obj, key));\n\n try {\n Reflect.defineProperty(obj, key, {\n value: 'def',\n enumerable: true\n });\n } catch (e) {\n ;\n }\n\n console.log('def', Reflect.get(obj, key));\n console.log(undefined, Reflect.getOwnPropertyDescriptor(obj, key));\n obj = {};\n\n try {\n obj[key] = 123;\n } catch (e) {\n ;\n }\n\n console.log(123, obj[key]);\n console.log(obj.hasOwnProperty(key));\n}", "get None() {}", "get None() {}", "get None() {}", "get None() {}", "set Emissive(value) {}", "function set (target, key, val) {\n if ( true &&\n (isUndef(target) || isPrimitive(target))\n ) {\n warn((\"Cannot set reactive property on undefined, null, or primitive value: \" + ((target))));\n }\n if (Array.isArray(target) && isValidArrayIndex(key)) {\n target.length = Math.max(target.length, key);\n target.splice(key, 1, val);\n return val\n }\n if (key in target && !(key in Object.prototype)) {\n target[key] = val;\n return val\n }\n var ob = (target).__ob__;\n if (target._isVue || (ob && ob.vmCount)) {\n true && warn(\n 'Avoid adding reactive properties to a Vue instance or its root $data ' +\n 'at runtime - declare it upfront in the data option.'\n );\n return val\n }\n if (!ob) {\n target[key] = val;\n return val\n }\n defineReactive$$1(ob.value, key, val);\n ob.dep.notify();\n return val\n}", "function set (target, key, val) {\n if ( true &&\n (isUndef(target) || isPrimitive(target))\n ) {\n warn((\"Cannot set reactive property on undefined, null, or primitive value: \" + ((target))));\n }\n if (Array.isArray(target) && isValidArrayIndex(key)) {\n target.length = Math.max(target.length, key);\n target.splice(key, 1, val);\n return val\n }\n if (key in target && !(key in Object.prototype)) {\n target[key] = val;\n return val\n }\n var ob = (target).__ob__;\n if (target._isVue || (ob && ob.vmCount)) {\n true && warn(\n 'Avoid adding reactive properties to a Vue instance or its root $data ' +\n 'at runtime - declare it upfront in the data option.'\n );\n return val\n }\n if (!ob) {\n target[key] = val;\n return val\n }\n defineReactive$$1(ob.value, key, val);\n ob.dep.notify();\n return val\n}", "function set (target, key, val) {\n if ( true &&\n (isUndef(target) || isPrimitive(target))\n ) {\n warn((\"Cannot set reactive property on undefined, null, or primitive value: \" + ((target))));\n }\n if (Array.isArray(target) && isValidArrayIndex(key)) {\n target.length = Math.max(target.length, key);\n target.splice(key, 1, val);\n return val\n }\n if (key in target && !(key in Object.prototype)) {\n target[key] = val;\n return val\n }\n var ob = (target).__ob__;\n if (target._isVue || (ob && ob.vmCount)) {\n true && warn(\n 'Avoid adding reactive properties to a Vue instance or its root $data ' +\n 'at runtime - declare it upfront in the data option.'\n );\n return val\n }\n if (!ob) {\n target[key] = val;\n return val\n }\n defineReactive$$1(ob.value, key, val);\n ob.dep.notify();\n return val\n}", "function set (target, key, val) {\n if ( true &&\n (isUndef(target) || isPrimitive(target))\n ) {\n warn((\"Cannot set reactive property on undefined, null, or primitive value: \" + ((target))));\n }\n if (Array.isArray(target) && isValidArrayIndex(key)) {\n target.length = Math.max(target.length, key);\n target.splice(key, 1, val);\n return val\n }\n if (key in target && !(key in Object.prototype)) {\n target[key] = val;\n return val\n }\n var ob = (target).__ob__;\n if (target._isVue || (ob && ob.vmCount)) {\n true && warn(\n 'Avoid adding reactive properties to a Vue instance or its root $data ' +\n 'at runtime - declare it upfront in the data option.'\n );\n return val\n }\n if (!ob) {\n target[key] = val;\n return val\n }\n defineReactive$$1(ob.value, key, val);\n ob.dep.notify();\n return val\n}", "function set (target, key, val) {\n if ( true &&\n (isUndef(target) || isPrimitive(target))\n ) {\n warn((\"Cannot set reactive property on undefined, null, or primitive value: \" + ((target))));\n }\n if (Array.isArray(target) && isValidArrayIndex(key)) {\n target.length = Math.max(target.length, key);\n target.splice(key, 1, val);\n return val\n }\n if (key in target && !(key in Object.prototype)) {\n target[key] = val;\n return val\n }\n var ob = (target).__ob__;\n if (target._isVue || (ob && ob.vmCount)) {\n true && warn(\n 'Avoid adding reactive properties to a Vue instance or its root $data ' +\n 'at runtime - declare it upfront in the data option.'\n );\n return val\n }\n if (!ob) {\n target[key] = val;\n return val\n }\n defineReactive$$1(ob.value, key, val);\n ob.dep.notify();\n return val\n}", "function set (target, key, val) {\n if ( true &&\n (isUndef(target) || isPrimitive(target))\n ) {\n warn((\"Cannot set reactive property on undefined, null, or primitive value: \" + ((target))));\n }\n if (Array.isArray(target) && isValidArrayIndex(key)) {\n target.length = Math.max(target.length, key);\n target.splice(key, 1, val);\n return val\n }\n if (key in target && !(key in Object.prototype)) {\n target[key] = val;\n return val\n }\n var ob = (target).__ob__;\n if (target._isVue || (ob && ob.vmCount)) {\n true && warn(\n 'Avoid adding reactive properties to a Vue instance or its root $data ' +\n 'at runtime - declare it upfront in the data option.'\n );\n return val\n }\n if (!ob) {\n target[key] = val;\n return val\n }\n defineReactive$$1(ob.value, key, val);\n ob.dep.notify();\n return val\n}", "function set (target, key, val) {\n if ( true &&\n (isUndef(target) || isPrimitive(target))\n ) {\n warn((\"Cannot set reactive property on undefined, null, or primitive value: \" + ((target))));\n }\n if (Array.isArray(target) && isValidArrayIndex(key)) {\n target.length = Math.max(target.length, key);\n target.splice(key, 1, val);\n return val\n }\n if (key in target && !(key in Object.prototype)) {\n target[key] = val;\n return val\n }\n var ob = (target).__ob__;\n if (target._isVue || (ob && ob.vmCount)) {\n true && warn(\n 'Avoid adding reactive properties to a Vue instance or its root $data ' +\n 'at runtime - declare it upfront in the data option.'\n );\n return val\n }\n if (!ob) {\n target[key] = val;\n return val\n }\n defineReactive$$1(ob.value, key, val);\n ob.dep.notify();\n return val\n}", "function set (target, key, val) {\n if ( true &&\n (isUndef(target) || isPrimitive(target))\n ) {\n warn((\"Cannot set reactive property on undefined, null, or primitive value: \" + ((target))));\n }\n if (Array.isArray(target) && isValidArrayIndex(key)) {\n target.length = Math.max(target.length, key);\n target.splice(key, 1, val);\n return val\n }\n if (key in target && !(key in Object.prototype)) {\n target[key] = val;\n return val\n }\n var ob = (target).__ob__;\n if (target._isVue || (ob && ob.vmCount)) {\n true && warn(\n 'Avoid adding reactive properties to a Vue instance or its root $data ' +\n 'at runtime - declare it upfront in the data option.'\n );\n return val\n }\n if (!ob) {\n target[key] = val;\n return val\n }\n defineReactive$$1(ob.value, key, val);\n ob.dep.notify();\n return val\n}", "function set (target, key, val) {\n if ( true &&\n (isUndef(target) || isPrimitive(target))\n ) {\n warn((\"Cannot set reactive property on undefined, null, or primitive value: \" + ((target))));\n }\n if (Array.isArray(target) && isValidArrayIndex(key)) {\n target.length = Math.max(target.length, key);\n target.splice(key, 1, val);\n return val\n }\n if (key in target && !(key in Object.prototype)) {\n target[key] = val;\n return val\n }\n var ob = (target).__ob__;\n if (target._isVue || (ob && ob.vmCount)) {\n true && warn(\n 'Avoid adding reactive properties to a Vue instance or its root $data ' +\n 'at runtime - declare it upfront in the data option.'\n );\n return val\n }\n if (!ob) {\n target[key] = val;\n return val\n }\n defineReactive$$1(ob.value, key, val);\n ob.dep.notify();\n return val\n}", "function set (target, key, val) {\n if ( true &&\n (isUndef(target) || isPrimitive(target))\n ) {\n warn((\"Cannot set reactive property on undefined, null, or primitive value: \" + ((target))));\n }\n if (Array.isArray(target) && isValidArrayIndex(key)) {\n target.length = Math.max(target.length, key);\n target.splice(key, 1, val);\n return val\n }\n if (key in target && !(key in Object.prototype)) {\n target[key] = val;\n return val\n }\n var ob = (target).__ob__;\n if (target._isVue || (ob && ob.vmCount)) {\n true && warn(\n 'Avoid adding reactive properties to a Vue instance or its root $data ' +\n 'at runtime - declare it upfront in the data option.'\n );\n return val\n }\n if (!ob) {\n target[key] = val;\n return val\n }\n defineReactive$$1(ob.value, key, val);\n ob.dep.notify();\n return val\n}", "function set (target, key, val) {\n if ( true &&\n (isUndef(target) || isPrimitive(target))\n ) {\n warn((\"Cannot set reactive property on undefined, null, or primitive value: \" + ((target))));\n }\n if (Array.isArray(target) && isValidArrayIndex(key)) {\n target.length = Math.max(target.length, key);\n target.splice(key, 1, val);\n return val\n }\n if (key in target && !(key in Object.prototype)) {\n target[key] = val;\n return val\n }\n var ob = (target).__ob__;\n if (target._isVue || (ob && ob.vmCount)) {\n true && warn(\n 'Avoid adding reactive properties to a Vue instance or its root $data ' +\n 'at runtime - declare it upfront in the data option.'\n );\n return val\n }\n if (!ob) {\n target[key] = val;\n return val\n }\n defineReactive$$1(ob.value, key, val);\n ob.dep.notify();\n return val\n}", "function set (target, key, val) {\n if ( true &&\n (isUndef(target) || isPrimitive(target))\n ) {\n warn((\"Cannot set reactive property on undefined, null, or primitive value: \" + ((target))));\n }\n if (Array.isArray(target) && isValidArrayIndex(key)) {\n target.length = Math.max(target.length, key);\n target.splice(key, 1, val);\n return val\n }\n if (key in target && !(key in Object.prototype)) {\n target[key] = val;\n return val\n }\n var ob = (target).__ob__;\n if (target._isVue || (ob && ob.vmCount)) {\n true && warn(\n 'Avoid adding reactive properties to a Vue instance or its root $data ' +\n 'at runtime - declare it upfront in the data option.'\n );\n return val\n }\n if (!ob) {\n target[key] = val;\n return val\n }\n defineReactive$$1(ob.value, key, val);\n ob.dep.notify();\n return val\n}", "function set (target, key, val) {\n if ( true &&\n (isUndef(target) || isPrimitive(target))\n ) {\n warn((\"Cannot set reactive property on undefined, null, or primitive value: \" + ((target))));\n }\n if (Array.isArray(target) && isValidArrayIndex(key)) {\n target.length = Math.max(target.length, key);\n target.splice(key, 1, val);\n return val\n }\n if (key in target && !(key in Object.prototype)) {\n target[key] = val;\n return val\n }\n var ob = (target).__ob__;\n if (target._isVue || (ob && ob.vmCount)) {\n true && warn(\n 'Avoid adding reactive properties to a Vue instance or its root $data ' +\n 'at runtime - declare it upfront in the data option.'\n );\n return val\n }\n if (!ob) {\n target[key] = val;\n return val\n }\n defineReactive$$1(ob.value, key, val);\n ob.dep.notify();\n return val\n}", "function set (target, key, val) {\n if ( true &&\n (isUndef(target) || isPrimitive(target))\n ) {\n warn((\"Cannot set reactive property on undefined, null, or primitive value: \" + ((target))));\n }\n if (Array.isArray(target) && isValidArrayIndex(key)) {\n target.length = Math.max(target.length, key);\n target.splice(key, 1, val);\n return val\n }\n if (key in target && !(key in Object.prototype)) {\n target[key] = val;\n return val\n }\n var ob = (target).__ob__;\n if (target._isVue || (ob && ob.vmCount)) {\n true && warn(\n 'Avoid adding reactive properties to a Vue instance or its root $data ' +\n 'at runtime - declare it upfront in the data option.'\n );\n return val\n }\n if (!ob) {\n target[key] = val;\n return val\n }\n defineReactive$$1(ob.value, key, val);\n ob.dep.notify();\n return val\n}", "function set (target, key, val) {\n if ( true &&\n (isUndef(target) || isPrimitive(target))\n ) {\n warn((\"Cannot set reactive property on undefined, null, or primitive value: \" + ((target))));\n }\n if (Array.isArray(target) && isValidArrayIndex(key)) {\n target.length = Math.max(target.length, key);\n target.splice(key, 1, val);\n return val\n }\n if (key in target && !(key in Object.prototype)) {\n target[key] = val;\n return val\n }\n var ob = (target).__ob__;\n if (target._isVue || (ob && ob.vmCount)) {\n true && warn(\n 'Avoid adding reactive properties to a Vue instance or its root $data ' +\n 'at runtime - declare it upfront in the data option.'\n );\n return val\n }\n if (!ob) {\n target[key] = val;\n return val\n }\n defineReactive$$1(ob.value, key, val);\n ob.dep.notify();\n return val\n}", "function set (target, key, val) {\n if ( true &&\n (isUndef(target) || isPrimitive(target))\n ) {\n warn((\"Cannot set reactive property on undefined, null, or primitive value: \" + ((target))));\n }\n if (Array.isArray(target) && isValidArrayIndex(key)) {\n target.length = Math.max(target.length, key);\n target.splice(key, 1, val);\n return val\n }\n if (key in target && !(key in Object.prototype)) {\n target[key] = val;\n return val\n }\n var ob = (target).__ob__;\n if (target._isVue || (ob && ob.vmCount)) {\n true && warn(\n 'Avoid adding reactive properties to a Vue instance or its root $data ' +\n 'at runtime - declare it upfront in the data option.'\n );\n return val\n }\n if (!ob) {\n target[key] = val;\n return val\n }\n defineReactive$$1(ob.value, key, val);\n ob.dep.notify();\n return val\n}", "function set (target, key, val) {\n if ( true &&\n (isUndef(target) || isPrimitive(target))\n ) {\n warn((\"Cannot set reactive property on undefined, null, or primitive value: \" + ((target))));\n }\n if (Array.isArray(target) && isValidArrayIndex(key)) {\n target.length = Math.max(target.length, key);\n target.splice(key, 1, val);\n return val\n }\n if (key in target && !(key in Object.prototype)) {\n target[key] = val;\n return val\n }\n var ob = (target).__ob__;\n if (target._isVue || (ob && ob.vmCount)) {\n true && warn(\n 'Avoid adding reactive properties to a Vue instance or its root $data ' +\n 'at runtime - declare it upfront in the data option.'\n );\n return val\n }\n if (!ob) {\n target[key] = val;\n return val\n }\n defineReactive$$1(ob.value, key, val);\n ob.dep.notify();\n return val\n}", "function set (target, key, val) {\n if ( true &&\n (isUndef(target) || isPrimitive(target))\n ) {\n warn((\"Cannot set reactive property on undefined, null, or primitive value: \" + ((target))));\n }\n if (Array.isArray(target) && isValidArrayIndex(key)) {\n target.length = Math.max(target.length, key);\n target.splice(key, 1, val);\n return val\n }\n if (key in target && !(key in Object.prototype)) {\n target[key] = val;\n return val\n }\n var ob = (target).__ob__;\n if (target._isVue || (ob && ob.vmCount)) {\n true && warn(\n 'Avoid adding reactive properties to a Vue instance or its root $data ' +\n 'at runtime - declare it upfront in the data option.'\n );\n return val\n }\n if (!ob) {\n target[key] = val;\n return val\n }\n defineReactive$$1(ob.value, key, val);\n ob.dep.notify();\n return val\n}", "function set (target, key, val) {\n if ( true &&\n (isUndef(target) || isPrimitive(target))\n ) {\n warn((\"Cannot set reactive property on undefined, null, or primitive value: \" + ((target))));\n }\n if (Array.isArray(target) && isValidArrayIndex(key)) {\n target.length = Math.max(target.length, key);\n target.splice(key, 1, val);\n return val\n }\n if (key in target && !(key in Object.prototype)) {\n target[key] = val;\n return val\n }\n var ob = (target).__ob__;\n if (target._isVue || (ob && ob.vmCount)) {\n true && warn(\n 'Avoid adding reactive properties to a Vue instance or its root $data ' +\n 'at runtime - declare it upfront in the data option.'\n );\n return val\n }\n if (!ob) {\n target[key] = val;\n return val\n }\n defineReactive$$1(ob.value, key, val);\n ob.dep.notify();\n return val\n}", "function set (target, key, val) {\n if ( true &&\n (isUndef(target) || isPrimitive(target))\n ) {\n warn((\"Cannot set reactive property on undefined, null, or primitive value: \" + ((target))));\n }\n if (Array.isArray(target) && isValidArrayIndex(key)) {\n target.length = Math.max(target.length, key);\n target.splice(key, 1, val);\n return val\n }\n if (key in target && !(key in Object.prototype)) {\n target[key] = val;\n return val\n }\n var ob = (target).__ob__;\n if (target._isVue || (ob && ob.vmCount)) {\n true && warn(\n 'Avoid adding reactive properties to a Vue instance or its root $data ' +\n 'at runtime - declare it upfront in the data option.'\n );\n return val\n }\n if (!ob) {\n target[key] = val;\n return val\n }\n defineReactive$$1(ob.value, key, val);\n ob.dep.notify();\n return val\n}" ]
[ "0.66587955", "0.6356464", "0.6235886", "0.6208156", "0.5865558", "0.58342254", "0.57981133", "0.57048345", "0.56855756", "0.5644346", "0.5636067", "0.56044286", "0.548204", "0.548204", "0.548204", "0.548204", "0.5450891", "0.5335113", "0.5334958", "0.5333292", "0.53252125", "0.5325149", "0.5225863", "0.52219796", "0.52153695", "0.5167507", "0.51617664", "0.51296556", "0.5128882", "0.5122658", "0.51211256", "0.512106", "0.5114944", "0.5114944", "0.51119256", "0.51049083", "0.51004934", "0.5088352", "0.508202", "0.50802034", "0.50802034", "0.50802034", "0.50802034", "0.5078875", "0.50717026", "0.5064444", "0.5061757", "0.5061757", "0.5061757", "0.5046499", "0.5029834", "0.5025089", "0.5025089", "0.5018887", "0.5018887", "0.5018887", "0.5018887", "0.5018887", "0.5018887", "0.5018887", "0.5018887", "0.5018663", "0.5018663", "0.5018663", "0.5018663", "0.50041634", "0.5002162", "0.49861982", "0.49861982", "0.49671507", "0.4966963", "0.4966963", "0.4966963", "0.49616405", "0.494758", "0.49459392", "0.49459392", "0.49459392", "0.49459392", "0.49377733", "0.4921256", "0.4921256", "0.4921256", "0.4921256", "0.4921256", "0.4921256", "0.4921256", "0.4921256", "0.4921256", "0.4921256", "0.4921256", "0.4921256", "0.4921256", "0.4921256", "0.4921256", "0.4921256", "0.4921256", "0.4921256", "0.4921256", "0.4921256" ]
0.7683469
0
Constructor for variables and functions / the delete function
constructor() { super(); this.DeleteFighter = this.DeleteFighter.bind(this); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "constructor() { \n // alias\n this.remove = this.delete;\n }", "delete() {}", "delete() {\n\n }", "constructur() {}", "deleteTattoo () {\n\n }", "constructor() {\n // this storage will be an empty obj\n this.storage = {};\n // this position will be 0\n this.position = 0;\n // this deposition will be 0\n this.deposition = 0;\n }", "function Cd(a){this.ta={};this.o=a}", "constructor() {\n this._storage = {};\n this._length = 0;\n }", "function Storage() { \n\n}", "_destroy() {}", "constructor() {\n this.storage = {};\n this.counter = 0;\n }", "function Ctor() {}", "constructor (){}", "DeleteCommand() {}", "gc() {\n // clear all arrays\n this.animation=null;\n this.keys=null;\n // clear variables\n this.generate=null;\n this.move=null;\n }", "constructor() {\n \tthis.storage = {};\n \tthis.i = 0;\n }", "constructor() {\n\t\tthis.clear();\n\t}", "constructor(x, y) { // Constructor function to initialize new instances.\n this.x = x; // This keyword is the new object being initialized.\n this.y = y; // Store function arguments as object properties.\n }", "function Constructor(arg){\n this.var = arg;\n }", "constructor() {\n \tthis.storage = {};\n this.count = 0;\n }", "function Ctor() {\r\n }", "constructor(){}", "constructor(){}", "constructor(){}", "constructor(){}", "constructor(){}", "constructor(){}", "constructor(){}", "destructor () {\n\t\tsuper.destructor();\n\t}", "constructor() {\n // create storage key for the instance of Queue and set it equal to an empty object\n this.storage = {};\n this.keyNum = 1;\n }", "constructor() {\n this._storage = {}\n this._length = 0\n this._head = 0\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x3417d728;\n this.SUBCLASS_OF_ID = 0x2899a53d;\n\n this.save = args.save || null;\n this.data = args.data;\n }", "function Ctor() {\n\t// Empty...\n}", "constructor() {\n // Data / properites / state\n // The difference between the properties and regular\n // variables is that the properies are encapsulated variables.\n this.name = null;\n this.age = null;\n }", "function Uc(){this.$d=[]}", "function _construct()\n\t\t{;\n\t\t}", "function destroy(){}", "constructor() {\n this.storage = {};\n this.counter = 0;\n }", "function sd(a){this.ta={};this.o=a}", "consructor() {\n }", "deleteAction() {}", "constructor() {\n this.functions = {};\n }", "function TempCtor() {}", "function TempCtor() {}", "function TempCtor() {}", "function TempCtor() {}", "function TempCtor() {}", "function TempCtor() {}", "constructor(data, annotations, toDelete, parser) {\n this.data = data;\n this.annotations = annotations;\n this.toDelete = toDelete;\n this.parser = parser;\n /**\n * Holds the crossite reference table\n * */\n this.xrefs = [];\n this.data = new Uint8Array(data);\n this.cryptoInterface = parser.getCryptoInterface();\n }", "constructor() {\n \tthis.storage = {};\n }", "destroy() {\n this.leftIndentIn = undefined;\n this.backgroundIn = undefined;\n this.leftIndentIn = undefined;\n this.leftMarginIn = undefined;\n this.rightMarginIn = undefined;\n this.topMarginIn = undefined;\n this.bottomMarginIn = undefined;\n this.cellSpacingIn = undefined;\n this.tableAlignmentIn = undefined;\n this.tableIn = undefined;\n this.selection = undefined;\n this.bidi = undefined;\n }", "constructor() {\n this.storage = {};\n this.i = 0;\n\n }", "delete(param, value) {\n return this.clone({\n param,\n value,\n op: 'd'\n });\n }", "constructor() {\n\t\t\t// Create a storage object for this class. This will serve as our 'memory' and corresponds to 'collection' in the first solution.\n\t\t\tthis.memState = {};\n\t\t}", "destroy() {\n this.leftIndentIn = undefined;\n this.rightIndentIn = undefined;\n this.beforeSpacingIn = undefined;\n this.afterSpacingIn = undefined;\n this.firstLineIndentIn = undefined;\n this.lineSpacingIn = undefined;\n this.textAlignmentIn = undefined;\n this.lineSpacingTypeIn = undefined;\n this.listId = undefined;\n this.listLevelNumberIn = undefined;\n this.viewer = undefined;\n this.selection = undefined;\n this.styleName = undefined;\n this.bidi = undefined;\n this.contextualSpacing = undefined;\n }", "constructor( ) {}", "constructor() {\n this._r = null;\n this._d = 0;\n }", "function NewObj(){}", "function _ctor() {\n\t}", "function Constructor() {}", "function Constructor() {}", "function Constructor() {}", "function DELETE(){\n\n}", "constructor(_owner, args) {\n\n this.args = args;\n DESTROYING.set(this, false);\n DESTROYED.set(this, false);\n }", "delete() {\n this.deleted = true;\n }", "get Delete() {}", "function tempCtor() {}", "constructor(varId, varDispID, )\n {\n ;\n }", "function destroy(){\r\n }", "function destroy(){\r\n }", "constructor() {\n //initialize currIndex to -1\n this.currIndex = -1;\n //initialize empty storage\n this.storage = {};\n }", "__previnit(){}", "constructor() {\n super();\n //region Private Methods\n //endregion\n //region Methods\n //endregion\n //region Events\n //endregion\n //region Properties\n /**\n * Property field\n */\n this._record = null;\n }", "constructor(x, y)// un seul constructor possible\n {\n this.x = x;// creations des variables de la classe\n this.y = y;\n }", "function deleteDog() {}", "created() {\n this._TPInstance = null\n this._obs_title = null\n this._obs_content = null\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x56022f4d;\n this.SUBCLASS_OF_ID = 0x9f89304e;\n\n this.difference = args.difference;\n }", "constructor() {\n this.storage = {};\n }", "constructor() {\n this.storage = {};\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x33f0ea47;\n this.SUBCLASS_OF_ID = 0x94dc7633;\n\n this.data = args.data;\n this.hash = args.hash;\n this.secret = args.secret;\n }", "function nd(a){this.la={};this.o=a}", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x8aeabec3;\n this.SUBCLASS_OF_ID = 0x7cd41eb4;\n\n this.data = args.data;\n this.dataHash = args.dataHash;\n this.secret = args.secret;\n }", "set Delete(value) {}", "constructor(name) {\n this.name = name;\n this.storage = {};\n }", "constructor() {\n this.storage = {};\n this.storage.size = 0;\n this.storage.first = 0;\n }", "destroy() {}", "destroy() {}", "destroy() {}", "destroy() {}", "destroy() {}", "destroy() {}", "destroy() {}", "destroy() {}", "destroy() {}", "destroy() {}", "destroy() {}", "constructor(a, b, c, d) {\r\n this.a = a;\r\n this.b = b;\r\n this.c = c;\r\n this.d = d;\r\n }", "_destroy() {\n\t this._source = null;\n\t this._offset = null;\n\t this._length = null;\n\t}", "constructor() {\n this._reset();\n }", "function StorageObject() {\n}", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0xedb93949;\n this.SUBCLASS_OF_ID = 0x5b0b743e;\n\n this.expires = args.expires;\n }" ]
[ "0.64373237", "0.63899314", "0.63532823", "0.62995636", "0.624344", "0.61420774", "0.6078818", "0.60131097", "0.5940566", "0.5923135", "0.5922725", "0.5916731", "0.591326", "0.5881079", "0.5874083", "0.5867198", "0.58543986", "0.5842719", "0.584033", "0.5833293", "0.5826478", "0.582368", "0.582368", "0.582368", "0.582368", "0.582368", "0.582368", "0.582368", "0.57836545", "0.5773067", "0.5765326", "0.5756283", "0.5754285", "0.5753406", "0.5751624", "0.5750955", "0.57430834", "0.5731497", "0.57262784", "0.5720556", "0.5719369", "0.571819", "0.5703798", "0.5703798", "0.5703798", "0.5703798", "0.5703798", "0.5703798", "0.57033086", "0.57008326", "0.5699461", "0.5696222", "0.56961244", "0.56915325", "0.5678826", "0.5673489", "0.567014", "0.56663865", "0.56598806", "0.565585", "0.565585", "0.565585", "0.56550026", "0.56425685", "0.56361866", "0.5631806", "0.56305975", "0.5621552", "0.5615502", "0.5615502", "0.5610971", "0.5605913", "0.55996436", "0.5592432", "0.5588968", "0.5583563", "0.5575066", "0.55731016", "0.55731016", "0.5558915", "0.55576533", "0.55469954", "0.55467325", "0.5543529", "0.5536249", "0.55356723", "0.55356723", "0.55356723", "0.55356723", "0.55356723", "0.55356723", "0.55356723", "0.55356723", "0.55356723", "0.55356723", "0.55356723", "0.553472", "0.5524119", "0.55210465", "0.55120945", "0.5507433" ]
0.0
-1
globals __VUE_SSR_CONTEXT__ IMPORTANT: Do NOT use ES2015 features in this file (except for modules). This module is a runtime utility for cleaner component module output and will be included in the final webpack user bundle.
function normalizeComponent ( scriptExports, render, staticRenderFns, functionalTemplate, injectStyles, scopeId, moduleIdentifier, /* server only */ shadowMode /* vue-cli only */ ) { // Vue.extend constructor export interop var options = typeof scriptExports === 'function' ? scriptExports.options : scriptExports // render functions if (render) { options.render = render options.staticRenderFns = staticRenderFns options._compiled = true } // functional template if (functionalTemplate) { options.functional = true } // scopedId if (scopeId) { options._scopeId = 'data-v-' + scopeId } var hook if (moduleIdentifier) { // server build hook = function (context) { // 2.3 injection context = context || // cached call (this.$vnode && this.$vnode.ssrContext) || // stateful (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional // 2.2 with runInNewContext: true if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') { context = __VUE_SSR_CONTEXT__ } // inject component styles if (injectStyles) { injectStyles.call(this, context) } // register component module identifier for async chunk inferrence if (context && context._registeredComponents) { context._registeredComponents.add(moduleIdentifier) } } // used by ssr in case component is cached and beforeCreate // never gets called options._ssrRegister = hook } else if (injectStyles) { hook = shadowMode ? function () { injectStyles.call( this, (options.functional ? this.parent : this).$root.$options.shadowRoot ) } : injectStyles } if (hook) { if (options.functional) { // for template-only hot-reload because in that case the render fn doesn't // go through the normalizer options._injectStyles = hook // register for functional component in vue file var originalRender = options.render options.render = function renderWithStyleInjection (h, context) { hook.call(context) return originalRender(h, context) } } else { // inject component registration as beforeCreate hook var existing = options.beforeCreate options.beforeCreate = existing ? [].concat(existing, hook) : [hook] } } return { exports: scriptExports, options: options } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Es(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"source.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "extend(config, ctx) {\n // if (process.server && process.browser) {\n if (ctx.isDev && ctx.isClient) {\n config.devtool = \"source-map\";\n // if (isDev && process.isClient) {\n config.plugins.push(\n new StylelintPlugin({\n files: [\"**/*.vue\", \"**/*.scss\"],\n })\n ),\n config.module.rules.push({\n enforce: \"pre\",\n test: /\\.(js|vue)$/,\n loader: \"eslint-loader\",\n exclude: /(node_modules)/,\n options: {\n formatter: require(\"eslint-friendly-formatter\"),\n },\n });\n if (ctx.isDev) {\n config.mode = \"development\";\n }\n }\n for (const rule of config.module.rules) {\n if (rule.use) {\n for (const use of rule.use) {\n if (use.loader === \"sass-loader\") {\n use.options = use.options || {};\n use.options.includePaths = [\n \"node_modules/foundation-sites/scss\",\n \"node_modules/motion-ui/src\",\n ];\n }\n }\n }\n }\n // vue-svg-inline-loader\n const vueRule = config.module.rules.find((rule) =>\n rule.test.test(\".vue\")\n );\n vueRule.use = [\n {\n loader: vueRule.loader,\n options: vueRule.options,\n },\n {\n loader: \"vue-svg-inline-loader\",\n },\n ];\n delete vueRule.loader;\n delete vueRule.options;\n }", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}" ]
[ "0.5847333", "0.57279235", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897" ]
0.0
-1
Do the stuff to be called after D3.js has loaded
function dotheviz() { //--------------------------------- //------------------ select items to analyze / graph type //--------------------------------- function capitalizeFirstLetter(string) { return string.charAt(0).toUpperCase() + string.slice(1); } thehtml = '<select id="selectITEM" style="width:170px;" >' fields.filter(function(f){return (f!='S2' || database=='scopus') ; }).forEach(function(f){thehtml+='<option value="'+f+'" '+(field_option==f?'selected':'')+'>'+capitalizeFirstLetter(items[f])+'</option>'}) thehtml += '</select>' d3.select('#itemselection').html(thehtml) d3.select('#selectITEM').on('change',function(){update();}) thehtml = '<select id="selectGRAPH" style="width:170px;" >' thehtml += '<option value="custom" '+(graph_option=='custom'?'selected':'')+'>Custom</option>' thehtml += '<option value="science" '+(graph_option=='science'?'selected':'')+'>Distributions</option>' thehtml += '</select>' d3.select('#graphselection').html(thehtml) d3.select('#selectGRAPH').on('change',function(){update();}) foo='<select id="selectSORTtab" style="width:170px;" >' foo+='<option value="NB" selected>Record count</option>' foo+='<option value="ITEM">Item</option>' foo+='</select>' d3.select('#sortTAB').html(foo) //... d3.select('#NUMPUB').html(Npapers) prep_infobulle("#info_fs", "Items from that field will be listed on the left panel in numeric order, based on the number of documents in which they appear.") prep_infobulle("#info_gt", "Choose between different options:<br/><ul><li>The \"Custom\" option will display the information in the left panel in a custom representation (either a co-occurrence network, a pie chart, a word cloud or a map)</li><li>The \"Distributions\" option will produce a histogram of the number of items per publication and a cumulative distribution graph displaying the number of items appearing in at least <i>x</i> documents, for varying <i>x</i>. This last graph use logarithmic scales on both axes, which is useful to recognize power law relationships, appearing as straight lines.</li></ul>") prep_infobulle("#info_sl", "We only display items appearing more than <i>x</i> times, the threshold <i>x</i> being chosen so that the length of the list is less than 10000.") update(); } // end of D3ok()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function init() {\n\n svg = d3\n .select(\"#d3-container-1\")\n .append(\"svg\")\n\n draw(); // calls the draw function\n }", "function documentReady(){\n $.ajax({\n type: 'GET',\n url: '/initialdload',\n dataType: 'json'\n })\n .done(function(data){\n data[0].forEach(function(d){\n \n });\n \n\n\n d3.select('body').style('pointer-events', 'none');\n createBarchart(data[0], true);\n createPieChart(data[1], ' PLN');\n createSimplePie(data[4]);\n createHeatMap(data[3]);\n createLineChart(data[2]);\n d3.select('body').style('pointer-events', 'auto');\n\n });\n}", "function onScriptLoad () {\n $rootScope.$apply(function () { deferred.resolve(window.d3); });\n }", "function init() {\n d3.json(\"samples.json\").then(function(data){\n buildPlots(data.names[0]);\n buildDemo(data.names[0]);\n })}", "function init() {\r\n var drop_down = d3.select(\"#Dataset\");\r\n d3.json(\"data/samples.json\").then((data) => {\r\n\r\n // loop through data array\r\n // append each of the values into the drop down menu\r\n\r\n data.names.forEach(function(name) {\r\n drop_down.append(\"option\").text(name);\r\n });\r\n\r\n // call function for intial web page load\r\n buildplot(data.names[0]);\r\n });\r\n}", "function init() {\n\n var dropdown = d3.select('#selDataset');\n d3.json (\"data/samples.json\").then (function(data){\n data.names.forEach(function(name) {\n dropdown.append('option').text(name).property('value');\n });\n });\n // pulls the main data\n graph_charts('940');\n graph_metadata('940');\n}", "function ZooT_3DInit() {\n __zoot_c3d__process_DOM();\n}", "function init() {\n // Select dropdown element\n let selector = d3.select(\"#selDataset\");\n // load data from sample.json\n d3.json(\"samples.json\").then(function(data) {\n console.log(data);\n\n let namesData = data.names;\n namesData.forEach(function(names) {\n selector.append(\"option\")\n .text(names)\n .property(\"value\", names)\n });\n\n let firstSample = namesData[0];\n\n // call functions to build charts and demographic info\n createChart(firstSample);\n createMetaData(firstSample);\n // createGauge(firstSample);\n });\n}", "function init() {\n // Grab Dropdown menu and add choices from the dataset\n var dropdown = d3.select(\"#selDataset\"); \n // create list of datasets for the dropdown\n d3.json(\"static/Data/samples.json\").then((data)=> { \n data.names.forEach(function(name) {\n dropdown.append(\"option\").text(name).property(\"value\");\n });\n // initialize the plots with data from the first dataset\n optionChanged(data.names[0]);\n });\n}", "function init() {\n // select dropdown menu \n var dropdown = d3.select(\"#selDataset\");\n\n // read the data \n d3.json(\"samples.json\").then((data)=> {\n console.log(data)\n\n // get the id data to the dropdwown menu\n data.names.forEach(function(name) {\n dropdown.append(\"option\").text(name).property(\"value\");\n });\n\n // call the functions to display the data and the plots to the page\n getPlot(data.names[0]);\n });\n}", "function init() {\n // create variable to use dropdown menu\n var dropdownMenu = d3.select(\"#selDataset\");\n\n // use samples.json to fill menu with \"names\"\n d3.json(\"samples.json\").then((data) => {\n var names = data.names;\n\n names.forEach((sample) => {\n dropdownMenu.append(\"option\")\n .text(sample)\n .property(\"value\", sample); \n });\n \n var firstDisplay = names[0];\n build_barchart(firstDisplay);\n build_bubble(firstDisplay);\n build_meta(firstDisplay);\n });\n}", "setUp() {\n this.g = d3\n .select(this.root)\n .append(\"g\");\n this.update();\n }", "function init() {\n // select dropdown menu \n const dropdown = d3.select(\"#selDataset\");\n \n // read the data \n d3.json(\"names.json\").then((data)=> {\n console.log(data)\n \n // get the id data to the dropdwown menu\n data.names.forEach(function(name) {\n dropdown.append(\"option\").text(name).property(\"value\");\n });\n \n // call the functions to display the data and the plots to the page\n namePlots(data.names[0]);\n getDemoInfo(data.names[0]);\n });\n }", "function init() {\n\td3.csv('data/indicators.csv', function(error, data) {\n\t\tindicatorData = data;\n\n\t\trender();\n\t\t$(window).resize(utils.throttle(onResize, 250));\n\t});\n}", "function initial() {\n // select dropdown menu \n var dropdown = d3.select(\"#selDataset\");\n\n // read the data \n d3.json(\"samples.json\").then((data)=> {\n console.log(data)\n\n // get the id data to the dropdwown menu\n data.names.forEach(function(name) {\n dropdown.append(\"option\").text(name).property(\"value\");\n })\n \n\n // call the functions to display the data and the plots to the page\n doplot(data.names[0]);\n getInfo(data.names[0]);\n });\n}", "function init(){\n console.log(\"Hello World!\");\n // Selector for sample ID name\n var selector = d3.select(\"#selDataset\");\n // Append a selector option for each sample name\n d3.json(\"samples.json\").then(function(data) {\n console.log(data);\n var sampleNames = data.names;\n\n sampleNames.forEach(function(name) {\n selector.append(\"option\")\n .text(name)\n .property(\"value\", name);\n })\n\n var firstSample = sampleNames[0];\n\n buildChart(firstSample);\n buildMetaData(firstSample);\n\n })\n}", "function init() {\n // Grab a reference to the dropdown select element\n var selector = d3.select(\"#sel_dataset\");\n\n // Use the list of sample names to populate the select options\n d3.json(\"/names\").then((sampleNames) => {\n sampleNames.forEach((sample) => {\n selector\n .append(\"option\")\n .text(sample)\n .property(\"value\", sample);\n });\n // console.log(sampleNames)\n // Use the first sample from the list to build the initial plots\n const firstSample = sampleNames[0];\n buildCharts(firstSample);\n buildMetadata(firstSample);\n });\n\n changeLayout();\n}", "initialize() {\n if (!d3) {\n throw new Error('D3 is not imported and Francy won\\'t work without it... please import D3 v5+ library.');\n }\n Logger.debug('D3 is available...');\n }", "function init() {\n // Used for computing centroids in coordinate space\n identityProjection = d3.geo.path()\n .projection({stream: function(d) { return d; }});\n\n\td3.json('data/geodata.json', function(error, data) {\n // Extract topojson features\n for (var key in data['objects']) {\n topoData[key] = topojson.feature(data, data['objects'][key]);\n }\n\n render();\n $(window).resize(utils.throttle(onResize, 250));\n });\n}", "function initial () {\n //Reference to the html dropdown id\n let dropdown = d3.select('#selDataset')\n\n //Append list of ids to the dropdown\n d3.json('samples.json').then(function (data) {\n data.names.forEach(subject => {\n dropdown.append('option').text(subject).property('value', subject)\n })\n\n //Setting up inital data\n let initialData = data.samples[0]\n //Setting up inital data for Demographic Info\n let metadata = data.metadata[0]\n console.log(data)\n // console.log(initialData)\n // console.log(metadata)\n\n //Calling functions\n barChart(initialData)\n bubbleChart(initialData)\n idData(metadata)\n })\n}", "function init() {\n force = d3.layout.force()\n .size([width, height])\n .on(\"tick\", tick);\n\n svg = d3.select(\"#chart\").append(\"svg\")\n .attr(\"width\", width)\n .attr(\"height\", height);\n\n // Define the div for the tooltip\n div = d3.select(\"#chart\").append(\"div\")\n .attr(\"class\", \"tooltip\")\n .style(\"opacity\", 0);\n\n // Store all the objects which have the link or node class associated with them\n link = svg.selectAll(\".link\");\n node = svg.selectAll(\".node\");\n\n // Read in edges\n d3.csv(\"./data/edges.csv\", function(error, json) {\n if (error) throw error;\n edges = json;\n console.log(edges, \"EDGES\");\n });\n\n // Read in nodes\n d3.csv(\"./data/nodes.csv\", function(error, json) {\n if (error) throw error;\n root = json;\n console.log(root, \"nodes\");\n update();\n });\n}", "function init() {\n // Select dropdown menu\n var dropdown = d3.select(\"#selDataset\");\n\n // Read data\n d3.json(\"samples.json\").then((data)=> {\n // console.log(data)\n\n data.names.forEach(function(name){\n dropdown.append(\"option\").text(name).property(\"value\");\n })\n\n getPlots(data.names[0]);\n getDemoInfo(data.names[0]);\n \n })\n}", "function pageLoaded() {\n svgweb.addOnLoad(createSVGObject);\n}", "function init() {\n // select dropdown menu in index.html \n var dropdown = d3.select(\"#selDataset\");\n\n // read the data from samples.json\n d3.json(\"../data/samples.json\").then((data) => {\n console.log(data)\n\n // get the id data and append it to the dropdown so that it can be selected\n data.names.forEach(function (name) {\n dropdown.append(\"option\").text(name).property(\"value\");\n });\n\n // call the functions to display the data and the plots to the page\n plot_samples(data.names[0]);\n get_demographics(data.names[0]);\n });\n}", "function init() {\n\n // read in data from json file using d3\n d3.json(\"samples.json\").then(function(data) {\n var names = Object.values(data.names);\n \n // add test samples to dropdown menu\n names.forEach((item) => {\n var row = dropdown.append(\"option\").attr(\"value\", item);\n row.text(item);\n });\n });\n \n // run plot data function\n plotData();\n\n}", "function OnDataLoaded() {\n\t\tobjChart.showWaiting(false);\t\t\t\t\n\t\tobjChart.reorganize();\t\t\n\t}", "function init() {\n // select dropdown menu \n var dropdown = d3.select(\"#selDataset\");\n \n // read the data \n d3.json(\"data/samples.json\").then((data)=> {\n //console.log(data)\n \n // get the id data to the dropdwown menu\n data.names.forEach(function(name) {\n dropdown\n .append(\"option\")\n .attr(\"class\",\"testSubject\")\n .text(name)\n .property(\"value\");\n });\n \n // call the functions to display the data and the plots to the page\n //updatePlotly(data.names[0]);\n getDemoData(data.names[0]);\n getPlots(data.names[0]);\n });\n }", "function init() {\n d3.json(\"samples.json\").then(bbData => {\n data = bbData;\n var options = bbData.names;\n var selection = d3.select(\"#selDataset\");\n\n options.forEach(value => {\n selection \n .append(\"option\")\n .text(value)\n .attr(\"value\", function() {\n return value\n });\n });\n });\n}", "function pageOnLoad(){\n render(datasetInit);\n render(convertedDataSet1992);\n }", "function init() {\n // Select the dropdown menu element\n var selection = d3.select(\"#selDataset\"); \n // Read in JSON samples, getting all of the Subject IDs and using them to build the dropdown menu options\n d3.json(\"samples.json\").then((results => {\n results.names.forEach((name => {\n selection\n .append(\"option\")\n .text(name);\n }));\n \n // Call the BuildCharts function with the initial subject ID\n var initial_ID = selection.property(\"value\");\n BuildCharts(initial_ID);\n \n }));\n}", "function init() {\n\n // Add dropdown option for each sample\n var dropdown = d3.select(\"#selDataset\");\n\n // Read json data\n d3.json(\"\\samples.json\").then((data)=> {\n console.log(data)\n\n // Parse and filter data to get sample names\n data.names.forEach(function(name) {\n dropdown.append(\"option\").text(name).property(\"value\");\n });\n\n // Use first sample to build metadata and initial plots\n buildCharts(data.names[0]);\n buildMetadata(data.names[0]);\n });\n\n}", "function ready(error, d) {\n\tdata = d;\n\t\n\t//Set up typeahead\n\tsetupTypeahead();\n\t\n\t// Get the view ready for the specified dataset\n\tinitializeView();\n\t\n\t// Render the view\n\t//render();\n\trenderTooltip();\n\trenderSpeciesText();\n\t\t\n\t//showVis();\n\t// Load remaining data\n\tloadAllSpecies();\n\n}", "function init() {\n d3.json(\"JS/data/samples.json\").then(d => {\n data = d;\n var selectNames = d.names;\n\n var selectData = d3.select(\"#selDataset\");\n\n selectNames.forEach(value => {\n selectData\n .append(\"option\")\n .text(value)\n .attr(\"value\", function() {\n return value;\n });\n });\n });\n}", "function init(){\r\n \r\n buildplot(940);\r\n var testId = d3.select(\"#selDataset\");\r\n d3.json(\"js/samples.json\").then((importedData)=>{\r\n console.log(importedData);\r\n var data = importedData;\r\n var names = data.names;\r\n console.log(names);\r\n names.forEach(name=>{\r\n testId.append(\"option\").property(\"value\",name).text(name);\r\n \r\n })\r\n \r\n }); \r\n \r\n }", "function init() {\n // Grab a reference to the dropdown select element\n var selector = d3.select(\"#selDataset\");\n // Use the list of sample names to populate the select options\n d3.json(\"/names\").then((sampleNames) => {\n sampleNames.forEach((sample) => {\n selector\n .append(\"option\")\n .text(sample)\n .property(\"value\", sample);\n });\n // Use the first sample from the list to build the initial plots\n const firstSample = sampleNames[0];\n buildCharts(firstSample);\n buildMetadata(firstSample);\n });\n}", "function init() {\n\n // Define selector variable\n var selector = d3.select(\"#selDataset\");\n\n // Get data from json file\n d3.json(\"data/samples.json\").then(data => {\n\n // Define sample names\n var sampleNames = data.names;\n\n // Assign each sample number to property tag\n sampleNames.forEach(sample => {\n selector\n .append(\"option\")\n .text(sample)\n .property(\"value\", sample);\n })\n\n // Test just one sample\n var firstSample = sampleNames[0]\n\n // console.log(sampleNames)\n\n // Build bar chart\n buildCharts(firstSample);\n buildMetadata(firstSample);\n })\n\n}", "function init() {\n // Select dropdown menu \n var dropdown = d3.select(\"#selDataset\");\n \n // Read the data \n d3.json(\"samples.json\").then((data)=> {\n console.log(data)\n var sampleIDs = data.names;\n // Get the id data for the dropdwown menu\n sampleIDs.forEach((BioSample) => {\n dropdown\n .append(\"option\")\n .text(BioSample)\n .property(\"value\", BioSample);\n });\n\n //\n const first_id = sampleIDs[0];\n buildPlots(first_id);\n buildMetadataInfo(first_id); \n });\n}", "onGraphLoaded() {\n this.axis = new CGFaxis(this, this.graph.referenceLength);\n\n this.gl.clearColor(...this.graph.background);\n\n this.setGlobalAmbientLight(...this.graph.ambient);\n\n this.initCameras();\n\n this.initLights();\n\n this.initMaterials();\n\n this.initSpritesheets();\n\n this.initTextures();\n\n this.sceneInited = true;\n }", "function finishedLoad() {\n console.log('finishedLoad()');\n if (externalIsLoaded()) {\n init();\n }\n }", "function setup(){\n loadData(\"life_expectancy_data_csv.csv\", \"fertility_rate_data_csv.csv\", \"africa_scatterplot.csv\");\n _vis = document.getElementById(\"vis\");\n _vis = d3.select(\"#vis\");\n // grab our container's dimension\n _vis_width = d3.select(\"#vis\").node().getBoundingClientRect().width;\n _vis_height = d3.select(\"#vis\").node().getBoundingClientRect().height;\n\n _vis2 = document.getElementById(\"vis2\");\n _vis2 = d3.select(\"#vis2\");\n // grab our container's dimension\n _vis2_width = d3.select(\"#vis2\").node().getBoundingClientRect().width;\n _vis2_height = d3.select(\"#vis2\").node().getBoundingClientRect().height;\n}", "function init(){\n var selector = d3.select(\"#selDataset\");\n d3.json(\"data/samples.json\").then(incomingData => {\n var nameId = incomingData.names;\n\n //filling the dropdown list of ID's \n nameId.forEach(id => {selector.append(\"option\").text(id).property(\"value\", id);});\n \n //default ID to generate the graphs\n var defaultId = nameId[0];\n demographicInfo(defaultId);\n barChart(defaultId);\n bubbleChart(defaultId);\n });\n}", "function init() {\n let dropdownMenu = d3.select(\"#selDataset\");\n // Read json data\n d3.json(\"samples.json\").then(function (response) {\n // Parse and filter data to get sample names\n let names = response.names;\n // Add dropdown option for each sample\n for (i = 0; i < names.length; i++) {\n dropdownMenu.append(\"option\").text(names[i]).property(\"value\", names[i])\n }\n let sample = names[0];\n buildMetadata(sample);\n buildCharts(sample);\n\n });\n\n}", "function init() {\n var selector = d3.select(\"#selDataset\")\n d3.json(\"samples.json\").then((data) => {\n // console.log(importedData);\n // var data = importedData.samples;\n\n // Select the dropdown element\n var subjectIds = data.names;\n subjectIds.forEach((id) => {\n selector\n .append(\"option\")\n .text(id)\n .property(\"value\", id);\n });\n var firstSample = subjectIds[0];\n buildCharts(firstSample);\n buildMetadata(firstSample);\n });\n }", "function setup() {\n d3.json(\"samples.json\").then((importedData) => {\n\n var data = importedData;\n var names = importedData.names;\n var metadata = importedData.metadata;\n var samples = importedData.samples;\n // var sampleData = utoData.samples;\n // console.log(dataObjects);\n console.log(data);\n console.log(names);\n console.log(metadata);\n console.log(samples);\n\n\n var innerContainer = document.querySelector('.well'),\n // plotEl = innerContainer.querySelector('#bar'),\n userSelector = innerContainer.querySelector('#selDataset');\n demoInfo = innerContainer.querySelector('#sample-metadata')\n\n function assignOptions(names, selector) {\n for (var i = 0; i < names.length; i++) {\n var currentOption = document.createElement('option');\n currentOption.text = names[i];\n selector.appendChild(currentOption);\n }\n }\n\n assignOptions(names, userSelector);\n initPlot(samples, metadata);\n });\n}", "function initialize() {\n var dropdown = d3.select(\"#selDataset\"); \n d3.json(\"samples.json\").then((data) => {\n var sampleList = data.names; \n sampleList.forEach((sample) => {\n dropdown.append(\"option\").text(sample).property(\"value\", sample); \n \n });\n //capture sample metadata from the list\n var firstSample = sampleList[0];\n chartBuilder(firstSample); \n metadataBuilder(firstSample);\n \n }); \n }", "function init() {\n // select dropdown menu \n var dropdown = d3.select(\"#selDataset\");\n\n // read the data \n // data.map((array)=> array.names);\n // console.log(names);\n // get the id data to the dropdwown menu\n (new_object.ids).forEach(function(name) {\n \n dropdown.append(\"option\").text(name)\n // .property(\"value\")\n });\n\n // call the functions to display the data and the plots to the page\n barPlots(data.names[0]);\n bubblePlots(data.names[0]);\n // guagePlots(data.names[0]);\n guagePlots(data.names[0]);\n \n}", "function init() {\n \n var selector = d3.select(\"#selDataset\");\n d3.json(\"samples.json\").then(function(data){\n var IDNames = data.names;\n IDNames.forEach(function(userchoice){\n selector\n .append(\"option\")\n .text(userchoice)\n .property(\"value\", userchoice);\n });\n var beginning = IDNames[0];\n ChartInfo(beginning);\n AllData(beginning);\n });\n }", "function setup(){\n initializeApplication(function(){\n d3.select(\"#curtain_text\").text(\"loading...\");\n loadElements(function(){\n d3.select(\"#curtain_text\").text(\"loading....\");\n loadNuclides(function(){\n d3.select(\"#curtain_text\").text(\"loading.....\");\n renderApplication(function(){\n questions.finalize();\n display.transition_speed = 0.8;\n d3.select(\"#curtain_text\").text(\"welcome!\");\n d3.select(\"#curtain\").transition().duration(1000).style(\"opacity\",0);\n d3.timer(function(){\n d3.select(\"#curtain\").style(\"display\", \"none\");\n return true;\n }, 1100);\n });\n });\n });\n });\n}", "function init_svg(){\n\n if(document.getElementById('world-map-svg')){\n \n // set svg fill to default\n reset_svg_fill();\n\n // generate the dropdwon with custom rank names\n makeDDM();\n\n // add tooltip event on all countries and info button\n add_tooltip_event_countries();\n add_tooltip_event_info();\n hideDDM2_extraOptions();\n\n // remove the next 3 lines once implemented\n document.getElementById('rank-attribute').selectedIndex = 0;\n document.getElementById('rank-type').selectedIndex = 0;\n var svg = d3.select('#world-map-svg')\n fill_csv(svg, global_rank_function + '_' + global_rank_type, global_is_mono, global_isAscending);\n\n }\n else{\n setTimeout(init_svg, 100); \n }\n \n}", "function init() {\n var selector = d3.select('#selDataset')\n\n //use sample names to poplate the select options\n var names = d3.json('/names').then((sampleNames) => {\n console.log(sampleNames)\n\n sampleNames.forEach((sample) => {\n selector.append(\"option\").text(sample).property(\"value\");\n });\n\n buildCharts(sampleNames[0]);\n getMetaData(sampleNames[0]);\n console.log(sampleNames[0]);\n });\n\n}", "function init() {\n var dropDownMenu = d3.select(\"#selDataset\");\n\n d3.json(\"samples.json\").then((data) => {\n \n var idNames = data.names;\n idNames.forEach((sample) => {\n dropDownMenu\n .append(\"option\")\n .text(sample)\n .property(\"value\", sample); \n });\n\n\n const firstName = idNames[0];\n horizontalBarChart(firstName);\n bubbleChart(firstName);\n getMetadata(firstName);\n });\n}", "function init() {\n // Grab a reference to the dropdown select element\n var selector = d3.select(\"#selDataset\");\n\n // Use the list of sample names to populate the select options\n // Route /tipicks returns a list of strings\n d3.json(\"/tickpicks\").then((tickers) => {\n console.log(tickers);\n tickers.forEach((symbol) => {\n selector\n .append(\"option\")\n .text(symbol)\n .property(\"value\", symbol);\n });\n\n //Use the first sample from the list to build the initial plots\n const firstSymbol = tickers[0];\n buildTable(firstSymbol);\n alphaVantagePullnPlot(firstSymbol);\n let stockSymbol = tickers[0];\n const historyYears = 3;\n getHistoryData(stockSymbol);\n historyPlot(stockSymbol,historyYears);\n });\n buildMarketStats('mostactivebysharevol')\n}", "function init(){\n var dropDown = d3.select(\"#selDataset\");\n d3.json(\"data/samples.json\").then(data =>{\n var names = data.names;\n // console.log(names)\n names.forEach(sample => {\n dropDown.append(\"option\")\n .text(sample)\n .property(\"value\",sample);\n });\n var firstSample = names[0];\n console.log(firstSample);\n buildTable(firstSample);\n buildCharts(firstSample);\n });\n}", "function init() {\n // get reference to the selected dropdown element\n var selector = d3.select(\"#selDataset\");\n \n // get sample names from json\n d3.json(\"samples.json\").then((data) => {\n var sampleNames = data.names;\n \n // put sample names in drop down list\n sampleNames.forEach((sample) => {\n selector\n .append(\"option\")\n .text(sample)\n .property(\"value\", sample);\n });\n \n // Use the first sample to build the initial plots\n var firstSample = sampleNames[0];\n buildPanel(firstSample);\n bubbleCharts(firstSample);\n });\n }", "function onLoad(){\r\n\tcy = cytoscape({\r\n\t\tcontainer: document.getElementById('cy'), // container to render in\r\n\t\tstyle: cyStyle\r\n\t});\r\n\t\r\n\taddEventListeners();\r\n\t// snap to grid: makes graph be positioned along a grid\r\n\tcy.snapToGrid();\r\n\texecuteSnapGrid(false);\r\n\r\n\t//load shelf data\r\n\tloadTagData();\r\n\tloadTemplateData();\r\n}", "function goReady(){ // wait for everything to load first\n\tif (domReady && svgReady!=null && loaded)\n\t\treadyStart(svgReady);\n}", "function init(file1,file2,file3,file4,file5){\n\td3.json(file1, function(error, txt) {\n\t\tmatching=txt;\n\t\t//console.log(matching[2].name);\n\t\td3.json(file2, function(error, txt) {\n\t\t\tcorpusStatistics=txt;\n\t\t\ttotalNum=txt.articles;\n\t\t\ttotalPages=txt.totalPages;\n\t\t\t//console.log(corpusStatistics);\n\t\t\td3.json(file3, function(error, txt) {\n\t\t\t\tarticlesStatistics=txt;\n\t\t\t\t//console.log(articlesStatistics[3].name);\n\t\t\t\td3.json(file4, function(error, txt) {\n\t\t\t\t\tcorpusStr=txt;\n\t\t\t\t\t//console.log(corpusStr[3].name);\n\t\t\t\t\td3.json(file5, function(error, txt) {\n\t\t\t\t\t\t//console.log(error);\n\t\t\t\t\t\tcorpusTxt=txt;\n\t\t\t\t\t\t//console.log(corpusTxt[2].content);\n\t\t\t\t\t\tgStratistics=\"<p>\"+\"Corpus Name: \"+ corpusStatistics.corpus+ \"</p>\";\n\t\t\t\t\t\tgStratistics=gStratistics+\"<p>\"+\"# of Articles: \"+ corpusStatistics.articles+ \"</p>\";\n\t\t\t\t\t\tgStratistics=gStratistics+\"<p>\"+\"# of Sentences: \"+ corpusStatistics.sentences+ \"</p>\";\n\t\t\t\t\t\tgStratistics=gStratistics+\"<p>\"+\"# of Words: \"+ corpusStatistics.words+ \"</p>\";\n\t\t\t\t\t\tgStratistics=gStratistics+\"<hr/>\";\n\t\t\t\t\t\tloadTab1();\n\t\t\t\t\t\tloadCorr1();\n\t\t\t\t\t\tloadCorr2();\n\t\t\t\t\t\tloadCorr3();\n\t\t\t\t\t\tupdateCorr3(currentPages);\n\t\t\t\t\t\td3.select(\"#inputpages\").property(\"value\",1);\n\t\t\t\t\t\td3.select(\"#title1\").text(space[currentPos]);\t\t\n\t\t\t\t\t\td3.select(\"#title2\").text(\"Statistics(\"+space[currentPos]+\")\");\t\n\t\t\t\t\t\td3.select(\"#background0\").style(\"fill\",colorActive);\n\t\t\t\t\t\td3.select(\"#background1\").style(\"fill\",colorInactive);\n\t\t\t\t\t\td3.select(\"#background2\").style(\"fill\",colorInactive);\n\t\t\t\t\t\td3.select(\"#background3\").style(\"fill\",colorInactive);\t\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t});\n\t\t});\n\t});\n}", "function init() {\n \n var selector = d3.select(\"#selDataset\");\n \n // Sample names to populate charts and table\n d3.json(\"samples.json\").then((data) => {\n var sampleNames = data.names;\n \n sampleNames.forEach((sample) => {\n selector\n .append(\"option\")\n .text(sample)\n .property(\"value\", sample);\n });\n \n // Default sample on opening page\n var firstSample = sampleNames[0];\n buildCharts(firstSample);\n buildMetadata(firstSample);\n });\n }", "function init() {\n d3.select(\"#more_info\").node().value = \"\";\n buildPlot(data);\n}", "function onChartLibraryLoaded() {\n bIsLibraryLoaded = true;\n\n dispatch.call('libraryLoaded', null, true);\n }", "function data_did_load() {\n cleanup_scene();\n stop_animation();\n\n //Abstract call here to pub sub model for scene and other modules as well\n //No reason pcl_scene should be talking directly to update GUI\n //update gui with file info \n PC_GUI.parameters.File = DataManager.imported_metadata.filename;\n PC_GUI.parameters.Rows = `0 of ${DataManager.imported_data.length}`; \n\n //Grab data from data importer \n pointcloud_data = DataManager.imported_data[current_row]; \n\n //make labeled point bins\n labeled_points = []; \n DataManager.imported_data.map( row => labeled_points.push([]) );\n\n build_pointcloud(); \n\t\n //selection_box = new SelectionBox( CAMERA, points );\n\t//begin update\n\tDATA_WAS_LOADED = true;\n}", "function loaded(){\n graph([]);\n pieChart([],[],[],[]);\n}", "function init() {\n resetData();\n d3.json(\"data/samples.json\").then((data => {\n data.names.forEach((name => {\n var option = idSelect.append(\"option\");\n option.text(name);\n }));\n var initId = idSelect.property(\"value\")\n plotCharts(initId);\n })); \n}", "function loadData() {\n\n // Load our data via d3\n d3.csv(\"data/corona_page_views.csv\", function (csv) {\n\n // PREPARE OUR DATA\n //\n // This example uses sample Google Analytics data to show page views of the www.brightpointinc.com website\n // over a 24 hour period.\n //\n // Use d3 nest operation to group unique page views.\n var pages = d3.nest()\n .key(function (d) {\n return d.page\n })\n .entries(csv);\n\n var allSeries = [];\n\n // For each unique page make a data series.\n pages.forEach(function (page) {\n var series = [];\n var i = 0;\n page.values.forEach(function (row) {\n row.hour = Number(row.hour);\n row.views = Number(row.views);\n //Fill in missing hours\n if (i < row.hour) {\n for (var j = i; j < row.hour; j++) {\n // console.log(\"adding hour \" + j + \" for \" + row.page);\n series.push({\"page\": row.page, \"views\": 0, \"hour\": String(j)});\n i++;\n }\n }\n i++;\n row.key = page.key;\n //Convert back to string for ordinal position - Vizuly will automatically assign a ordinal scale to strings\n row.hour = String(row.hour);\n series.push(row);\n })\n\n //Fill in any trailing zero hour values\n if (series.length < 24) {\n for (var i = series.length - 1; i < 23; i++) {\n series.push({\"key\": page.key, \"views\": 0, \"hour\": String(i)});\n }\n }\n allSeries.push(series);\n });\n\n data = allSeries;\n\n // Call our initialize routine\n initialize();\n\n });\n\n}", "function initializeVisualization(createStaticElements) {\n d3.json(\"data/\" + global.dataset.file, function(data) {\n // Cache the dataset\n global.papers = data.papers;\n\n // Initialize some global parameters\n global.computeOldestLatestPublicationYears();\n global.computeMedianMaximalNormalizedCitationCountsPerYear();\n\n // Restore data from previous session\n sessionManager.loadPreviousSession();\n\n // If no seed papers, won't do anything\n algorithm.updateFringe();\n view.initializeView(createStaticElements);\n\n // setup autocomplete popup\n $('#dialog .typeahead').typeahead({\n hint: true,\n highlight: true,\n minLength: 3\n }, {\n name: 'titles',\n displayKey: 'value',\n source: substringMatcher(Object.keys(global.papers)\n .map(function(doi) {\n return global.papers[doi].title;\n }))\n });\n });\n}", "function init() {\n var selector = d3.select(\"#selDataset\");\n d3.json(\"samples.json\").then((data) => {\n var Samp_ID = data.names;\n Samp_ID.forEach((sample) => {\n selector.append(\"option\").text(sample).property(\"value\");\n });\n\n var original = Samp_ID[0];\n charts(original);\n metadata(original);\n \n });\n}", "onGraphLoaded() {\n this.axis = new CGFaxis(this, this.graph.referenceLength);\n\n this.gl.clearColor(this.graph.background[0], this.graph.background[1], this.graph.background[2], this.graph.background[3]);\n\n this.setGlobalAmbientLight(this.graph.ambient[0], this.graph.ambient[1], this.graph.ambient[2], this.graph.ambient[3]);\n\n this.initLights();\n\n this.interface.initKeys();\n\n this.interface.addLights(this.graph.lights);\n this.interface.addViews(this.graph.views);\n this.interface.addThemes(this.themes, this);\n this.interface.addGameInterface(this, this.gameMode);\n\n this.initDefaultView();\n\n this.sceneInited = true;\n }", "function loadScene0() {\n\tchartarea();\n\td3.select(\"#b0\").classed(\"active\",true);\n\n\t//d3.selectAll(\"#selection\").style(\"visibility\",\"hidden\");\n\td3.select(\"#chart-div\").insert(\"div\").classed(\"heading\",true);\n\td3.select(\".heading\").insert(\"h2\").text(\"Summaries\").style(\"text-anchor\", \"start\");\n\td3.select(\"#chart-div\").insert(\"div\").classed(\"para\",true);\n\td3.select(\".para\").insert(\"p\").text(\"The time range of this crime data is from Records begin in June 14, 2015 and continue to September 3, 2018.\");\n\td3.select(\".para\").insert(\"p\").text(\"This is a dataset containing records from the new crime incident report system, which includes a reduced set of fields focused on capturing the type of incident as well as when and where it occurred.\");\n\td3.select(\".para\").insert(\"p\").text(\"In this crime analysis, you will learn the following:\");\n\td3.select(\".para\").insert(\"p\").text(\"1. Where does most of the crimes most likely to occur?\");\n\td3.select(\".para\").insert(\"p\").text(\"2. When does crimes usually happen?\");\n\td3.select(\".para\").insert(\"p\").text(\"3. Which year has the most number of crimes?\");\n}", "function init(){\n d3.json(\"samples.json\").then((d) => {\n var sampleName = d.names;\n var dataset = d3.select(\"#selDataset\");\n sampleName.forEach((sample) =>{\n dataset.append(\"option\")\n .text(sample)\n .property(\"value\", sample);\n });\n \n var resultSample = sampleName[0];\n getData(resultSample);\n getDemoData(resultSample);\n });\n \n}", "function ready(error, data, cats) {\n // Logs any error to the console\n if (error) {\n return console.warn(error);\n }\n\n v.DEATH_CATS = cats;\n v.DATA = data;\n console.log('Main Data Object:');\n console.log(data);\n\n // get an array of all the age groups\n v.AGE_GRPS = d3.nest()\n .key(function(d) { return d.death_age; })\n .entries(data)\n .map(function(d) { return d.key; });\n\n var chartData = v.stackData(data, 'h_cat');\n console.log(chartData);\n\n\n // calculate age grp death totals\n // for normalising functions (All, Males, Females)\n v.DEATH_TOTALS.None = sumStackedData(chartData);\n v.DEATH_TOTALS.M = sumStackedData(v.stackData(v.filterData(v.DATA, 'gender', 'M'), 'h_cat'));\n v.DEATH_TOTALS.F = sumStackedData(v.stackData(v.filterData(v.DATA, 'gender', 'F'), 'h_cat'));\n\n\n\n chartData = v.normaliseStackedData(chartData);\n v.initViz(chartData);\n }", "function dataSetup(){\n d3.csv(\"assets/data/data.csv\"),then(function(error, data){\n if(error) throw error;\n\n data.forEach(function(hData){\n hData.id= +hData.id;\n hData.state= +hData.state;\n hData.abbr= +hData.abbr;\n hData.poverty= +hData.poverty;\n hData.povertyMoe = +hData.povertyMoe;\n hData.age = +hData.age;\n hData.ageMoe = +hData.ageMoe;\n hData.income = +hData.income;\n hData.incomeMoe = +hData.incomeMoe;\n hData.healthcare = +hData.healthcare;\n hData.healthcareLow = +hData.healthcareLow;\n hData.healthcareHigh = +hData.healthcareHigh;\n hData.obesity = +hData.obesity;\n hData.obesityLow = +hData.obesityLow;\n hData.obesityHigh = +hData.obesityHigh;\n hData.smokes = +hData.smokes;\n hData.smokesLow = +hData.smokesLow;\n hData.smokesHigh = +hData.smokesHigh;\n });\n }); \n\n\n // Step 5: Build Scales\n var xScale = d3.xScale()\n .domain(d3.extend(hData,d=> d.poverty))\n .range([0,width]);\n\n var yScale = d3.yScale()\n .domain(d3.extend(hData,d=> d.healthcare))\n .range([height,0]);\n\n // Step 6: Create Axis Fuctions with Axis Titles\n var bottomAxis= d3.axisBottom(xScale);\n var leftAxis = d3.axisLeft(yScale);\n\n chartGroup.append(\"g\")\n .attr(\"transform\",'translate(0, ${height})')\n .call(bottomAxis);\n\n chartGroup.append(\"g\")\n .attr(\"transfrom\",'translate (${width},0')\n .call(leftAxis);\n\n chartGroup.append(\"text\")\n .attr(\"transform\",'translate(${width/2},${height + margin.top + 20})')\n .classed(\"x-axis text\",true)\n .text(\"In Poverty %\");\n \n chartGroup.append(\"text\")\n .attr(\"transform\",'translate(${width/2},${height + margin.top + 20})')\n .classed(\"y-axis text\",true)\n .text(\"Lack Healthcare %\");\n\n // var circleGroup = chartGroup.selectAll(\"circle\")\n // .data(hdata)\n // .enter()\n // .append(\"circle\")\n // .attr(\"cx\", (d, i)=> xScale(i))\n // .attr(\"cy\", (d,i)=> yScale(d))\n // .attr(\"r\",\"5\")\n // .attr(\"fill\",\"red\"); \n \n}", "function start() {\n d3.select( \"#d3-start\" )\n .append( \"p\" )\n .text( \"Place a console.log(d3) in your script block to see the entire d3 object in the console\" ); \n}", "function init() {\n\n // AXIS LABELS\n // Set yAxis label to class 'yAxis-label'\n graph\n .append('text')\n .attr('class','yAxis-label')\n \n // Set xAxis label to class 'xAxis-label'\n graph\n .append('text')\n .attr('class','xAxis-label')\n\n // AXIS GROUPS\n // Create axisX group with class 'axisX'\n graph\n .append('g')\n .attr('class','axisX')\n .attr('id','axisX')\n \n // Create axisY group with class 'axisY'\n graph\n .append('g')\n .attr('class','axisY')\n .attr('id','axisY')\n\n\n // add event listner for any resizes (listener is debounced)\n window.addEventListener(\"resize\", debounce(resize, 200));\n drawChart(rawData, props);\n }", "function init() {\n // Append options for users to select based on ids\n d3.json(\"/api/ins-us\").then(function (ins) {\n d3.json(\"/api/mmr-us\").then(function (data) {\n usData = data;\n insData = ins\n // console.log(insData);\n\n\n var filterState = ins.filter(event => event.year === 2009);\n filterState.forEach(element => {\n state = element.location;\n states.push(state);\n });\n var filterYear = ins.filter(event => event.location.trim() === \"California\");\n filterYear.forEach(element => {\n year = element.year;\n years.push(year);\n })\n\n var selection = d3.select(\"#selDataset\");\n\n states.forEach(item => {\n var options = selection.append(\"option\");\n options.property(\"value\", item);\n options.text(item);\n });\n\n var selection2 = d3.select(\"#selYear\")\n\n years.forEach(item => {\n var options2 = selection2.append(\"option\");\n options2.property(\"value\", item);\n options2.text(item);\n });\n\n\n buildPlot(selection.property(\"value\"));\n insChart(selection.property(\"value\"));\n state1Chart(selection2.property(\"value\"));\n });\n });\n}", "function init() {\n //Creating instances for each visualization\n \n d3.csv(\"data/timesMergedData.csv\", function (error, schoolData) {\n \n var filterChart = new FilterChart(schoolData);\n });\n }", "function pageLoaded() {\n\tgoogle.load(\"visualization\", \"1\", {\n\t\tpackages : [\"corechart\"],\n\t\tcallback : googleLoaded\n\t});\n}", "function pageLoaded() {\n\tgoogle.load(\"visualization\", \"1\", {\n\t\tpackages : [\"corechart\"],\n\t\tcallback : googleLoaded\n\t});\n}", "function ready(error, data, gerOutline, gerCountries) {\n if (error) throw error;\n \n console.log({data: data, gerOutline: gerOutline, gerCountries: gerCountries});\n\n \n /* Sequence */\n /* -------- */\n\n // Global data\n vis.nodes = data;\n\n // Set up and get visual variables\n setUpVisual();\n\n // Set the initial node layout\n initialVisualLayout(vis.nodes);\n\n // Set up the map\n setupMap(gerOutline, gerCountries);\n\n // Draw the map\n drawMap();\n\n // Calculate y scale for positioning (pull the lower end up a little to leave space for the text)\n vis.yScale = d3.scaleLinear().domain([0, Math.ceil(vis.nodes.length/2)]).range([vis.dims.height*0.05, vis.dims.height*0.85]);\n\n // Calculate and augment positions\n vis.nodes = nodesAlphabeticalCinema(vis.nodes);\n vis.nodes = nodesAlphabeticalCity(vis.nodes);\n vis.nodes = nodesVisitingOrder(vis.nodes);\n\n // play intro\n story();\n\n\n /* Interactivity elements */\n /* ---------------------- */\n\n // Zoom\n var zoom = d3.zoom().scaleExtent([0.75, 2.5]).on('zoom', zoomed);\n d3.select('#visual svg').call(zoom);\n\n\n // circles\n d3.selectAll('.node').on('mouseover', circleOver);\n d3.selectAll('.node').on('mousedown', circleDown);\n d3.selectAll('.node').on('mouseout', circleOut);\n d3.selectAll('.node-text').on('mouseover', textOver);\n d3.selectAll('.node-text').on('mousedown', textDown);\n d3.selectAll('.node-text').on('mouseout', textOut);\n\n}", "onGraphLoaded() {\r\n\r\n this.camera = this.graph.cameras[this.graph.currView];\r\n this.interface.setActiveCamera(this.camera);\r\n\r\n this.axis = new CGFaxis(this, this.graph.referenceLength);\r\n\r\n this.gl.clearColor(this.graph.background[0], this.graph.background[1], this.graph.background[2], this.graph.background[3]);\r\n\r\n this.setGlobalAmbientLight(this.graph.ambient[0], this.graph.ambient[1], this.graph.ambient[2], this.graph.ambient[3]);\r\n\r\n this.initLights();\r\n\r\n this.interface.addLights(this.lights, this.graph.numLights);\r\n this.interface.addViewsGroup(this.graph.viewsId);\r\n\r\n this.sceneInited = true;\r\n }", "function gDone() {\nconsole.log(\"page done!\");\n\n//The below loads google charting package and calls back gvizloaded\n\ngoogle.load(\"visualization\", \"1\", {\npackages : [\"corechart\"],\n\"callback\" : gVizloaded\n});\n}", "function init() {\n \n d3.json(\"/getCountryData\", function (countrys_info) {\n buildMaps(countrys_info);\n });\n }", "function RDonload(){\n\n /* RD stand for result design */\n RDVariableInitialize();\n RDCoverLoading();\n RDAnimationInitialize();\n RDArtworkOnClickInitialize();\n AOS.init();\n}", "function initialize() {\n\t\t\n\t\tsvg = scope.selection.append(\"svg\").attr(\"id\", scope.id).style(\"overflow\", \"visible\").attr(\"class\", \"vizuly\");\n\t\tbackground = svg.append(\"rect\").attr(\"class\", \"vz-background\");\n\t\tdefs = vizuly2.util.getDefs(viz);\n\t\tplot = svg.append('g');\n\t\t\n\t\tscope.dispatch.apply('initialized', viz);\n\t}", "function init() {\n\t\tvar defaultLayer = properties.tickerData.layers[0].value;\n\t\tactiveLayer=defaultLayer;\n\t\tdata = prepareDataSet(defaultLayer);\n\n\t\tvar subDomain = _subDomain;\n\n\t\tsvgDomain = subDomain.append(\"svg\")\n\t\t\t.attr(\"width\", 140 + \"px\")\n\t\t\t.attr(\"height\", 140 + \"px\")\n\t\t\t.style(\"position\", \"absolute\")\n\t\t\t.style(\"left\", 14 + \"em\")\n\t\t\t.style(\"top\", -1 + \"em\")\n\t\t//.attr(\"transform\", \"translate(\" + 0 + \",\" + 240 + \")\")\n\t\t.append(\"g\")\n\n\t\tpack = d3.layout.pack()\n\t\t\t.size([circlePackSize, circlePackSize])\n\t\t\t.value(function(d) {\n\t\t\t\treturn d.value\n\t\t\t})\n\n\t\tupdateGraph(data);\n\n\t}", "onGraphLoaded() {\n this.initCameras();\n\n //TODO: Change reference length according to parsed graph\n this.axis = new CGFaxis(this, this.graphs[this.currGraph].sceneInfo.axis_length);\n\n // TODO: Change ambient and background details according to parsed graph\n\n this.gl.clearColor(this.graphs[this.currGraph].background.r, this.graphs[this.currGraph].background.g, this.graphs[this.currGraph].background.b, this.graphs[this.currGraph].background.a);\n this.setGlobalAmbientLight(this.graphs[this.currGraph].ambient.r, this.graphs[this.currGraph].ambient.g, this.graphs[this.currGraph].ambient.b, this.graphs[this.currGraph].ambient.a)\n\n this.initLights();\n\n // Adds lights group.\n this.interface.addLightsGroup(this.graphs[this.currGraph].lights);\n\n this.sceneInited = true;\n\n this.materialNo = 0;\n }", "preRender() {\n // draw the container svg for the chart\n this.dom.svg = d3.select(this.dom.graphContainer).append('svg')\n .attr('width', this.width + this.margin.left + this.margin.right)\n .attr('height', this.height + this.margin.top + this.margin.bottom)\n .append('g')\n .attr('transform', `translate(${this.margin.left}, ${this.margin.top})`);\n\n this.dom.svg.append('g')\n .attr('class', 'data');\n\n this.setupAxis('xAxis');\n this.setupLegend();\n }", "_chartistLoaded() {\n this.__chartistLoaded = true;\n this._renderChart();\n }", "function init() {\n var url = \"/api/statelist\";\n d3.json(url).then(function (menuData) {\n console.log(menuData);\n\n // Prepare menu items for State dropdown\n for (var i = 0; i < menuData.length; i++) {\n d3.select(\"#selDataset\")\n .append(\"option\").text(menuData[i].State);\n }\n\n // Populate demographic info box with first ID\n var state = menuData[0].State;\n\n url = \"/api/\" + state + \"/counties\";\n d3.json(url).then(function (countyData) {\n console.log(countyData);\n // Prepare menu items for County dropdown\n d3.select(\"#selCountyDataset\")\n .append(\"option\").text(\"--Select--\");\n\n for (var i = 0; i < countyData.length; i++) {\n d3.select(\"#selCountyDataset\")\n .append(\"option\").text(countyData[i].County);\n }\n\n plotAndInfo(state);\n plotLineGraph(state);\n plotBubble(state);\n })\n });\n}", "function init(){\n\n d3.json(\"static/data/year.json\").then(function(raw) { \n console.log(\"raw data from first pull down selection\")\n console.log(raw)\n\n \n // Identifies unique years to populate pull down menu\n var teamList = raw.map(raw => raw.team);\n teamList = uniqueArray4(teamList); \n console.log(teamList);\n\n\n // populates pull down list with team names/// IT WORKS!!!! YES!!!!!!!!!\n teamList.forEach(i =>\n d3.select(\"select\")\n .append(\"option\")\n .text(i)\n .property(\"value\", i)\n );\n \n // Use the first sample from the list to build the initial plots\n var firstSample = \"ARI\";\n drawChart(firstSample);\n\n\n });\n\n\n}", "function preload(){\n //load world map data and contacts data\n url = \"https://raw.githubusercontent.com/holtzy/D3-graph-gallery/master/DATA/world.geojson\";\n geographies = loadJSON(url);\n url2 = \"https://raw.githubusercontent.com/awhite2/CreativeCoding/main/contacts.geojson\";\n contacts = loadJSON(url2);\n \n}", "function init() {\n // Grab a reference to the dropdown select element\n var selector = d3.select(\"#selDataset\");\n \n // Use the list of state names to populate the select options\n stateArray.forEach((state) => {\n selector.append(\"option\")\n .text(state)\n .property(\"value\", state);\n });\n \n // Build first chart using Minnesota\n updateLinechart('Minnesota');\n}", "onGraphLoaded() {\n this.axis = new CGFaxis(this, this.graph.referenceLength);\n\n this.gl.clearColor(\n this.graph.background[0],\n this.graph.background[1],\n this.graph.background[2],\n this.graph.background[3]\n );\n\n this.setGlobalAmbientLight(\n this.graph.ambient[0],\n this.graph.ambient[1],\n this.graph.ambient[2],\n this.graph.ambient[3]\n );\n\n this.initLights();\n\n this.sceneInited = true;\n }", "function initDashboard() {\n console.log(\"Initializing Screen\");\n \n // The Initialize function needs to do the following:\n // Populate the dropdown box with all the IDs - create variable to select the dropdown\n var selector = d3.select(\"#selDataset\");\n\n // Read json file with data, then populate the dropdown using the key from the data (names in this case)\n d3.json(\"samples.json\").then((data) => {\n var sampleNames = data.names;\n\n // For each sample, use the value from the key to populate the contents of the dropdown box -\n // append an option to it, set text to it and assign a property\n sampleNames.forEach((sampleID) => { \n selector\n .append(\"option\") \n .text(sampleID)\n .property(\"value\", sampleID); \n });\n \n var sampleID = sampleNames[0];\n\n // Populate Demographic Information\n showDemographicInfo(sampleID);\n // Draw bargraph\n drawBarGraph(sampleID);\n // // Draw bubble chart\n drawBubbleChart(sampleID);\n\n });\n\n }", "function init() {\n d3.json(\"data/samples.json\").then((incomingData) => {\n var dropDown = d3.select('#selDataset');\n //console.log(incomingData);\n\n // Loop for all test subject IDs.\n incomingData.names.forEach((name) => {\n dropDown.append('option').text(name).property('value', name);\n });\n\n // Grabbing first ID.\n var firstID = incomingData.names[0];\n //console.log(firstID);\n\n // Running function on first ID to create initial dashboard.\n optionChanged(firstID);\n });\n}", "function setup() {\n d3.json(\"http://127.0.0.1:5000/data\").then(function(data) {\n \n // Create initial dashboard view\n var neighborhood_list = data.Map_Data.map(d=>d[0]);\n var TS_initial_labels = data.N_CountbyYear[\"Minneapolis\"][0];\n var TS_initial_values = data.N_CountbyYear[\"Minneapolis\"][1];\n var P_initial_labels = data.N_CountbyProblem[\"Minneapolis\"][0];\n var P_initial_values = data.N_CountbyProblem[\"Minneapolis\"][1];\n var FT_initial_labels = data.N_CountbyForceType[\"Minneapolis\"][0];\n var FT_initial_values = data.N_CountbyForceType[\"Minneapolis\"][1];\n \n console.log(data.N_CountbyProblem[\"Minneapolis\"]);\n \n myBestChart = CreateTimeSeries(TS_initial_labels, TS_initial_values);\n console.log(myBestChart.config.data.datasets.data);\n myOtherChart = CreateProblemChart(P_initial_labels,P_initial_values);\n myChart = CreateForceTypeChart(FT_initial_labels, FT_initial_values);\n \n // Select Divs containing select\n var innerContainer = document.querySelector('.well'),\n userSelector = innerContainer.querySelector('#selDataset');\n \n // Function to append all neighborhoods as options for the dropdown\n function assignOptions(neighborhood, selector) {\n for (var i = 0; i < neighborhood.length; i++) {\n if (neighborhood[i] !== null) {\n var currentOption = document.createElement('option');\n currentOption.text = neighborhood[i];\n selector.appendChild(currentOption);\n } else {\n console.log(\"skipped neighborhood\")\n }\n }\n }\n\n // Call menu creation function\n assignOptions(neighborhood_list, userSelector);\n\n // Update charts\n function updatePlotly() {\n\n var dropdownMenu = d3.select(\"#selDataset\");\n // Assign the value of the dropdown menu option to a variable\n var dataset = dropdownMenu.property(\"value\");\n // Push selection to console\n console.log(dataset);\n \n // Select new data for time series plot\n var labels = data.N_CountbyYear[dataset][0];\n var values = data.N_CountbyYear[dataset][1];\n // Destroy old chart per chart.js \n myBestChart.destroy();\n // Call function to create new chart and pass new data\n myBestChart = CreateTimeSeries(labels, values);\n\n // Select new data for time series plot\n var P_labels = data.N_CountbyProblem[dataset][0];\n var P_values = data.N_CountbyProblem[dataset][1];\n // Destroy old chart per chart.js \n myOtherChart.destroy();\n // Call function to create new chart and pass new data\n myOtherChart = CreateProblemChart(P_labels, P_values);\n \n // Select new data for time series plot\n var FT_labels = data.N_CountbyForceType[dataset][0];\n var FT_values = data.N_CountbyForceType[dataset][1];\n // Destroy old chart per chart.js \n myChart.destroy();\n // Call function to create new chart and pass new data\n myChart = CreateForceTypeChart(FT_labels, FT_values); \n };\n\n // Update charts when dropdown menu changes\n d3.selectAll(\"#selDataset\").on(\"change\", updatePlotly);\n \n })\n}", "function init() {\n\n // 1. call a resize on load to update width/height/position of elements\n handleResize();\n\n // 2. setup the scrollama instance\n // 3. bind scrollama event handlers (this can be chained like below)\n scroller\n .setup({\n container: '#scroll', // our outermost scrollytelling element\n graphic: '.scroll__graphic', // the graphic\n text: '.scroll__text', // the step container\n step: '.scroll__text .step', // the step elements\n offset: 0.25, // set the trigger to be 0.25 way down screen\n debug: false, // not display the trigger offset for testing\n })\n .onStepEnter(handleStepEnter)\n .onContainerEnter(handleContainerEnter)\n .onContainerExit(handleContainerExit);\n\n // setup resize event\n window.addEventListener('resize', handleResize);\n\n legendVol1()\n legendVol2()\n\n d3.queue() \n .defer(d3.csv, './data/busroutes.csv') \n .defer(d3.csv, './data/busstops.csv') \n .await(initializeData); \n\n}", "function initData(){\n dynarexDataIsland.init();\n loadFunctionTimes();\n setEventListener();\n}", "_initializeChart() {\n const {\n element,\n rootNode,\n zoomBehaviour,\n selectedProcessId\n } = this.getProperties('element', 'rootNode', 'zoomBehaviour', 'selectedProcessId');\n const el = select(element);\n\n // Needed for zooming\n this.centeringElement = el.select('.centering-element');\n\n const parent = el.select('svg');\n parent.call(zoomBehaviour);\n\n this.parent = parent;\n if (rootNode) {\n // Reset Zoom\n const transform = zoomIdentity\n .scale(1)\n .translate(0, 0);\n zoomBehaviour.transform(parent, transform);\n\n this._buildChart(rootNode);\n addSelectedClass(selectedProcessId);\n }\n }", "initializeElements () {\n const d3Body = d3.select('body')\n const d3Main = d3.select('main')\n d3Body.classed('initialized', true)\n d3Body.attr('data-view-mode', this.settings.viewMode)\n\n this.mainContainer.d3Element = d3Main.size()\n ? d3Main\n : d3Body.append('main').attr('id', 'bubbleprof-main')\n this.mainContainer.d3ContentWrapper = this.mainContainer.d3Element\n\n // TODO: try replacing with .emit('initializeElements')\n for (const section of this.sections.values()) {\n section.initializeElements()\n }\n\n this.on('highlightType', (className) => {\n d3Body.attr('data-highlight-type', className || null)\n })\n\n this.on('highlightParty', (className) => {\n d3Body.attr('data-highlight-party', className || null)\n })\n\n const debounceTime = 300\n const nodeLinkSection = this.getNodeLinkSection()\n if (!this.layoutNode) {\n this.resizeSpinner = spinner.attachTo(nodeLinkSection.d3Element.node())\n }\n\n const onWindowResize = debounce(() => {\n this.redrawLayout()\n\n if (this.resizeSpinner) {\n this.resizeSpinner.hide()\n }\n }, debounceTime)\n\n window.addEventListener('resize', () => {\n if (this.resizeSpinner) {\n this.resizeSpinner.show('Redrawing...')\n }\n\n onWindowResize()\n })\n\n if (this.originalUI === this) {\n this.initializeBackButton()\n }\n }", "function loadData() {\n\n d3.queue()\n .defer(d3.csv, './data/data.csv')\n .await(processData); \n\n }", "function dataReady() {\n // números grandes, precisa normalizar\n neuralNet.normalizeData();\n // treinar a neuralNet com os dados carregados\n neuralNet.train({epochs:50}, loaded);\n}" ]
[ "0.705255", "0.6885922", "0.68565935", "0.66266733", "0.66253453", "0.6545289", "0.6535469", "0.6512057", "0.65115803", "0.6481609", "0.64461374", "0.6429353", "0.63752764", "0.6360469", "0.6350081", "0.63429004", "0.6341875", "0.6337636", "0.63354945", "0.63226116", "0.6322186", "0.63180584", "0.631657", "0.62952304", "0.6277307", "0.6273319", "0.6269448", "0.62692046", "0.6269", "0.6263528", "0.6263063", "0.62358576", "0.6233452", "0.6229806", "0.6220305", "0.6196215", "0.6182628", "0.6173385", "0.6150353", "0.61334246", "0.61266327", "0.6122795", "0.6120633", "0.61150366", "0.61138016", "0.6112438", "0.6102974", "0.6100723", "0.6093274", "0.607854", "0.6067664", "0.6065214", "0.6053194", "0.6037995", "0.60280704", "0.60262525", "0.60137695", "0.6013213", "0.6001255", "0.5999186", "0.5995792", "0.5993675", "0.59894246", "0.59843016", "0.5983833", "0.59772825", "0.5963291", "0.5945223", "0.59444314", "0.59394807", "0.59393406", "0.59379596", "0.59280795", "0.59273994", "0.5927265", "0.59211665", "0.59211665", "0.59125316", "0.5912378", "0.5906808", "0.59008723", "0.5882406", "0.58771586", "0.58686393", "0.5849897", "0.58474517", "0.58422834", "0.58349955", "0.5834673", "0.5810382", "0.5810029", "0.57859385", "0.5785284", "0.578114", "0.57703865", "0.57672435", "0.575675", "0.57552415", "0.574923", "0.5741343", "0.5737604" ]
0.0
-1
select items to analyze / graph type
function capitalizeFirstLetter(string) { return string.charAt(0).toUpperCase() + string.slice(1); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onSelectType(type){\n\t/*\n\t * if selected type is structure or land and selected group by option is property\n\t * we must reset group by option to ctry\n\t */\n\tif (type == \"structure\" || type == \"land\") {\n\t\tvar groupBy = $(\"group_by\").value;\n\t\tif (groupBy == \"property\") {\n\t\t\t$(\"group_by\").value = \"geo_region\";\n\t\t}\n\t}\n\tvar controller = View.controllers.get(\"abRepmPfadminItemsByLocationController\");\n\tcontroller.customizeConsoleForItemType();\n}", "function chooseValueType(item) {\n if (!item || !item.valueType || !item.visualMode) return;\n item.valueType = item.valueType.toUpperCase();\n item.visualMode = item.visualMode.toUpperCase();\n\n // console.log(item);\n // console.log(item.value, item.value && !_.isArray(item.value));\n switch (true) {\n case (((item.valueType === 'STRING') && (item.visualMode === 'SELECT')) ||\n ((item.valueType === 'INTEGERARRAY') && (item.visualMode === 'SELECT'))):\n renderControl('select');\n break;\n case ((item.valueType === 'DATETIME') && (item.visualMode === 'DATERANGEPICKER')):\n renderControl('date-range');\n break;\n case ((item.valueType === 'DOUBLE') && (item.visualMode === 'DOUBLERANGESLIDER')):\n renderControl('range-slider');\n break;\n case ((item.valueType === 'INTEGER') && (item.visualMode === 'INTEGERRANGESLIDER')):\n renderControl('range-slider');\n break;\n case (\n // (item.value && !_.isArray(item.value)) ||\n (item.visualMode === 'CHECKBOX') ||\n ((item.valueType === 'STRINGARRAY') && (item.visualMode === 'LABEL')) ||\n ((item.valueType === 'INTEGERARRAY') && (item.visualMode === 'LABEL'))):\n if(item.value && !_.isArray(item.value) && !item.options) item.options = [item.value];\n renderControl('checkbox-group');\n break;\n case ((item.valueType === 'BOOLEAN') && (item.visualMode === 'RADIOGROUP')):\n renderControl('radio-group');\n break;\n default:\n //Empty\n }\n }", "function selectByTypes(e) {\n\tbtnLoadMore.style.display = 'none';\n\tcardsList.innerHTML = '';\n\tlet keyType = e.target.value;\n\tlet arrByType = dataArr.filter((card) => card.types.join(', ').toLowerCase().includes(keyType.toLowerCase()));\n\t\n\trenderCardList(arrByType);\n}", "handleTypeSelection(e) {\r\n const selectedCat = e.target.dataset.category;\r\n this.toggleLegendState(e.target);\r\n let selectedTypes = this.state.selectedType;\r\n if(selectedTypes.indexOf(selectedCat) > -1) {\r\n selectedTypes.splice(selectedTypes.indexOf(selectedCat), 1);\r\n } else {\r\n selectedTypes.push(selectedCat);\r\n }\r\n this.setState({selectedType: selectedTypes});\r\n this.filterDataSet(selectedTypes);\r\n }", "filterDataSet(selectedTypes) {\r\n if(selectedTypes && selectedTypes.length > 0) {\r\n let itemSet = new Set();\r\n this.state.items.map(item => (item.types.map(type => {if(selectedTypes.indexOf(type) > -1){itemSet.add(item); return;}})));\r\n this.setState({filteredData: Array.from(itemSet)});\r\n } else {\r\n this.setState({filteredData: this.state.allowedData});\r\n }\r\n }", "function onSelect(type) {\n //console.log(\"select id : \", type);\n setShow(\n array1.filter(item => {\n return item.type == type;\n })\n );\n\n setDisplayMin(0);\n }", "function dotheviz() {\n //---------------------------------\n //------------------ select items to analyze / graph type\n //---------------------------------\n function capitalizeFirstLetter(string) {\n return string.charAt(0).toUpperCase() + string.slice(1);\n }\n thehtml = '<select id=\"selectITEM\" style=\"width:170px;\" >'\n fields.filter(function(f){return (f!='S2' || database=='scopus') ; }).forEach(function(f){thehtml+='<option value=\"'+f+'\" '+(field_option==f?'selected':'')+'>'+capitalizeFirstLetter(items[f])+'</option>'})\n thehtml += '</select>'\n d3.select('#itemselection').html(thehtml) \n d3.select('#selectITEM').on('change',function(){update();})\n\n thehtml = '<select id=\"selectGRAPH\" style=\"width:170px;\" >'\n thehtml += '<option value=\"custom\" '+(graph_option=='custom'?'selected':'')+'>Custom</option>'\n thehtml += '<option value=\"science\" '+(graph_option=='science'?'selected':'')+'>Distributions</option>'\n thehtml += '</select>'\n d3.select('#graphselection').html(thehtml) \n d3.select('#selectGRAPH').on('change',function(){update();})\n\n foo='<select id=\"selectSORTtab\" style=\"width:170px;\" >'\n foo+='<option value=\"NB\" selected>Record count</option>'\n foo+='<option value=\"ITEM\">Item</option>'\n foo+='</select>'\n d3.select('#sortTAB').html(foo) \n\n //...\n d3.select('#NUMPUB').html(Npapers)\n prep_infobulle(\"#info_fs\", \"Items from that field will be listed on the left panel in numeric order, based on the number of documents in which they appear.\")\n prep_infobulle(\"#info_gt\", \"Choose between different options:<br/><ul><li>The \\\"Custom\\\" option will display the information in the left panel in a custom representation (either a co-occurrence network, a pie chart, a word cloud or a map)</li><li>The \\\"Distributions\\\" option will produce a histogram of the number of items per publication and a cumulative distribution graph displaying the number of items appearing in at least <i>x</i> documents, for varying <i>x</i>. This last graph use logarithmic scales on both axes, which is useful to recognize power law relationships, appearing as straight lines.</li></ul>\")\n prep_infobulle(\"#info_sl\", \"We only display items appearing more than <i>x</i> times, the threshold <i>x</i> being chosen so that the length of the list is less than 10000.\")\n update();\n} // end of D3ok()", "function show_facility_type_selector(ndx) {\n\n\n serviceSelectorDim = ndx.dimension(dc.pluck('type'));\n serviceSelectorGroup = serviceSelectorDim.group()\n dc.selectMenu(\"#service_type_selector\")\n .dimension(serviceSelectorDim)\n .group(serviceSelectorGroup)\n .promptText('All Sites');\n \n}", "function selectActivityTypeFilter() {\n return function (items, activityTypeId, withCommutes) {\n var retArray = [];\n if (activityTypeId.id == ALL_ACTIVITIES && withCommutes) {\n return items;\n }\n angular.forEach(items, function (obj) {\n // activityTypeId can either be an activity type or a bike type because we use a flat selector\n if (((activityTypeId.id == ALL_ACTIVITIES) || (obj.bike_type == activityTypeId.label || obj.activity_type == activityTypeId.label)) && (withCommutes || !obj.commute)) {\n retArray.push(obj);\n }\n });\n return retArray;\n };\n}", "updateType(type) {\n\t\tif (type === \"Meteorites\") this.category = \"meteors\";\n\t\telse if (type === \"Fireballs\") this.category = \"fireballs\";\n\t\telse if (type === \"Future Events\") this.category = \"futureEvents\";\n\t\telse this.category = \"default\";\n\t\tlet selectedData = this.selectionData[this.category]; //this.allData[this.category];\n\t\t\n\t\tlet options = d3.select(\"#columnSelect\")\n\t\t\t.selectAll(\"option\")\n\t\t\t.data(selectedData);\n\t\t\n\t\toptions.exit().remove();\n\t\toptions = options.enter().append(\"option\").merge(options);\n\t\toptions.attr(\"value\", function(d) { return d; })\n\t\t\t.text(function(d) { return d; });\n\t}", "function selectNode() {\n if ((graphTypes[selected] == \"material\") || (graphTypes[selected] == \"process\")) {\n updateAttributes(this);\n } else if (graphTypes[selected] == \"link\") {\n addEdge(this);\n } else if (graphTypes[selected] == \"delete\") {\n deleteNode(this.id);\n }\n}", "function isItem(opts, node) {\n return opts.typeItem.includes(node.type);\n}", "getSelectedDishes(type) {\n return this.menu.filter(dish => dish.dishTypes.includes(type));\n }", "function valueTypeChange() {\n if (vm.annotType.valueType === 'Select') {\n // add an option if none exist\n if (!vm.annotType.options || (vm.annotType.options.length < 1)) {\n optionAdd();\n }\n } else {\n vm.annotType.options = undefined;\n vm.annotType.maxValueCount = 0;\n }\n }", "idType () {\n const name = this.currentAstNode.value\n const nextResults = this.initialItems.filter(node =>\n (name === node.name) || (name === node.package.name)\n )\n this.processPendingCombinator(nextResults)\n }", "function generateTypeSelector(allType, types) {\n var resultDiv = doc.createElement(\"div\");\n\n resultDiv.appendChild(doc.createTextNode(\"Select type: \"));\n\n var dropdown = doc.createElement(\"select\");\n\n dropdown.appendChild(optionElement(\"All types\", \"null\"));\n\n for (var uri in types) {\n dropdown.appendChild(optionElement(types[uri].getLabel(), uri));\n }\n\n dropdown.addEventListener(\"click\", function() {\n var type;\n\n if (dropdown.value == \"null\") {\n type = allType;\n } else {\n type = types[dropdown.value];\n }\n\n typeSelectorChanged(type);\n }, false);\n\n resultDiv.appendChild(dropdown);\n\n return resultDiv;\n }", "function typeUpdated(e) {\n var index = item.index();\n console.log(index, signals[id]);\n var signal = signals[id][index];\n var typeVal = type_select.val();\n var subtypeVal = subtype_select.val();\n signal.type = typeVal;\n signal.subtype = subtypeVal;\n }", "function useItem() {\n for (i = 0; i < items.length; i++) {\n if (items[i].selected) {\n items[i].use();\n console.log(\"datt\");\n }\n }\n \n}", "function selectType(e){\n var evn = e || event;\n var a = evn.target;\n var newIndexType=parseInt(a.getAttribute('data-array'));\n setNewType(newIndexType);\n}", "function salary_type_selector(ndx){\n var salary_type_selector_dim = ndx.dimension(dc.pluck('Type'));\n var salary_type_selector_group = salary_type_selector_dim.group();\n\n dc.selectMenu(\".salary-type-selector\")\n .dimension(salary_type_selector_dim)\n .group(salary_type_selector_group);\n}", "function type(node) {\n\t\treturn node.getAttribute('type') || (/^select/i.test(node.nodeName) ? 'select' : 'text');\n\t}", "ngOnInit() {\n if (!this.items) { this.items = []; }\n\n if (this.items[0] || !this.selectedItem) {\n this.selectedItem = this.items[0];\n }\n\n if (this.types.length === 0) {\n //If no specific classes were specified, it works with any class\n let visualClasses = [...this.model.Artefact.allSubclasses()].map(x => x.name);\n for (let cls of Object.values(this.model)){\n if (cls.isResource && !cls.abstract && !visualClasses.includes(cls.name)){\n this.types.push(cls.name);\n if (cls.name === this.model.Lyph.name){ this.types.push(\"LyphWithAxis\"); }\n }\n }\n }\n this._zones = this.types.map(x => x + \"_zone\");\n }", "function getByType(type) {\n let listnew = [];\n dataPost.forEach((item, index) => {\n if (item.type.toLowerCase() == type) {\n listnew.push(item);\n }\n });\n showPost(listnew);\n // console.log(listnew);\n }", "function selectEntryToExamine(item) {\n\tvar selectionList = [item.user]\n\tconsole.log(\"geomap selection:\",selectionList)\n\tvar outObject = {'user':selectionList}\n\tOWF.Eventing.publish(\"entity.selection\",selectionList)\n}", "function switchEdgeType(){\r\n\tcy.$('edge:selected').each(function(edge, j, edges){\r\n\t\tfor(let i = 0; i < EDGE_TYPES_SWITCH.current.length; i++){\r\n\t\t\tedge_class = EDGE_TYPES_SWITCH.current[i];\r\n\t\t\tif(edge.hasClass(edge_class)){\r\n\t\t\t\tedge.removeClass(edge_class).addClass(EDGE_TYPES_SWITCH.next[i]);\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t});\r\n}", "function y_select_change(self) {\n $(self).parent().find(\".attr-options\").fadeOut();\n var type = $(self).find(\":selected\").attr('type');\n if(type == \"gene\"){\n $(self).parent().find('.y-gene-attribute-select option:contains(\"select a specification\")').prop('selected', true);\n $(self).parent().find(\".y-gene-attribute-select\").fadeIn();\n var gene = $(self).find(\":selected\").val();\n } else {\n $(self).parent().find('.y-gene-attribute-select option:contains(\"select a specification\")').prop('selected', true);\n $(self).parent().find(\".y-gene-attribute-select\").fadeOut();\n $(self).parent().find(\"#y-data-type-container\").fadeOut();\n }\n }", "function handleAnnotationTypeChange() {\n gAnnotationType = parseInt($('#annotation_type_id').val());\n globals.currentAnnotationsOfSelectedType = gCurrentAnnotations.filter(function(e) {\n return e.annotation_type.id === gAnnotationType;\n });\n setTool();\n setupCBCheckboxes();\n }", "function filter(category){\n d3.select(\".dropbtn\").text(category);\n switch(category){\n case 'all':\n svg.selectAll(\".node\")\n .select(\"circle\")\n .attr(\"opacity\", 1);\n svg.selectAll(\".node\")\n .select(\"text\")\n .attr(\"opacity\", 1);\n break;\n default:\n svg.selectAll(\".node\")\n .select(\"circle\")\n .attr(\"opacity\", function(d){ return d.category == category? 1:0;});\n svg.selectAll(\".node\")\n .select(\"text\")\n .attr(\"opacity\", function(d){ return d.category == category? 1:0;});\n break;\n }\n}", "filterByType(e) {\n\t\tdocument.getElementById(\"selected-service\").innerHTML = e.target.innerHTML;\t\t\n\t\tthis._setActiveClass(e);\n\n\t\tlet selected = e.target.getAttribute(\"data-value\");\n\n\t\tif(!selected) {\n\t\t\treturn this.clearFilter(\"typeFilter\").apply();\n\t\t}\n\n\t\treturn this.addFilter(\"typeFilter\", selected).apply();\t\n\t}", "onSelectAll (name) {\n const f = this.dimProp.find((d) => d.name === name)\n if (!f) return\n\n // if options not filtered then all select items in dimension\n // else append to current selection items from the filter\n if (f.options.length === f.enums.length) {\n f.selection = Array.from(f.options)\n } else {\n const a = f.options.filter(ov => f.selection.findIndex(sv => sv.value === ov.value) < 0)\n f.selection = f.selection.concat(a)\n f.selection.sort(\n (left, right) => (left.value === right.value) ? 0 : ((left.value < right.value) ? -1 : 1)\n )\n }\n\n f.singleSelection = f.selection.length > 0 ? f.selection[0] : {}\n f.options = f.enums\n\n this.updateSelectOrClearView(name)\n }", "function getItemType(item) {\n\t\tif (item.rad) {\n\t\t\treturn 'meaning';\n\t\t}\n\n\t\tlet itemReviewData = item.kan ? $.jStorage.get('k' + item.id) : $.jStorage.get('v' + item.id);\n\n\t\tif (itemReviewData === null || (typeof itemReviewData.mc === 'undefined' && typeof itemReviewData.rc === 'undefined')) {\n\t\t\treturn ['meaning', 'reading'][Math.floor(2 * Math.random())];\n\t\t}\n\n\t\tif (itemReviewData.mc >= 1) {\n\t\t\treturn 'reading';\n\t\t}\n\n\t\treturn 'meaning'\n\t}", "function display_list_type(val) {\n display_list_select(val, 'obj_type', document.formSaisieExpress);\n}", "function parseAnalysisInfo(item) {\n switch (item.typ) {\n case 'numeric':\n item.average = item.data.reduce(function (prev, current) {\n return prev + parseInt(current, 10);\n }, 0) / item.data.length;\n item.template = 'numeric';\n break;\n\n case 'info':\n item.data = item.data.map(function(dataItem) {\n dataItem = $mmText.parseJSON(dataItem);\n return typeof dataItem.show != \"undefined\" ? dataItem.show : false;\n }).filter(function(dataItem) {\n // Filter false entries.\n return dataItem;\n });\n case 'textfield':\n case 'textarea':\n item.template = 'list';\n break;\n\n case 'multichoicerated':\n case 'multichoice':\n item.data = item.data.map(function(dataItem) {\n dataItem = $mmText.parseJSON(dataItem);\n return typeof dataItem.answertext != \"undefined\" ? dataItem : false;\n }).filter(function(dataItem) {\n // Filter false entries.\n return dataItem;\n });\n\n // Format labels.\n item.labels = item.data.map(function(dataItem) {\n dataItem.quotient = parseFloat(dataItem.quotient * 100).toFixed(2);\n var label = \"\";\n\n if (typeof dataItem.value != \"undefined\") {\n label = '(' + dataItem.value + ') ';\n }\n label += dataItem.answertext;\n label += dataItem.quotient > 0 ? ' (' + dataItem.quotient + '%)' : \"\";\n return label;\n });\n item.chartData = item.data.map(function(dataItem) {\n return dataItem.answercount;\n });\n\n if (item.typ == 'multichoicerated') {\n item.average = item.data.reduce(function (prev, current) {\n return prev + parseFloat(current.avg);\n }, 0.0);\n }\n\n var subtype = item.presentation.charAt(0);\n item.single = subtype != 'c';\n\n item.template = 'chart';\n break;\n }\n\n return item;\n }", "function onSelectType(evt) {\n var $type = $(this);\n var type = $(this).data('type');\n //Unselect the previous type button\n $('#types .btn-primary').removeClass('btn-primary').addClass('btn-light');\n //Select this button\n $type.removeClass('btn-light').addClass('btn-primary');\n doSearch($('#search').text(), type);\n }", "function filterTypeSelection(e){\n if(e.target.value === ''){\n getInventory()\n } else {\n axios.get(`/inventory/search/dept?dept=${e.target.value}`)\n .then(res => setItems(res.data))\n .catch(err => alert(err))\n }\n }", "function showChartType(params, node){\n\t\t\tvar layout=params.obj;\n\t\t\tif(layout.aggregationType && layout.aggregationType!=\"ohlc\"){\n\t\t\t\tif(chartType!==layout.aggregationType){\n\t\t\t\t\t$(node).removeClass(activeClassName);\n\t\t\t\t}else{\n\t\t\t\t\t$(node).addClass(activeClassName);\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\tif(chartType!==layout.chartType){\n\t\t\t\t\t$(node).removeClass(activeClassName);\n\t\t\t\t}else{\n\t\t\t\t\t$(node).addClass(activeClassName);\n\t\t\t\t}\n\t\t\t}\n\t\t}", "function BXMLTypeSelector(Params)\n{\n\tthis.oML = Params.oML;\n\tthis.oCallback = Params.oCallback;\n\tthis.Types = Params.Types;\n\tthis.Init();\n}", "function setDatatypeSelection(datatypeArray) { \n\tvar selection = new Object();\n\t\n\tif (exhibit._registry._registry.facet.f2 != null) {\n\t\tfor (var i = 0; i < datatypeArray.length; i++) {\n\t\t\tselection[datatypeArray[i]] = true; \n\t\t\texhibit._registry._registry.facet.f2.setSelection(datatypeArray[i], true);\n\t\t} \t\t\n\t\tif (exhibit._registry._registry.facet.f2._valueSet._hash != null) { \n\t\t\texhibit._registry._registry.facet.f2._notifyCollection();\n\t\t}\n\t}\n}", "function crawl ( type, handler ) {\n\t\tgui.Object.each ( type, istype ).forEach ( \n\t\t\tfunction ( type ) {\n\t\t\t\thandle ( type, handler );\n\t\t\t\tcrawl ( type, handler );\n\t\t\t}\n\t\t);\n\t}", "function selectType(type) {\n let selected = $(`input[name='${type}']:checked`);\n if (selected != undefined && selected.length != 0) {\n unselected = $(`input[name='${type}']:not(:checked)`);\n selected.parent().parent().css({\"outline\":\"green solid 4px\"});\n unselected.parent().parent().css({\"outline\":\"grey solid 2px\"});\n selected = undefined;\n }\n selected = undefined;\n}", "function filterOptions () {\n var opts = [\n {\n name : \"general\",\n on : true,\n klass : \"general-type\",\n type : 'type-general'\n },\n {\n name : \"text\",\n on : true,\n klass : \"text-type\",\n type : 'type-text'\n },{\n name : \"image\",\n on : true,\n klass : \"image-type\",\n type : 'type-image'\n }, {\n name : \"color\",\n on : true,\n klass : \"color-type\",\n type : 'type-color'\n }, {\n name : \"layout\",\n on : true,\n klass : \"layout-type\",\n type : 'type-layout'\n }\n ];\n\n return opts;\n }", "function getModelsForSelectedDatatypes(selectedDatatypes) {\n return selectedDatatypes\n .filter(function(datatype) { return datatype.checked; })\n .map(function(datatype) {\n switch( datatype.name ) {\n case 'bloodpressure': return BloodPressure;\n case 'bloodglucose': return BloodGlucose;\n case 'bodyweight': return BodyWeight;\n case 'cholesterol': return Cholesterol;\n case 'bmi': return BMI;\n default: console.error( \"Invalid datatype selected\", datatype.name ); return null;\n }\n });\n }", "function updateSelectors(type){\n\t\n\t//Steps to do:\n\t//\t1. Call the function based on the type.\n\t//\t2. Update the multi selects.\n\t\n\tif ('picks' == type){\n\t\tupdatePicksSelectors(type);\n\t}\n\telse if ('standings' == type){\n\t\tupdateStandingsSelectors(type);\n\t}\n\telse if ('divisionStandings' == type){\n\t\tupdateDivisionStandingsSelectors(type);\n\t}\n\telse if ('stats' == type){\n\t\tupdateStatsSelectors(type);\n\t}\n}", "_getAvailableOptions(model) {\n const targetTypes = Array.from(model._targetTypes);\n if (targetTypes.length !== 1) {\n throw new Error('Unsupported relationship. Expected to find one targetType');\n }\n const doc = this.getDocument();\n const first = targetTypes[0];\n const targetType = first;\n switch (targetType) {\n case 'funder': {\n return doc.get('metadata').resolve('funders');\n }\n case 'affiliation': {\n return doc.get('metadata').resolve('affiliations');\n }\n case 'group': {\n return doc.get('metadata').resolve('groups');\n }\n case 'conflict-of-interest': {\n return doc.get('article').resolve('conflictOfInterests');\n }\n default:\n throw new Error('Unsupported relationship: ' + targetType);\n }\n }", "function fillFilterBy() {\n if (typeof pageProductType != 'undefined') {\n if (pageProductType.length != 0) {\n var selectElement = document.getElementById(\"filterBy\");\n switch(pageProductType) {\n case 'Gloves':\n createOptions(selectElement, filterGloves);\n break;\n case 'Hats':\n createOptions(selectElement, filterHats);\n break;\n case 'Scarves':\n createOptions(selectElement, filterScarves);\n break;\n default:\n // do nothing\n break;\n }\n }\n }\n}", "function chooseData(v) {\n\n console.log(v);\n\n\n // ******* TODO: PART I *******\n // Change the selected data when a user selects a different\n // menu item from the drop down.\n createBarChart(v);\n}", "function drawItemSelection(x,y,w,h,id){\n\t\n\tif (numberSelected() == 1) { //Change to == numberRuleItems\n\t\tallowed = false;\n\t} else if (numberSelected() == 0) { // < numberRuleItems\n\t\tallowed = true;\n\t}\n\t\tconsole.log(ruleType, ruleNumber, ruleColor)\n\t\n\t//Depending on which item you draw... Do the following...\n\tvar img = borderImage2; // deselected\n\tif (id == \"hat\"){\n\t\tif (hatSelected == true){\n\t\t\timg = borderImage; // selected\n\t\t}\n\t\tuiObjects[2] = new uiObject(x, y, w, h, \n\t\t\tfunction (){\n\t\t\t\tif (hatSelected){\n\t\t\t\t\thatSelected = false; // Hat selected\n\t\t\t\t} else if (allowed==true) {hatSelected = true;}\n\t\t\t\tconsole.log(\"hat selected.\")\n\t\t}, null, function() {});\n\t}\n\n\tif (id == \"shirt\"){\n\t\tif (shirtSelected == true){\n\t\t\timg = borderImage; // selected\n\t\t}\n\t\tuiObjects[3] = new uiObject(x, y, w, h, \n\t\t\tfunction (){\n\t\t\t\tif (shirtSelected){\n\t\t\t\t\tshirtSelected = false; // shirt selected\n\t\t\t\t}else if (allowed==true) {shirtSelected = true;}\n\t\t\t\tconsole.log(\"shirt selected.\")\n\t\t}, null, function() {});\t\t\n\t}\n\n\tif (id == \"pants\"){\n\t\tif (pantsSelected == true){\n\t\t\timg = borderImage; // selected\t\t\n\t\t}\n\t\tuiObjects[4] = new uiObject(x, y, w, h, \n\t\t\tfunction (){\n\t\t\t\tif (pantsSelected){\n\t\t\t\t\tpantsSelected = false; // pants selected\n\t\t\t\t}else if (allowed==true) {pantsSelected = true;}\n\t\t\t\tconsole.log(\"pants selected.\")\n\t\t}, null, function() {});\n\t}\n\n\tif (id == \"shoes\"){\n\t\tif (shoesSelected == true){\n\t\t\timg = borderImage; // selected\t\t\n\t\t}\n\t\tuiObjects[5] = new uiObject(x, y, w, h, \n\t\t\tfunction (){\n\t\t\t\tif (shoesSelected){\n\t\t\t\t\tshoesSelected = false; // shoes selected\n\t\t\t\t}else if (allowed==true) {shoesSelected = true;}\n\t\t\t\tconsole.log(\"shoes selected.\")\n\t\t}, null, function() {});\n\t}\n\t\n\t\tif (id == \"itemFront\"){\n\t\tif (itemfSelected == true){\n\t\t\timg = borderImage; // selected\n\t\t}\n\t\tuiObjects[6] = new uiObject(x, y, w, h, \n\t\t\tfunction (){\n\t\t\t\tif (itemfSelected){\n\t\t\t\t\titemfSelected = false; // Hat selected\n\t\t\t\t}else if (allowed==true) {itemfSelected = true;}\n\t\t\t\tconsole.log(\"front item selected.\")\n\t\t}, null, function() {});\n\t}\n\t\n\t\tif (id == \"itemBack\"){\n\t\tif (itembSelected == true){\n\t\t\timg = borderImage; // selected\n\t\t}\n\t\tuiObjects[7] = new uiObject(x, y, w, h, \n\t\t\tfunction (){\n\t\t\t\tif (itembSelected){\n\t\t\t\t\titembSelected = false; // Hat selected\n\t\t\t\t}else if (allowed==true) {itembSelected = true;}\n\t\t\t\tconsole.log(\"back item selected.\")\n\t\t}, null, function() {});\n\t}\n\n\t//create a box around each item.\n\tctx.drawImage(img,x,y,w,h);\n}", "function crawl(type, handler) {\n\t\tgui.Object.each(type, istype).forEach(function(oneType) {\n\t\t\thandle(oneType, handler);\n\t\t\tcrawl(oneType, handler);\n\t\t});\n\t}", "function changeType(typedd, conceptIDsUsed) {\n\t//alert('in changeType -- conceptIDsUsed is '+ conceptIDsUsed);\n\t// Find out which sentence we're looking at\n\tvar sid = parseInt(typedd.readAttribute(\"sid\"));\n\t// remove any entry for this sentence from the hashes\n\tremoveFromHash(sid);\n\tsubTypeHash.unset(sid);\n\tvar typeSelected = typedd.getValue();\n\tcolourDDs(typedd, typeSelected);\n\t// alert(\"type selected:\" + typeSelected);\n\t//REMOVING \"None\" as an option.\n\t// if they haven't selected \"None\" for the type\n\t/*typeSelected != \"None\" && */\n\tif (typeSelected != \"default\") {\n\t\tgetsubtypeOptions(typedd, conceptIDsUsed);\n\t\t//REMOVING \"None\" as an option.\n\t\t// if it is None, empty the subtype menu.\n\t//} else if (typeSelected == \"None\") {\n\t\t//conceptHash.set(sid, \"None\");\n\t\t//typedd.next('select.subtype').innerHTML = '<option sid=\"' + sid\n\t\t\t//\t+ '\" class=\"default\" value=\"default\"><option sid=\"' + sid\n\t\t\t\t//+ '\" class=\"None\" value=\"None\">None</option>';\n\t//\ttypedd.next('select.conceptid').innerHTML = '<option sid=\"' + sid\n\t\t//\t\t+ '\" class=\"default\" value=\"default\"></option><option sid=\"'\n\t\t\t//\t+ sid + '\" class=\"None\" value=\"None\">None</option>';\n\t\t//typedd.next('select.conceptid').down('[value=\"None\"]').selected = true;\n\t\t//typedd.next('select.subtype').down('[value=\"None\"]').selected = true;\n\t} else {\n\t\ttypedd.next('select.subtype').innerHTML = '<option sid=\"' + sid + '\" class=\"default\" value=\"default\"></option>';\n\t\ttypedd.next('select.conceptid').innerHTML = '<option sid=\"' + sid + '\" class=\"default\" value=\"default\"></option>';\n\t\t// leave this alert uncommented -- it is for the user\n\t\tnotify('noan', sid);\n\n\t}\n}", "function typeSelectorChanged()\r\n{\r\n var type = document.getElementsByClassName(name_typeSelector)[0].value;\r\n \r\n \r\n // reset rating stars in the search box\r\n resetRatingStars(document.getElementsByClassName(name_ratingSelector)[0]);\r\n \r\n if (type == 'name') {\r\n showSearchBar();\r\n hideSuburbSelector();\r\n hideRatingSelector();\r\n \r\n } else if (type == 'suburb') {\r\n showSuburbSelector();\r\n hideRatingSelector();\r\n hideSearchBar();\r\n \r\n } else if (type == 'rating') {\r\n showRatingSelector();\r\n hideSuburbSelector();\r\n hideSearchBar();\r\n \r\n } else if (type == 'location') {\r\n showSearchBar();\r\n hideSuburbSelector();\r\n hideRatingSelector();\r\n getLocation();\r\n }\r\n}", "function selectType(abbr) {\n\tif(abbr !== \"standard\") { \t// If standard, leave abbr empty\n\t\ttypeSelected = abbr;\t// Else, save the selection\n\t}\n\telse {\n\t\ttypeSelected = \"\";\n\t}\n\ttypes.forEach(type => {\t\t// remove all selected borders\n\t\tdocument.getElementById(\"badges-\"+type).setAttribute(\"selected\", \"false\");\n\t});\n\tdocument.getElementById(\"badges-\"+abbr).setAttribute(\"selected\", \"true\");\t// add a selected border to the clicked on element\n\n\trefreshIFrame();\t// Refresh the preview with the new variables\n}", "function get_mt_types() {\n\n var metal_cutting_types = [\n {'description': 'Torna', 'selected': false, 'text': 'Turning Lathe', 'value': '1'},\n {'description': 'Freze', 'selected': false, 'text': 'Milling', 'value': '2'},\n {'description': 'Çok fonksiyonlu CNC', 'selected': false, 'text': 'Multi Tasking', 'value': '3'},\n {'description': 'Delme', 'selected': false, 'text': 'Drilling', 'value': '4'},\n {'description': 'Taşlama', 'selected': false, 'text': 'Grinding', 'value': '5'},\n {'description': 'Borlama', 'selected': false, 'text': 'Boring', 'value': '6'}\n ];\n\n var metal_forming_types = [\n {'description': 'Pres', 'selected': false, 'text': 'Press', 'value': '1'},\n {'description': 'Dövme', 'selected': false, 'text': 'Forging', 'value': '2'},\n {'description': 'Ekstrüzyon', 'selected': false, 'text': 'Extrusion', 'value': '3'},\n {'description': 'Haddeleme', 'selected': false, 'text': 'Roll Forming ', 'value': '4'}\n ];\n\n var casting_types = [\n {'description': 'Basınçlı döküm', 'selected': false, 'text': 'Die Casting', 'value': '1'},\n {'description': 'Merkezkaç döküm', 'selected': false, 'text': 'Centrifuge Casting', 'value': '2'},\n ]\n\n var joining_types = [\n {'description': 'TIG Kaynak', 'selected': false, 'text': 'TIG Welding', 'value': '1'},\n {'description': 'MIG Kaynak', 'selected': false, 'text': 'MIG Welding', 'value': '2'},\n {'description': 'Lehimleme', 'selected': false, 'text': 'Brazing', 'value': '3'}\n ];\n\n $.ajax({\n url: 'https://proxy.uretimosb.com/SlimProxyBoot.php',\n data: {\n url: 'fillComboBox_syscountrys',\n language_code: $(\"#langCode\").val(),\n component_type: 'ddslick'\n },\n type: 'GET',\n dataType: 'json',\n //data: 'rowIndex='+rowData.id,\n success: function (data, textStatus, jqXHR) {\n if (data.length !== 0) {\n var dataset;\n if ($(\"#selected_mt_category\").val() === 'Metal Cutting') {\n dataset = metal_cutting_types;\n } else if ($(\"#selected_mt_category\").val() === 'Metal Forming') {\n dataset = metal_forming_types;\n } else if ($(\"#selected_mt_category\").val() === 'Casting') {\n dataset = casting_types;\n } else if ($(\"#selected_mt_category\").val() === 'Joining') {\n dataset = joining_types;\n }\n\n// console.log(data);\n $('#machine_types').ddslick('destroy');\n $('#machine_types').ddslick({\n data: dataset,\n width: '100%',\n height: '500%',\n background: false,\n selectText: window.lang.translate(\"Please select a category from list...\"),\n imagePosition: 'right',\n onSelected: function (selectedData) {\n\n $(\"#selected_mt_type\").empty();\n $(\"#selected_mt_brand\").empty();\n $(\"#selected_mt_series\").empty();\n\n $('#machine_brands').ddslick('destroy');\n $('#machine_series').ddslick('destroy');\n\n $(\"#show_sel_mt_btn\").css('display', 'none');\n $(\"#show_sel_mt_btn\").css('visibility', 'hidden');\n $(\"#reset_sel_mt_btn\").css('display', 'none');\n $(\"#reset_sel_mt_btn\").css('visibility', 'hidden');\n\n $(\"#selected_mt_type\").val(selectedData.selectedData.text);\n $(\"#selected_mt_type\").append(selectedData.selectedData.text);\n\n get_mt_brands();\n }\n });\n } else {\n console.error('\"machine tools types\" servis datası boÅŸtur!!');\n }\n },\n error: function (jqXHR, textStatus, errorThrown) {\n console.error('\"machine tools types\" servis hatası->' + textStatus);\n }\n });\n}", "function locateSingleChoice () {\n\td3.selectAll (\"g#vertices circle\").each(function (h,i){\n\t\tvar vtx = d3.select(this);\n\t\tvtx.classed(\"singlechoice\", false);\n\t\tvar isBorder = false;\n\t\tfor (let g of h.ds.vertexCirculator(h)) {\n\t\t\tif (g.isBorder) {\n\t\t\t\tisBorder = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif (!isBorder) return;\n\t\tvar vtype = vertexNodeType(h);\n\t\tvar matches = archMatch(vtype);\n\t\tif (matches.length == 1) {\n\t\t\td3.select(this).classed(\"singlechoice\", true);\n\t\t}\t\n\t});\n}", "function getTypes() {\n\t\tif (focusCategory === \"All Types\") {\n\t\t\treturn [\"All Types\"];\n\t\t} else {\n\t\t\treturn d3.map(this.data.pointsData, function(d) {\n\t\t\t\treturn d[categories[focusCategory]];\n\t\t\t}).keys().sort();\n\t\t}\n\t}", "function filterCrewAvail(){\n\n // get current selected parameters from DOM <select> elements\n let baseSelection = $(\"#baseSelect option:selected\").text();\n let crewSelection = $(\"#crewTypeSelect option:selected\").text();\n \n // case: all bases and all crew types\n if(baseSelection === \"All\" && crewSelection === \"All\"){ \n drawVis(masterData); // draw visualization with all data\n return;\n } \n\n // case: specific bases and all crew types\n else if(baseSelection !== \"All\" && crewSelection === \"All\"){ \n let filteredData = masterData.filter(function(d){\n return d.base===baseSelection;\n });\n drawVis(filteredData);\n return;\n } \n\n // case: all bases and specific crew types\n else if(crewSelection !== \"All\" && baseSelection === \"All\"){ \n let filteredData = masterData.filter(function(d){\n return d.crewType === crewSelection;\n });\n drawVis(filteredData);\n return;\n } \n\n // case: specific bases and specific crew types\n else { \n let filteredData = masterData.filter(function(d){\n return d.crewType === crewSelection && d.base === baseSelection;\n });\n drawVis(filteredData);\n return;\n }\n }", "function getTypes(data) {\n\t\tvar types = Object.keys(data.overall);\n\n\t\treturn types;\n\t}", "function testType(d, type) {\n return node_by_id[d.source].type === type || node_by_id[d.target].type === type;\n } //A version that has to be used after the simulations have run", "selectItem (i) { this.toggSel(true, i); }", "getUniqueTypes() {\r\n let typesSet = this.state.types;\r\n this.state.items.map(item => (item.types.map(type => {if(this.state.allowedTypes.indexOf(type) > -1) typesSet.add(type)})));\r\n return Array.from(typesSet);\r\n }", "function D_GQTypeOptions() {\n var paramsPage = pega.ui.ClientCache.find(\"D_GQTypeOptions.pxDPParameters\");\n var GQTypeOptions = pega.ui.ClientCache.find(\"D_GQTypeOptions\").put(\"pxResults\",[]);\n var nameParam = paramsPage.get(\"Name\").getValue();\n var GQTypeOptionsMaster = pega.ui.ClientCache.find(\"D_AllGQTypes.pxResults\").iterator(); \n while(GQTypeOptionsMaster.hasNext()) {\n var currentPage = GQTypeOptionsMaster.next()\n if(currentPage.get(\"Name\").getValue() == nameParam) {\n GQTypeOptions.add().adoptJSON(currentPage.getJSON()); \n }\n }\n}", "function handleTypeChange(e){\n //update the selectedType object\n publicAPI.$npcSelectedType = $(this);\n // update the available skills to select based on the new matrix\n //debug string\n console.log(`Type changed to ${publicAPI.$npcSelectedType.val()}`);\n updateAvailableSkillsSelectors();\n }", "_getTypesList(){\n return [\n {\"optText\": \"Select type\", \"optValue\":\"\"},\n {\"optText\": \"Media Type\", \"optValue\":\"MediaType\"},\n {\"optText\": \"Localization Type\", \"optValue\":\"LocalizationType\"},\n {\"optText\": \"State Type\", \"optValue\":\"StateType\"},\n {\"optText\": \"Leaf Type\", \"optValue\":\"LeafType\"},\n ];\n }", "if (availableOptions.length > 0) {\n setSelected(newItem);\n setSearch(newItem.label);\n if (onSelect) onSelect({ event, item: newItem });\n }", "function selectFilter() {\n createVisualization();\n}", "filterMatchingItems(item) {\n if (this.state.shelf_life === 'All' && this.state.type === 'All') {\n return true;\n } else if (this.state.shelf_life === 'All' && this.state.type === item.type) {\n return true;\n } else if (this.state.shelf_life === item.shelf_life && this.state.type === \"All\") {\n return true;\n } else if (this.state.shelf_life === item.shelf_life && this.state.type === item.type) {\n return true;\n } else {\n return false;\n }\n\n }", "function biquad_type_select(table, handler) {\n var row = table.insertRow(-1);\n var col_name = row.insertCell(-1);\n var col_menu = row.insertCell(-1);\n\n col_name.appendChild(document.createTextNode('Type'));\n\n var select = document.createElement('select');\n select.className = 'biquad_type_select';\n var options = [\n 'lowpass',\n 'highpass',\n 'bandpass',\n 'lowshelf',\n 'highshelf',\n 'peaking',\n 'notch'\n /* no need: 'allpass' */\n ];\n\n for (var i = 0; i < options.length; i++) {\n var o = document.createElement('option');\n o.appendChild(document.createTextNode(options[i]));\n select.appendChild(o);\n }\n\n select.value = INIT_EQ_TYPE;\n col_menu.appendChild(select);\n\n function onchange() {\n handler(select.value);\n }\n select.onchange = onchange;\n\n function update(v) {\n select.value = v;\n }\n\n this.update = update;\n}", "function select_type() {\n\tvar type = $('#unit_type').val();\n\tif (type == 'unit') {\n\t\t$('#product_type').val('non-variant');\n\t\t$('.js-variant-div').hide();\n\t\t$('.js-variant-price-div').hide();\n\t\t$('#js-non-variant-weight-div').hide();\n\t\t$('#js-non-variant-dimentions-div').hide();\n\t\t$('#js-non-variant-unit-div').show();\n\t}\n\telse if (type == \"weight\") {\n\t\t$('#product_type').val('non-variant');\n\t\t$('.js-variant-div').hide();\n\t\t$('.js-variant-price-div').hide();\n\t\t$('#js-non-variant-unit-div').hide();\n\t\t$('#js-non-variant-dimentions-div').hide();\n\t\t$('#js-non-variant-weight-div').show();\n\t} else if (type == \"dimensions\") {\n\t\t$('#product_type').val('non-variant');\n\t\t$('.js-variant-div').hide();\n\t\t$('.js-variant-price-div').hide();\n\t\t$('#js-non-variant-unit-div').hide();\n\t\t$('#js-non-variant-weight-div').hide();\n\t\t$('#js-non-variant-dimentions-div').show();\n\t} else {\n\t\talert(\"nothing selected\");\n\t}\n}", "function is(type, item) { return (typeof item)[0] == type; }", "function is(type, item) { return (typeof item)[0] == type; }", "function is(type, item) { return (typeof item)[0] == type; }", "function is(type, item) { return (typeof item)[0] == type; }", "function selectState(type) {\n if (type === \"promoters\") {\n return state.promoters;\n } else if (type === \"passives\") {\n return state.passives;\n } else if (type === \"detractors\") {\n return state.detractors;\n }\n }", "function whatTypeIsSelected() {\n\tvar option;\n\t$(\".type\").each(function() {\t\t\n\t\tif($(this).hasClass(\"selected\")) {\n\t\t\tif($(this).text() === \"Addition\"){\n\t\t\t\toption = \"+\";\n\t\t\t}else if($(this).text() === \"Subtraction\"){\n\t\t\t\toption = \"-\";\t\t\t\t\n\t\t\t}else{\n\t\t\t\toption = \"*\";\n\t\t\t}\n\t\t}\t\t\t\t\t\n\t});\t\t\n\treturn option;\n}", "function handleSelect(e) {\n if (input.types.includes(parseInt(e.target.value))) {\n alert('You already selected this type. Try again.')\n } else if (input.types.length >= 3) {\n alert('You can select up to 3 types.')\n } else {\n // traeme lo que ya habia y concatenale el target value donde va a meter en un [] todo lo que yo agregue\n setInput((prev) => ({\n ...prev, \n types: [...prev.types, parseInt(e.target.value)] }))\n }\n }", "function filterType(array,container) {\r\n print(array,container);\r\n $('#type').change(\r\n function(){\r\n let value= $('#type').val();\r\n console.log(value);\r\n if(value!=\"all\"){\r\n const arrayForType= array.filter((element)=>{\r\n return element.type==value;\r\n });\r\n print(arrayForType,container);\r\n } else {\r\n print(array,container);\r\n }\r\n});\r\n\r\n}", "function chooseCategory(){\n var cat = document.getElementById(\"mySelect-viz3\").value;\n if (cat==\"age\"&&!by_1000) {\n plot_viz3(str_age);\n svg.selectAll(\"*\").remove();\n }else if (cat==\"sex\"&&!by_1000) {\n plot_viz3(str_gender);\n svg.selectAll(\"*\").remove();\n }\n else if (cat==\"continent\"&&!by_1000){\n plot_viz3(str_cont);\n svg.selectAll(\"*\").remove();\n } else if (cat==\"age\"&&by_1000) {\n plot_viz3(str_age_1000);\n svg.selectAll(\"*\").remove();\n }else if (cat==\"sex\"&&by_1000) {\n plot_viz3(str_gender_1000);\n svg.selectAll(\"*\").remove();\n }\n else if (cat==\"continent\"&&by_1000){\n plot_viz3(str_cont_1000);\n svg.selectAll(\"*\").remove();\n }\n}", "function choosetype() {\n\t\"use strict\";\n\tvar i = document.getElementById(\"networklist\"); //finds the dropdown menu\n\t//each if statement checks for what item in the list is selected and changes the content with the respective information.\n\tif (i.selectedIndex === 0) {\n\t\tdocument.getElementById('ANNtype').innerHTML = \"The Basics Of Neural Networks\";\n\t\tdocument.getElementById('ANNinfo').innerHTML = basic;\n\t\tdocument.getElementById('ANNimage').innerHTML = '<img src=\"../../_images/simplenetwork.jpg\">';\n\t}\n\tif (i.selectedIndex === 1) {\n\t\tdocument.getElementById('ANNtype').innerHTML = \"Convolutional Neural Networks\";\n\t\tdocument.getElementById('ANNinfo').innerHTML = cnn;\n\t\tdocument.getElementById('ANNimage').innerHTML = '<img src=\"../../_images/cnn.jpeg\">';\n\t}\n\tif (i.selectedIndex === 2) {\n\t\tdocument.getElementById('ANNtype').innerHTML = \"Recurrent Neural Networks\";\n\t\tdocument.getElementById('ANNinfo').innerHTML = rnn;\n\t\tdocument.getElementById('ANNimage').innerHTML = '<img src=\"../../_images/rnnunrolled.png\">';\n\t}\n\tif (i.selectedIndex === 3) {\n\t\tdocument.getElementById('ANNtype').innerHTML = \"Neuroevolutional Network\";\n\t\tdocument.getElementById('ANNinfo').innerHTML = nen;\n\t\tdocument.getElementById('ANNimage').innerHTML = '<img src=\"../../_images/marLO.jpg\">';\n\t}\n}", "function populateItemList(type) {\n let item_list = document.getElementById(type+\"-items\");\n for (const item of itemLists.get(type)) {\n let item_obj = itemMap.get(item);\n if (item_obj[\"restrict\"] && item_obj[\"restrict\"] === \"DEPRECATED\") {\n continue;\n }\n let el = document.createElement(\"option\");\n el.value = item;\n item_list.appendChild(el);\n }\n}", "nodeRender(item) {\n\t\t// verifica se é um grupo ou filtro\n\t\treturn item.id ?\n\t\t\t<a className=\"selectable\" onClick={this.filterClick(item)}>{item.label}</a> :\n\t\t\t<a className=\"lnk-label\" onClick={this.groupClick(item)}><b style={{ fontSize: '1.2em' }}>{item.label}</b></a>;\n\t}", "function select(item){\r\n alert(item.text+\",\"+item.value);\r\n}", "function barsByBeerType(type){\n\tbars.once(\"value\").then(function(snap){\n\t\tloaderBars.style.display = \"none\";\n\t\tnoResults.style.display = \"block\";\n\t\tsnap.forEach(function(childSnapshot){\n\t\t\tchildSnapshot.child(\"beers\").forEach(function(beerchild){\n\t\t\t\t\tif(beerchild.child(\"type\").val() == type){\n\t\t\t\t\t\tbarFilter(childSnapshot);\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t})\n\t\t})\n\t});\t\t\n}", "function _selectElement(type, $element) {\n\t\t\tif($element.isAvailable) {\n\t\t\t\tswitch(type) {\n\t\t\t\t\tcase 'room_choice':\n\t\t\t\t\t\tif(!$element.isCustom)\n\t\t\t\t\t\t\t$element.isAvailable = false;\n\t\t\t\t\t\t$element.css('color', 'white');\n\t\t\t\t\t\t$element.find(\"i\").fadeIn(200, function() {\n\t\t\t\t\t\t\t$element.isAvailable = true;\n\t\t\t\t\t\t\t$element.data('selected', true);\n\t\t\t\t\t\t});\n\t\t\t\t\t\t$element.animate({\n\t\t\t\t\t\t\tbackgroundColor: '#59BAFF'\n\t\t\t\t\t\t}, 200, null);\n\t\t\t\t\t\tif($element.isCustom) {\n\t\t\t\t\t\t\tvar $inputs = $element.find(\"input\");\n\t\t\t\t\t\t\t$inputs.css('color', 'white');\n\t\t\t\t\t\t\t$inputs.css('border-bottom', '1px solid white');\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'multiple_image_choice':\n\t\t\t\t\t\t$element.find(\".circle-select\").addClass('selected');\n\t\t\t\t\t\t$element.find(\".circle-select .background\").fadeIn(200);\n\t\t\t\t\t\t$element.find(\".circle-select .inner-circle-icon\").fadeIn(200);\n\t\t\t\t\t\t$element.data('selected', true);\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}", "function builBbusinessTripTypes() {\n self.types([]);\n \n self.types(rootViewModel.globalTypes());\n \n\n }", "function Selections (type, size, toppings) {\n this.type = type;\n this.size = size;\n this.toppings = [];\n}", "function saveAnomalyTypesForm() {\n // Save anomaly types form\n var anomalyList = document.getElementById(\"anomaly-selection-list\").children;\n for (var i = 0; i < anomalyList.length; i++) {\n var item = anomalyList[i];\n var type = item.getElementsByTagName(\"label\")[0].innerText;\n var value = item.getElementsByTagName(\"input\")[0].value;\n anomalySelectionForm.counts[type] = value;\n }\n // Sets whether anomaly form is used or not\n for (var _type in anomalySelectionForm.counts) {\n var count = anomalySelectionForm.counts[_type];\n var startIndex = anomalyTypeIndexes[_type];\n for (var _i3 = startIndex; _i3 < startIndex + maxAnomalies; _i3++) {\n if (count != 0) {\n anomalyForms[_i3][\"selected\"] = true;\n count -= 1;\n } else anomalyForms[_i3][\"selected\"] = false;\n }\n }\n}", "itemSelectionChanged(sender, args) {\n if (args == null) return\n let item = args.item\n\n if (INode.isInstance(item) && item.style instanceof UMLNodeStyle) {\n let model = item.style.model\n this.div.innerHTML = \"\"\n this.buildNodeProperties(model, this.div)\n } else if (IEdge.isInstance(item) && item.style instanceof UMLEdgeStyle) {\n let model = item.style.model\n this.div.innerHTML = \"\"\n this.buildEdgeProperties(model, this.div);\n\n }\n }", "function announcements_analyse_DEV() {\n var Doc = DocumentApp.getActiveDocument();\n var totalElements = Doc.getNumChildren();\n var el=[]\n for( var j = 0; j < totalElements; ++j ) {\n var element = Doc.getChild(j);\n var type = element.getType();\n log(j+\" : \"+type)\n }\n}", "select(itemValue) {\n\t\tthis.setState({\n\t\t\ttype: itemValue,\n\t\t\tshowSpecfic: true\n\t\t});\n\t\tfetch(`http://192.168.0.14:3000/seeSpicfic?type=${itemValue}`).then((data) => data.json()).then((data) => {\n\t\t\tvar arr = [];\n\t\t\tfor (let i = 0; i < data.length; i++) {\n\t\t\t\tarr.push({ label: data[i].specfic, value: data[i].specfic });\n\t\t\t}\n\t\t\tthis.setState({\n\t\t\t\tspecficArr: arr\n\t\t\t});\n\t\t});\n\t}", "function categorySelect() {\n\t//카테고리 선택 안했을때 -> hamburger\n\tmenus.forEach((menu) => {\n\t\tif (menu.dataset.type !== \"hamburger\") {\n\t\t\t// console.log(menu.dataset.type);\n\t\t\tmenu.classList.add(\"invisible\");\n\t\t}\n\t});\n\n\t//카테고리 선택시\n\tcategory.addEventListener(\"click\", (event) => {\n\t\tconst filter = event.target.dataset.filter;\n\t\tif (filter == null) {\n\t\t\treturn;\n\t\t}\n\n\t\t//선택 카테고리 색상 변경\n\t\tconst active = document.querySelector(\".category_btn.selected\");\n\t\tactive.classList.remove(\"selected\");\n\t\tevent.target.classList.add(\"selected\");\n\n\t\t//메뉴 선별\n\t\tmenus.forEach((menu) => {\n\t\t\tif (filter === menu.dataset.type) {\n\t\t\t\tmenu.classList.remove(\"invisible\");\n\t\t\t} else {\n\t\t\t\tmenu.classList.add(\"invisible\");\n\t\t\t}\n\t\t});\n\t});\n}", "function setEntityType() {\n var new_type = $(this).attr('label')\n var edits = [];\n $(\".entity.ui-selected\").each(function() {\n var eid = this.id;\n edits.push({action:'change_entity_type', id:eid, old_type:entities[eid].type, new_type:new_type});\n });\n if (edits.length > 0) makeEdits(edits);\n return false;\n }", "function choose() {\n var checkBox = document.querySelectorAll('input[type=\"checkbox\"]:checked'),\n radioButton = document.querySelectorAll('input[type=\"radio\"]:checked');\n if (checkBox.length) {\n inputs = checkBox\n } else {\n inputs = radioButton\n }\n var names = [].map.call(inputs, function (input) {\n return input.value;\n }).join(','),\n input = JSON.parse(\"[\" + names + \"]\");\n selections[questionCounter] = input;\n }", "function selectProps(type) {\n if (type === \"promoters\") {\n return totalPromoters;\n } else if (type === \"passives\") {\n return totalPassives;\n } else if (type === \"detractors\") {\n return totalDetractors;\n }\n }", "function colourDDs(typedd, type) {\n\t// alert('type: '+ type);\n\tsubtypedd = Element.next(typedd, 'select.subtype');\n\tconceptidd = Element.next(typedd, 'select.conceptid');\n\tswitch (type) {\n\tcase \"Bac\":\n\t\ttypedd.setStyle( {\n\t\t\tbackgroundColor :\"#666\",\n\t\t\tcolor :\"#FFF\"\n\t\t});\n\t\tsubtypedd.setStyle( {\n\t\t\tbackgroundColor :\"#666\",\n\t\t\tcolor :\"#FFF\"\n\t\t});\n\t\tconceptidd.setStyle( {\n\t\t\tbackgroundColor :\"#666\",\n\t\t\tcolor :\"#FFF\"\n\t\t});\n\t\tbreak;\n\tcase \"Con\":\n\t\ttypedd.setStyle( {\n\t\t\tbackgroundColor :\"#600\",\n\t\t\tcolor :\"#FFF\"\n\t\t});\n\t\tsubtypedd.setStyle( {\n\t\t\tbackgroundColor :\"#600\",\n\t\t\tcolor :\"#FFF\"\n\t\t});\n\t\tconceptidd.setStyle( {\n\t\t\tbackgroundColor :\"#600\",\n\t\t\tcolor :\"#FFF\"\n\t\t});\n\t\tbreak;\n\tcase \"Exa\":\n\t\ttypedd.setStyle( {\n\t\t\tbackgroundColor :\"#660\",\n\t\t\tcolor :\"#FFF\"\n\t\t});\n\t\tsubtypedd.setStyle( {\n\t\t\tbackgroundColor :\"#660\",\n\t\t\tcolor :\"#FFF\"\n\t\t});\n\t\tconceptidd.setStyle( {\n\t\t\tbackgroundColor :\"#660\",\n\t\t\tcolor :\"#FFF\"\n\t\t});\n\t\tbreak;\n\tcase \"Exp\":\n\t\ttypedd.setStyle( {\n\t\t\tbackgroundColor :\"#060\",\n\t\t\tcolor :\"#FFF\"\n\t\t});\n\t\tsubtypedd.setStyle( {\n\t\t\tbackgroundColor :\"#060\",\n\t\t\tcolor :\"#FFF\"\n\t\t});\n\t\tconceptidd.setStyle( {\n\t\t\tbackgroundColor :\"#060\",\n\t\t\tcolor :\"#FFF\"\n\t\t});\n\t\tbreak;\n\tcase \"Goa\":\n\t\ttypedd.setStyle( {\n\t\t\tbackgroundColor :\"#066\",\n\t\t\tcolor :\"#FFF\"\n\t\t});\n\t\tsubtypedd.setStyle( {\n\t\t\tbackgroundColor :\"#066\",\n\t\t\tcolor :\"#FFF\"\n\t\t});\n\t\tconceptidd.setStyle( {\n\t\t\tbackgroundColor :\"#066\",\n\t\t\tcolor :\"#FFF\"\n\t\t});\n\t\tbreak;\n\tcase \"Hyp\":\n\t\ttypedd.setStyle( {\n\t\t\tbackgroundColor :\"#006\",\n\t\t\tcolor :\"#FFF\"\n\t\t});\n\t\tsubtypedd.setStyle( {\n\t\t\tbackgroundColor :\"#006\",\n\t\t\tcolor :\"#FFF\"\n\t\t});\n\t\tconceptidd.setStyle( {\n\t\t\tbackgroundColor :\"#006\",\n\t\t\tcolor :\"#FFF\"\n\t\t});\n\t\tbreak;\n\tcase \"Met\":\n\t\ttypedd.setStyle( {\n\t\t\tbackgroundColor :\"#606\",\n\t\t\tcolor :\"#FFF\"\n\t\t});\n\t\tsubtypedd.setStyle( {\n\t\t\tbackgroundColor :\"#606\",\n\t\t\tcolor :\"#FFF\"\n\t\t});\n\t\tconceptidd.setStyle( {\n\t\t\tbackgroundColor :\"#606\",\n\t\t\tcolor :\"#FFF\"\n\t\t});\n\t\tbreak;\n\tcase \"Mod\":\n\t\ttypedd.setStyle( {\n\t\t\tbackgroundColor :\"#c00\",\n\t\t\tcolor :\"#FFF\"\n\t\t});\n\t\tsubtypedd.setStyle( {\n\t\t\tbackgroundColor :\"#c00\",\n\t\t\tcolor :\"#FFF\"\n\t\t});\n\t\tconceptidd.setStyle( {\n\t\t\tbackgroundColor :\"#c00\",\n\t\t\tcolor :\"#FFF\"\n\t\t});\n\t\tbreak;\n\tcase \"Mot\":\n\t\ttypedd.setStyle( {\n\t\t\tbackgroundColor :\"#cc0\",\n\t\t\tcolor :\"#FFF\"\n\t\t});\n\t\tsubtypedd.setStyle( {\n\t\t\tbackgroundColor :\"#cc0\",\n\t\t\tcolor :\"#FFF\"\n\t\t});\n\t\tconceptidd.setStyle( {\n\t\t\tbackgroundColor :\"#cc0\",\n\t\t\tcolor :\"#FFF\"\n\t\t});\n\t\tbreak;\n\tcase \"Obj\":\n\t\ttypedd.setStyle( {\n\t\t\tbackgroundColor :\"#0c0\",\n\t\t\tcolor :\"#FFF\"\n\t\t});\n\t\tsubtypedd.setStyle( {\n\t\t\tbackgroundColor :\"#0c0\",\n\t\t\tcolor :\"#FFF\"\n\t\t});\n\t\tconceptidd.setStyle( {\n\t\t\tbackgroundColor :\"#0c0\",\n\t\t\tcolor :\"#FFF\"\n\t\t});\n\t\tbreak;\n\tcase \"Obs\":\n\t\ttypedd.setStyle( {\n\t\t\tbackgroundColor :\"#0cc\",\n\t\t\tcolor :\"#FFF\"\n\t\t});\n\t\tsubtypedd.setStyle( {\n\t\t\tbackgroundColor :\"#0cc\",\n\t\t\tcolor :\"#FFF\"\n\t\t});\n\t\tconceptidd.setStyle( {\n\t\t\tbackgroundColor :\"#0cc\",\n\t\t\tcolor :\"#FFF\"\n\t\t});\n\t\tbreak;\n\tcase \"Pro\":\n\t\ttypedd.setStyle( {\n\t\t\tbackgroundColor :\"#00c\",\n\t\t\tcolor :\"#FFF\"\n\t\t});\n\t\tsubtypedd.setStyle( {\n\t\t\tbackgroundColor :\"#00c\",\n\t\t\tcolor :\"#FFF\"\n\t\t});\n\t\tconceptidd.setStyle( {\n\t\t\tbackgroundColor :\"#00c\",\n\t\t\tcolor :\"#FFF\"\n\t\t});\n\t\tbreak;\n\tcase \"Res\":\n\t\ttypedd.setStyle( {\n\t\t\tbackgroundColor :\"#c0c\",\n\t\t\tcolor :\"#FFF\"\n\t\t});\n\t\tsubtypedd.setStyle( {\n\t\t\tbackgroundColor :\"#c0c\",\n\t\t\tcolor :\"#FFF\"\n\t\t});\n\t\tconceptidd.setStyle( {\n\t\t\tbackgroundColor :\"#c0c\",\n\t\t\tcolor :\"#FFF\"\n\t\t});\n\t\tbreak;\n\n\tdefault:\n\t\ttypedd.setStyle( {\n\t\t\tbackgroundColor :\"#FFF\",\n\t\t\tcolor :\"#000\"\n\t\t});\n\t\tsubtypedd.setStyle( {\n\t\t\tbackgroundColor :\"#FFF\",\n\t\t\tcolor :\"#000\"\n\t\t});\n\t\tconceptidd.setStyle( {\n\t\t\tbackgroundColor :\"#FFF\",\n\t\t\tcolor :\"#000\"\n\t\t});\n\t}\n}", "function typeSelected(value) {\n setFormGeneratorState({ type: value });\n console.log(formGeneratorState);\n }", "function getss(items, rtype) {\n console.log(\"\\n\\nIN GETSItems:: \", items, \"types: \", rtype);\n return {\n xtype: rtype.map((t) =>\n items.results\n .filter((item) => item._id.type === t)\n .map((item) => [\n item.count,\n item._id.year,\n item._id.month,\n item._id.type,\n ])\n .sort(compareSecondColumn)\n ),\n };\n }", "function filter() {\n var filtered = listings;\n\n var selected_cat = document.getElementById(\"filter-cats\").value;\n if (selected_cat != \"All Categories\") {\n $.post(\"count/cats/\", {\"name\": selected_cat});\n filtered = filtered.filter(function(d) {\n if (Array.isArray(d.cat)) {\n return d.cat.includes(selected_cat);\n } else {\n return d.cat == selected_cat;\n }\n });\n } \n \n var selected_genre = document.getElementById(\"filter-genres\").value;\n if (selected_genre != \"all\") {\n filtered = filtered.filter(function(d) {\n if (\"type\" in d && d.type != null) {\n if (selected_genre in d.type) {\n return d[\"type\"][selected_genre] == \"True\";\n } else {\n return false;\n }\n } else {\n return false;\n }\n });\n } \n draw(filtered);\n}", "function wpb_grid_post_types_for_taxomonies_handler($element, $object) {\n\n var $labels = $object.find('label[data-post-type]');\n $labels.hide();\n\n jQuery('.grid_posttypes:checkbox').change(function () {\n if (jQuery(this).is(':checked')) {\n $labels.filter('[data-post-type=' + jQuery(this).val() + ']').show();\n } else {\n $labels.filter('[data-post-type=' + jQuery(this).val() + ']').hide();\n }\n }).each(function () {\n if (jQuery(this).is(':checked')) $labels.filter('[data-post-type=' + jQuery(this).val() + ']').show();\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}", "static types(){\n return {\n GRASS: 'grass',\n AIR: 'air',\n DIRT: 'dirt',\n SAND: 'sand',\n ROCK: 'rock',\n WATER: 'water'\n };\n }", "function fetchTypes() {\n\tfetch('https://api.magicthegathering.io/v1/types')\n\t.then((response) => response.json())\n\t.then((data) => {\n\t\tconsole.log(data);\n\t\ttypesArr = data.types.slice();\n\t\t// console.log(typesArr); test\n\n\t\t// create option tags for select tag (by types)\n\t\ttypesArr.forEach(function(type, i) {\n\t\t\tlet option = document.createElement('option');\n\t\t\toption.innerText = type;\n\t\t\toption.setAttribute('value', type.toLowerCase());\n\t\t\tselectTypes.appendChild(option);\n\t\t});\n\t});\n}", "function parseSelectedType(optionSelect) {\n // read the selected option and format to pass into selectType()\n var ERROR_RATE = \"Error Rate\";\n var ASSISTANCE_SCORE = \"Assistance Score\";\n var NUM_INCORRECTS = \"Number of Incorrects\";\n var NUM_HINTS = \"Number of Hints\";\n var STEP_DURATION = \"Step Duration\";\n var CORRECT_STEP_DURATION = \"Correct Step Duration\";\n var ERROR_STEP_DURATION = \"Error Step Duration\";\n\n if (optionSelect == ASSISTANCE_SCORE) { selectType(ASSISTANCE_SCORE_TYPE); }\n else if (optionSelect == ERROR_RATE) { selectType(ERROR_RATE_TYPE); }\n else if (optionSelect == NUM_INCORRECTS) {selectType(AVG_INCORRECTS_TYPE); }\n else if (optionSelect == NUM_HINTS) { selectType(AVG_HINTS_TYPE); }\n else if (optionSelect == STEP_DURATION) { selectType(STEP_DURATION_TYPE); }\n else if (optionSelect == CORRECT_STEP_DURATION) { selectType(CORRECT_STEP_DURATION_TYPE); }\n else if (optionSelect == ERROR_STEP_DURATION) { selectType(ERROR_STEP_DURATION_TYPE); }\n}" ]
[ "0.5915644", "0.56025255", "0.5541621", "0.5471803", "0.54138464", "0.53355885", "0.529513", "0.5268753", "0.5267664", "0.5261855", "0.5250799", "0.5216662", "0.518014", "0.5168487", "0.5147239", "0.514352", "0.5113984", "0.5091728", "0.5090887", "0.50452125", "0.50400203", "0.5034487", "0.5027199", "0.5007876", "0.49981448", "0.4962327", "0.4956154", "0.49543884", "0.4953378", "0.4951633", "0.49499574", "0.49285653", "0.4923691", "0.4919263", "0.4917598", "0.49151194", "0.49150142", "0.4914435", "0.49135903", "0.49098802", "0.49044836", "0.48934942", "0.48757744", "0.48734865", "0.48673034", "0.48638287", "0.48576662", "0.4854223", "0.4847266", "0.484126", "0.48412412", "0.48365065", "0.4832608", "0.48239505", "0.4823844", "0.48226488", "0.48225313", "0.48219633", "0.4818348", "0.48040706", "0.48016492", "0.480062", "0.47889587", "0.477928", "0.47786155", "0.47738215", "0.47703582", "0.47638735", "0.47638735", "0.47638735", "0.47638735", "0.4761989", "0.4742564", "0.47424278", "0.4739706", "0.47356638", "0.47323322", "0.47257698", "0.47182545", "0.47154105", "0.47080353", "0.47073752", "0.4691987", "0.4691797", "0.46908322", "0.46903607", "0.46879923", "0.4681084", "0.4677876", "0.46777675", "0.46776447", "0.4670572", "0.4666316", "0.4661681", "0.46513915", "0.4649257", "0.46446684", "0.46419165", "0.46419138", "0.46417734", "0.4640129" ]
0.0
-1
Do the "real" stuff once the selection has been made
function update() { //--------------------------------- //------------------ select options //--------------------------------- field_option=document.getElementById("selectITEM").value; graph_option=document.getElementById("selectGRAPH").value; filename=file[field_option]; //--------------------------------- //------------------ deal with list //--------------------------------- function prepList(stuff){ d3.select("#noneAV").style("opacity", 0) // prep table with data mytable = '<table style="width:99%;table-layout:fixed;margin-left:1%;font-size:'+(field_option.indexOf('R')>-1?'0.75':'0.95')+'em;">' //mytable+="<colgroup><col ><col style='width:33%;'><col style='width: 20%;'><col style='width: 20%;'></colgroup>" mytable+='<tr><th align="left" style="width:7%;" >Rank</th><th align="left" style="width:63%;">Item='+items[field_option]+'</th><th align="right" style="width:15%;">Record count</th><th align="right" style="width:15%;">% of '+Npapers+'</th></tr>' sortby=document.getElementById("selectSORTtab").value; if(sortby=="ITEM"){stuff.sort(function(a, b){ return (b[1].toLowerCase() > a[1].toLowerCase()) ? -1:1 ; })} if(sortby=="NB"){stuff.sort(function(a, b){ if(a[2]==b[2]){return ((b[1].toLowerCase() > a[1].toLowerCase()) ? -1:1)} else {return (b[2] - a[2]);} })} stuff.forEach(function(elt) { ee=(elt[3]<0.01)?'&epsilon;':elt[3]; if (elt[1]=="none available"){d3.select("#noneAV").html("<strong>Note: this data is NOT available/existing for "+elt[3]+" % of the publications in the studied corpus.</strong>").style("opacity", 1)} else{mytable+="<tr><td>"+elt[0]+"</td><td style=\"width:63%;\">"+elt[1]+"</td><td align='right' >"+elt[2]+"</td><td align='right'>"+ee+"</td></tr>"} }) mytable += '</table>' // fancy decorum mylist = '' mylist += mytable // output d3.select('#listTAB').html(mylist).property("scrollTop", 0); return } d3.select("#titleTAB").html("<i>List of " + itemsB[field_option] + " in corpus</i>") stuff=[] d3.csv(dirdatafreqs+'freq_'+filename+'.dat', function(err,data) { data.forEach(function(d,i){ // use this to declare the format (string or float) of the data stuff.push([i+1,d.item,+d.count,+d.f]) }) // output the list and scroll to top d3.select('#selectSORTtab').on('change',function(){prepList(stuff);}) prepList(stuff) //--------------------------------- //------------------ deal with graph //--------------------------------- alpha = 0 draw_graph(); }) } // end of update()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function SelectionChange() {}", "function SelectionChange() {}", "function SelectionChange() {}", "function SelectionChange() {}", "function updateSelection(){\n\t\t\tif(lastMousePos.pageX == null) return;\n\t\t\t\n\t\t\tsetSelectionPos(selection.second, lastMousePos);\n\t\t\tclearSelection();\n\t\t\t\n\t\t\tif(selectionIsSane()) drawSelection();\n\t\t}", "function SelectionChange() { }", "function SelectionChange() { }", "resetSelection() {\n if (!this.isSelectionEmpty()) {\n this._resetSelection();\n this._fireChangeSelection();\n }\n }", "function onSelect()\n\t{\n\t\tunit.div.toggleClass(\"selected\", unit.movePoints > 0);\n\t}", "function select () {\r\n\t\t\t\tthis.tool.select();\r\n\t\t\t}", "select() { this.selected = true; }", "function reCheckSelection(doc) {\r\n setSelectionInner(doc, skipAtomicInSelection(doc, doc.sel, null, false), sel_dontScroll);\r\n }", "function update_selection(cellView,paper,graph) {\n deselect_all_elements(paper,graph);\n select_element(cellView,graph);\n}", "function reCheckSelection(doc) {\n\t\t setSelectionInner(doc, skipAtomicInSelection(doc, doc.sel, null, false), sel_dontScroll);\n\t\t }", "main_enter() {\n\n\t\t\t// \n\t\t\tlet n_line = y_editor.getSelectionRange();\n\n\t\t\t// ref selection\n\t\t\tlet k_selection = y_editor.getSelection();\n\n\t\t\t// no selection\n\t\t\tif(k_selection.isEmpty()) {\n\n\t\t\t\t//\n\t\t\t\texecute_query_block(n_line.start.row);\n\t\t\t}\n\t\t\t// things are selected\n\t\t\telse {\n\n\t\t\t}\n\t\t}", "function finalizeSelection(){\n\n\tvar len = cliptext.value.length\n\tif(len > 5) cliptext.selectionStart = 3\n\telse cliptext.selectionStart = defaultStart\n\tcliptext.selectionEnd = len - 2\n}", "function drawSelections() {\n\t\thideSelectionRect();\n\t}", "function doSelect(t) {\n\t\t\tif (!t.select) return;\n\t\t\tif (t._selectDone) return;\n\t\t\tt.select();\n\t\t\tt._selectDone = true;\n\t\t}", "function doSelect(t) {\n\t\t\tif (!t.select) return;\n\t\t\tif (t._selectDone) return;\n\t\t\tt.select();\n\t\t\tt._selectDone = true;\n\t\t}", "function reCheckSelection(doc) {\n\t setSelectionInner(doc, skipAtomicInSelection(doc, doc.sel, null, false), sel_dontScroll);\n\t }", "function reCheckSelection(doc) {\n\t setSelectionInner(doc, skipAtomicInSelection(doc, doc.sel, null, false), sel_dontScroll);\n\t }", "function reCheckSelection(doc) {\n\t setSelectionInner(doc, skipAtomicInSelection(doc, doc.sel, null, false), sel_dontScroll);\n\t }", "function reCheckSelection(doc) {\n setSelectionInner(doc, skipAtomicInSelection(doc, doc.sel, null, false), sel_dontScroll);\n }", "function reCheckSelection(doc) {\n setSelectionInner(doc, skipAtomicInSelection(doc, doc.sel, null, false), sel_dontScroll);\n }", "function reCheckSelection(doc) {\n setSelectionInner(doc, skipAtomicInSelection(doc, doc.sel, null, false), sel_dontScroll);\n }", "function reCheckSelection(doc) {\n setSelectionInner(doc, skipAtomicInSelection(doc, doc.sel, null, false), sel_dontScroll);\n }", "function reCheckSelection(doc) {\n setSelectionInner(doc, skipAtomicInSelection(doc, doc.sel, null, false), sel_dontScroll);\n }", "function reCheckSelection(doc) {\n setSelectionInner(doc, skipAtomicInSelection(doc, doc.sel, null, false), sel_dontScroll);\n }", "function reCheckSelection(doc) {\n setSelectionInner(doc, skipAtomicInSelection(doc, doc.sel, null, false), sel_dontScroll);\n }", "function reCheckSelection(doc) {\n setSelectionInner(doc, skipAtomicInSelection(doc, doc.sel, null, false), sel_dontScroll);\n }", "function UISelection(){\n\n }", "function reCheckSelection(doc) {\r\n setSelectionInner(doc, skipAtomicInSelection(doc, doc.sel, null, false));\r\n}", "function xcustom_makeActionOnObjectSelection() {\r\n var currentSelectedObject = xcustom_getCurrentSelectedObject();\r\n if (null === currentSelectedObject) {\r\n // console.log('Nothing Selected...');\r\n xcustom_resetAndClosePanelSelectedObjectContent();\r\n $('#xcustom-div-right-panel').hide();\r\n return;\r\n }\r\n // console.log('The Selected Object Is : ', currentSelectedObject);\r\n xcustom_showSelectedObjectDataOnViewer(currentSelectedObject);\r\n}", "function displaySelections(){\r\n //defaults\r\n Session.set('breaksOption','origOption');\r\n Session.set('highlightElement','line');\r\n Session.set('boldElement','boldLine');\r\n Session.set('syllablesVisible','true');\r\n Session.set('stressVisible', 'true');\r\n \r\n var selectionsCursor = Selections.find({poem_id:Session.get('currentPoem')});\r\n selectionsCursor.observe({\r\n //when something is added to the Selections Collection\r\n added: function (selection, beforeIndex) {\r\n var location = selection.location;\r\n var styleID = selection.style_id;\r\n var style = Styles.find({_id:styleID}).fetch();\r\n //used to catch errors\r\n if (style.length > 0){\r\n var layerNodeID = style[0].layer_id;\r\n var layerID = Layers.findOne({poem_id: Session.get('currentPoem'), id: layerNodeID})._id;\r\n //if selection is from highlighting style/layer\r\n if ((style[0].background_color !== null)&&(typeof style[0].background_color !== \"undefined\")) {\r\n var rgba = style[0].background_color;\r\n var lastIndex = rgba.lastIndexOf(\",\");\r\n var substring = rgba.substr(0, lastIndex+1);\r\n //check opacity of layer that made the selection\r\n var curRGBA = substring+' ';\r\n var op = Layers.findOne(layerID).opacity;\r\n var newRGBA = curRGBA+op+\")\";\r\n console.log(newRGBA);\r\n $(\".\"+location).css(\r\n {\r\n \"background\": newRGBA\r\n });\r\n }\r\n //if selection is from bolding style/layer\r\n if ((style[0].font_color !== null)&&(typeof style[0].font_color !== \"undefined\")) {\r\n var substring = style[0].font_color;\r\n $(\".\"+location).css(\r\n {\r\n \"color\": substring\r\n }\r\n );\r\n }\r\n //if selection is from bolding style/layer\r\n if ((style[0].bold !== null)&&(typeof style[0].bold !== \"undefined\")) {\r\n var substring = style[0].bold;\r\n if (substring){\r\n $(\".\"+location).css(\r\n {\r\n \"font-weight\": \"bold\"\r\n }\r\n );\r\n $(\".\"+location).addClass(\"bold\"+style[0].font_color);\r\n }\r\n }\r\n //if selection is from stressing style/layer\r\n if((style[0].verticalAlign !== null)&&(typeof style[0].verticalAlign !== \"undefined\")){\r\n location = location.substr(1);\r\n if (Session.get('stressVisible')==\"true\"){\r\n $('.'+location).css('vertical-align','super');\r\n }\r\n $('.'+location).addClass('stressStyle');\r\n }\r\n }\r\n },\r\n //when something is removed from the Selections Collection\r\n removed: function (selection, beforeIndex) {\r\n var location = selection.location;\r\n var styleID = selection.style_id;\r\n var curLayerNodeID = selection.layerNode_id;\r\n var style = Styles.find({_id:styleID}).fetch();\r\n console.log(style);\r\n //used to catch errors\r\n if (style.length > 0){\r\n //if removed is highlighting\r\n if ((style[0].background_color !== undefined)) {\r\n //must go through all selections that may have colored line/word/character to check and\r\n //see if after one background-color is turned off, there is another (from another layer)\r\n //still coloring that line/word/character\r\n var curRGBA = \"transparent\";\r\n var allSelections = Selections.find({poem_id: Session.get('currentPoem'), location: location}).fetch();\r\n console.log(allSelections);\r\n _.each(allSelections, function(sel){\r\n var piece = sel.style_id; \r\n var otherStyle = Styles.findOne({_id: piece});\r\n if ((otherStyle !== undefined)){\r\n if ((otherStyle.background_color !== undefined)){\r\n op = Layers.findOne({id:otherStyle.layer_id}).opacity;\r\n var rgba = otherStyle.background_color;\r\n var lastIndex = rgba.lastIndexOf(\",\");\r\n var substring = rgba.substr(0, lastIndex+1);\r\n //check opacity of layer that made the selection\r\n curRGBA = substring;\r\n var newRGBA = curRGBA+op+\")\";\r\n if (otherStyle.layer_id != curLayerNodeID){\r\n curRGBA = newRGBA;\r\n console.log(curRGBA);\r\n }\r\n }\r\n }\r\n });\r\n $(\".\"+location).css(\r\n {\r\n \"background-color\": curRGBA\r\n }\r\n );\r\n\r\n }\r\n //if removed selection is bolding\r\n if ((style[0].font_color !== null)&&(typeof style[0].font_color !== \"undefined\")) {\r\n $(\".\"+location).css(\r\n {\r\n \"color\": \"black\"\r\n }\r\n );\r\n $(\".\"+location).removeClass(\"bold\"+style[0].font_color);\r\n }\r\n //if removed selection is bolding\r\n if ((style[0].bold !== null)&&(typeof style[0].bold !== \"undefined\")) {\r\n //so that word can be bolded if line is bolded\r\n $(\".\"+location).css(\"font-weight\",\"\");\r\n $(\".\"+location).css(\"color\",\"\");\r\n }\r\n //if removed selection is stressing\r\n if((style[0].verticalAlign !== null)&&(typeof style[0].verticalAlign !== \"undefined\")){\r\n location = location.substr(1);\r\n $('.'+location).css('vertical-align','baseline');\r\n $('.'+location).removeClass('stressStyle');\r\n }\r\n }\r\n }\r\n });\r\n //handles additions/removals from SyllableMarkers Collection\r\n var syllablesCursor = SyllableMarkers.find({poem_id:Session.get('currentPoem')});\r\n syllablesCursor.observe({\r\n added: function (selection, beforeIndex) {\r\n var location = selection.location;\r\n if (Session.get('syllablesVisible')==\"true\"){\r\n $(\".\"+location).css(\r\n {\r\n \"border-left\": \"2px solid black\"\r\n });\r\n }\r\n $(\".\"+location).addClass('syllableStyle');\r\n //updates natural syllables\r\n var lineSpan = $('#'+location).closest('.line');\r\n var countSpan = $(lineSpan).find('.lineCount');\r\n var wordCount=$(lineSpan).find('.word').length;\r\n var sylCount=0;\r\n $(lineSpan).find('.letter').each(function(){\r\n if ($(this).hasClass(\"syllableStyle\")){\r\n sylCount++; \r\n }\r\n })\r\n $(countSpan).text(wordCount+sylCount);\r\n //updates other versions' syllable markers \r\n var lineSpanArray = $('.'+location).closest('.unnaturalLine');\r\n var countSpan1 = $(lineSpanArray[0]).find('.lineCount');\r\n var countSpan2 = $(lineSpanArray[1]).find('.lineCount');\r\n var wordArray1=$(lineSpanArray[0]).find('.word');\r\n var wordArray2=$(lineSpanArray[1]).find('.word');\r\n var wordCount1 = 0;\r\n var wordCount2 = 0;\r\n //don't count the awkward spaces created by new lines\r\n _.each(wordArray1, function(elem) {\r\n if ($(elem).text().trim() == \"\"){\r\n }\r\n else{\r\n wordCount1++;\r\n }\r\n });\r\n _.each(wordArray2, function(elem) {\r\n if ($(elem).text().trim() == \"\"){\r\n }\r\n else{\r\n wordCount2++;\r\n }\r\n });\r\n var sylCount1=0;\r\n var sylCount2=0; \r\n $(lineSpanArray[0]).find('.letter').each(function(){\r\n if ($(this).hasClass(\"syllableStyle\")){\r\n sylCount1++; \r\n }\r\n });\r\n $(lineSpanArray[1]).find('.letter').each(function(){\r\n if ($(this).hasClass(\"syllableStyle\")){\r\n sylCount2++; \r\n }\r\n });\r\n $(countSpan1).text(wordCount1+sylCount1);\r\n $(countSpan2).text(wordCount2+sylCount2);\r\n if ($('.syllablesGrid').data('gridded')===true){\r\n grid();\r\n grid();\r\n }\r\n },\r\n removed: function (selection, beforeIndex) {\r\n var location = selection.location;\r\n $(\".\"+location).css(\r\n {\r\n \"border-left\": \"none\"\r\n });\r\n $(\".\"+location).removeClass('syllableStyle');\r\n var lineSpan = $('#'+location).closest('.line');\r\n var countSpan = $(lineSpan).find('.lineCount');\r\n var wordCount=$(lineSpan).find('.word').length;\r\n var sylCount=0;\r\n $(lineSpan).find('.letter').each(function(){\r\n console.log($(this).css(\"border-left\"));\r\n if ($(this).hasClass(\"syllableStyle\")){\r\n sylCount++; \r\n }\r\n })\r\n $(countSpan).text(wordCount+sylCount);\r\n //updates other versions' syllable markers \r\n var lineSpanArray = $('.'+location).closest('.unnaturalLine');\r\n var countSpan1 = $(lineSpanArray[0]).find('.lineCount');\r\n var countSpan2 = $(lineSpanArray[1]).find('.lineCount');\r\n var wordArray1=$(lineSpanArray[0]).find('.word');\r\n var wordArray2=$(lineSpanArray[1]).find('.word');\r\n var wordCount1 = 0;\r\n var wordCount2 = 0;\r\n //don't count the awkward spaces created by new lines\r\n _.each(wordArray1, function(elem) {\r\n if ($(elem).text().trim() == \"\"){\r\n }\r\n else{\r\n wordCount1++;\r\n }\r\n });\r\n _.each(wordArray2, function(elem) {\r\n if ($(elem).text().trim() == \"\"){\r\n }\r\n else{\r\n wordCount2++;\r\n }\r\n });\r\n var sylCount1=0;\r\n var sylCount2=0; \r\n $(lineSpanArray[0]).find('.letter').each(function(){\r\n if ($(this).hasClass(\"syllableStyle\")){\r\n sylCount1++; \r\n }\r\n });\r\n $(lineSpanArray[1]).find('.letter').each(function(){\r\n if ($(this).hasClass(\"syllableStyle\")){\r\n sylCount2++; \r\n }\r\n });\r\n $(countSpan1).text(wordCount1+sylCount1);\r\n $(countSpan2).text(wordCount2+sylCount2);\r\n if ($('.syllablesGrid').data('gridded')===true){\r\n grid();\r\n grid();\r\n }\r\n },\r\n });\r\n //handles changes from Layers Collection\r\n var layersCursor = Layers.find({poem_id:Session.get('currentPoem')});\r\n layersCursor.observe({ \r\n added: function (selection, beforeIndex) {\r\n var sessionObj = Session.get(\"layersArray\");\r\n //if layer just created, user probably wants to use it, so default \"visible\"\r\n sessionObj[selection._id] = \"visible\";\r\n Session.set(\"layersArray\", sessionObj);\r\n },\r\n });\r\n\r\n}", "function selection_update() {\n\n // if the new selection is not in the valid moves area don't update the last_selection var\n if (selection.row != '') {\n last_selection = selection;\n }\n\n $(\"#log\").html(\"clicked: \" + clicked.row + \"x\" + clicked.col + \"<br />\" + clicked.piece);\n\n\n}", "function redrawSelectionBox() {\n console.log('redrawSelectionBox called');\n \n if (optimalApp.selectedFunction !== null && \n optimalApp.selectedBBox !== null &&\n optimalApp.selectedBBox.container !== null) {\n optimalApp.selectedBBox.container.detach();\n \n optimalApp.selectedBBox = initSelectionBox(optimalApp.selectedFunction.drawnGraph);\n optimalApp.selectedBBox.trigger.mousedown(mousedownMoveHandler);\n optimalApp.selectedBBox.rotator.mousedown(mousedownRotateHandler);\n for (var i in optimalApp.selectedBBox.handle) {\n $(optimalApp.selectedBBox.handle[i]).mousedown(mousedownResizeHandler);\n }\n }\n}", "function reCheckSelection(doc) {\n setSelectionInner(doc, skipAtomicInSelection(doc, doc.sel, null, false), sel_dontScroll)\n}", "function reCheckSelection(doc) {\n setSelectionInner(doc, skipAtomicInSelection(doc, doc.sel, null, false), sel_dontScroll)\n}", "function reCheckSelection(doc) {\n\t\t setSelectionInner(doc, skipAtomicInSelection(doc, doc.sel, null, false));\n\t\t }", "function toggleSelect() {\n toggleSelectTask(requireCursor());\n }", "_resetSelection() {\n this.__selectedRangeArr = [];\n this.__anchorSelectionIndex = -1;\n this.__leadSelectionIndex = -1;\n }", "resetSelection () {\n this.currentSelection = null\n }", "function prepareSelectAllHack() {\r\n if (display.input.selectionStart != null) {\r\n var selected = cm.somethingSelected();\r\n var extval = display.input.value = \"\\u200b\" + (selected ? display.input.value : \"\");\r\n display.prevInput = selected ? \"\" : \"\\u200b\";\r\n display.input.selectionStart = 1; display.input.selectionEnd = extval.length;\r\n // Re-set this, in case some other handler touched the\r\n // selection in the meantime.\r\n display.selForContextMenu = cm.doc.sel;\r\n }\r\n }", "_applyPendingSelection() {\n if (this._model !== this._globalModel) {\n this._globalModel.updateSelection(this._model.selection, this);\n }\n }", "function fireSelectedEvent(){\n\t\t\tvar x1 = (selection.first.x <= selection.second.x) ? selection.first.x : selection.second.x;\n\t\t\tvar x2 = (selection.first.x <= selection.second.x) ? selection.second.x : selection.first.x;\n\t\t\tvar y1 = (selection.first.y >= selection.second.y) ? selection.first.y : selection.second.y;\n\t\t\tvar y2 = (selection.first.y >= selection.second.y) ? selection.second.y : selection.first.y;\n\t\t\t\n\t\t\tx1 = xaxis.min + x1 / hozScale;\n\t\t\tx2 = xaxis.min + x2 / hozScale;\n\t\t\ty1 = yaxis.max - y1 / vertScale;\n\t\t\ty2 = yaxis.max - y2 / vertScale;\n\n\t\t\ttarget.fire('flotr:select', [ { x1: x1, y1: y1, x2: x2, y2: y2 } ]);\n\t\t}", "_processInitialSelections() {\n if (this._selectionHandler && this._initialSelection) {\n var targets = DvtTreeUtils.getAllNodes(this._root);\n this._selectionHandler.processInitialSelections(this._initialSelection, targets);\n this._initialSelection = null;\n }\n }", "function prepareSelectAllHack() {\n\t\t if (te.selectionStart != null) {\n\t\t var selected = cm.somethingSelected();\n\t\t var extval = \"\\u200b\" + (selected ? te.value : \"\");\n\t\t te.value = \"\\u21da\"; // Used to catch context-menu undo\n\t\t te.value = extval;\n\t\t input.prevInput = selected ? \"\" : \"\\u200b\";\n\t\t te.selectionStart = 1; te.selectionEnd = extval.length;\n\t\t // Re-set this, in case some other handler touched the\n\t\t // selection in the meantime.\n\t\t display.selForContextMenu = cm.doc.sel;\n\t\t }\n\t\t }", "function prepareSelectAllHack() {\n if (display.input.selectionStart != null) {\n var selected = cm.somethingSelected();\n var extval = display.input.value = \"\\u200b\" + (selected ? display.input.value : \"\");\n display.prevInput = selected ? \"\" : \"\\u200b\";\n display.input.selectionStart = 1; display.input.selectionEnd = extval.length;\n // Re-set this, in case some other handler touched the\n // selection in the meantime.\n display.selForContextMenu = cm.doc.sel;\n }\n }", "function prepareSelectAllHack() {\n if (display.input.selectionStart != null) {\n var selected = cm.somethingSelected();\n var extval = display.input.value = \"\\u200b\" + (selected ? display.input.value : \"\");\n display.prevInput = selected ? \"\" : \"\\u200b\";\n display.input.selectionStart = 1; display.input.selectionEnd = extval.length;\n // Re-set this, in case some other handler touched the\n // selection in the meantime.\n display.selForContextMenu = cm.doc.sel;\n }\n }", "function prepareSelectAllHack() {\n if (display.input.selectionStart != null) {\n var selected = cm.somethingSelected();\n var extval = display.input.value = \"\\u200b\" + (selected ? display.input.value : \"\");\n display.prevInput = selected ? \"\" : \"\\u200b\";\n display.input.selectionStart = 1; display.input.selectionEnd = extval.length;\n // Re-set this, in case some other handler touched the\n // selection in the meantime.\n display.selForContextMenu = cm.doc.sel;\n }\n }", "function prepareSelectAllHack() {\n if (display.input.selectionStart != null) {\n var selected = cm.somethingSelected();\n var extval = display.input.value = \"\\u200b\" + (selected ? display.input.value : \"\");\n display.prevInput = selected ? \"\" : \"\\u200b\";\n display.input.selectionStart = 1; display.input.selectionEnd = extval.length;\n // Re-set this, in case some other handler touched the\n // selection in the meantime.\n display.selForContextMenu = cm.doc.sel;\n }\n }", "function prepareSelectAllHack() {\n if (display.input.selectionStart != null) {\n var selected = cm.somethingSelected();\n var extval = display.input.value = \"\\u200b\" + (selected ? display.input.value : \"\");\n display.prevInput = selected ? \"\" : \"\\u200b\";\n display.input.selectionStart = 1; display.input.selectionEnd = extval.length;\n // Re-set this, in case some other handler touched the\n // selection in the meantime.\n display.selForContextMenu = cm.doc.sel;\n }\n }", "clearSelection() {\n this._clearSelection();\n }", "function frankerCoreSelect(doc, range, collapse) {\n\tvar selection = doc.getSelection();\n\tselection.removeAllRanges();\n\tselection.addRange(range.cloneRange());\n\tif (collapse) {\n\t\tselection.collapseToStart();\n\t}\n}", "function clearSelection() {\r\n map.deselectCountry();\r\n pc1.deselectLine();\r\n donut.deselectPie();\r\n sp1.deselectDot();\r\n }", "function startOperation() {\n updateInput = userSelChange = textChanged = null;\n changes = []; selectionChanged = false; callbacks = [];\n }", "function startOperation() {\n updateInput = userSelChange = textChanged = null;\n changes = []; selectionChanged = false; callbacks = [];\n }", "function startOperation() {\n updateInput = userSelChange = textChanged = null;\n changes = []; selectionChanged = false; callbacks = [];\n }", "function startOperation() {\n updateInput = userSelChange = textChanged = null;\n changes = []; selectionChanged = false; callbacks = [];\n }", "function selectionRestore() {\n if (savedSelection) {\n rangy.restoreSelection(savedSelection);\n savedSelection = false;\n }\n}", "function prepareSelectAllHack() {\n if (te.selectionStart != null) {\n var selected = cm.somethingSelected();\n var extval = \"\\u200b\" + (selected ? te.value : \"\");\n te.value = \"\\u21da\"; // Used to catch context-menu undo\n te.value = extval;\n input.prevInput = selected ? \"\" : \"\\u200b\";\n te.selectionStart = 1; te.selectionEnd = extval.length;\n // Re-set this, in case some other handler touched the\n // selection in the meantime.\n display.selForContextMenu = cm.doc.sel;\n }\n }", "function prepareSelectAllHack() {\n if (te.selectionStart != null) {\n var selected = cm.somethingSelected();\n var extval = \"\\u200b\" + (selected ? te.value : \"\");\n te.value = \"\\u21da\"; // Used to catch context-menu undo\n te.value = extval;\n input.prevInput = selected ? \"\" : \"\\u200b\";\n te.selectionStart = 1; te.selectionEnd = extval.length;\n // Re-set this, in case some other handler touched the\n // selection in the meantime.\n display.selForContextMenu = cm.doc.sel;\n }\n }", "function start()\n{\n\tselected = filter;\n\tx_elem = x_pos - selected.offsetLeft;\n\ty_elem = y_pos - selected.offsetTop;\n}", "function reCheckSelection(doc) {\n setSelectionInner(doc, skipAtomicInSelection(doc, doc.sel, null, false));\n }", "function reCheckSelection(doc) {\n setSelectionInner(doc, skipAtomicInSelection(doc, doc.sel, null, false));\n }", "function reCheckSelection(doc) {\n setSelectionInner(doc, skipAtomicInSelection(doc, doc.sel, null, false));\n }", "function reCheckSelection(doc) {\n setSelectionInner(doc, skipAtomicInSelection(doc, doc.sel, null, false));\n }", "function reCheckSelection(doc) {\n setSelectionInner(doc, skipAtomicInSelection(doc, doc.sel, null, false));\n }", "function reCheckSelection(doc) {\n setSelectionInner(doc, skipAtomicInSelection(doc, doc.sel, null, false));\n }", "function reCheckSelection(doc) {\n setSelectionInner(doc, skipAtomicInSelection(doc, doc.sel, null, false));\n }", "function reCheckSelection(doc) {\n setSelectionInner(doc, skipAtomicInSelection(doc, doc.sel, null, false));\n }", "function reCheckSelection(doc) {\n setSelectionInner(doc, skipAtomicInSelection(doc, doc.sel, null, false));\n }", "function reCheckSelection(doc) {\n setSelectionInner(doc, skipAtomicInSelection(doc, doc.sel, null, false));\n }", "function reCheckSelection(doc) {\n setSelectionInner(doc, skipAtomicInSelection(doc, doc.sel, null, false));\n }", "function reCheckSelection(doc) {\n setSelectionInner(doc, skipAtomicInSelection(doc, doc.sel, null, false));\n }", "function reCheckSelection(doc) {\n setSelectionInner(doc, skipAtomicInSelection(doc, doc.sel, null, false));\n }", "function reCheckSelection(doc) {\n setSelectionInner(doc, skipAtomicInSelection(doc, doc.sel, null, false));\n }", "function reCheckSelection(doc) {\n setSelectionInner(doc, skipAtomicInSelection(doc, doc.sel, null, false));\n }", "function reCheckSelection(doc) {\n setSelectionInner(doc, skipAtomicInSelection(doc, doc.sel, null, false));\n }", "function reCheckSelection(doc) {\n setSelectionInner(doc, skipAtomicInSelection(doc, doc.sel, null, false));\n }", "function reCheckSelection(doc) {\n setSelectionInner(doc, skipAtomicInSelection(doc, doc.sel, null, false));\n}", "function reCheckSelection(doc) {\n setSelectionInner(doc, skipAtomicInSelection(doc, doc.sel, null, false));\n}", "function reCheckSelection(doc) {\n setSelectionInner(doc, skipAtomicInSelection(doc, doc.sel, null, false));\n}", "function reCheckSelection(doc) {\n setSelectionInner(doc, skipAtomicInSelection(doc, doc.sel, null, false));\n}", "function reCheckSelection(doc) {\n setSelectionInner(doc, skipAtomicInSelection(doc, doc.sel, null, false));\n}", "function reCheckSelection(doc) {\n setSelectionInner(doc, skipAtomicInSelection(doc, doc.sel, null, false));\n}", "function reCheckSelection(doc) {\n setSelectionInner(doc, skipAtomicInSelection(doc, doc.sel, null, false));\n}", "function reCheckSelection(doc) {\n setSelectionInner(doc, skipAtomicInSelection(doc, doc.sel, null, false));\n}", "function reCheckSelection(doc) {\n setSelectionInner(doc, skipAtomicInSelection(doc, doc.sel, null, false));\n}", "function reCheckSelection(doc) {\n setSelectionInner(doc, skipAtomicInSelection(doc, doc.sel, null, false));\n}", "function reCheckSelection(doc) {\n setSelectionInner(doc, skipAtomicInSelection(doc, doc.sel, null, false));\n}", "reset() {\n this._selection = -1;\n }", "function setSelection(doc, sel, options) {\n\t\t setSelectionNoUndo(doc, sel, options);\n\t\t addSelectionToHistory(doc, doc.sel, doc.cm ? doc.cm.curOp.id : NaN, options);\n\t\t }", "function setSelection(doc, sel, options) {\n\t\t setSelectionNoUndo(doc, sel, options);\n\t\t addSelectionToHistory(doc, doc.sel, doc.cm ? doc.cm.curOp.id : NaN, options);\n\t\t }", "select(value) {\n\n \n let selectables = this.object_item(value).selectables;\n let selections = this.object_item(value).selections;\n\n\n\n if (selectables.length > 0) {\n\n selectables.addClass('OPTION-selected')\n .hide(1000);\n\n selections.addClass('OPTION-selected')\n .show(1000);\n\n this.object_item(value).options.prop('selected', true); // active selected original select\n\n // effacer class css SELECT-hover de cursur chaque changement\n this.$newSelect.find(this.elemsSelector).removeClass('SELECT-hover');\n\n\n\n\n if (this.options.keepOrder) { // order de position des item( asec or none)\n var selectionLiLast = this.$selectionUl.find('.OPTION-selected'); //les elements non hide =>show\n if ((selectionLiLast.length > 1) && (selectionLiLast.last().get(0) != selections.get(0))) {\n selections.insertAfter(selectionLiLast.last());\n }\n }\n\n\n this.$originalSelect.trigger('change'); // start onchange de element original\n this.afterSelect(value);\n\n }\n }", "function prepareSelectAllHack() {\n\t if (te.selectionStart != null) {\n\t var selected = cm.somethingSelected();\n\t var extval = \"\\u200b\" + (selected ? te.value : \"\");\n\t te.value = \"\\u21da\"; // Used to catch context-menu undo\n\t te.value = extval;\n\t input.prevInput = selected ? \"\" : \"\\u200b\";\n\t te.selectionStart = 1; te.selectionEnd = extval.length;\n\t // Re-set this, in case some other handler touched the\n\t // selection in the meantime.\n\t display.selForContextMenu = cm.doc.sel;\n\t }\n\t }", "function prepareSelectAllHack() {\n\t if (te.selectionStart != null) {\n\t var selected = cm.somethingSelected();\n\t var extval = \"\\u200b\" + (selected ? te.value : \"\");\n\t te.value = \"\\u21da\"; // Used to catch context-menu undo\n\t te.value = extval;\n\t input.prevInput = selected ? \"\" : \"\\u200b\";\n\t te.selectionStart = 1; te.selectionEnd = extval.length;\n\t // Re-set this, in case some other handler touched the\n\t // selection in the meantime.\n\t display.selForContextMenu = cm.doc.sel;\n\t }\n\t }", "function prepareSelectAllHack() {\n\t if (te.selectionStart != null) {\n\t var selected = cm.somethingSelected();\n\t var extval = \"\\u200b\" + (selected ? te.value : \"\");\n\t te.value = \"\\u21da\"; // Used to catch context-menu undo\n\t te.value = extval;\n\t input.prevInput = selected ? \"\" : \"\\u200b\";\n\t te.selectionStart = 1; te.selectionEnd = extval.length;\n\t // Re-set this, in case some other handler touched the\n\t // selection in the meantime.\n\t display.selForContextMenu = cm.doc.sel;\n\t }\n\t }", "function showSelection() {\n navigationBrowse(memSelection);\n}", "function prepareSelectAllHack() {\n\t\t if (te.selectionStart != null) {\n\t\t var selected = cm.somethingSelected();\n\t\t var extval = \"\\u200b\" + (selected ? te.value : \"\");\n\t\t te.value = \"\\u21da\"; // Used to catch context-menu undo\n\t\t te.value = extval;\n\t\t input.prevInput = selected ? \"\" : \"\\u200b\";\n\t\t te.selectionStart = 1; te.selectionEnd = extval.length;\n\t\t // Re-set this, in case some other handler touched the\n\t\t // selection in the meantime.\n\t\t display.selForContextMenu = cm.doc.sel;\n\t\t }\n\t\t }", "function prepareSelectAllHack() {\n if (te.selectionStart != null) {\n var selected = cm.somethingSelected()\n var extval = \"\\u200b\" + (selected ? te.value : \"\")\n te.value = \"\\u21da\" // Used to catch context-menu undo\n te.value = extval\n input.prevInput = selected ? \"\" : \"\\u200b\"\n te.selectionStart = 1; te.selectionEnd = extval.length\n // Re-set this, in case some other handler touched the\n // selection in the meantime.\n display.selForContextMenu = cm.doc.sel\n }\n }" ]
[ "0.74893624", "0.74893624", "0.74893624", "0.74893624", "0.744857", "0.73624", "0.73624", "0.6963687", "0.6924228", "0.6874348", "0.67306197", "0.6705155", "0.6702453", "0.66762435", "0.663542", "0.6606934", "0.6605485", "0.6595165", "0.6595165", "0.65926903", "0.65926903", "0.65926903", "0.6590076", "0.6590076", "0.6590076", "0.6590076", "0.6590076", "0.6590076", "0.6590076", "0.6590076", "0.65802634", "0.65614706", "0.6559895", "0.65586585", "0.6550796", "0.65395445", "0.65377927", "0.65377927", "0.65350264", "0.6521032", "0.65188855", "0.648807", "0.64761955", "0.647123", "0.64647716", "0.6455135", "0.64400095", "0.64395016", "0.64395016", "0.64395016", "0.64395016", "0.64395016", "0.643752", "0.6435331", "0.64295405", "0.64240956", "0.64240354", "0.64240354", "0.64240354", "0.6420878", "0.64147216", "0.64147216", "0.64136976", "0.6390241", "0.6390241", "0.6390241", "0.6390241", "0.6390241", "0.6390241", "0.6390241", "0.6390241", "0.6390241", "0.6390241", "0.6390241", "0.6390241", "0.6390241", "0.6390241", "0.6390241", "0.6390241", "0.6390241", "0.63845617", "0.63845617", "0.63845617", "0.63845617", "0.63845617", "0.63845617", "0.63845617", "0.63845617", "0.63845617", "0.63845617", "0.63845617", "0.6377595", "0.6377207", "0.6377207", "0.6370436", "0.6366886", "0.6366886", "0.6366886", "0.6353912", "0.6344393", "0.6344164" ]
0.0
-1
Stores a random userID in localStorage. Remove this once you have integrated your own authentication scheme.
function useUserID() { const [userID, setUserID] = useState(null); // useEffect forces this to happen on the client, since `window` is not // available on the server during server-side rendering useEffect(() => { let userID = window.localStorage.getItem("roomservice-user"); if (userID == null) { const generateBase62ID = customAlphabet( "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", 22 ); userID = generateBase62ID(); window.localStorage.setItem("roomservice-user", userID); } setUserID(userID); }, []); return userID; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "cacheUserID(userID) {\n localStorage.setItem(USER_ID, userID);\n }", "function userIdGenerator(){\r\n var pt1 = Math.floor((Math.random() * 9 ) + 1);\r\n var pt2 = Math.floor((Math.random() * 9 ) + 1);\r\n var pt3 = Math.floor((Math.random() * 9 ) + 1);\r\n var pt4 = Math.floor((Math.random() * 9 ) + 1);\r\n var pt5 = Math.floor((Math.random() * 9 ) + 1);\r\n var pt6 = Math.floor((Math.random() * 9 ) + 1);\r\n var pt7 = Math.floor((Math.random() * 9 ) + 1);\r\n var pt8 = Math.floor((Math.random() * 9 ) + 1);\r\n var pt9 = Math.floor((Math.random() * 9 ) + 1);\r\n var pt0 = Math.floor((Math.random() * 9 ) + 1);\r\n userId = \"'\" + pt1 + pt2 + pt3 + pt4 + pt5 + pt6 + pt7 + pt8 + pt9 + pt0 + \"'\";\r\n window.localStorage.setItem('userId', userId.replace(/['\"]+/g, ''));\r\n}", "function saveAuthData() {\n // Skip if the local storage is not available.\n if (!utils.storageAvailable('localStorage')) {\n return;\n }\n\n // Create the data object.\n var data = {\n authUserID: authUserID\n };\n\n // Save to the local storage.\n localStorage.setItem(authDataID, JSON.stringify(data));\n }", "static GetUserId() {\n\t\t// Try to retrieve the id from the local storage\n\t\tlet userId = window.localStorage.getItem('userId');\n\n\t\t// Does it exist?\n\t\tif (!userId) {\n\t\t\t// It does not\n\t\t\tuserId = _generateId();\n\n\t\t\t// Save it\n\t\t\twindow.localStorage.setItem('userId', userId);\n\t\t}\n\n\t\t// Return a value\n\t\treturn userId;\n\t}", "static currentUserId() {\n return localStorage.getItem('userid');\n }", "getCurrentUserId() {\r\n return JSON.parse(localStorage.getItem(\"user\")).id;\r\n }", "function getUserID() {\n userID = Math.floor(Math.random()*1000000000)\n }", "function GeefGebruikerID() {\n return localStorage.getItem('user_id');\n}", "function getUserId() {\n\tif (userid != null) {\n\t\treturn userid;\n\t} else {\n\t\treturn localStorage.getItem('userid');\n\t}\n}", "function saveUserCredentialsInLocalStorage() {\n console.debug(\"saveUserCredentialsInLocalStorage\");\n if (currentUser) {\n localStorage.setItem(\"token\", currentUser.loginToken);\n localStorage.setItem(\"username\", currentUser.username);\n }\n}", "function saveUserCredentialsInLocalStorage() {\n console.debug('saveUserCredentialsInLocalStorage');\n if (currentUser) {\n localStorage.setItem('token', currentUser.loginToken);\n localStorage.setItem('username', currentUser.username);\n }\n}", "static storeUser(user) {\n localStorage.setItem('userInfo', user);\n }", "function _getUserId() {\n if (!this.userId) {\n this.userId = localStorage.userId;\n if (!this.userId) {\n this.userId = cuid();\n localStorage.userId = this.userId;\n }\n }\n return this.userId;\n }", "function _getUserId() {\n if (!this.userId) {\n this.userId = localStorage.userId;\n if (!this.userId) {\n this.userId = cuid();\n localStorage.userId = this.userId;\n }\n }\n return this.userId;\n }", "async _setUserId(userId) {\n try {\n await AsyncStorage.setItem(GLOBAL.STORAGE_KEY, userId);\n } catch (error) {\n console.log('AsyncStorage error: ', error.message);\n }\n }", "function saveCurrentUserinLocalStorage() {\n localStorage.setItem(\"curUserId\", firebase.auth().currentUser.uid);\n localStorage.setItem(\"curUserImgSource\", firebase.auth().currentUser.photoURL);\n}", "function syncCurrentUserToLocalStorage() {\n if (currentUser) {\n localStorage.setItem(\"token\", currentUser.loginToken);\n localStorage.setItem(\"username\", currentUser.username);\n }\n }", "function syncCurrentUserToLocalStorage() {\n if (currentUser) {\n localStorage.setItem(\"token\", currentUser.loginToken);\n localStorage.setItem(\"username\", currentUser.username);\n }\n }", "function syncCurrentUserToLocalStorage() {\n if (currentUser) {\n localStorage.setItem(\"token\", currentUser.loginToken);\n localStorage.setItem(\"username\", currentUser.username);\n }\n }", "function syncCurrentUserToLocalStorage() {\n if (currentUser) {\n localStorage.setItem(\"token\", currentUser.loginToken);\n localStorage.setItem(\"username\", currentUser.username);\n }\n }", "function syncCurrentUserToLocalStorage() {\n if (currentUser) {\n localStorage.setItem(\"token\", currentUser.loginToken);\n localStorage.setItem(\"username\", currentUser.username);\n }\n }", "function syncCurrentUserToLocalStorage() {\n if (currentUser) {\n localStorage.setItem(\"token\", currentUser.loginToken);\n localStorage.setItem(\"username\", currentUser.username);\n }\n }", "login(idToken, user) {\n localStorage.setItem(\"id_token\", idToken);\n localStorage.setItem(\"user\", JSON.stringify(user));\n }", "function setTemp() {\n if (localStorage.getItem(\"userId\") === null) {\n // Create temp user\n var tempUser = {\n name: \"temp\",\n password: \"\"\n };\n localUser.name = tempUser.name;\n console.log(tempUser);\n // User post\n API.createUser(tempUser);\n } else {\n localUser.id = localStorage.getItem(\"userId\");\n API.getFridge(localUser.id);\n }\n}", "function setUserId() {\n var xhr = new XMLHttpRequest();\n xhr.onreadystatechange = function () {\n if (xhr.readyState == XMLHttpRequest.DONE) {\n var userId = xhr.responseText;\n if (validateId(userId)) {\n chrome.storage.local.set(\n { userId: userId, recentlyUpdated: true },\n function () {\n console.log(\"Settings saved\");\n }\n );\n }\n }\n };\n xhr.open(\"GET\", \"https://data2.netflixparty.com/create-userId\", true);\n xhr.send(null);\n }", "function setUser(id, username) {\n\tuserid = id;\n\tusername = username;\n\tlocalStorage.setItem('userid', userid);\n\tlocalStorage.setItem('username', username);\n}", "function getLoggedInUserID() {\n var LoggedInUserID;\n if (typeof (Storage) !== \"undefined\") {\n if (localStorage.getItem(\"LoggedInUserID\")) {\n LoggedInUserID = localStorage.getItem(\"LoggedInUserID\");\n }\n }\n else {\n toastr.error(\"Sorry, your browser does not support web storage...\");\n }\n return LoggedInUserID;\n}", "function loggedIn(){\r\n if(localStorage.getItem(\"loggedIn\")){\r\n loginButton.style.display = \"none\";\r\n signupButton.style.display = \"none\";\r\n console.log(document.getElementById(\"userID\").value);\r\n if(localStorage.getItem(\"userID\") == \"null\"){\r\n localStorage.setItem(\"userID\", document.getElementById(\"userID\").value);\r\n }\r\n userNameDisplay[1].style.display = \"inline\";\r\n savedQuotesButton[0].style.display = \"inline\";\r\n savedQuotesButton[1].style.display = \"inline\";\r\n savedQuotesButton[2].style.display = \"block\";\r\n userNameDisplay[1].textContent = localStorage.getItem(\"userName\");\r\n document.getElementById(\"userID\").value = localStorage.getItem(\"userID\");\r\n }\r\n}", "function storeUserCredentials(token) {\n window.localStorage.setItem(LOCAL_TOKEN_KEY, token);\n }", "updateUserID (e) {\n let id\n id = e.target.parentElement.parentElement.children[1].children[4].lastChild.data\n localStorage.setItem(\"currentUserId\", JSON.stringify(id));\n }", "setToken(idToken) {\n localStorage.setItem('id_token', idToken)\n }", "setToken(idToken) {\n localStorage.setItem('id_token', idToken);\n }", "getIdentity() {\n const identity = JSON.parse(localStorage.getItem('identity'));\n if (identity != 'undefined') {\n this.identity = identity;\n }\n else if (identity == 'undefined') {\n this.identity = null;\n }\n return this.identity;\n }", "function storeUserCredentials(token) { \n localStorageService.set(key, token);\n useCredentials(token);\n }", "async function saveUserCredentialsInLocalStorage() {\n if (currentUser) {\n let teamsList = await Team.getTeams();\n\n favName = teamsList.find(function (obj) {\n if (obj[\"id\"] == favTeam) return obj;\n });\n\n localStorage.setItem(\"username\", currentUser.username);\n localStorage.setItem(\"userId\", currentUser.userId);\n localStorage.setItem(\"favTeamId\", favTeam);\n\n //catches error when function is called prior to user setting a favorite team\n try {\n localStorage.setItem(\"favTeamName\", favName.name);\n } catch (err) {\n console.log(\"no favorite team selected\");\n }\n }\n}", "function saveUserData() {\n localStorage.setItem('locallyStored', JSON.stringify(userData))\n}", "function setVIPId (){\n VIP_id = localStorage.getItem(\"user_id\");\n}", "function resetUserId(oldUserId) {\n var xhr = new XMLHttpRequest();\n xhr.onreadystatechange = function () {\n if (xhr.readyState == XMLHttpRequest.DONE) {\n var userId = xhr.responseText;\n if (validateId(userId)) {\n chrome.storage.local.set(\n { userId: userId, oldUserId: oldUserId, recentlyUpdated: true },\n function () {\n console.log(\"Settings saved\");\n }\n );\n }\n }\n };\n xhr.open(\"GET\", \"https://data2.netflixparty.com/create-userId\", true);\n xhr.send(null);\n }", "function createData(localJson){\n\tlocalStorage.setItem(userID.toString(), localJson);\n}", "setUserLS(userName) {\n localStorage.setItem('logedUser', userName);\n }", "function setUserId() {\n var xhr = new XMLHttpRequest();\n xhr.onreadystatechange = function() {\n if (xhr.readyState == XMLHttpRequest.DONE) {\n var userId = xhr.responseText;\n if(validateId(userId)) {\n chrome.storage.local.set({'userId': userId, 'recentlyUpdated': true}, function() {\n console.log('Settings saved');\n });\n chrome.runtime.setUninstallURL(\"https://www.netflixparty.com/uninstall?userId=\" + userId);\n }\n }\n }\n xhr.open('GET', 'https://data2.netflixparty.com/create-userId', true);\n xhr.send(null);\n }", "persist() {\n localStorage.setItem(\n STORAGE_KEY + \"/\" + this.user.getId(),\n JSON.stringify(this.data)\n );\n }", "function saveToLocalStorage() { \n\t\n\t\t\t\t\tvar lscount = localStorage.length; \n\t\t\t\t\tvar Userstring=User.toJSONString();\n\t\t\t\t\t\t\tlocalStorage.setItem(\"User_\" + lscount, Userstring); \n\t\t\n}", "token(value){ window.localStorage.setItem('token', value)}", "function rememberUser() {\r\n\tif(localStorage.remember) {\r\n\t\tgetId('name').value = localStorage.name;\r\n\t\tgetId('email').value = localStorage.email;\r\n\t\tgetId('phone').value = localStorage.phone;\r\n\t\tgetId('address').value = localStorage.address;\r\n\t\tgetId('remember').checked = localStorage.remember;\r\n\t}\r\n}", "function storeLocal() {\n const jsonUserData = JSON.stringify(userData);\n localStorage.setItem('fullname', jsonUserData);\n}", "setUserId(state, action) {\n console.log(action.payload);\n localStorage.setItem(\"currentUserId\", action.payload._id);\n state.currentUserId = localStorage.getItem(\"currentUserId\");\n }", "function setUserDetailsInLocalStorage(user) {\n localStorage.setItem(\"userDetails\", JSON.stringify(user));\n}", "function storedata(username, jwt) {\r\n if(typeof(Storage) !== \"undefined\") {\r\n if (localStorage.jwt && localStorage.username) {\r\n localStorage.username =username;\r\n localStorage.jwt =jwt;\r\n // alert('done')\r\n } else {\r\n localStorage.username =username;\r\n localStorage.jwt =jwt;\r\n // alert('done add')\r\n }\r\n } else {\r\n alert(\"Sorry, your browser does not support web storage...\");\r\n }\r\n }", "saveAuthData(token, expirationDate, admin) {\n localStorage.setItem('token', token);\n localStorage.setItem('expiration', expirationDate.toISOString());\n if (admin) {\n localStorage.setItem('qdqwdqdweg4hhvt4vhtyvw5 t5juykn ', admin.toString());\n }\n // edit here to add more users type\n }", "function storeUserCredentials(token) {\n window.localStorage.setItem(LOCAL_TOKEN_KEY, token);\n useCredentials(token);\n }", "function storageStoreDocId() {\n\n firebase.auth().onAuthStateChanged(function (user) { // Check the current authenticated user\n if (user) {\n db.collection('users') \n .doc(user.uid) // get the user's document in 'users'\n .get() // READ \n .then(function (doc) {\n var storeID = doc.data().store; \n sessionStorage.setItem('storeID', storeID); // store the 'store' value from the user document to sessionStorage\n })\n }\n })\n}", "function storeSession (data) {\n const now = new Date()\n const expirationDate = new Date(now.getTime() + data.expiresIn * 1000)\n localStorage.setItem('expirationDate', expirationDate)\n localStorage.setItem('expiresIn', data.expiresIn * 1000)\n localStorage.setItem('token', data.idToken)\n localStorage.setItem('userId', data.localId)\n localStorage.setItem('refreshToken', data.refreshToken)\n}", "function storeCredentials () {\n var storage = window.localStorage;\n\n //Get Info\n username = document.getElementById(\"username\").value;\n password = document.getElementById(\"password\").value;\n\n //Store Info\n storage.setItem(\"username\", username);\n storage.setItem(\"password\", password);\n\n //Hide Login\n hideLogin();\n}", "function saveUserData(userData) {\n localStorage.setItem('username', userData.username);\n localStorage.setItem('accessToken', userData.accessToken);\n localStorage.setItem('id', userData.id);\n username = userData.username;\n accessToken = userData.accessToken;\n }", "getLocalStorageUser() {\n return JSON.parse(localStorage.getItem('user'))\n }", "function createAnonymousUserAndSave() {\n // Retrieve the stored User from Local Device Storage\n var userId = window.localStorage.getItem('deviceUser');\n if (userId === null) {\n app.appUser().create({\n anonymous: true\n }).then(function (anonymousUser) {\n console.log('Created anonymous user: ', anonymousUser);\n $('#results').append('<h2>User</h2>' + JSON.stringify(anonymousUser, null, 2));\n if (window.localStorage) {\n localStorage.deviceUser = anonymousUser.id;\n localStorage.deviceApiKey = anonymousUser.apiKey;\n }\n });\n }\n else {\n var anonymousUser = new EVT.User({\n id: localStorage.deviceUser,\n apiKey: localStorage.deviceApiKey\n }, app);\n console.log('Anonymous User read from Local Storage : ' + JSON.stringify(anonymousUser));\n $('#results').append('<h2>User</h2>' + JSON.stringify(anonymousUser, null, 2));\n }\n}", "static saveUserInfo(userData) {\n localStorage.setItem('uid', userData.uid);\n localStorage.setItem('name', userData.name);\n }", "function setUserLastSeen(userID, timestamp) {\n\tsessionStorage.setItem(userID + \".lastseen\", timestamp);\n}", "setGuidBase(guid) {\n localStorage.guid_base = guid;\n }", "init () {\n if (localStorage.users === undefined || !localStorage.encrypted) {\n // Set default user\n let defaultUser = 'DeekshithShetty'\n let defaultUserSalt = genSalt(defaultUser)\n let defaultUserPass = hashSync('Hydra@12345', defaultUserSalt)\n\n users = {\n [defaultUser]: hashSync(defaultUserPass, salt)\n }\n\n localStorage.users = JSON.stringify(users)\n localStorage.encrypted = true\n } else {\n users = JSON.parse(localStorage.users)\n }\n }", "function guardarLS(user) {\n const token = {\n token: user\n };\n localStorage.setItem('token', JSON.stringify(token));\n}", "function setUserLocalStorage(username, email) {\n localStorage.setItem(\"username\", username);\n localStorage.setItem(\"email\", email);\n}", "function getIdentification(cb) {\n chrome.storage.sync.get('userRandId', function(items) {\n var userRandId = items.userRandId;\n if (userRandId) {\n useToken(userRandId);\n } else {\n userRandId = getRandomToken();\n chrome.storage.sync.set({userRandId: userRandId}, function() {\n useToken(userRandId);\n });\n }\n function useToken(userRandId) {\n cb(userRandId);\n }\n });\n}", "function Logout() {\n localStorage.removeItem('user_id')\n}", "function getUUID(appkey = \"socialvr4chi\") {\n //let uuid = localStorage.getItem(appkey);\n//console.log(\"in uuid with value: \",uuid);\n //if (uuid === null) {\n //uuid = uuidv4();\n //localStorage.setItem(appkey, uuid);\n //}\n // return uuid;\n}", "function initUserInfo () {\r\n\t \tvar storedUserInfo = localStorage.getItem('user'), currentUser = null;\r\n\t \tif (!!storedUserInfo) {\r\n\t \t\tcurrentUser = JSON.parse(storedUserInfo);\r\n\t \t}\r\n\t \treturn currentUser;\r\n\t }", "function saveNickName() {\n localStorage.setItem('receivedNickName', userNickName); //1st argument is a keyword to get the info, 2nd argument - info that has to be rememeber \n userNickName = localStorage.getItem('receivedNickName');\n}", "function resetUserId(oldUserId) {\n var xhr = new XMLHttpRequest();\n xhr.onreadystatechange = function() {\n if (xhr.readyState == XMLHttpRequest.DONE) {\n var userId = xhr.responseText;\n if(validateId(userId)) {\n chrome.storage.local.set({'userId': userId, 'oldUserId': oldUserId, 'recentlyUpdated': true}, function() {\n console.log('Settings saved');\n });\n chrome.runtime.setUninstallURL(\"https://www.netflixparty.com/uninstall?userId=\" + userId);\n }\n }\n }\n xhr.open('GET', 'https://data2.netflixparty.com/create-userId', true);\n xhr.send(null);\n }", "function getToken() {\n let token = localStorage.getItem('readable.token');\n if (!token) {\n token = Math.random().toString(36).substr(-10);\n localStorage.setItem('readable.token', token);\n }\n return token;\n}", "function check_current_user() {\n\tfor (var i=0; i<members_db.length; i++) {\n\t\tif (members_db[i][7] == true) {\n\t\t\tlocalStorage.setItem(\"current_user_id\", i); \n\t\t}\n\t}\n}", "function generateUser(users){\r\n if (users.token == null ){\r\n\r\n \r\n document.getElementById(\"message\").classList.add(\"alert\", \"alert-danger\");\r\n document.getElementById(\"message\").textContent = \"Vous n'êtes pas inscrit.\"\r\n } else{ \r\n // let cookieUser = document.cookie = `token=${users.token}; max-age=86000`;\r\n let storageUser = localStorage.setItem('token', `${users.token}`);\r\n location.href = \"articles.html\";\r\n }\r\n}", "function saveSession(data) {\n localStorage.setItem('username', data.username);\n localStorage.setItem('id', data._id);\n localStorage.setItem('authtoken', data._kmd.authtoken);\n userLoggedIn();\n }", "function saveSession(data) {\n localStorage.setItem('username', data.username);\n localStorage.setItem('id', data._id);\n localStorage.setItem('authtoken', data._kmd.authtoken);\n userLoggedIn();\n }", "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 User()\n{\n var that = this;\n var dataStorageKey = \"currentUser\";\n\n var saveGuestUser = function () {\n function guid() {\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 }\n\n var guestUser = {\n userId: guid(),\n name: null,\n domain: null\n }\n that.save(guestUser);\n return localStorage.getItem(dataStorageKey);\n };\n\n this.currentUser = function () {\n var currentUser = localStorage.getItem(dataStorageKey);\n if (currentUser == null) {\n var currentUser = saveGuestUser();\n }\n return JSON.parse(currentUser);\n }\n this.login = function (email) {\n var name = email.split('@')[0]\n var currentUser = {\n userId: email,\n firstName: name.split('.')[0],\n lastName: name.split('.')[1],\n domain: email.split('@')[1]\n }\n that.save(currentUser);\n }\n\n this.save = function (data) {\n localStorage.setItem(dataStorageKey, JSON.stringify(data));\n };\n}", "function saveData(id) {\n \n var userInput = $(\"#\"+id).val();\n localStorage.setItem(id, userInput); \n}", "function __getUid() {\n if (ComplianceService.isPrivacyEnabled()\n || !Browser.isLocalStorageSupported()\n || __hasOptedOutOfPersonalization()) {\n return false;\n }\n var uid = window.localStorage.getItem(CONCERT_UID_KEY);\n if (!uid) {\n uid = __generateUUID();\n window.localStorage.setItem(CONCERT_UID_KEY, uid);\n }\n\n return uid;\n }", "setInfo(token, expiresAt, role) {\n localStorage.setItem('token', token)\n localStorage.setItem('expiresAt', new Date(expiresAt).getTime())\n localStorage.setItem('role', role)\n }", "function clearLocalStorage() {\n\tlocalStorage.removeItem('userid');\n\tlocalStorage.removeItem('username');\n}", "function loadUser(){\n let userLogged = JSON.parse(localStorage.getItem(\"userLogged\"))\n setUser(userLogged)\n }", "function saveRandSeed() {\n var randseed = new Uint8Array(32);\n asmCrypto.getRandomValues(randseed);\n localStorage.randseed = base64urlencode(asmCrypto.bytes_to_string(randseed));\n}", "function setStorage() \r\n\t{\r\n if (typeof(Storage) !== \"undefined\")\r\n\t\t{\r\n if (remember)\r\n\t\t\t{\r\n localStorage.setItem(\"member\", 'true');\r\n if (publicAddr)\r\n localStorage.setItem(\"address\", publicAddr);\r\n } else\r\n\t\t\t{\r\n localStorage.removeItem('member');\r\n localStorage.removeItem('address');\r\n }\r\n } \r\n }", "setAuth(state, userData) {\n state.authenticated = true\n localStorage.setItem('id_token', userData.id_token)\n if (userData.refresh_token) {\n localStorage.setItem('refresh', userData.refresh_token)\n }\n ApiService\n .setHeader(userData.id_token)\n }", "getUserData() {\n return JSON.parse(localStorage.getItem(SIMPLEID_USER_SESSION));\n }", "function localAddTestUsersToStorage(){\n let choice = prompt(\"Clear Storage before adding users? Y/N\");\n \n if(choice.toLocaleLowerCase() == \"y\"){\n localStorage.clear();\n }\n \n for(let i = 0; i < localTestUsers.users.length; i++){\n localStorage.setItem(localTestUsers.users[i].email, JSON.stringify(localTestUsers.users[i])); \n }\n}", "function saveLogin(login, password) {\r\n\tif (typeof localStorage != 'undefined') {\r\n\r\n\t\tvar ident = {\r\n\t\t\tlogin : login,\r\n\t\t\tpassword : password\r\n\t\t};\r\n\r\n\t\tvar identJson = JSON.stringify(ident);\r\n\t\tlocalStorage.setItem(\"ident\", identJson);\r\n\r\n\t} else {\r\n\t\talert(\"Pas de storage tocard !\");\r\n\t}\r\n\r\n\tappelLogin(login, password);\r\n}", "SAVE_TOKEN(state, token) {\n localStorage.setItem(\"auth-token\", token);\n }", "function stashId(inid) {\n sessionStorage.setItem('productid', inid)\n}", "syncWithWebStorage(){\n let userId = firebase.auth().currentUser.uid;\n firebase.database().ref('users/' + userId).once('value').then((snapshot) => {\n this.webStorage.setItem(userId, JSON.stringify(snapshot.val()));\n });\n }", "function userFromLocal() {\n let user = localStorage.getItem(\"user\");\n return user;\n}", "authListener() {\n fireDB.auth().onAuthStateChanged((user) => {\n // console.log(user);\n if (user) {\n this.setState({ user });\n localStorage.setItem('user', user.uid);\n }\n else {\n this.setState({ user: null });\n localStorage.removeItem('user');\n }\n });\n }", "generateUserID() {\n\t\treturn (Math.random() * 999).toString();\n\t}", "function setUser(user) {\n\t\t\tlocalStorage.addLocal('user', user);\n\t\t}", "function getLoggedInUserCommunityID() {\n var CommunityID;\n if (typeof (Storage) !== \"undefined\") {\n if (localStorage.getItem(\"CommunityID\")) {\n CommunityID = localStorage.getItem(\"CommunityID\");\n }\n }\n else {\n toastr.error(\"Sorry, your browser does not support web storage...\");\n }\n return CommunityID;\n}", "function setSessionID(id) {\n if (typeof Storage !== \"undefined\") {\n sessionStorage.setItem(\"sessionID\", id);\n } else {\n alert(\"Sorry, your browser does not support Web Storage...\");\n }\n\n sessionID = sessionStorage.sessionID;\n}", "GenerateUserID() {\n return this.Cache.Wrap('user_id', () => {\n // generate new UUID if cache hit fails\n const newUserID = uuid();\n\n this.Log(`Generated new UserID ${newUserID}`);\n\n return Promise.resolve(newUserID);\n }, 43200000);\n }", "save(user) {\n //user.id = crypto.randomBytes(20).toString('hex');\n return 1; \n }", "function storeUserLocal(user){\n try\n {\n LocalStorage.setObject(Constants.USER,user);\n return true;\n }\n catch(err)\n {\n return false;\n }\n }" ]
[ "0.80057853", "0.76980156", "0.7214092", "0.71314824", "0.71070856", "0.69873935", "0.690461", "0.6807177", "0.67809165", "0.67739415", "0.6773735", "0.6752356", "0.6717299", "0.6717299", "0.67109925", "0.66859233", "0.6645169", "0.6645169", "0.6645169", "0.6645169", "0.6645169", "0.6645169", "0.6615809", "0.65810883", "0.65775794", "0.6486787", "0.6436937", "0.64275146", "0.6424762", "0.6411822", "0.64073956", "0.6403875", "0.63680744", "0.635179", "0.63488173", "0.6343679", "0.6335553", "0.63182586", "0.6310192", "0.63044035", "0.6272388", "0.625683", "0.6236333", "0.62290245", "0.62271947", "0.6205486", "0.6193871", "0.6190765", "0.6177724", "0.61760587", "0.6173169", "0.61623347", "0.61549646", "0.614512", "0.6129647", "0.61186165", "0.6105387", "0.6100199", "0.60905915", "0.60781765", "0.6069774", "0.60572165", "0.6057203", "0.603816", "0.60364527", "0.60300016", "0.6030001", "0.6027902", "0.6027744", "0.60242957", "0.6022384", "0.6018798", "0.60146224", "0.60146224", "0.6012825", "0.60068667", "0.6001544", "0.6001114", "0.5996579", "0.59849936", "0.59822685", "0.59634733", "0.59596616", "0.59480405", "0.5945571", "0.59452856", "0.5940022", "0.5933867", "0.5932304", "0.59320927", "0.59316796", "0.59265965", "0.5922531", "0.5919199", "0.591823", "0.59139806", "0.5912883", "0.5909913", "0.5909575", "0.58997595" ]
0.70996904
5
toggle function for fixedheight displays with potentially large contents
function toggleDisplay(selector,singleRowHeight,bindType) { var display = $(selector); var toggler = display.find(gTogglerClass).first(); display.css({'height':'auto'});//set height to auto var fullHeight = display.height();//get full content height when auto display.css({'height':singleRowHeight});//now set height to one row if (display.height() >= fullHeight) {//only show toggler if full contents larger than 1 row toggler.css('visibility','hidden'); } else { toggler.css('visibility','visible'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "toggleContents() {\n\t\tif (this.breakpoint === this.sizeS && this.sideContentVisibility !== SideContentVisibility.AlwaysShow) {\n\t\t\tthis._toggled = !this._toggled;\n\t\t}\n\t}", "toggleContents() {\n if (this.breakpoint === this.sizeS && this.sideContentVisibility !== _SideContentVisibility.default.AlwaysShow) {\n this._toggled = !this._toggled;\n }\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 handleDynamicHeight(value){$element.toggleClass('md-dynamic-height',value);}", "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 onToggleReduction()\n\t{\n\t\tvar ui = CashShop.ui;\n\n\t\tif (_realSize) {\n\t\t\tui.find('.panel').show();\n\t\t\tui.height(_realSize);\n\t\t\t_realSize = 0;\n\t\t}\n\t\telse {\n\t\t\t_realSize = ui.height();\n\t\t\tui.height(17);\n\t\t\tui.find('.panel').hide();\n\t\t}\n\t}", "function menuToggle() {\r\n if(maxHeight === \"0px\") {\r\n setMaxHeight(\"200px\");\r\n } else {\r\n setMaxHeight(\"0px\");\r\n }\r\n }", "function toggleContent() {\n\n\t\t\t\tthisAutoHeight && $thisContainer.css('height', $thisContainer.outerHeight());\n\n\t\t\t\t$currentContent.css({\n\t\t\t\t\t'position': 'absolute',\n\t\t\t\t\t'left': 0,\n\t\t\t\t\t'top': 0\n\t\t\t\t});\n\n\t\t\t\tTweenMax.to($currentContent, animationSpeed, {\n\t\t\t\t\tautoAlpha: 0\n\t\t\t\t});\n\n\t\t\t\tif (arguments[0] === false) return;\n\n\t\t\t\tvar $initialContent = $currentContent.filter('[id=\"' + initialTab + '\"]');\n\n\t\t\t\t$initialContent.css('z-index', 2);\n\n\t\t\t\tTweenMax.to($initialContent, animationSpeed, {\n\t\t\t\t\tautoAlpha: 1\n\t\t\t\t\t// ,'z-index': 2\n\t\t\t\t});\n\t\t\t}", "function adjustHeight(){\n\t\t\t\t\t\t var viewportHeight = jQuery(window).height();\n\t\t\t\t\t var canvasHeight = jQuery('nav.full_vertical').height(); \n\t\t\t\t\t\t var newHeight = canvasHeight;\n\t\t\t\t\t\t \n\t\t\t\t\t\t if(canvasHeight < viewportHeight) {\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t var newHeight = viewportHeight\n\t\t\t\t\t\t }\n\t\t\t\t\t\t \n\t\t\t\t\t jQuery(\"body, .off-canvas, #responsive-nav-overlay\").css({'height': newHeight, 'overflow': 'hidden'});\n\t\t\t\t\t }", "function toggleFooter() {\r\n\t\t\tconsole.info('Info: Footer toggled.');\r\n\t\t\tif($(window).scrollTop() + $(window).height() + 80 >= $(document).height()) {\r\n\t \t\t\t$element.show();\r\n\t \t} else {\r\n\t\t\t\t$element.hide();\r\n\t\t\t}\r\n\t\t}", "function __toggleOffscreenContent() {\n\n\t\tif (sOpen) {\n\t\t\t$content.fadeOut();\n\t\t\t$body.toggleClass('no-scroll');\n\t\t\tsOpen = false;\n\t\t} else {\n\t\t\t$content.fadeIn();\n\t\t\t$body.toggleClass('no-scroll');\n\t\t\tsOpen = true;\n\t\t}\n\n\t}", "function handleDynamicHeight (value) {\n $element.toggleClass('md-dynamic-height', value);\n }", "function handleDynamicHeight (value) {\n $element.toggleClass('md-dynamic-height', value);\n }", "function handleDynamicHeight (value) {\n $element.toggleClass('md-dynamic-height', value);\n }", "function ShowHDDiv() {\n\n if (!SHD) {\n\n $(\".Bottom_Div\").css('height', 40);\n SHD = true;\n } else {\n $(\".Bottom_Div\").css('height', 400);\n SHD = false;\n }\n}", "function toggleLiveResizing () {\n\t\t\t\t$.each( $.layout.config.borderPanes, function (i, pane) {\n\t\t\t\t\tvar o = myLayout.options[ pane ];\n\t\t\t\t\to.livePaneResizing = !o.livePaneResizing;\n\t\t\t\t});\n\t\t\t}", "function toggle(button, target) {\n\t\t\t\n\t\t\tif(target.css(\"height\") == \"0px\" ) {\n\t\t\t\tbutton.attr(\"src\", \"/static/app/pts/collapse.png\");\n\t\t\t\ttarget.css({\n\t\t\t\t\t\"height\": \"auto\",\n\t\t\t\t\t\"overflow\": \"visible\"\n\t\t\t\t});\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tbutton.attr(\"src\", \"/static/app/pts/expand.png\");\n\t\t\t\ttarget.css({\n\t\t\t\t\t\"height\": \"0px\",\n\t\t\t\t\t\"overflow\": \"hidden\"\n\t\t\t\t});\n\t\t\t}\n\t\t}", "toggleVisible(){\n $(this.content).animate({width: 'toggle'}, 300);\n }", "function toggle_desc(){\n\tif (fullDesc){\n\t\t$(\"#project_desc\").animate({height:\"100px\"});\n\t\tfullDesc = false;\n\t}else{\n\t\t$(\"#project_desc\").animate({height:height_desc});\n\t\tfullDesc = true;\n\t}\n}", "function display_details( id )\n{ \n var flag = 0; \n if ( $('toggle_details').innerHTML == \"Expanded view\" ) \n flag = 1;\n else \n flag = 0;\n \n if ( flag == 0 ) \n Element.hide( id );\t\t \n else \n Element.show( id );\n}", "function toggleHeadingSmaller() {\n\t_toggleHeading(\"smaller\");\n}", "function toggleOn() {\n if(toggle==0)\n {\n toggle=1;\n $(\".content\").css(\"display\",\"none\");\n $(\".containeffect\").css(\"display\",\"inline-block\");\n if(equal==1)\n {\n $(\".contain\").css(\"display\",\"none\");\n $(\".fa-bar-chart\").toggleClass('bar-icon')\n $(\"svg\").css(\"display\",\"none\");\n equal=0;\n }\n }\n else {\n toggle=0;\n $(\".containeffect\").css(\"display\",\"none\");\n $(\".content\").css(\"display\",\"inline-block\");\n }\n}", "function wpgmza_toggle_dbox_width_setting_area(toggle){\r\n if(toggle){\r\n $(\".wpgmza_dbox_width_settings_area\").hide();\r\n } else {\r\n $(\".wpgmza_dbox_width_settings_area\").show();\r\n\r\n }\r\n }", "function toggleExpand3Dview(elt) {\n \n track_full = !track_full;\n if(track_full) {\n elt.innerHTML=\"Expand\";\n $('#modal3DDialog').removeClass('full_modal-dialog');\n $('#modal3DContent').removeClass('full_modal-content');\n document.getElementById(\"view3DIfram\").height = \"400\";\n } else {\n elt.innerHTML=\"Shrink\";\n $('#modal3DDialog').addClass('full_modal-dialog');\n $('#modal3DContent').addClass('full_modal-content');\n var c=document.getElementById(\"modal3DContent\");\n var f=document.getElementById(\"modal3DFooter\");\n var c_h=c.scrollHeight;\n var f_h=f.scrollHeight;\n var n_h=c_h -(f_h* 2.5);\n document.getElementById(\"view3DIfram\").height = n_h;\n }\n}", "function heightDetect() {\n\t\t$(\".main_head\").css(\"height\", $(window).height());\n\t}", "function changeHeight(h) {\n\t//if( $(\"#htmlContainer\").css( \"display\" ) != \"none\" ){\n\t\t//alert( \"from AS3 setting flash height to html height: \" + ($(\"#htmlContainer\").height() + 80) );\n\t\t//$(\"#flashContent\").height( $(\"#htmlContainer\").height() + 80 );\n\t//}else{\n\t\t//alert( \"from AS3 setting flash height to: \" + h );\n \t//swffit.configure( {target:\"flashContent\", minHei:h } );\n\t //}\n}", "function changeHeight(h) {\n\t//if( $(\"#htmlContainer\").css( \"display\" ) != \"none\" ){\n\t\t//alert( \"from AS3 setting flash height to html height: \" + ($(\"#htmlContainer\").height() + 80) );\n\t\t//$(\"#flashContent\").height( $(\"#htmlContainer\").height() + 80 );\n\t//}else{\n\t\t//alert( \"from AS3 setting flash height to: \" + h );\n \t//swffit.configure( {target:\"flashContent\", minHei:h } );\n\t //}\n}", "#toggleDiv() {\n if(document.getElementById('content').style.display === 'block') {\n document.getElementById('content').style.display = 'none';\n document.getElementById('alternative').style.display = 'block';\n } else { \n document.getElementById('alternative').style.display = 'none';\n document.getElementById('content').style.display = 'block';\n }\n }", "function toggle(mode) {\n if(mode == 'detail') {\n $iframe.css({\n top: '0',\n left: '0',\n right: 'auto',\n bottom: 'auto',\n width: '100%',\n height: '100%'\n });\n $('body').css('overflow', 'hidden');\n $('html').css('overflow', 'hidden');\n } else {\n $iframe.attr('style', toolbarStyle);\n $('body').attr('style', bodyStyle);\n $('html').attr('style', htmlStyle);\n }\n }", "function toggle_down()\n{\n show('action_panel_main_id');\n show('toggle_up_id');\n hide('toggle_down_id');\n\t if(earthnc_getUrlVariable('em'))\n\t {\n\t map_c=document.getElementById('map');\n\t map_c.style.height='641px';\n\t }\n\t else\n\t {\n\t document.getElementById('map').className='full_screen_old';\n\t }\n\n\n }", "function heightDetect() {\n $(\".main_head\").css(\"height\", $(window).height());\n }", "function toggleDescriptionText() {\n\n\tvar default_height = parseInt(jQuery('.item-description.has-toggle').css('max-height')),//112,//150,//400;\n\t\titem_description = jQuery('.js-item-description'),\n\t\titem_description_toggle = jQuery('.js-item-description-toggle');\n\n\t//console.log(default_height);\n\t//console.log(item_description.height());\n\n\tif(item_description.height() < default_height) {\n\t\titem_description.removeClass('has-toggle');\n\t\titem_description_toggle.addClass('hide').removeClass('is-hidden');\n\t} else {\n\t\titem_description.addClass('has-toggle');\n\t\titem_description_toggle.removeClass('hide').addClass('is-hidden');\n\n\t\t/*var wordArray = item_description.get(0).innerHTML.split(' ');\n\t\twhile(item_description.get(0).scrollHeight > item_description.get(0).offsetHeight) {\n\t\t\twordArray.pop();\n\t\t\titem_description.get(0).innerHTML = wordArray.join(' ') + '...';\n\t\t}*/\n\t}\n\n\titem_description_toggle.on('click', function(e) {\n\t\te.preventDefault();\n\t\tif(item_description.is('.has-toggle')){\n\t\t\tjQuery('html, body').stop(true).animate({\n\t\t\t\tscrollTop: jQuery('.siteWidth').offset().top - jQuery('header').height()\n\t\t\t}, 750);\n\t\t}\n\t\titem_description.toggleClass('has-toggle');\n\t\titem_description.toggleClass('is-expanded');\n\t\titem_description_toggle.toggleClass('is-expanded');\n\t});\n}", "function toggleTabContentOnResize()\n\t{\n\t\tvar $activeTabIndex = $stepTabsNav.find('.active').index();\n\n\t\tif ( !Body.hasClass('body-mobile') && stepTabsViewState == \"mobile-view\" )\n\t\t{\n\t\t\tif ($activeTabIndex != '-1')\n\t\t\t{\n\t\t\t\t$('.step-tab-content').show();\n\t\t\t\t$mobileTabHeadingsWrappers.eq($activeTabIndex).addClass('active');\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$stepTabsNavLinks.eq(0).addClass('active');\n\t\t\t\t$mobileTabHeadingsWrappers.eq(0).addClass('active');\n\t\t\t\t$stepTabsContentBlocks.eq(0).addClass('active');\n\t\t\t\t$('.step-tab-content').show();\n\t\t\t}\n\t\t\tstepTabsViewState = \"pc-view\";\n\t\t}\n\t\telse if ( Body.hasClass('body-mobile') && stepTabsViewState == \"pc-view\" )\n\t\t{\n\t\t\tstepTabsViewState = \"mobile-view\";\n\t\t\t\n\t\t\tif ( $activeTabIndex != '-1' )\n\t\t\t{\n\t\t\t\t$stepTabsContentBlocks.not($stepTabsContentBlocks.eq($activeTabIndex)).find('.step-tab-content').hide();\n\t\t\t\t$stepTabsContentBlocks.eq($activeTabIndex).find('.step-tab-content').show();\n\t\t\t\t$mobileTabHeadingsWrappers.eq($activeTabIndex).addClass('active');\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$mobileTabHeadingsWrappers.removeClass('active');\n\t\t\t\t$stepTabsContentBlocks.find('.step-tab-content').hide();\n\t\t\t}\n\t\t}\n\t}", "function toggleHidness(toHide, toShow) {\n if (toHide != \"\") {\n $(toHide).hide();\n }\n\n if (toShow != \"\") {\n if ($(toShow).hasClass(\"hide\")) {\n $(toShow).removeClass(\"hide\");\n } else {\n $(toShow).show();\n }\n }\n}", "function toggle_tests(){\n\tif (fullTests){\n\t\t$(\"#tests\").animate({height:\"45px\"});\n\t\tfullTests = false;\n\t}else{\n\t\t$(\"#tests\").animate({height:height_tests});\n\t\tfullTests = true;\n\t}\n}", "function fixHeight() {\r\n\r\n j$('.full-width-content').each(function () {\r\n if (j$(this).find('.vc_column_container').length > 1) {\r\n\t\t\tif ( j$(window).width() > 748) {\r\n var maxHeight = 0;\r\n j$(this).children('.vc_column_container').css('height', 'auto');\r\n j$(this).children('.vc_column_container').each(function () {\r\n if (j$(this).outerHeight() > maxHeight) {\r\n maxHeight = j$(this).outerHeight();\r\n }\r\n });\r\n j$(this).find('#map_canvas').outerHeight(maxHeight);\r\n\t\t\t}\r\n\r\n }\r\n });\r\n\r\n\t\r\n\tif ( j$(window).width() > 768) { \r\n\tvar p_height = j$(\"#posts\").outerHeight();\r\n\tj$('.business_sidebar').css('min-height', p_height);\r\n\t\t\r\n\t}\r\n\telse {\r\n\tj$('.business_sidebar').css('min-height', 0);\r\n\t}\r\n \r\n}", "get _hiddenContentSize(){var size=this.grid?this._physicalRows*this._rowHeight:this._physicalSize;return size-this._viewportHeight;}", "function display2(event) {\n $(event.currentTarget).next().animate( {height: 'toggle'}, 'slow');\n}//end of display2", "function panelResizeKludge() {\n if (currentlyOpenPanel) {\n currentlyOpenPanel.style.height = window.innerHeight + \"px\";\n }\n return true;\n }", "function toggleContent() {\n\n\t\t\t\t$thisContainer.css('height', $thisContainer.outerHeight());\n\n\t\t\t\t$thisContent.css({\n\t\t\t\t\t'position': 'absolute',\n\t\t\t\t\t'left': 0,\n\t\t\t\t\t'right': 0\n\t\t\t\t});\n\n\t\t\t\tTweenMax.set($thisContent, {\n\t\t\t\t\tautoAlpha: 0,\n\t\t\t\t\t'z-index': -1\n\t\t\t\t});\n\n\t\t\t\tif ( arguments[0] === false ) return;\n\n\t\t\t\tvar $initialContent = $thisContent.filter('[data-id=\"' + initialDataAtr + '\"]');\n\n\t\t\t\t$initialContent.css('z-index', 2);\n\n\t\t\t\tTweenMax.to($initialContent, animationSpeed, {\n\t\t\t\t\tautoAlpha: 1\n\t\t\t\t});\n\t\t\t}", "function toggleStoryMode() {\n if (!$(\".container-bottom-story\").hasClass(\"mode--active\")) {\n $(\".container-bottom-map\").removeClass(\"mode--active\");\n $(\".container-bottom-map\").toggle();\n $(\".container-bottom-story\").addClass(\"mode--active\");\n $(\".container-bottom-story\").toggle();\n }\n resizeWindowDelayed();\n}", "function setupDisplayContent() {\n addClassToFeaturesThatEnableThisFeature();\n setContainerHeight();\n $('html, body').animate({\n scrollTop: 0\n }, 400);\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 toggleMenu(ele) {\n var menuHeight = ele.offsetHeight;\n if (menuHeight) {\n ele.style.height = 0;\n } else {\n ele.style.height = ele.scrollHeight + \"px\";\n }\n }", "function actCloseDICOM(){\n $('.obj-opendicom').toggle();\n pageScroll('auto');\n\n// $('main').css('overflow', 'auto').css('height', 'auto');\n// toggleFullScreen();\n }", "function toggle_details()\n{ \n var flag = 0; \n if ( $('toggle_details').innerHTML == \"Expanded view\" ) \n {\n flag = 0;\n $('toggle_details').innerHTML = \"List view\";\n }\n else \n {\n flag = 1;\n $('toggle_details').innerHTML = \"Expanded view\"; \n }\n \n details = document.getElementsByClassName( 'log_params', $('content') );\n for( var i = 0; i < details.length; i++ )\n {\n if ( flag == 0 ) \n\t Element.hide( details[i].id );\t\t \n else \n\t Element.show( details[i].id );\n\t }\n}", "function toggleMode() {\n\tif (overviewMode === \"graph\") {\n\t\tmatrixContainer.style.display = \"flex\";\n\t\tgraphContainer.style.display = \"none\";\n\t\toverviewMode = \"matrix\";\n\t\ticonMode.src = \"img/hash.svg\";\n\t} else if (overviewMode === \"matrix\") {\n\t\tmatrixContainer.style.display = \"none\";\n\t\tgraphContainer.style.display = \"flex\";\n\t\toverviewMode = \"graph\";\n\t\ticonMode.src = \"img/git-branch.svg\";\n\t}\n}", "function display2(event) { //display2\n $(event.currentTarget).next().animate ({height: 'toggle'}, \"slow\");\n}//end of display2", "function toggleConfFit(){\n\tfitSize = toggleConfBool('fit', fitSize);\n\tfitImagen();\n\tscrollear();\n\tget('wcr_btnfit').innerHTML = (fitSize ? 'Disable' : 'Enable') + ' Fit-to-screen';\n}", "function toggleHeadingBigger(editor) {\n\tvar cm = editor.codemirror;\n\t_toggleHeading(cm, \"bigger\");\n}", "function toggleHeadingBigger(editor) {\n\tvar cm = editor.codemirror;\n\t_toggleHeading(cm, \"bigger\");\n}", "function toggleHeadingBigger(editor) {\n\tvar cm = editor.codemirror;\n\t_toggleHeading(cm, \"bigger\");\n}", "function toggleHeadingBigger(editor) {\n\tvar cm = editor.codemirror;\n\t_toggleHeading(cm, \"bigger\");\n}", "function checkSize() {\n if ($(\".menu-toggle\").css(\"display\") == \"block\") {\n numbers(shortCol, tallCol);\n }\n if ($(\".col-md-4, .col-md-5\").css(\"float\") == \"left\") {\n numbers(shortCol, tallCol);\n }\n}", "function toggleFlyout() {\n const analyticsAction = isExpanded ? 'CloseDrawer' : 'OpenDrawer'\n analyticsService.logEvent('KnowledgeManagement', analyticsAction)\n setIsExpanded(!isExpanded)\n }", "get _hiddenContentSize(){var size=this.grid?this._physicalRows*this._rowHeight:this._physicalSize;return size-this._viewportHeight}", "function toggleDisplay() {\n display = !display;\n\n if (!frame) {\n createFrame();\n }\n\n toggleScrolling(display);\n\n if (display) {\n frame.style.display = \"block\";\n }\n else {\n frame.style.display = \"none\";\n }\n}", "function checkSize() {\n if ($(\".navbar-toggle\").css(\"display\") == \"block\") {\n //Cart Tab tweaks\n\t\t\t\t$('.cart-parent').wrapInner('<span></span>');\n     }\n }", "function ShowcaseHeightSet() {\n\t\t$(\".showcase_stage-wrapper\").css(\"height\", $(\".showcase_stage-active\").height() );\n\t}", "toggle(){\n // Measure heights and animate transition\n const {_details: details} = this;\n const initialHeight = getComputedStyle(details).height;\n const wasOpen = details.open;\n details.open= !details.open;\n const finalHeght = getComputedStyle(details).height;\n details.open= true; // Close after animation ends\n const keyframes = [\n {height: initialHeight},\n {height: finalHeght}\n ];\n const options = { duration: 150 };\n const animation = details.animate(keyframes, options);\n // This makes the animation consistent between states\n if(wasOpen){\n details.classList.remove(\"open\");\n animation.onfinish = () => {\n details.open = false;\n };\n }else\n details.classList.add(\"open\");\n }", "function fadeInTextContentWhenLargeEnough() {\n fadeInTimer = nativeGlobal.setTimeout(function () {\n state.set('isSecondaryExpanding', false);\n view.update();\n }, heightAnimationDelay + heightAnimationDuration * 0.7);\n }", "function toggleInfo() {\n infoContent.toggle();\n upperContent.toggle();\n $('#ketchup').animate({\n bottom: '-300px'\n }, 0.5);\n $('#ketchup').animate({\n bottom: '0px'\n }, \"slow\");\n burgerContainer.toggleClass('strong-blur');\n if (lowerContent.children().length) lowerContent.toggle();\n collapseHeader(lowerContent.is(':visible') && !firstRun);\n}", "function setSoftphoneHeight(height) {\n sforce.interaction.cti.setSoftphoneHeight(height, setSoftphoneHeightCallback);\n}", "function toggleHideoverflow() {\n setHideoverflow(!hideoverflow)\n dispatch({type: 'SET_FRAME_HIDEOVERFLOW', payload: !hideoverflow });\n }", "function toggleScrollbar() {\n adjustColumnOverflow(\"hidden\");\n}", "function floatingTopButtonToolbarToggle()\n{\n toolbarToggle.updateForScroll();\n}", "#jqueryToggleDiv() {\n $('#jquery').on('click', function() {\n $('#content').toggle();\n $('#alternative').toggle();\n });\n }", "changeContentSize() {\n if (this.state.reduced) {\n this.setState({\n reduced: false,\n read: `Show Less`,\n })\n } else {\n this.setState({\n reduced: true,\n read: `Read More`,\n })\n }\n }", "function contentSwitch(content) {\r\n\tvar b = content;\r\n\tvar id = \"con\" + b;\r\n\r\n\tif (document.getElementById(id).classList.contains('hidden')) {\r\n\t\t\tdocument.getElementById(id).classList.remove('hidden');\r\n\t\t\tdocument.getElementById(id).classList.add('show');\r\n\t\t} else {\r\n\t\t\tdocument.getElementById(id).classList.remove('show');\r\n\t\t\tdocument.getElementById(id).classList.add('hidden');\r\n\t\t}\r\n}", "function toggle_visbility(make_visible, currently_visible) {\n\tdocument.getElementById(currently_visible).style.display = \"none\";\n\tdocument.getElementById(make_visible).style.display = \"initial\";\n\t\n\t// Update counter\n\tif (make_visible in found_objects_map){\n\t\tfound_objects_map[make_visible]=1;\n\t}\n\tcounter_update();\n\t\n\t// Set left pane scroll bar to top\n\tdocument.getElementById(\"myleftcol\").scrollTop = 0;\n\t\n\t// Return id of content that is now visible\n\treturn make_visible;\n}", "function completeVisibilityToggle() {\n var content = document.getElementById(COMPELTE_TODO_ID);\n if(content.style.display == 'none')\n content.style.display = 'block';\n else\n content.style.display = 'none';\n}", "function _mainHistToggle() {\r\n window.scrollTo(0, 0);\r\n mainHist.classList.toggle('collapsed');\r\n }", "function toggleHeadingSmaller(editor) {\n\tvar cm = editor.codemirror;\n\t_toggleHeading(cm, \"smaller\");\n}", "function toggleHeadingSmaller(editor) {\n\tvar cm = editor.codemirror;\n\t_toggleHeading(cm, \"smaller\");\n}", "function toggleHeadingSmaller(editor) {\n\tvar cm = editor.codemirror;\n\t_toggleHeading(cm, \"smaller\");\n}", "function toggleHeadingSmaller(editor) {\n\tvar cm = editor.codemirror;\n\t_toggleHeading(cm, \"smaller\");\n}", "function toggleMapMode() {\n if (!$(\".container-bottom-map\").hasClass(\"mode--active\")) {\n $(\".container-bottom-story\").removeClass(\"mode--active\");\n $(\".container-bottom-story\").toggle();\n $(\".container-bottom-map\").addClass(\"mode--active\");\n $(\".container-bottom-map\").toggle();\n }\n resizeWindowDelayed();\n}", "function toggle() {\n\t\tif (currentLocation.hash !== '#main') {\n\t\t\tmain.classList.add('hide');\n\t\t\tzoom.classList.add('show');\n\t\t\tmain.classList.remove('showFlex');\n\t\t} else {\n\t\t\tzoom.classList.add('hide');\n\t\t\tmain.classList.add('showFlex');\n\t\t\tzoom.classList.remove('show');\n\t\t}\n\t}", "function setFlyoutHeight(selector) {\n var WinHig = $(window).height();\n $('#' + selector).css('height', WinHig);\n}", "function ShowHideFlyout() {\r\n System.Gadget.Flyout.show = !System.Gadget.Flyout.show;\r\n}", "setOpenSizes(){\n\t\t\n\t\tfor(let key in this.accordions){\n\t\t\tlet accordion = this.accordions[key];\n\t\t\tlet accordionContent = accordion.content;\n\t\t\taccordionContent.setAttribute(\"data-height\", accordionContent.offsetHeight);\n\t\t\tif(accordion.input.checked === true){\n\t\t\t\tlet accordionWrapper = accordion.wrapper;\n\t\t\t\taccordionWrapper.style.height = accordionContent.offsetHeight + \"px\";\n\t\t\t}\n\t\t}\n\t\t\n\t}", "function toggle_up()\n{\n hide('action_panel_main_id');\n hide('toggle_up_id');\n show('toggle_down_id');\n\t if(earthnc_getUrlVariable('em'))\n\t {\n\t map_c=document.getElementById('map');\n\t map_c.style.height='676px';\n\n\t }\n\t else\n\t {\n\n\t document.getElementById('map').className='full_screen_new';\n\t }\n\n}", "function minimize() {\n\t// change container heights\n\tgetCrdwnd().changeHeight(\"Track\", 30);\n\tdoc.getElementById(\"tdSide\").setAttribute(\"height\", \"30\");\n\tdoc.getElementById(\"Track_side\").setAttribute(\"height\", \"30\");\n\tdoc.getElementById(\"Track_cont\").setAttribute(\"height\", \"30\");\n\n\t// change content\n\tdoc.getElementById(\"Track_side\").src = \"./PnlMsdcLivTrack_aside.html\";\n\tdoc.getElementById(\"Track_cont\").src = \"./PnlMsdcLivTrack_a.html\";\n}", "function toggleMenu(){\n var getHeight= $('.drop-menu-container').height();\n if(getHeight == 0){\n $('.drop-menu-container').height('178px');\n }else{\n $('.drop-menu-container').height('0px');\n }\n} //end of toggleMenu()", "function changeLayout(){\n var sticky = d3.select(\"#sticky\");\n var fixed = d3.select(\"#fixed\");\n\n switch(true)\n {\n case (window.outerWidth <= 767):\n if (fixed.attr(\"class\") === \"fixed-top\"){\n fixed.classed(\"fixed-top\", false);\n sticky.classed(\"sticky-offset\", false);\n }\n break;\n case (window.outerWidth >= 768):\n if (fixed.attr(\"class\") === \"\"){\n fixed.classed(\"fixed-top\", true);\n sticky.classed(\"sticky-offset\", true);\n } \n break; \n }\n\n}", "function fullscreenFix() {\n var h = $( 'body' ).height();\n // set .fullscreen height\n $( \".content-b\" ).each( function ( i ) {\n if ( $( this ).innerHeight() <= h ) {\n $( this ).closest( \".fullscreen\" ).addClass( \"not-overflow\" );\n }\n } );\n }", "handle100HeightContent() {\n\n let current = this;\n $('.full-height-content').each((index, el) => {\n let target = $(el);\n let height;\n\n height = App.getViewPort().height -\n $('.page-header').outerHeight(true) -\n $('.page-footer').outerHeight(true) -\n $('.page-title').outerHeight(true);\n\n if (target.hasClass('portlet')) {\n let portletBody = target.find('.portlet-body');\n\n height = height -\n target.find('.portlet-title').outerHeight(true) -\n parseInt(target.find('.portlet-body').css('padding-top')) -\n parseInt(target.find('.portlet-body').css('padding-bottom')) - 5;\n\n if (App.getViewPort().width >= current.resBreakpointMd && target.hasClass('full-height-content-scrollable')) {\n height = height - 35;\n portletBody.find('.full-height-content-body').css('height', height);\n } else {\n portletBody.css('min-height', height);\n }\n } else {\n if (App.getViewPort().width >= current.resBreakpointMd && target.hasClass('full-height-content-scrollable')) {\n height = height - 35;\n target.find('.full-height-content-body').css('height', height);\n } else {\n target.css('min-height', height);\n }\n }\n });\n }", "function toggleSize() {\n if (pencilTool.secondary.active) {\n restoreWhiteOutSize();\n } else {\n restoreDrawingSize();\n }\n }", "toggleEdgeHide() {\n if (this.html.attr(\"visibility\") === \"hidden\") {\n this.html.attr(\"visibility\", \"visible\")\n }\n else {\n this.html.attr(\"visibility\", \"hidden\")\n }\n }", "function toggleHeadingBigger(editor) {\n\t\tvar cm = editor.codemirror;\n\t\t_toggleHeading(cm, \"bigger\");\n\t}", "function showHide(shID) {\n\tvar top = document.getElementById(shID+'-top').offsetTop; //Getting position of top of article\n\tif (document.getElementById(shID)) {\n\t\t//if Read More link visible - hide Read More link, display hidden section:\n\t\tif (document.getElementById(shID+'-show').style.display != 'none') {\n\t\t\tdocument.getElementById(shID+'-show').style.display = 'none';\n\t\t\tdocument.getElementById(shID).style.display = 'block';\n\t\t}\n\t\telse {\n\t\t// Read More link not visible - show Read More link, hide hidden section:\t\n\t\t\tdocument.getElementById(shID+'-show').style.display = 'inline';\n\t\t\tdocument.getElementById(shID).style.display = 'none';\n\t\t\twindow.scrollTo(0, top-250); //Go to the top of the article (-250 so it displays slightly lower).\n\t\t}\n\t}\n}", "workHov(isTrue,elemId){\r\n let elem = document.getElementById(elemId+'-hov');\r\n let shareBtn = document.getElementById(elemId+'-hov'+'-share');\r\n if(isTrue===1){\r\n elem.style.height='100%';\r\n shareBtn.style.animation='btn 0.5s';\r\n }\r\n else{\r\n elem.style.height='0%'; \r\n shareBtn.style.animation='';\r\n }\r\n }", "function toggleHeadingBigger(editor) {\n\t\t\tvar cm = editor.codemirror;\n\t\t\t_toggleHeading(cm, \"bigger\");\n\t\t}", "toggle() {\n if (!this.state.isVisible) {\n document.body.style.overflowY = \"hidden\";\n } else {\n document.body.style.overflowY = \"visible\";\n }\n\n this.setState({ isVisible: !this.state.isVisible });\n }", "function toggle(el) {\n el.style.display = (el.style.display == 'none') ? '' : 'none'\n\n}", "function setHeiHeight() {\n\t $('.full__height').css({\n\t minHeight: $(window).height() + 'px'\n\t });\n\t}", "function setHeiHeight() {\n\t $('.full__height').css({\n\t minHeight: $(window).height() + 'px'\n\t });\n\t}", "function toggleHeadingBigger(editor) {\n _toggleHeading(editor.codemirror, 'bigger');\n}", "function setPanelHeight(size) {\n if (size === 'small') {\n var heightOffset = viewport.max - viewport.min;\n var navHeight = $('.nav-container').height();\n\n $('#hero').css('height', viewport.min - navHeight);\n $('article').css('height', viewport.max);\n } else {\n $('#hero').css('height', '');\n $('article').css('height', '');\n }\n }", "function expandResize() {\n const allPanels = document.querySelectorAll('[x-ref=\"panel\"]');\n allPanels.forEach((panel) => {\n const panelStatus = panel.parentElement.getAttribute('x-data');\n if (panelStatus === '{ selected: true }') {\n panel.style.setProperty('max-height', `${panel.scrollHeight}px`);\n }\n });\n}" ]
[ "0.6962882", "0.67986274", "0.6457488", "0.6397949", "0.6359628", "0.6288883", "0.6118295", "0.6083848", "0.60695976", "0.60531247", "0.6044697", "0.60446244", "0.60446244", "0.60446244", "0.60394144", "0.6039283", "0.60283476", "0.60204124", "0.6008511", "0.6006757", "0.5926266", "0.5924214", "0.5923959", "0.5922977", "0.5919239", "0.5918667", "0.5918667", "0.5918343", "0.5918041", "0.591281", "0.5896367", "0.5885813", "0.5870497", "0.58612984", "0.582883", "0.5822103", "0.5807755", "0.57916987", "0.57880056", "0.578434", "0.5775152", "0.57673687", "0.5766606", "0.57550997", "0.57548964", "0.5744621", "0.5734378", "0.5729938", "0.5722954", "0.5722454", "0.5722454", "0.5722454", "0.5722454", "0.57176876", "0.5709885", "0.5709618", "0.57067555", "0.57049644", "0.56873214", "0.5679309", "0.56768304", "0.5671489", "0.5670413", "0.5667222", "0.56664634", "0.5665993", "0.5658361", "0.56544024", "0.5651338", "0.56486887", "0.5646362", "0.56425637", "0.56390095", "0.56390095", "0.56390095", "0.56390095", "0.5636593", "0.56342685", "0.56322694", "0.5623722", "0.56189644", "0.5611287", "0.56004065", "0.55987155", "0.5595876", "0.5593614", "0.55919147", "0.55889094", "0.55853343", "0.5585191", "0.5582084", "0.55757755", "0.55754083", "0.55735666", "0.5572616", "0.5571111", "0.5571111", "0.55648905", "0.5563785", "0.5563379" ]
0.60407156
14
SACO EL ID DE LA GALERIA
function getIdGallery(hotspot){ return $.ajax({ url: getIdGalleryRoute.replace('hotspotid', hotspot), type: 'POST', data: { '_token': token, } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getIdOrden(){\n return orden_id;\n}", "function GeraId(prefixo, elemento) {\n //return prefixo + '-' + elemento.childNodes.length;\n var id = 0;\n while (true) {\n var tentativa = prefixo + '-' + id;\n var encontrou_igual = false;\n for (var i = 0; i < elemento.childNodes.length; ++i) {\n var filho = elemento.childNodes[i];\n if (filho.id && filho.id.indexOf(tentativa) != -1) {\n encontrou_igual = true;\n }\n }\n if (encontrou_igual) {\n ++id;\n } else {\n return tentativa;\n }\n }\n}", "function getIndiceDeLogro() {\n 'use strict';\n var indicelogro = 1, theForm = document.forms.cakeform, densidadSelec = theForm.elements.indicelogro;\n indicelogro = porcen_indice_logro[densidadSelec.value];\n return indicelogro;\n}", "function IndicadorGradoAcademico () {}", "function ustawId(pole) {\r\n aktualnePole = pole.id; \r\n aktualnaWartosc = pole.value;\r\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 }", "function IndicadorRangoEdad () {}", "function getIdPublicacion(){\n\treturn Math.round(Math.random() * 20) + 1;\n}", "function getCuponesPorIndustria(idIndustria){\n\t\n}", "static getId(to,t,p,op,couleur,cb){\n\t\tvar nb= \"nb\"+op.split(\"#\")[1].substr(4);\n\t\tvar cime=\"\";\n\t\tif(couleur==\"N\"){\n\t\t\tcime=\"cimeNoir\";\n\t\t}\n\t\telse{\n\t\t\tcime =\"cimeBlanc\";\n\t\t}\n\t\tquery.execute(conn, 'echec','select ?c where {:'+cime+' :'+nb+' ?c}',\n\t\t'application/sparql-results+json', {\n\t\t\toffset:0,\n\t\t\treasoning: true\n\t\t}).then(({body})=>{\n\t\t\tvar data = body.results.bindings;\n\t\t\tvar id = parseInt(data[0].c.value) +1;\n\t\t\tthis.putInCime(to,t,p,op,couleur,id,cb);\n\t\t\tupdate.deleteOldId(cime, nb, id-1,id);\n\t\t\t//this.deleteOldId(cime,nb,id);\n\t\t}).catch(e=> {console.log(e);});\t\n\t}", "getIdNuevo(e, id) {\n return `nv_${e.getNombreFuncionGeneradora()}_${id}`;\n }", "function gizmo(id){\n\treturn{\n\t\ttoString: function(){\n\t\t\treturn \"gizmo\" + id;\n\t\t}\n\t};\n}", "function OnPrimaryGirders_Change( e )\r\n{\r\n Alloy.Globals.ShedModeInfrastructure[\"PRIMARY_GIRDERS\"] = e.id ;\r\n}", "function getIdByPlaca(placa) {\n return new Promise((res, rej) => {\n db.collection('vehiculos').where('placa', '==', placa).get().then((els) => {\n if (els.empty) {\n alert(`No se encontro esta placa : ${placa}`)\n btnRetirarVehiculo.classList.remove('is-loading')\n rej('No se encontro la placa socitada')\n } else {\n res(els.docs[0].id)\n }\n })\n });\n}", "contaGoleiro(){\n let contador = 0;\n\n sorteio.selectJogadoresConfirmados().filter(function(e){\n if(e.goleiro){\n contador++;\n }\n });\n\n return contador;\n }", "function BuscarIndiceAnuncio(id){\n //Validar datos\n for(let i=0; i<listaAnuncios.length; i++){\n if(listaAnuncios[i].id == id)\n return i;\n }\n \n return -1;\n}", "function gizmo(id){\n\treturn{\n\t\tid: id,\n\t\ttoString: function(){\n\t\t\treturn \"gizmo\" + this.id;\n\t\t}\n\t};\n}", "function getIdUsuario (){\n\treturn Math.round(Math.random() * 50) + 1;\n}", "function proximoRegistro() {\n let ultimo = personas.find((x) => x.id === personas.length);\n let registro = ultimo.id + 1;\n return registro;\n}", "getID() {}", "function etsiSuurinId(joukkueet) {\n let suurinId = joukkueet[0].id;\n for (let i in joukkueet) {\n if (suurinId < joukkueet[i].id) {\n suurinId = joukkueet[i].id;}\n \n }\n return (suurinId + 1);\n}", "function posarBoleta(e) {\r\n// console.log(\"has clicat el \"+ e.target.getAttribute('id'));\r\n if (numDeClics==0) {\r\n //si guanya\r\n if (e.target.getAttribute('id')==aleatorio) {\r\n resultat(\"guany\", \"Felicitats :)\");\r\n // resultat(\"Felicitats :)\");\r\n //si perd\r\n }else{\r\n // resultat(\"Torna a provar! :S\");\r\n resultat(\"perd\", \"Torna a provar! :S\");\r\n\r\n }\r\n numDeClics=numDeClics+1;\r\n }\r\n}", "function crabGemeenteId(gemeente) {\r\n return new Promise(function(resolve, reject) {\r\n crabGemeenten().then(function(gemeenten) {\r\n var g = gemeenten.find(g => g.GemeenteNaam === gemeente)\r\n if (g) {\r\n resolve(g.GemeenteId)\r\n }\r\n })\r\n })\r\n}", "function ControlGramajeSeleccionadoOnda(id)\n{\n\t //alert('id es '+document.getElementById(\"gramaje_seleccionado\").value);\n\t //carga_ajax(webroot+'produccion/BuscarKilosOnda',id,document.getElementById(\"gramaje_seleccionado\").value,'hola');\t\n carga_ajax15(webroot+'produccion/BuscarKilosOnda',id,document.getElementById(\"gramaje_seleccionado\").value,document.getElementById(\"ancho_seleccionado_de_bobina\").value,'hola');\t\t\t\n}", "function getidElementos(img,typeelem,tipoimg){\n var tabla;\n var idCuento;\n var idelemento;\n\n idCuento= CuentoActual.ID.split('_')[1];\n\n switch (typeelem){\n case 'Personaje':\n tabla = 'Personajes';\n break;\n case 'Objeto':\n tabla = 'Objetos';\n break;\n case 'Bocadillo':\n tabla = 'Bocadillos';\n break;\n case 'Narracion':\n tabla = 'Narraciones';\n break;\n }\n\t\n\tvar sql = \"SELECT ID FROM \"+ tabla +\" WHERE ID_Cuento=\"+ idCuento +\" ORDER BY ID DESC\";\n\n function queryDB(tx) {\n tx.executeSql(sql, [], querySuccess, errorCB);\n }\n\n function querySuccess(tx, results) {\n if(results.rows.length == 0) {\n addElemento(img, typeelem, tipoimg, 0);\n\n }\n else\n addElemento(img,typeelem,tipoimg, results.rows.item(0).ID + 1);\n }\n\n\n function errorCB(err) {\n alert(\"Error al crear elemento. processing SQL: \"+err.code);\n }\n\n db.transaction(queryDB, errorCB);\n}", "function haeJoukkueId() {\n\n let tunnisteet = new Map();\n\n for (let kilpailu of data) {\n for (let sarja of kilpailu['sarjat']) {\n for (let joukkue of sarja['joukkueet']) {\n tunnisteet.set(joukkue['id'], joukkue);\n }\n }\n }\n\n return tunnisteet;\n}", "function addID() {\n\tfor (let i = 0; i < gs; i++) {\n\t\tif (getGrid(i) != undefined) {\n\t\t\tgetGrid(i).id = i;\n\t\t}\t\t\n\t}\n}", "irAlBoss(){\n this.salaActual = new Sala(this.salaActual.jugador, this.salaActual, posicionSala.bossBatle, \"Boss.txt\",5, this.counterId++);\n }", "function comer(golondrina, alpiste) { \n return {\n nombre: golondrina.nombre,\n energia: golondrina.energia + 10 * alpiste\n }\n}", "function getVillageId(aElem) {\n\ttry {\n\t\tvar xpathVillageId = \"\";\n\t\tswitch ( aTravianVersion ) {\n\t\t\tcase \"3.6\":\n\t\t\t\txpathVillageId = \".//table[@id='vlist']//td[@class='dot hl']/following-sibling::td[@class='link']//a\";\n\t\t\t\tbreak;\n\t\t\tcase \"4.0\":\n\t\t\t\txpathVillageId = './/div[@id=\"villageList\"]//li[contains(@class,\"active\")]/a[contains(@class,\"active\")]';\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tthrowLogicError ( \"getVillageId():: Travian Version not set!!\" );\n\t\t}\n\t\ttheboys = $g( xpathVillageId, XPFirst, aElem );\n\t\t//printErrorMSG(\"theboys=\"+theboys);\n\t\t//TS_debug(\" resultat evaluate currentID : \" + theboys + \" --- \" + theboys.singleNodeValue);\n\t\tif ( theboys!= null ) {\n\t\t\ttheUrl = theboys.href.match(/newdid=\\d{1,}/)[0];\n\t\t\tgetit = theUrl.toString().match(/\\d{1,}/)[0];\n\t\t\treturn getit;\n\t\t}\n\t\telse {\n\t\t\t//printErrorMSG(\"getVillageId()\" + aElem.innerHTML);\n\t\t\tif ( getAllVillageNewdids().length > 1 )\n\t\t\t\tthrowLogicError ( \"getVillageId():: Cannot get village id from aElem!\" );\n\t\t\treturn GM_getValue(myacc() + '_singleTownNEWDID');\n\t\t}\n\t}\n\tcatch ( err ) {\n\t\tprintStackTrace ( \"getVillageId():: Error! aElem.innerHTML: \" + aElem.innerHTML );\n\t\tvar msg = \"<b>getVillageId():: Something went wrong, error: \" + err.name + \", Error Message: \" + err.message + \"</b>\";\n\t\tplaySound ( msg );\n\t\tprintErrorMSG(msg);\n\t\tthrow err;\n\t}\n}", "get ID(){return ID}", "static get ID() {\n return \"OTZSILJ\";\n }", "function Oggetto(_id, _anni, _speranzav, _morti,/* _saturation, _brightness, _morti, _forma*/) {\r\n // DATI E COSTRUTTORE\r\n this.id = Number(_id); // < Number() converte in numero intero la stringa\r\n this.anni2015 = _anni;\r\n // < Number() converte in numero intero la stringa\r\n this.speranzadivita2015 = _speranzav;\r\n this.morti2015 =_morti;\r\n\r\n this.mostra = function() {\r\n\r\n noStroke();\r\n fill(255);\r\n textAlign(LEFT, CENTER);\r\n push();\r\n translate(grid + (this.id * grid),height/3);\r\n\r\n\r\n text(this.anni2015,-40,10,);\r\n\r\n rotate(PI/2);\r\n fill(255, 24, 10);\r\n text(this.morti2015,30,00);\r\n fill(25, 204, 100);\r\n text(this.speranzadivita2015,30,30);\r\n\r\n\r\n // disegna barrette\r\n rotate(3*PI/2);\r\n fill(25, 204, 100);\r\n rect(-38, 60, 10, this.speranzadivita2015);\r\n\r\n\r\n fill(255, 24, 10);\r\n rect(-8, 60, 10, this.morti2015);\r\n\r\n pop();\r\n\r\n }\r\n}", "function get_proyecto(id_proyecto) {\n \n gapi.client.communicationchannel.getProyecto({\"id\":function get_proyecto(id_proyecto) {\n}).execute(function(resp){\n if (resp.code) {\n }else{\n ProyectoItems = resp.items;\n obras(ProyectoItems[i].id_Proyecto);\n }\n });\n}", "function deletaId(id){\n console.log('eita foi!!!: ', id)\n}", "function genereID(){\nvar ref='DA-';\nvar date = new Date();\n\n // Format de l'ID de la demande d'achat DA-YYMMDD-HHMMSS\n ref+=(String(date.getFullYear())).slice(-2)+(\"0\"+ String(date.getMonth()+1)).slice(-2)+(\"0\" + String(date.getDate())).slice(-2);\n ref+=\"-\"\n ref+=(\"0\"+String(date.getHours())).slice(-2)+(\"0\"+ String(date.getMinutes()+1)).slice(-2)+(\"0\" + String(date.getSeconds())).slice(-2);\n return ref;\n}", "function calculaIdade(data,dataHoje) {\n\tvar x = data.split(\"/\");\n\tvar h = dataHoje.split(\"/\");\n\tvar anosProvisorio = h[2] - x[2];\n\n\tif(h[1] < x[1]) {\n\t\tanosProvisorio -= 1;\n\t}else if(h[1] == x[1]) {\n\t\tif(h[0] < x[0]) {\n\t\t\tanosProvisorio -= 1;\n\t\t};\n\t};\n\t\n\treturn anosProvisorio;\n}", "function GetIDCuento(Cuento){\n\n var sql = \"SELECT rowid,ID_Colecciones FROM Cuentos WHERE NombreCuento = '\"+Cuento.Nombre +\"'\";\n\n function queryDB(tx) {\n tx.executeSql(sql, [], querySuccess, errorCB);\n }\n\n\n\tfunction querySuccess(tx, results) {\n\t\tvar len = results.rows.length;\n\t\tCuentoActual = {\n\t\t\tID : \"Cuento_\" + results.rows.item(0).rowid,\n\t\t\tNombre : Cuento.Nombre,\n\t\t\tN_Pag : 0,\n\t\t\tColeccion : results.rows.item(0).ID_Colecciones\n\t\t};\n\t\tGuardarPagina(0);\n\t\t$('#TabsCuento').append('<div id=\"pag_0\" class=\"PaginaCuento actual ' + CuentoActual.ID + '\" ></div>');\n\t\tPaginas[0] = \"pag_0\";\n\t\t\n\t\tlocalStorage.setItem(\"ID_CuentoUltimo\", CuentoActual.ID.split(\"_\")[1]); \n\t\tUltimaPaginaModificada();\n\t\tAddobjetopopup();\n\t\tAddPersonajepopup();\n\t\tAddBocadillospopup();\n\t\tAddFondospopup();\n}\n\n\n function errorCB(err) {\n alert(\"Error en getidcuento: \"+err.code);\n }\n\n db.transaction(queryDB, errorCB);\n}", "function gId(a) {\r\n return document.getElementById(a)\r\n}", "getId (){\r\n return this.id;\r\n }", "function somarPontoJogador() {\n jogadorPontos++;\n document.getElementById('jogador-pontos').innerHTML = jogadorPontos;\n}", "function obtenerId(frm) {\n for (element of frm.elements) {\n if (element.name === \"legislador\") {\n return element.value;\n }\n }\n}", "function obtenerNombreMarcador(marcador){\n\t\tvar idLeaflet = marcador['_leaflet_id'];\n\t\tfor (var i in markers){\n\t\t\tconsole.log(markers[i]);\n\t\t\tconsole.log(i);\n\t\t\tif(idLeaflet == markers[i]['_leaflet_id'])\n\t\t\t\treturn i;\n\t\t}\n\t\treturn null;\n\t}", "gsi1key() {\n return{\n 'GSI1PK': 'OrderMail',\n 'GSI1SK': `OrderMail#${this.id}`\n }\n }", "function getIdAldea(){\r\n\t\tvar a = find(\"//span[@class='c2']/a\", XPFirst);\r\n\t\tif (a){\r\n\t\t\ta.getAttribute(\"href\").search(/\\?newdid=(\\d+)/);\r\n\t\t\treturn RegExp.$1;\r\n\t\t}else return 0;\r\n\t}", "function panggilParameter(idNegara, dataKota) {\n console.log(idNegara);\n console.log(dataKota);\n}", "function capturaDados(ids) {\n\n var tm = document.getElementById(\"tipoDeManejo\");\n var lt = document.getElementById(\"combo-idlotes\");\n\n var dataManejo = document.getElementById(\"dataManejo\").value;\n var dataProximo = document.getElementById(\"dataProximo\").value;\n var tipoDeManejo = tm.options[tm.selectedIndex].value;\n var anotacoes = document.getElementById(\"anotacoes\").value;\n var viaDeAplicacao = document.getElementById(\"viaDeAplicacao\").value;\n var tratamento = document.getElementById(\"tratamento\").value;\n var insumoUtilizado = document.getElementById(\"insumoUtilizado\").value;\n var custoUnitarioInsumo = document.getElementById(\"custoUnitarioInsumo\").value;\n var quantInsumo = document.getElementById(\"quantInsumo\").value;\n var custosAdicionais = document.getElementById(\"custosAdicionais\").value;\n var lote = lt.options[lt.selectedIndex].value;\n\n //var idGado = capturaIdGado();\n console.log(\"AND Now This!\")\n\n\n //Montando o objeto\n var objeto = {\n dataManejo: dataManejo,\n dataProximo: dataProximo,\n tipoDeManejo: tipoDeManejo,\n anotacoes: anotacoes,\n viaDeAplicacao: viaDeAplicacao,\n tratamento: tratamento,\n insumoUtilizado: insumoUtilizado,\n custoUnitarioInsumo: custoUnitarioInsumo,\n quantInsumo: quantInsumo,\n custosAdicionais: custosAdicionais,\n lote: {\n id: lote\n },\n rebanhoManejado: ids\n }\n\n\n //Fazer requisicao para fluxo de caixa como Saida\n var multip = custoUnitarioInsumo * quantInsumo;\n var calculoSaida = parseFloat(multip) + parseInt(custosAdicionais);\n\n console.log(\"CALCULO => \" + calculoSaida);\n enviaValorCaixa(calculoSaida, tipoDeManejo);\n\n\n console.log(JSON.stringify(objeto));\n enviaManejo(JSON.stringify(objeto));\n\n}", "function modficarDistrito(id){\n idDistrito = id;\n}", "function getIdAldea(){\n\t\tvar a = find(\"//span[@class='c2']/a\", XPFirst);\n\t\tif (a){\n\t\t\ta.getAttribute(\"href\").search(/\\?newdid=(\\d+)/);\n\t\t\treturn RegExp.$1;\n\t\t}else return 0;\n\t}", "function grabEBI(id){ return tf_Id(id); }", "function User_Delete_Groupes_de_cantons_Liste_des_groupes_de_cantons0(Compo_Maitre)\n{\n var Table=\"groupecanton\";\n var CleMaitre = Compo_Maitre.getCleVal();\n var NomCleMaitre = DePrefixerChamp(Compo_Maitre.getCle());\n var Req=\"delete from \"+Table+\" where \"+NomCleMaitre+\" = \"+CleMaitre;\n\n if (pgsql_update(Req)==0)\n\talert(\"Echec lors de la supression\");\nreturn CleMaitre;\n\n}", "function ControlGranajeSeleccionado(id)\n{\n //carga_ajax(webroot+'produccion/BuscarKilosCartulina',id,document.getElementById(\"gramaje_seleccionado\").value,'hola');\t\n\t carga_ajax15(webroot+'produccion/BuscarKilosCartulina',id,document.getElementById(\"gramaje_seleccionado\").value,document.getElementById(\"ancho_seleccionado_de_bobina\").value,'hola');\t\t\t\n}", "async function mostrarLigaID(req, res) {\n var idLiga = req.params.idLiga;\n\n await Liga.findById(idLiga).populate('creador', 'nombre email').exec((err, liga) => {\n if (err) {\n return res.status(500).send({ mensaje: \"Error en la petición\" })\n } else if (!liga) {\n return res.status(500).send({ mensaje: \"No se ha podido obtener la liga\" })\n } else {\n return res.status(200).send({ liga })\n }\n })\n}", "function User_Update_Groupes_de_cantons_Liste_des_groupes_de_cantons0(Compo_Maitre)\n{\n var Table=\"groupecanton\";\n var CleMaitre = Compo_Maitre.getCleVal();\n var NomCleMaitre = DePrefixerChamp(Compo_Maitre.getCle());\n var gc_nom=GetValAt(37);\n if (!ValiderChampsObligatoire(Table,\"gc_nom\",TAB_GLOBAL_COMPO[37],gc_nom,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"gc_nom\",TAB_GLOBAL_COMPO[37],gc_nom))\n \treturn -1;\n var Req=\"update \"+Table+\" set \";\n Req+=\"gc_nom=\"+(gc_nom==\"\" ? \"null\" : \"'\"+ValiderChaine(gc_nom)+\"'\" )+\"\";\n Req+=\" where \"+NomCleMaitre+\"=\"+CleMaitre;\n\n if (pgsql_update(Req)==0)\n\talert(\"Echec lors de la mise à jour\");\n\n/* table canton*/\nLstDouble_Exec_Req(GetSQLCompoAt(41),CleMaitre);\nreturn CleMaitre;\n\n}", "getOrdreFamille(){\n if (this.appartientFamille()){\n return parseInt(this.donneesUtilisateur.getElementsByTagName(DictionnaireXml.getTagFamille())[0].getAttribute(DictionnaireXml.getAttOrdreFamille()));\n }\n else{\n throw \"Récupération de l'ordre dans la famille impossible : Le QRCode n'appartient à aucune famille\";\n }\n }", "function getGoldberg(id) {\n return goldbergs[id]\n}", "function getgiatri() {\n var hd = Xrm.Page.getAttribute(\"new_hopdongdautumia\").getValue();\n if (hd != null && hd.length > 0) {\n var xml = [];\n xml.push(\"<fetch mapping='logical' version='1.0' distinct='true' >\");\n xml.push(\"<entity name='new_chinhsachdautu'>\");\n xml.push(\"<attribute name='new_muclaisuatdautu'/>\");\n xml.push(\"<attribute name='new_hinhthucdautu'/>\");\n xml.push(\"<attribute name ='new_loailaisuatcodinhthaydoi'/>\");\n xml.push(\"<attribute name ='new_cachtinhlai'/>\");\n xml.push(\"<filter type='and'>\");\n xml.push(\"<condition attribute='new_loaihopdong' operator='eq' value='100000000'/> \");\n xml.push(\"</filter>\");\n xml.push(\"<link-entity name='new_new_chinhsachdautu_new_hopdongdautumia' from='new_chinhsachdautuid' to='new_chinhsachdautuid'>\");\n xml.push(\"<link-entity name='new_hopdongdautumia' from='new_hopdongdautumiaid' to='new_hopdongdautumiaid'>\");\n xml.push(\"<link-entity name='new_thuadatcanhtac' from='new_hopdongdautumia' to='new_hopdongdautumiaid'>\");\n xml.push(\"<filter type='and'>\");\n xml.push(\"<condition attribute='new_hopdongdautumia' operator='eq' value='\" + hd[0].id + \"'/>\");\n xml.push(\"</filter>\");\n xml.push(\"</link-entity>\");\n xml.push(\"</link-entity>\");\n xml.push(\"</link-entity> \");\n xml.push(\"</entity> \");\n xml.push(\"</fetch>\");\n CrmFetchKit.Fetch(xml.join(\"\"), true).then(function (rs) {\n if (rs.length <= 0) {\n alert(\"Vui lòng nhập giá trị trong chính sách đầu tÆ° của hợp đồng !!!\");\n Xrm.Page.getAttribute(\"new_loailaisuat\").setValue(null);\n Xrm.Page.getAttribute(\"new_laisuat\").setValue(null);\n Xrm.Page.getAttribute(\"new_cachtinhlai\").setValue(null);\n } else if (rs.length > 0) {\n if (rs[0].attributes.new_loailaisuatcodinhthaydoi.value == true) {\n alert(\"Vui lòng nhập các giá trị lãi suất trong chính sách đầu tÆ° cho hợp đồng !!!\");\n } else {\n if (rs[0].attributes.new_hinhthucdautu.value == 100000000) {\n var option = Xrm.Page.getAttribute(\"new_loailaisuat\").getOptions();\n for (i = 0 ; i < option.length; i++) {\n var loails = rs[0].attributes.new_loailaisuatcodinhthaydoi.formattedValue;\n if (option[i].text == loails) {\n Xrm.Page.getAttribute(\"new_loailaisuat\").setValue(option[i].value);\n }\n }\n var cachtinhlai = Xrm.Page.getAttribute(\"new_cachtinhlai\").getOptions();\n for (i = 0 ; i < option.length; i++) {\n var cachtinh = rs[0].attributes.new_cachtinhlai.formattedValue;\n if (cachtinhlai[i].text == cachtinh) {\n Xrm.Page.getAttribute(\"new_cachtinhlai\").setValue(cachtinhlai[i].value);\n }\n }\n Xrm.Page.getAttribute(\"new_laisuat\").setValue((rs[0].attributes.new_muclaisuatdautu.value));\n }\n else if (rs[0].attributes.new_hinhthucdautu.value == 100000001) {\n Xrm.Page.getAttribute(\"new_loailaisuat\").setValue(null);\n Xrm.Page.getAttribute(\"new_laisuat\").setValue(0);\n Xrm.Page.getAttribute(\"new_cachtinhlai\").setValue(null);\n }\n }\n }\n },\n function (er) {\n console.log(er.message)\n });\n } else if (hd == null) {\n Xrm.Page.getAttribute(\"new_loailaisuat\").setValue(null);\n Xrm.Page.getAttribute(\"new_laisuat\").setValue(null);\n Xrm.Page.getAttribute(\"new_cachtinhlai\").setValue(null);\n }\n}", "set_hasil() {\n this.get_hasil();\n document.getElementById(\"nilai-hasil\").innerHTML = this.nilai_hasil;\n }", "function getElementAsignar(bien_id) \r\n{\r\n $('#bien_id_asigna').val(bien_id);\r\n return false;\r\n}", "function renumera_opcao_grade_linha(key){\n $('div#div_pergunta_'+key).find('div#div_op_grade_linha').find('label#label_op_grade_linha').each(function(i, label){\n $(this).find('span').html('Marcador da Linha '+(i+1)+'&nbsp;');\n });\n }", "function User_Insert_Groupes_de_cantons_Liste_des_groupes_de_cantons0(Compo_Maitre)\n{\n\n/*\n***** INFOS ******\n\nNbr d'esclaves = 2\n\nId dans le tab: 37;\nsimple\nNbr Jointure: PAS DE JOINTURE;\n\nId dans le tab: 41;\ncomplexe\nNbr Jointure: 2;\n Joint n° 0 = appartienta,gc_numero,gc_numero\n Joint n° 1 = canton,ct_numero,ct_numero\n\n******************\n*/\n\n var Table=\"groupecanton\";\n var CleMaitre = TAB_COMPO_PPTES[35].NewCle;\n var NomCleMaitre = DePrefixerChamp(Compo_Maitre.getCle());\n var gc_nom=GetValAt(37);\n if (!ValiderChampsObligatoire(Table,\"gc_nom\",TAB_GLOBAL_COMPO[37],gc_nom,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"gc_nom\",TAB_GLOBAL_COMPO[37],gc_nom))\n \treturn -1;\n var Req=\"insert into \"+Table+\" \";\nvar TabInsertionEnPlus=new Array();\n Req+=\"(\"+NomCleMaitre+\",gc_nom\"+(TabInsertionEnPlus.length!=0?\",\"+TabInsertionEnPlus[0]:\"\")+\")\";\n Req+=\" values (\"+CleMaitre+\",\"+(gc_nom==\"\" ? \"null\" : \"'\"+ValiderChaine(gc_nom)+\"'\" )+\"\"+(TabInsertionEnPlus.length!=0?\",\"+TabInsertionEnPlus[1]:\"\")+\")\";\n\n if (pgsql_update(Req)==0)\n\talert(\"Echec lors de l'insertion\");\n\n/* table canton*/\nLstDouble_Exec_Req(GetSQLCompoAt(41),CleMaitre);\nreturn CleMaitre;\n\n}", "function generarAleatorio(valor)\r\n{\r\n return numIdentificacion = Math.floor(Math.random() * ((valor+1) - 0) + 0); \r\n}", "resultado() {\n return this.local + \"-\" + this.visitante;\n }", "function listContent (geoID) {\r\n var geoIDsansFR = geoID.id.replace(\"id-\",\"\");\r\n var index = -1;\r\n var nameReg = \"Not found\" ;\r\n for (i=0 ; i < dataReg.cumul_par_reg_lasts.length ; i++) {\r\n\r\n if (dataReg.cumul_par_reg_lasts[i].reg_id == geoIDsansFR) {\r\n index = i;\r\n nameReg = dataReg.cumul_par_reg_lasts[i].reg_nom ;\r\n break; \r\n }\r\n }\r\n\r\n if (index != -1) {\r\n var totalDC = dataReg.cumul_par_reg_lasts[index].dc ;\r\n } else {\r\n console.log(\"Erreur: \"+geoIDsansFR+ \" not found\")\r\n }\r\n dcTitle = \"<h2>Mort</h2>\" ;\r\n $(list_title).html(dcTitle);\r\n dcText = nameReg + \" : <em class='num red'>\" + totalDC + \"</em>\" ;\r\n $(geoID).html(dcText);\r\n \r\n}", "nodoHijo(jugada){\n //console.log(\"Jugadas totales: \" + this.hijos.size)\n let hijo = this.hijos.get(jugada.hash())\n //console.log(\"CONTROL \" + hijo.jugada.hash())\n if (hijo === undefined){\n throw new Error (\"No es posible la jugada\")\n }\n else if (hijo.nodo === null){\n throw new Error (\"El hijo no ha sido expandido\")\n }\n\n return hijo.nodo;\n }", "function extractId(panoId){\n if (!panoId){ panoId = gCurPano }\n // console.log('checkInput panoId:', panoId)\n let pId = panoId.toString().match(/\\d+/)[0]\n if(!pId){pId=gCurPano}\n pId = Number(pId)\n return pId\n }", "static getLastId() {\r\n let lastId = 0\r\n if (eventos.length > 0) {\r\n lastId = eventos[eventos.length - 1].id\r\n console.log('O lastId do utilizador é = ' + lastId)\r\n }\r\n\r\n return lastId\r\n }", "function cuentaPreguntasInicial() {\n $cuantasPreg = $(\"#countPreguntas\").val();\n idPreg = $cuantasPreg;\n\n}", "function getIid() {\r\n return iid;\r\n}", "function getIid() {\r\n return iid;\r\n}", "function getIid() {\r\n return iid;\r\n}", "function getIdSocle() {\n\t\t// Seek via cookie params :\n\t\tvar name = $.socleBureau.getNameIdSocle();\n\t\treturn $.cookie(name) || $.urlParam(name);\n\t\t// TODO Implementation du POST\n\t\t// Seek via Post data\n\t\t// not yet implemented ...\n\t}", "function getMainVillageid() {\n\ttry {\n\t\t//flag (\"getMainVillageid():: Started! \");\n\t\tif (window.location.href.indexOf(\"spieler.php\") != -1 && window.location.href.match(/\\bs=\\b/) == null ) { // works only if self profile page.\n\t\t\tif ( window.location.href.match(/\\buid=/) == null || window.location.href.match(/\\buid=\\d{1,}\\b/)[0].split(\"uid=\")[1] == getuid() ) {\n\t\t\t\tvar xpathMainVillaAnchor = \"\";\n\t\t\t\tvar xpathX = \"\";\n\t\t\t\tvar xpathY = \"\";\n\t\t\t\tswitch ( aTravianVersion ) {\n\t\t\t\t\tcase \"3.6\":\n\t\t\t\t\t\txpathMainVillaAnchor = './/table[@id=\"villages\"]/descendant::span[@class=\"none3\"]/../a[contains(@href,\"karte.php\")]';\n\t\t\t\t\t\txpathX = './/table[@id=\"villages\"]/descendant::span[@class=\"none3\"]/../../td[@class=\"aligned_coords\"]/div[@class=\"cox\"]';\n\t\t\t\t\t\txpathY = './/table[@id=\"villages\"]/descendant::span[@class=\"none3\"]/../../td[@class=\"aligned_coords\"]/div[@class=\"coy\"]';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"4.0\":\n\t\t\t\t\t\t// coordinateX & coordinateY suggested by Rhayader (2011.04.11)\n\t\t\t\t\t\txpathMainVillaAnchor = '//table[@id=\"villages\"]/descendant::span[@class=\"mainVillage\"]/../a[contains(@href,\"karte.php\")]';\n\t\t\t\t\t\txpathX = './/table[@id=\"villages\"]/descendant::span[@class=\"mainVillage\"]/../../td[@class=\"coords\"]'\n\t\t\t\t\t\t\t\t+ '//span[@class=\"cox\" or @class=\"xCoord\" or @class=\"coordinateX\"]';\n\t\t\t\t\t\txpathY = './/table[@id=\"villages\"]/descendant::span[@class=\"mainVillage\"]/../../td[@class=\"coords\"]'\n\t\t\t\t\t\t\t\t+ '//span[@class=\"coy\" or @class=\"yCoord\" or @class=\"coordinateY\"]';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tthrowLogicError ( \"getMainVillageid():: Travian Version not set!!\" );\n\t\t\t\t}\n\t\t\t\tvar mainvi = document.evaluate(xpathMainVillaAnchor, document, null, XPFirst, null).singleNodeValue;\n\t\t\t\tif ( mainvi == null ) {\n\t\t\t\t\tvar msg = \"getMainVillageid():: Cannot get main (capital) village!\"; \n\t\t\t\t\tTS_debug ( msg );\n\t\t\t\t\tthrowLogicError ( msg );\n\t\t\t\t}\n\t\t\t\tvar themainv = mainvi.innerHTML;\n\t\t\t\tvar mainpos = mainvi.href.match(/\\bd=\\d{1,}\\b/)[0].split(\"=\")[1];\n\t\t\t\t//flag ( \"getMainVillageid():: Setting _mainvillageName: \" + themainv );\n\t\t\t\tGM_setValue(myacc() + \"_mainvillageName\", themainv);\n\t\t\t\t//flag ( \"getMainVillageid():: Setting _mainvillageId: \" + getDidFromVillage(themainv) );\n\t\t\t\tGM_setValue(myacc() + \"_mainvillageId\", getDidFromVillage(themainv));\n\n\t\t\t\tvar racefound = false;\n\t\t\t\tfor (var oo in aLangRaceName) {\n\t\t\t\t\tvar therace = new RegExp(aLangRaceName[oo]);\n\t\t\t\t\tif (document.getElementsByTagName(\"body\")[0].innerHTML.match(therace)) {\n\t\t\t\t\t\tGM_setValue(myacc() + \"_raceID\", oo.toString());\n\t\t\t\t\t\tvar racefound = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif ( racefound == false ) {\n\t\t\t\t\tprintErrorMSG ( \"<b>ERROR:: Cannot set race, translation required for race names.</b>\", 1 );\n\t\t\t\t}\n\n\t\t\t\t//flag ( \"getMainVillageid():: aTravianVersion: \" + aTravianVersion );\n\t\t\t\t//flag ( \"getMainVillageid():: xpathX: \" + xpathX );\n\t\t\t\t//flag ( \"getMainVillageid():: xpathY: \" + xpathY );\n\t\t\t\t//flag ( \"getMainVillageid():: coordx: \" + document.evaluate(xpathX, document, null, XPFirst, null).singleNodeValue.innerHTML );\n\t\t\t\t//flag ( \"getMainVillageid():: coordy: \" + document.evaluate(xpathY, document, null, XPFirst, null).singleNodeValue.innerHTML );\n\t\t\t\tvar coordx = document.evaluate(xpathX, document, null, XPFirst, null).singleNodeValue.innerHTML.match(/[-0-9]{1,}/);\n\t\t\t\tvar coordy = document.evaluate(xpathY, document, null, XPFirst, null).singleNodeValue.innerHTML.match(/[-0-9]{1,}/);\n\t\t\t\tGM_setValue(myacc() + \"_mainVillageCoord\", coordx+\"/\"+coordy);\n\t\t\t\tGM_setValue(myacc() + \"_mainVillagePosition\", mainpos.toString());\n\t\t\t}\n\t\t}\n\t}\n\tcatch ( err ) {\n\t\tprintStackTrace();\n\t\tvar msg = \"<b>getMainVillageid():: Something went wrong, error: \" + err.name + \", Error Message: \" + err.message + \"</b>\";\n\t\tplaySound ( msg );\n\t\tthrow err;\n\t}\n}", "function calculaIdade ( dataNascimento ) {\n\t var hoje = new Date();\t \n\t var arrayData = dataNascimento.split(\"/\");\t \n\t var retorno = \"#ERR#\";\n\t \n\t if (arrayData.length == 3) {\n\t // Decompoem a data em array\n\t var ano = parseInt( arrayData[2] );\n\t var mes = parseInt( arrayData[1] );\n\t var dia = parseInt( arrayData[0] );\n\t \n\t // Valida a data informada\n\t if ( arrayData[0] > 31 || arrayData[1] > 12 ) {\n\t return retorno;\n\t } \n\t \n\t ano = ( ano.length == 2 ) ? ano += 1900 : ano;\n\n\t // Subtrai os anos das duas datas\n\t var idade = ( hoje.getYear()+1900 ) - ano;\n\n\t // Subtrai os meses das duas datas\n\t var meses = ( hoje.getMonth() + 1 ) - mes;\n\t \n\t // Se meses for menor que 0 entao nao cumpriu anos. Se for maior sim ja cumpriu\n\t idade = ( meses < 0 ) ? idade - 1 : idade; \n\n\t meses = ( meses < 0 ) ? meses + 12 : meses; \n\n\t retorno = ( idade ); \n\t } \n\n\t return retorno;\n }", "function idAlumno() {\n const alumnoId = document.getElementById(\"alumnos\").value;\n document.getElementById(\"alumnoId\").value = alumnoId;\n}", "function agregarComentario(id_miembro){\n\n\n res= document.getElementById(\"comentar\").value; //Se toma a traves del id, el comentario realizado(valor).\n document.getElementById(\"mostrarComentario\").innerHTML+= res + \"<br>\"; //Hace visible el comentario relizado.\n\tres= document.getElementById(\"comentar\").value= \"\";//Despues que se genera el click vuelve al valor original.\n}", "function gId(s) {\n return document.getElementById(s);\n }", "nextID(){\n this.uniiqueID = this.uniiqueID || 0;\n return this.uniiqueID++;\n }", "function calcola_jddata(giorno,mese,anno,ora,minuti,secondi){\n\n // funzione per il calcolo del giorno giuliano per una data qualsiasi. \n // by Salvatore Ruiu Irgoli-Sardegna (Italy) dicembre 2009\n // restituisce il valore numerico dataGiuliana_annox\n// ATTENZIONE! inserire i valori dei tempi come T.U. di GREENWICH\n \nvar dataGiuliana=costanti_jd(giorno,mese,anno,ora,minuti,secondi); // valore del giorno giuliano per una data qualsiasi.\n\n dataGiuliana=dataGiuliana*1 // definire come valore numerico.\n\nreturn dataGiuliana;\n\n}", "pallini(i){\r\n // L'indice dell'immagine deve essere uguale al parametro che gli ho passato \r\n this.indice_immagine = i;\r\n console.log(i);\r\n }", "getId() {\n \n return this.id; \n }", "function construirOptionID(indicePregunta, indiceOpcion){\n var optionID= \"opcion_\"+indicePregunta+\"_\"+ indiceOpcion;\n return optionID;\n}", "function addId () {\n\t//varId += 1\n\tlet newId = vLS.length\n\treturn newId\n\n\t\n}", "function perfilCampanha(idCampanha) {\n formatarPerfil(idCampanha);\n}", "function azarDulce(){\n var NroDulce = Math.floor(Math.random()*MAXIMO_IMAGENES);\n return tipoDulce[NroDulce];\n}", "function selectDisc(id){\n\n const torreClicada = document.querySelector(`#${id}`)\n const disco = torreClicada.lastElementChild\n\n if(disco === null){\n return disco\n }\n\n return disco.id\n\n}", "function galerijRechts(){\r\n\tlengthExtensie = getImgPad(\"plaatjeFrame\");\r\n\tif (Number(lengthExtensie[3]) < totaalPlaatjes){\r\n\t\tplaatjeNummer = Number(lengthExtensie[3]) + 1;\r\n\t}\r\n\telse{\r\n\t\tplaatjeNummer = 1;\r\n\t}\r\n\tsetPlaatjeNaam(lengthExtensie, plaatjeNummer, \"plaatjeFrame\");\r\n\treturn\r\n}", "static buscarLaurelPorId(idLaurel) {\n\t\tlog.info('Búscando Laurel');\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tLaurelController.buscarLaurelPorId(idLaurel).then((laurel) => {\n\t\t\t\tlog.info('Laurel encontrado');\n\t\t\t\tresolve(laurel !== null ? cambiaFechasLaurel(laurel.toObject()) : laurel);\n\t\t\t}).catch((error) => {\n\t\t\t\tlog.error('Error al buscar el laurel en el type', error);\n\t\t\t\treject(error);\n\t\t\t});\n\t\t});\n\t}", "function testId(Id) {\n QRCodeFactory.getFromServer(new Gutschein({ Id: Id })).then(function (Gutschein) {\n GutscheinService.add(Gutschein);\n $scope.GutscheinListe = GutscheinService.getListAll();\n });\n }", "deleteGrupo(idMaestro, idMateria, idTurno){\n console.log(idMaestro, idMateria, idTurno);\n }", "function idGua(guaCode) {\n\t//Gua[0] is the upper trigram; Gua[1] is the lower trigram\n var jiuGua = 0, //Old situation\n\tyiGua = 0, //The situation which affects the change\n\txinGua =0; //New situation\n\n\tfor (i=0; i<6; i++) {\n\t if (guaCode[i] === 3) { //Yang changes to Yin\n\t\tjiuGua += 9 * (Math.pow(10,i));\t//Yang\n\t\tyiGua += 9 * (Math.pow(10,i));\t//Active\n\t\txinGua += 6 * (Math.pow(10,i));\t//Yin\n\t } else if (guaCode[i] === 4) { //Yin stays yin\n\t\tjiuGua += 6 * (Math.pow(10,i));\t//Yin\n\t\tyiGua += 6 * (Math.pow(10,i));\t//Passive\n\t\txinGua += 6 * (Math.pow(10,i));\t//Yin\n\t } else if (guaCode[i] === 5) { //Yang stays Yang\n\t\tjiuGua += 9 * (Math.pow(10,i));\t//Yang\n\t\tyiGua += 6 * (Math.pow(10,i));\t//Passive\n\t\txinGua += 9 * (Math.pow(10,i));\t//Yang\n\t } else { //if (guaCode[i] === 6) { //Yin changes to Yang\n\t\tjiuGua += 6 * (Math.pow(10,i));\t//Yin\n\t\tyiGua += 9 * (Math.pow(10,i));\t//Active\n\t\txinGua += 9 * (Math.pow(10,i));\t//Yang\n\t }\n\t}\n\n\tfunction nameGua(gua) {\n\t\tif (gua === 669669) {\n\t\t\treturn '51';\n\t\t} else if (gua === 969669) {\n\t\t\treturn '21';\n\t\t} else if (gua === 699669) {\n\t\t\treturn '17';\n\t\t} else if (gua === 999669) {\n\t\t\treturn '25. Wu Wang: Innocence |||';\n\t\t} else if (gua === 996669) {\n\t\t\treturn '42. Yi: Increase |||';\n\t\t} else if (gua === 696669) {\n\t\t\treturn '3';\n\t\t} else if (gua === 966669) {\n\t\t\treturn '27. Yi: The corners of the Mouth |||';\n\t\t} else if (gua === 666669) {\n\t\t\treturn '24. Fu: Return ||';\n\n\n\t\t} else if (gua === 669969) {\n\t\t\treturn '55';\n\t\t} else if (gua === 969969) {\n\t\t\treturn '30';\n\t\t} else if (gua === 699969) {\n\t\t\treturn '49';\n\t\t} else if (gua === 999969) {\n\t\t\treturn '13. Tong Ren: Fellowship with People |||';\n\t\t} else if (gua === 996969) {\n\t\t\treturn '37';\n\t\t} else if (gua === 696969) {\n\t\t\treturn '63';\n\t\t} else if (gua === 966969) {\n\t\t\treturn '22';\n\t\t} else if (gua === 666969) {\n\t\t\treturn '36';\n\n\n\t\t} else if (gua === 669699) {\n\t\t return '54';\n\t\t} else if (gua === 969699) {\n\t\t return '38';\n\t\t} else if (gua === 699699) {\n\t\t return '58';\n\t\t} else if (gua === 999699) {\n\t\t return '10. Lu: Treading |||';\n\t\t} else if (gua === 996699) {\n\t\t return '61. Zhong Fu: Inner Truth |||';\n\t\t} else if (gua === 696699) {\n\t\t return '60';\n\t\t} else if (gua === 966699) {\n\t\t return '41. Sun: Decrease |||';\n\t\t} else if (gua === 666699) {\n\t\t return '19. Lin: Approach ||';\n\n\n\t\t} else if (gua === 669999) {\n\t\t return '34. Da Zhuang: The Power of the Great ||';\n\t\t} else if (gua === 969999) {\n\t\t return '14. Da Yu: Possession in Great Measure |||';\n\t\t} else if (gua === 699999) {\n\t\t return '43. Guai: Break-through ||';\n\t\t} else if (gua === 999999) {\n\t\t return '1. Qian: The Creative |';\n\t\t} else if (gua === 996999) {\n\t\t return '9. Xiao Chu: The Taming Power of the Small |||';\n\t\t} else if (gua === 696999) {\n\t\t return '5';\n\t\t} else if (gua === 966999) {\n\t\t return '26. Da Chu: The Taming Power of the Great |||';\n\t\t} else if (gua === 666999) {\n\t\t return '11. Tai: Peace ||';\n\n\n\t\t} else if (gua === 669996) {\n\t\t return '32. Heng: Duration |||';\n\t\t} else if (gua === 969996) {\n\t\t return '50';\n\t\t} else if (gua === 699996) {\n\t\t return '28. Da Guo: Preponderance of the Great |||';\n\t\t} else if (gua === 999996) {\n\t\t return '44. Gou: Coming to Meet ||';\n\t\t} else if (gua === 996996) {\n\t\t return '57';\n\t\t} else if (gua === 696996) {\n\t\t return '48';\n\t\t} else if (gua === 966996) {\n\t\t return '18';\n\t\t} else if (gua === 666996) {\n\t\t return '46. Sheng: Pushing Upward |||';\n\n\n\t\t} else if (gua === 669696) {\n\t\t return '40';\n\t\t} else if (gua === 969696) {\n\t\t return '64';\n\t\t} else if (gua === 699696) {\n\t\t return '47';\n\t\t} else if (gua === 999696) {\n\t\t return '6';\n\t\t} else if (gua === 996696) {\n\t\t return '59';\n\t\t} else if (gua === 696696) {\n\t\t return '29';\n\t\t} else if (gua === 966696) {\n\t\t return '4';\n\t\t} else if (gua === 666696) {\n\t\t return '7. Shi: The Army |||';\n\n\n\t\t} else if (gua === 669966) {\n\t\t return '62. Xiao Guo: Preponderance of the Small |||';\n\t\t} else if (gua === 969966) {\n\t\t return '56';\n\t\t} else if (gua === 699966) {\n\t\t return '31. Xian: Influence |||';\n\t\t} else if (gua === 999966) {\n\t\t return '33. Dun: Retreat ||';\n\t\t} else if (gua === 996966) {\n\t\t return '53';\n\t\t} else if (gua === 696966) {\n\t\t return '39';\n\t\t} else if (gua === 966966) {\n\t\t return '52';\n\t\t} else if (gua === 666966) {\n\t\t return '15. Qian: Modesty |||';\n\n\n\t\t} else if (gua === 669666) {\n\t\t return '16. Yu: Enthusiasm |||';\n\t\t} else if (gua === 969666) {\n\t\t return '35';\n\t\t} else if (gua === 699666) {\n\t\t return '45. Cui: Gathering Together |||';\n\t\t} else if (gua === 999666) {\n\t\t return '12. Pi: Standstill ||';\n\t\t} else if (gua === 996666) {\n\t\t return '20. Guan: Contempation ||';\n\t\t} else if (gua === 696666) {\n\t\t return '8. Bi: Holding Together |||';\n\t\t} else if (gua === 966666) {\n\t\t return '23. Bo: Splitting Apart ||';\n\t\t} else if (gua === 666666) {\n\t\t return '2. Kun: The Receptive |';\n\t\t} else { return gua; }\n\t}\n\t\n\treturn (nameGua(jiuGua) + '\\n' + nameGua(yiGua) + '\\n' + nameGua(xinGua));\n\t//return jiuGua + '\\n' + yiGua + '\\n' + xinGua;\n}", "function gId(id) {\n return document.getElementById(id)\n}", "function asignarCurso() {\n const cursoId = document.getElementById(\"cursos\").value;\n document.getElementById(\"cursoId\").value = cursoId;\n}", "function getIdMain()\n{\n _idMainChar = jisQuery( '.idHolder' ).first().html();\n _idStorage += _idMainChar;\n}", "genId(heroes) {\r\n return heroes.length > 0 ? Math.max(...heroes.map(hero => hero.id)) + 1 : 11;\r\n }", "static update_pago_deleted(cadenaDeConexion, idIngreso) {\n\n sqlNegocio(\n cadenaDeConexion,\n \"SELECT * from info_ingresos WHERE idIngreso = \" + idIngreso,\n [],\n function (err, res) {\n sqlNegocio(\n cadenaDeConexion,\n \"UPDATE info_ingresos SET aCuenta = aCuenta-\" + (res[0].aCuenta) + \" WHERE idIngreso = \" + res[0].codOperacion,\n [],\n function (err, res18) {\n if (err) {\n console.log(\"error: \", err);\n result(null, err);\n }\n });\n });\n }", "getId(){\r\n return this.#id;\r\n }", "get id() {\r\n return utils.hash(TX_CONST + JSON.stringify({\r\n proof: this.proof,\r\n cm: this.cm }));\r\n }", "getId() {\n uniqueId++\n return uniqueId;\n }", "constructor(nombre, apellido,edad){\n this._nombre = nombre; \n this._apellido = apellido;\n this._edad = edad;\n this.idPersona = ++Persona.contadorPersonas;\n \n }", "function generateID(){\n var id = \"\";\n var anahtarlar= \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n var uzunluk=100;\n for (var i=0;i<uzunluk; i++){\n id += anahtarlar.charAt(Math.floor(Math.random()* anahtarlar.length));\n // console.log(i);\n // console.log(Math.floor(Math.random()* anahtarlar.length));\n // console.log(id);\n }\n return id;\n}" ]
[ "0.6470128", "0.6366212", "0.62819856", "0.6240039", "0.62393963", "0.62037885", "0.61227894", "0.6085263", "0.60740674", "0.6040701", "0.6038364", "0.60255605", "0.59959036", "0.5971114", "0.59625673", "0.59495467", "0.5919588", "0.5904595", "0.58878917", "0.5876722", "0.58732504", "0.58672816", "0.58527327", "0.5836706", "0.5821281", "0.5802039", "0.5762863", "0.57588667", "0.5754235", "0.575275", "0.5745891", "0.5742415", "0.5741894", "0.5740401", "0.57279146", "0.5713551", "0.56833684", "0.56789523", "0.5673103", "0.5654891", "0.56451726", "0.5644193", "0.5633336", "0.5629204", "0.56150806", "0.5608879", "0.5600198", "0.5593294", "0.5588778", "0.5578982", "0.55719316", "0.5561646", "0.55413586", "0.5540961", "0.55398583", "0.5537484", "0.5536593", "0.55264044", "0.5525814", "0.5521971", "0.55208665", "0.55206925", "0.5501104", "0.5495097", "0.54936886", "0.5493622", "0.5491826", "0.5491435", "0.54902846", "0.54902846", "0.54902846", "0.5490231", "0.5485991", "0.54851913", "0.54848766", "0.5477845", "0.5464926", "0.5461993", "0.54494834", "0.5449449", "0.5449181", "0.54474205", "0.54449964", "0.5437906", "0.54358613", "0.5435776", "0.54356915", "0.5434192", "0.5433414", "0.54331017", "0.54288924", "0.5423518", "0.5420244", "0.54197663", "0.5419749", "0.541609", "0.5413393", "0.5410379", "0.5408947", "0.54063785", "0.5404432" ]
0.0
-1
Metodo para finalizar accion de mover
function finishMove(){ //Cambiar estado hotspot $(".hots"+id).find(".in").removeClass("move"); $(".hots"+id).find(".out").removeClass("moveOut"); $(".hotspotElement").removeClass('active'); $(".hotspotElement").css("pointer-events", "all"); //Volver a desactivar las acciones de doble click $("#pano").off( "dblclick"); //Quitar el cursor de tipo cell $("#pano").removeClass("cursorAddHotspot"); //Mostrar el menu inicial showMain(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "finMouvement() {\n\t\tthis.visuel.removeEventListener('transitionend', this.evt.visuel.transitionend);\n\t\tthis.file.shift();\n this.cellule.verifierObjet();\n\t\tthis.prochainMouvement();\n\t\t//this.vitesse = 0; //maintenant gere dans la fn prochainMouvement\n\t}", "function end(){\n this.previousRotation = this.previousRotation;\n this.mouseSphere0 = null;\n}", "function terminaMovimientoMarcador(e){\n\t\tvar nombreActual = obtenerNombreMarcador(this);\n\t\tconsole.log(\"hola\");\n\t\t//console.log(\"\");\n\t\tif(nombreActual){\n\t\t \t//actualizarlo en la tabla\n\t\t\tjQuery(jQuery(\"#ID-\" + nombreActual.replace(\" \", \"_\")).children()[2]).text(this.getLatLng().lat);\n\t\t \tjQuery(jQuery(\"#ID-\" + nombreActual.replace(\" \", \"_\")).children()[3]).text(this.getLatLng().lng);\n\t\t \t\t\n\t\t \tvar res = obtenerCoordenadaDesdeNombre(nombreActual);\n\t\t \tif(res){\n\t\t \t\tvar coordenadaActual = res[0];\n\t\t \t\tvar indiceActual = res[1];\n\t\t \t\tvar otraCoor = {\n\t\t\t\t nombre: nombreActual,\n\t\t\t\t x: this.getLatLng().lat,\n\t\t\t\t y: this.getLatLng().lng,\n\t\t\t\t h: 0,\n\t\t\t\t tipo: coordenadaActual['tipo']\n\t\t\t\t};\n\t\t \t\tobtenerAltura(this.getLatLng(), nombreActual, coordenadas, indiceActual, otraCoor);\n\t\t \t}\n\t\t}\n\t\tif((Object.keys(markers).length == 4 || (Object.keys(markers).length == 5 && puntoInicial)) && rectangulo){\n\t\t\tdibujarRectangulo();\n\t\t}\n\t}", "function finalize()\r\n {\r\n $(\".cell\").css('cursor', 'default');\r\n $(\".turn\").css('visibility', 'hidden');\r\n gameOver = true;\r\n }", "function endTurn()\n\t{\n\t\tunit.movePoints = type.move;\n\n\t\tupdate();\n\t}", "function end(event) {\n\t\t\t_moving = false;\n\t\t}", "end() {\n this.isOver = true;\n this.isRunning = false;\n\n if (typeof this.onGameOver === 'function') {\n this.onGameOver();\n }\n }", "function quitarCapaMesActual() {\n if (capaMesActual) {\n myMap.removeLayer(capaMesActual);\n capaMesActual = null;\n }\n if (leyendaMesActual) {\n myMap.removeControl(leyendaMesActual);\n leyendaMesActual = null;\n }\n}", "endUpdate() {\r\n\r\n }", "function endMove() {\n moveMode = 0;\n drawMethod();\n}", "function endMove(event) {\n current.win.style.opacity = 1;\n }", "mateEnd() {}", "finish() {\n this._ctx.restore();\n }", "function endMove() {\n window.removeEventListener(\"mousemove\", moveBubble);\n }", "function endRotation() {\r\n rot.inProgress = false;\r\n rotate(that.selection);\r\n redrawSelectedEndRotation();\r\n setIsFinal();\r\n if (that.isFinal) {\r\n grayOut();\r\n var statusImgNode = dojo.byId('statusImg');\r\n statusImgNode.src = '/images/done.gif';\r\n statusImgNode.alt = '';\r\n highlightTopPlayers();\r\n topPlayers.tryToInsertNew(rotations);\r\n }\r\n }", "end() {\n this.endZoomInMode();\n this.endHandMode();\n }", "function end() {\n \tcreditsLoopOn = false;\n \tcreditsAbort();\n }", "transitionCompleted() {\n // implement if needed\n }", "endTurn () {\n\t\tthis.turnToAct = (this.turnToAct === COLOR.BLACK) ? \n\t\t\tCOLOR.WHITE : COLOR.BLACK;\n\t}", "wait_GM_AnimationEnd(){\n if(this.check_Reset())\n return;\n if (this.view.currentMoviePiece.parabolic.end == true) {\n if(this.model.lastMoviePlay() == true)\n {\n this.scene.reset = false;\n this.scene.showGameMovie = false;\n this.model.currentMoviePlay = 0;\n this.state = 'GAME_OVER';\n }\n else\n {\n this.model.inc_currentMoviePlay();\n this.scene.update_CameraRotation();\n this.state = 'WAIT_GM_CAMERA_ANIMATION_END';\n }\n }\n }", "endTracking_() {\n this.tracking_ = false;\n this.dragging_ = false;\n this.totalMoveY_ = 0;\n this.totalMoveX_ = 0;\n }", "_complete() {\n this._resetCurrent(true);\n\n super._complete();\n }", "end() {\n if (this.mode !== mode.move) return;\n\n let bbox = this.bbox();\n let x = Box.snap(bbox.x);\n let y = Box.snap(bbox.y);\n this.setPosition(x, y);\n this.moveEndEvent.trigger();\n }", "function C012_AfterClass_Amanda_Untie() {\n\tActorUntie();\n\tC012_AfterClass_Amanda_CalcParams();\n\tCurrentTime = CurrentTime + 50000;\n}", "function fin() {\n //ponemos el contados y el tiempo final a 0\n contador = 0;\n tiempoFinal = 0;\n console.log('fin');\n\n //desbloqueamos el boton de finalizar para que puedan guardar el movimiento\n document.getElementById('siguiente').innerHTML = '<b>FINALIZAR</b>';\n document.getElementById('siguiente').disabled = false;\n document.getElementById('siguiente').style.backgroundColor = 'rgb(3, 119, 25)';\n}", "afterStep() {\n this.useItems();\n this.handleSlimeExplosion();\n this.handleBullets();\n this.checkHealth();\n this.cleanup();\n this.spawnMonster();\n this.comparePosition();\n this.checkProgress();\n }", "animationEnd() {\n if (this.movements.length !== 0) {\n this.nextMove()\n } else {\n this.orchestrator.camera.startAnimation(\"position\", 1.5, () => {\n this.orchestrator.changeState(new GameOverState(this.orchestrator))\n },\n [...this.orchestrator.camera.originalPosition],\n [\n this.orchestrator.gameboardProperties.x,\n this.orchestrator.gameboardProperties.y,\n this.orchestrator.gameboardProperties.z\n ])\n }\n\n }", "moveCompleted() {\n // Reset the from so we can\n this.from = null;\n\n if (this.gameOver) return;\n this.changeTurn();\n this.hideMessage();\n }", "function UnredoOperations () {\n\t\t\t\tthis.position = 0;\n\t\t\t\tthis.actions = new Array();\n\t\t\t\tvar me = this;\n\n\t\t\t\t/* Binding events of DOM elements related to UnredoOperations */\n\t\t\t\t//Undo-redo action fade when rollout bottom zone\n\t\t\t\t$(\"div.footer\").hover(\n\t\t\t\t\tfunction(ev) {},\n\t\t\t\t\tfunction(ev) {\n\t\t\t\t\t\t$(\"#action_info\").fadeTo(500,0);\n\t\t\t\t\t}\n\t\t\t\t);\n\n\t\t\t\t// Undo action.\n\t\t\t\t$('a.undo').click(function(){me.Undo();});\n\n\t\t\t\t// Redo action.\n\t\t\t\t$('a.redo').click(function() {me.Redo();});\n\t\t\t}", "function actualizarCantidadMovimientos() {\n limiteMovimientos -= 1;\n}", "function finish() {\n c.removeEventListener(\"mousemove\", camera);\n}", "Unload() {}", "function C012_AfterClass_Amanda_BreakUp() {\n\tGameLogAdd(\"LoverBreakUp\");\n\tCommon_PlayerLover = \"\";\n\tCommon_ActorIsLover = false;\n\tActorSetPose(\"\");\n\tLeaveIcon = \"\";\n}", "endTurn(){\n this.turn = false;\n }", "finish() {\n\t\tthis.IS_STARTED = false;\n\t}", "function completeMasturbatePhase () {\n /* strip the player with the lowest hand */\n startMasturbation(recentLoser);\n}", "function undoAnimationDone() {\n isUndoing = false;\n tiles.splice(tiles.length - 1, 1);\n removeNode(tilesContainer.lastElementChild);\n updateTileVisibility(numTilesShown);\n lastBlacklistedTile.elem.removeEventListener(\n 'webkitTransitionEnd', undoAnimationDone);\n}", "leave() {\n }", "function undoLastTurn() {\n\n undoLastMove();\n if (vsComputer)\n undoLastMove();\n}", "function RollBackAction():void\n {\n if((TakeBackFlag || NewGameFlag) && (!C0.c0_moving) && (C0.c0_moves2do.length==0) )\n //&&((C0.c0_sidemoves==C0.c0_side) || gameover) && (drag1_animator==0) && (move_animator==0))\n {\n if(gameover) gameover=false;\n\t\t\n for(var h=0;h<8;h++)\n for(var v=8;v>0;v--)\n {\n var id=\"piece_\"+System.Convert.ToChar(System.Convert.ToInt32(\"a\"[0])+h)+v.ToString();\t\t// Is this square mouse is over?\n var qObj=GameObject.Find(id);\n if(!(qObj==null)) Destroy(qObj);\n }\t\n if(TakeBackFlag)\n {\n if(mode==1)\t{\n C0.c0_take_back();\n if(!(C0.c0_sidemoves==C0.c0_side)) C0.c0_take_back();\n TakeBackFlag=false;\n }\n else if(mode==2) {\n if(C0.c0_moveslist==\"\") {\n TakeBackFlag=false;\n setCamSide=true;\n }\n else {\n C0.c0_take_back();\n temp=white;\n white=black;\n black=temp;\n TakeBackFlag=false;\n if(white == \"w\") {setCamSide=true; setCamSide2=false;}\n if(white != \"w\") {setCamSide=false; setCamSide2=true;}\n }\n }\n }\n if(NewGameFlag)\n {\n if(mode==1) {\n C0.c0_set_start_position(\"\");\n C0.c0_sidemoves=1;\n C0.c0_waitmove=false;\n C0.c0_side=-C0.c0_side;\n C0.c0_waitmove=(C0.c0_side==C0.c0_sidemoves);\n NewGameFlag=false;\n }\n else if(mode==2) {\n if(C0.c0_side==1) message2show =\"WHITE TURN!\";\n else message2show =\"BLACK TURN!\";\n C0.c0_set_start_position(\"\");\n C0.c0_sidemoves=1;\n C0.c0_waitmove=true;\n white=\"w\";\n black=\"b\";\n temp=\"\";\n setCamSide=true; setCamSide2=false;\n NewGameFlag=false;\n }\n }\t\n\t\t\n position2board();\t\t\t\t\t// Set current position on the board visually...\n }\n }", "onResponderTerminate() {\n this.resetMovingItem();\n // console.log(\"responder terminated\");\n }", "end () {\n require('./actions/end')(this)\n }", "end () {\n this.game.newTurn()\n }", "function accionModalFin() {\n pantallaDeFinal.setAttribute(\"class\", \"hide\");\n vistaDeJuego.setAttribute(\"class\", \"game\");\n inicializacion();\n}", "function escreveConteudo(){}", "function btnFinalizarAnular(accion) {\n \n switch (accion) {\n case \"F\":\n _estadoSolicitud = view.openFinalizarAnular(accion);\n break;\n\n case \"X\":\n _estadoSolicitud = view.openFinalizarAnular(accion);\n break; \n } \n }", "gameOver(){\n\n\t\tthis.mvc.gameState = 0;\n\n\t\tthis.mvc.model.ioSendEnd();\n\n\t\tthis.stop();\n\n\t\tthis.mvc.model.updatedHallOfFame();\n\n\t}", "function complete() {\n $archive.removeClass(\"processing\");\n Y.log('complete');\n }", "function endOfGame() {\n\tcreatesMensg();\n\tstopTime();\n\tshowModal();\n}", "finish() {\n Object.keys(this._names).forEach((mark) => performance.clearMarks(mark))\n this._names = {}\n this._observer.disconnect()\n this._observer = null\n }", "_after() {\n this._exitContext();\n }", "function redo(){\n\t\t\tflush();\n\t\t\tinit();\n\t\t\ttimeout = false;\n\t\t}", "endGameAction() {\n\n }", "endGame() {\n this.inProgress = false;\n this.currentPlayer = null;\n this.pendingChip = null;\n this.emit('game:end');\n this.type = null;\n if (this.debug) {\n this.columnHistory.length = 0;\n }\n }", "function C012_AfterClass_Amanda_EndEnslaveAmanda() {\n\tC012_AfterClass_Amanda_CalcParams();\n\tLeaveIcon = \"Leave\";\n}", "function complete() {\n $archive.removeClass(\"processing\");\n Y.log('complete');\n }", "function complete() {\n $archive.removeClass(\"processing\");\n Y.log('complete');\n }", "onDestroy() {\n STATE.wheats--;\n }", "function onUnload() {\r\n \tcontrols.log('onUnload');\r\n stop();\r\n }", "loseTurn(){\n this.playerTurn = (this.playerTurn % 2) + 1;\n this.scene.rotateCamera();\n this.previousBishops = ['LostTurn'];\n this.activeBishop = null;\n }", "async afterTurn() {\n await super.afterTurn();\n // <<-- Creer-Merge: after-turn -->>\n this.updateSpawnedCowboys();\n this.game.currentPlayer.siesta = Math.max(0, this.game.currentPlayer.siesta - 1);\n this.updateCowboys();\n this.advanceBottles();\n this.resetPianoPlaying();\n this.applyHazardDamage();\n utils_1.filterInPlace(this.game.cowboys, (c) => !c.isDead);\n utils_1.filterInPlace(this.game.furnishings, (f) => !f.isDestroyed);\n utils_1.filterInPlace(this.game.bottles, (b) => !b.isDestroyed);\n this.game.currentPlayer.youngGun.update();\n // <<-- /Creer-Merge: after-turn -->>\n }", "function C012_AfterClass_Jennifer_BreakUp() {\n\tGameLogAdd(\"LoverBreakUp\");\n\tCommon_PlayerLover = \"\";\n\tCommon_ActorIsLover = false;\n\tActorSetPose(\"\");\n\tLeaveIcon = \"\";\n}", "function mouseOut() {\n\t\tif (canMove(this)) {\n\t\t\tthis.className = \"piece normal\";\n\t\t}\n\t}", "function completeContinuePhase () {\n /* show the player removing an article of clothing */\n prepareToStripPlayer(recentLoser);\n allowProgression(eGamePhase.STRIP);\n}", "_finishDismiss() {\n this._overlayRef.dispose();\n if (!this._onAction.closed) {\n this._onAction.complete();\n }\n this._afterDismissed.next({ dismissedByAction: this._dismissedByAction });\n this._afterDismissed.complete();\n this._dismissedByAction = false;\n }", "function cleanup() {\n res.removeListener('finish', makePoint);\n res.removeListener('error', cleanup);\n res.removeListener('close', cleanup);\n }", "ondestruct() {\n\t\tsuper.ondestruct();\n\t\tthis._unobserve && this._unobserve();\n\t}", "mouseOutPileHandler () {\n fgmState.hoveredPile = undefined;\n\n if (fgmState.previousHoveredPile) {\n const zoomed = this.pilesZoomed[fgmState.previousHoveredPile.id];\n fgmState.previousHoveredPile.elevateTo(zoomed ? Z_HIGHLIGHT : undefined);\n fgmState.previousHoveredPile.previewMatrix();\n fgmState.previousHoveredPile.setCoverDispMode(this.coverDispMode);\n this.highlightFrame.visible = false;\n fgmState.previousHoveredPile.draw();\n fgmState.previousHoveredPile = undefined;\n }\n\n this.removePileArea();\n }", "function onPlayerEnd () {\n\t\t\tfireMetricsEvent(0);\n\t\t}", "function onEnd() {\n element.off(css3AnimationEvents, onAnimationProgress);\n $$jqLite.removeClass(element, activeClassName);\n $$jqLite.removeClass(element, pendingClassName);\n if (staggerTimeout) {\n $timeout.cancel(staggerTimeout);\n }\n animateClose(element, className);\n var node = extractElementNode(element);\n for (var i in appliedStyles) {\n node.style.removeProperty(appliedStyles[i]);\n }\n }", "function onUndo() {\n hideNotification();\n if (lastBlacklistedTile != null) {\n ntpApiHandle.undoMostVisitedDeletion(lastBlacklistedTile);\n }\n}", "redo() {\n this.ffauWorkspace.undo(1);\n }", "function onHoverExit() {\n if (!callAlive(call)) {\n return;\n }\n if (!call.muted) {\n // mute button should be visible always\n $(this).find('img').fadeOut('slow');\n } else {\n $(this).find('.media_call_end').fadeOut('slow');\n $(this).find('.media_call_video').fadeOut('slow');\n }\n if (call.win.fullscreen) {\n status.fadeOut('slow');\n }\n }", "function endGame() {\n $('.home').css({ 'margin-top': '0px' });\n disappear('.instructions');\n hide('.view-button');\n disappear('.follow-circle');\n disappear('.instructions');\n state = \"view\";\n }", "onClose() {\n\t\t}", "resetConter () {\n\t\tthis.model.resetUserMovements();\n\t\t$writeInnerHTML( this.view.$counter, this.model.userMovements );\n\t}", "function scriptEnding() {\n Overlays.deleteOverlay(overlay1);\n Overlays.deleteOverlay(overlay2);\n Overlays.deleteOverlay(overlay3);\n Overlays.deleteOverlay(overlay4);\n Overlays.deleteOverlay(clipboard);\n}", "function endOperation(cm) {\n\t\t var op = cm.curOp;\n\t\t if (op) { finishOperation(op, function (group) {\n\t\t for (var i = 0; i < group.ops.length; i++)\n\t\t { group.ops[i].cm.curOp = null; }\n\t\t endOperations(group);\n\t\t }); }\n\t\t }", "end () {\n this.html.classList.remove(Action.RUNNING_CLASS);\n\n const effect = {\n action: this.data,\n people: this.owner,\n };\n const data = this.mergeWithOption(this.chosenOptionId);\n this.chosenOptionId = null;\n\n this.owner.finishAction();\n\n // Effect\n if (Utils.isFunction(this.data.effect)) {\n this.data.effect(this, data, effect);\n }\n\n const result = this.resolveAction(effect, data);\n\n // Give\n if (result.give.length) {\n MessageBus.notify(MessageBus.MSG_TYPES.GIVE, {\n give: result.give,\n initiator: this,\n });\n }\n\n // Unlock for all\n if (result.unlock.forAll.length) {\n // add to all\n MessageBus.notify(MessageBus.MSG_TYPES.UNLOCK, result.unlock.forAll);\n }\n // add to owner\n this.owner.addAction(result.unlock.forOne);\n\n // Lock for all\n if (result.lock.forAll.length) {\n // lock to all\n MessageBus.notify(MessageBus.MSG_TYPES.LOCK, result.lock.forAll);\n }\n // lock to owner\n this.owner.lockAction(result.lock.forOne);\n\n // Build\n if (result.build) {\n MessageBus.notify(MessageBus.MSG_TYPES.BUILD, result.build);\n }\n\n MessageBus.notify(MessageBus.MSG_TYPES.ACTION_END, result.log);\n }", "function C012_AfterClass_Jennifer_Untie() {\n\tActorUntie();\n\tC012_AfterClass_Jennifer_CalcParams();\n\tCurrentTime = CurrentTime + 50000;\n}", "function Clearup(){\n\t\tEventLogout();\n }", "function endHover() {\r\n\t\t$('#map-hover-box').hide();\r\n\t\t$(document).unbind('mousemove', getPosition);\r\n\t}", "end() {\n this.medals();\n this.endMessage();\n this.cleanUp();\n this.gc();\n }", "function finish() {\n module.exports.gameOver = true;\n}", "function C012_AfterClass_Amanda_EndChat() {\n\tif (ActorGetValue(ActorPose) == \"Kneel\") ActorSetPose(\"Shy\");\n\tLeaveIcon = \"Leave\";\n}", "endTurn() {\n if (this.board.checkWin(this.players[this.turn].token)) {\n console.log(`${this.players[this.turn].name} has won, starting a new game`);\n this.board.resetBoard();\n this.board.printBoard();\n this.turn = (this.turn + 1) % 2;\n } else {\n this.turn = (this.turn + 1) % 2;\n console.log(`It is now ${this.players[this.turn].name}s turn`);\n this.board.printBoard();\n }\n }", "function Clearup() {\n //TO DO:\n EventLogout();\n }", "function Clearup() {\n //TO DO:\n EventLogout();\n }", "function Clearup() {\n //TO DO:\n EventLogout();\n }", "function finish()\r\n{\r\n\t\t//Before calling any LMS function, we will always check for the API.\r\n\t\tAPI = GetAPI();\t\t\r\n\t\tif( API != null )\r\n\t\t{\r\n\t\t\t//Submit Data to the LMS\r\n\t\t\tset_val(\"cmi.suspend_data\",Bookmark_location);\t\t\t\r\n\t\t\tsTime=stopclock();\r\n\t\t\tsTime=String(sTime);\r\n\t\t\t//Submit Tile value to the LMS.\r\n\t\t\tset_val(\"cmi.core.session_time\",sTime);\t\t\r\n\t\t\t//call LMS Finish\r\n\t\t\tret1 = API.LMSFinish(\"\");\r\n\t\t\tfnCheckErrors();\t\r\n\t\t}\r\n\t\t\r\n}", "handleFinish(useful) {\n recordFinish(this.state.currentGuide.id, useful);\n closeGuide();\n }", "function gameOver() {\n puzzleEnd(false)\n }", "function finish() {\n if (!isIn) element.hide();\n reset();\n if (cb) cb.apply(element);\n } // Resets transitions and removes motion-specific classes", "undo() {\n if (this.Undo.length) {\n //board\n var i = 1;\n let sizeBoards = this.PastTabuleiros.length - 1;\n this.board = this.PastTabuleiros[sizeBoards - i];\n //Indexes\n let sizeIndexes = this.Undo.length;\n this.Undo.pop();\n //Score1\n let scrIndex = this.PastScore1.length - 1;\n this.score1 = this.PastScore1[scrIndex - i];\n //Score2\n var scrIdx = this.PastScore2.length - 1;\n this.score2 = this.PastScore2[scrIdx - i];\n //Mudanca de estado\n this.state = STATES.READY_TO_PICK_PIECE;\n this.changeColours();\n this.displayBoard();\n console.log(\"last move undone\");\n }\n }", "saveAndExit() {\n saveAndExit();\n }", "function onPanelSlideFinish() {\n\n\t\tg_objThis.trigger(g_panel.events.FINISH_MOVE);\n\n\t}", "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 }" ]
[ "0.6835387", "0.62044543", "0.6173208", "0.6167339", "0.61224705", "0.61108464", "0.59987867", "0.5991849", "0.5975187", "0.5969416", "0.5935727", "0.5925944", "0.58890903", "0.5871062", "0.5811536", "0.5802742", "0.5782116", "0.5748354", "0.5741184", "0.5724469", "0.57241756", "0.5718426", "0.57171", "0.567839", "0.56778175", "0.56737965", "0.5657824", "0.5650647", "0.5642676", "0.562321", "0.5622447", "0.5621074", "0.5611477", "0.56011397", "0.5594591", "0.5585071", "0.55826706", "0.558004", "0.5572433", "0.5559152", "0.555805", "0.5555496", "0.55525035", "0.5542292", "0.5541047", "0.5538962", "0.5538818", "0.55352676", "0.5526677", "0.5515622", "0.55145866", "0.55143744", "0.5510171", "0.55083543", "0.5502627", "0.55024856", "0.55024856", "0.55014896", "0.5498296", "0.54915", "0.54914874", "0.5486813", "0.5479652", "0.5474324", "0.5473524", "0.54707396", "0.5464718", "0.5464135", "0.5455095", "0.5454408", "0.5444491", "0.544399", "0.5442145", "0.54411227", "0.54292893", "0.54285806", "0.5422863", "0.5417622", "0.5408926", "0.54079956", "0.5407956", "0.5406707", "0.54062074", "0.5405787", "0.5405153", "0.5404224", "0.5398866", "0.5398866", "0.5398866", "0.5395914", "0.53953326", "0.53942", "0.53934443", "0.53934175", "0.5383278", "0.5382487", "0.5381261", "0.5381261", "0.5381261", "0.5381261" ]
0.63237244
1
For example: a = 1 b = 4 > [1, 2, 3, 4]
function between(a, b) { // your code here let array = [] let min = Math.min(a,b) let max = Math.max(a,b) for(let i=min; i<=max; i++){ array.push(i) } return array }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function numberArray(a, b) {\n b = []; while (a--) b[a] = a + 1; return b\n}", "function xy2(a) {\n console.log(\"xy\");\n console.log(a.id);\n var u = Math.floor((a.id - 1) /2 / b_map[0].length );\n var d = ((a.id - 1) / 2 ) % b_map[0].length ;\n console.log(\"u\", u, \"d\", d);\n return [u, d];\n}", "function between(a, b) {\n const arr = []\n for (let i = a; i <= b; i++) {\n arr.push(i)\n }\n return arr\n}", "function range(a, b, step = 1) {\n let range = [];\n if (a < b) {\n for (let n = a; n < b; n += step) range.push(n);\n } else {\n for (let n = a; n > b; n -= step) range.push(n);\n }\n return range;\n}", "function toArray(a, b) {\n return [a , b];\n \n}", "function ma(a){var b,c,d,e=[];for(b=0;b<a.length;b++)for(c=a[b],d=0;d<c.length;d++)e.push(c[d]);return e}", "function m(a, b) {\n const l = Math.max(a.length, b.length);\n const result = [];\n for (let i = 0; i < l; i++) {\n if (a[i] !== undefined) {\n result.push(a[i]);\n }\n if (b[i] !== undefined) {\n result.push(b[i]);\n }\n }\n\n //console.log(result);\n return result;\n }", "function sumAndMultiply(a, b) {\n return [a+b, a*b];\n}", "function split(a) {\n const c = f * a;\n const a_h = c - (c - a);\n const a_l = a - a_h;\n return [a_h, a_l];\n}", "function between(a, b) {\n // your code here\n var ar = [];\n for (var n = a; n <= b; n++) { ar.push(n); }\n return ar;\n}", "function sumAndMult(a, b) {\n return [a + b, a * b, a/b];\n}", "function Fb(a,b){var c=b||[];a&&c.push(a);return c}", "function Fb(a,b){var c=b||[];a&&c.push(a);return c}", "static compose(a, b) {\n let nums = 2;\n if (!a.includes(b.n)) nums++;\n if (!a.includes(b.m)) nums++;\n\n if (nums == 2) {\n return [[1]]\n }\n if (nums == 4) {\n return a.n < b.n ? [a.permForm, b.permForm] : [b.permForm, a.permForm];\n }\n const first = _min(a.n, b.n);\n let out = [first];\n let next = a.map(b.map(first));\n out.push(next);\n next = a.map(b.map(next));\n out.push(next);\n return [out];\n }", "function toArray(num1, num2){\n return [num1, num2];\n\n}", "function compareTriples(a,b){\n //Almacenar puntos\n let Alice = 0;\n let Bob = 0;\n a.map((element, index) => {\n if(element > b[index]){\n Alice +=1;\n }\n if(element < b[index]){\n Bob +=1;\n }\n })\n return [Alice, Bob];\n}", "function arr_diff(a,b){\r\n\tvar c=[];//clone of a\r\n\tvar d=[];//Anything a does not include\r\n\tvar e=[];//Anything a *does* include\r\n\tfor(var an of a){\r\n\t\tc.push(an);\r\n\t}\r\n\tfor(var bn of b){\r\n\t\tif(c.indexOf(bn)===-1)d.push(bn);\r\n\t\telse e.push(bn);\r\n\t}\r\n\tfor(var en of e){\r\n\t\tc.splice(c.indexOf(en),1);\r\n\t}\r\n\treturn [c,d];\r\n}", "function siblise(a, b)\n\t{\n\t\treturn {\n\t\t\tctor: \"_Array\",\n\t\t\theight: a.height + 1,\n\t\t\ttable: [a, b],\n\t\t\tlengths: [length(a), length(a) + length(b)]\n\t\t};\n\t}", "function vadd(a,b) { return [a[0]+b[0], a[1]+b[1]] }", "function l$b(t=T$1){return [t[0],t[1],t[2],t[3]]}", "function siblise(a, b)\n{\n\treturn {\n\t\tctor: '_Array',\n\t\theight: a.height + 1,\n\t\ttable: [a, b],\n\t\tlengths: [length(a), length(a) + length(b)]\n\t};\n}", "function siblise(a, b)\n{\n\treturn {\n\t\tctor: '_Array',\n\t\theight: a.height + 1,\n\t\ttable: [a, b],\n\t\tlengths: [length(a), length(a) + length(b)]\n\t};\n}", "function siblise(a, b)\n{\n\treturn {\n\t\tctor: '_Array',\n\t\theight: a.height + 1,\n\t\ttable: [a, b],\n\t\tlengths: [length(a), length(a) + length(b)]\n\t};\n}", "function siblise(a, b)\n{\n\treturn {\n\t\tctor: '_Array',\n\t\theight: a.height + 1,\n\t\ttable: [a, b],\n\t\tlengths: [length(a), length(a) + length(b)]\n\t};\n}", "function siblise(a, b)\n{\n\treturn {\n\t\tctor: '_Array',\n\t\theight: a.height + 1,\n\t\ttable: [a, b],\n\t\tlengths: [length(a), length(a) + length(b)]\n\t};\n}", "function siblise(a, b)\n{\n\treturn {\n\t\tctor: '_Array',\n\t\theight: a.height + 1,\n\t\ttable: [a, b],\n\t\tlengths: [length(a), length(a) + length(b)]\n\t};\n}", "function GetSum( a, b ) {\n var list = [];\n \n if ( a < b ) {\n for(var i = a; i <= b; i++) {\n list.push(i);\n }\n }\n \n else {\n for(var i = b; i <= a; i++) {\n list.push(i);\n }\n }\n \n // ES6 to the rescue\n var sum = list.reduce((a, b) => a + b);\n return sum; \n}", "function MiaFunzione (array, a, b) {\n var arrayNuovo = [];\n for (i = a; i < b; i++) {\n arrayNuovo.push(array[i]);\n }\n return arrayNuovo;\n}", "plus(b) {\r\n return this.map((x, i) => x + b[i]);\r\n }", "function getPowers(a_limit, b_limit) {\n var powers = new Array();\n\n for(var a = 2; a <= a_limit; a++) {\n for(var b = 2; b <= b_limit; b++) {\n var power = a ** b;\n if(!(powers.includes(power))) {\n powers.push(power);\n }\n }\n }\n powers = powers.sort(function(a,b) {return a-b});\n return powers;\n}", "function getSum(a,b) {\n let arrayOfNumbers = [];\n\n const min = (a <= b) ? a : b;\n const max = (a <= b) ? b : a;\n\n for (var item = min; item <= max; item++) {\n arrayOfNumbers = [...arrayOfNumbers, item];\n }\n\n const sum = arrayOfNumbers.reduce((total, item) => total + item);\n return sum;\n}", "function swap_2(a, b){ //cach truyen tham chieu\n return [b, a];\n}", "function kproduct(a,b){\n\n var ac = 0, bc = 0, al = a.length, bl = b.length, abl = al*bl, abc = 0, ab = [];\n\n if(al === 0 && b === 0){\n return [];\n }\n if(al === 0){\n return b;\n }\n if(bl === 0){\n return a;\n }\n\n for(abc ; abc < abl ; abc++){\n if(bc >= bl){\n bc = 0;\n ac++;\n }\n\n ab.push($.extend(true, {},a[ac], b[bc]));\n bc++;\n }\n\n return ab;\n }", "function sub(a, b) {\n var m = {};\n var d = [];\n a.forEach(function(al){m[al]=al;});\n b.forEach(function(bl){delete m[bl];});\n for (var key in m) {\n d.push(key);\n }\n return d;\n}", "minus(b) {\r\n return this.map((x, i) => x - b[i]);\r\n }", "function numSwap(a,b) {\n a = a - b; // 5 - 10 = -5\n b = a + b; // - 5 + 10 = 5\n a = b - a; // 5 - -5 = 10\n return [a,b]\n}", "function op(a,b){this.a=[];this.h=b||l}", "function multiply(a, b) {\n return [\n a[0] * b[0] + a[1] * b[3],\n a[0] * b[1] + a[1] * b[4],\n a[0] * b[2] + a[1] * b[5] + a[2],\n a[3] * b[0] + a[4] * b[3],\n a[3] * b[1] + a[4] * b[4],\n a[3] * b[2] + a[4] * b[5] + a[5]\n ];\n}", "function multiply(a, b) {\n return [\n a[0] * b[0] + a[1] * b[3],\n a[0] * b[1] + a[1] * b[4],\n a[0] * b[2] + a[1] * b[5] + a[2],\n a[3] * b[0] + a[4] * b[3],\n a[3] * b[1] + a[4] * b[4],\n a[3] * b[2] + a[4] * b[5] + a[5]\n ];\n}", "function arrayDiff(a, b) {\n \n const newArray = [];\n \n for (var i = 0; i < b.length; i++){\n a.forEach(number => number !== b[i] ? newArray.push(number) : null)\n }\n \n if (b.length == \"\") { newArray.push(...a)}\n \n return newArray\n }", "function coba1 () {\n\treturn [1,2];\n}", "function createArrayFromAtoB(start, end){\n var range = [];\n while (start <= end){\n range.push(start);\n start ++;\n }\n return range;\n}", "function add(a, b) {\n return a.map((e) => e + b);\n}", "function binaryMap(func, a, b) {\r\n var result = [];\r\n $.each(a, function (index, value) {\r\n result.push(func(value, b[index]));\r\n });\r\n return result;\r\n}", "static build(a, b) {\n return toChunks(presentableDiff(a.toString(), b.toString(), limit), a, b, 0, 0);\n }", "function inter(as,bs){return comp(union(comp(as),comp(bs)))}", "function list() {\n var the_list = [];\n for (var i = arguments.length - 1; i >= 0; i--) {\n the_list = pair(arguments[i], the_list);\n }\n return the_list;\n}", "function addPoints(a, b) {\n return [a[0] + b[0], a[1] + b[1]];\n}", "mult_pairs(b) {\r\n return this.map((x, i) => x * b[i]);\r\n }", "function getPositions ( a, b, delimit ) {\n\n\t\t// Add movement to current position.\n\t\tvar c = a + b[0], d = a + b[1];\n\n\t\t// Only alter the other position on drag,\n\t\t// not on standard sliding.\n\t\tif ( delimit ) {\n\t\t\tif ( c < 0 ) {\n\t\t\t\td += Math.abs(c);\n\t\t\t}\n\t\t\tif ( d > 100 ) {\n\t\t\t\tc -= ( d - 100 );\n\t\t\t}\n\n\t\t\t// Limit values to 0 and 100.\n\t\t\treturn [limit(c), limit(d)];\n\t\t}\n\n\t\treturn [c,d];\n\t}", "function getPositions ( a, b, delimit ) {\n\n\t\t// Add movement to current position.\n\t\tvar c = a + b[0], d = a + b[1];\n\n\t\t// Only alter the other position on drag,\n\t\t// not on standard sliding.\n\t\tif ( delimit ) {\n\t\t\tif ( c < 0 ) {\n\t\t\t\td += Math.abs(c);\n\t\t\t}\n\t\t\tif ( d > 100 ) {\n\t\t\t\tc -= ( d - 100 );\n\t\t\t}\n\n\t\t\t// Limit values to 0 and 100.\n\t\t\treturn [limit(c), limit(d)];\n\t\t}\n\n\t\treturn [c,d];\n\t}", "function getPositions ( a, b, delimit ) {\n\n\t\t// Add movement to current position.\n\t\tvar c = a + b[0], d = a + b[1];\n\n\t\t// Only alter the other position on drag,\n\t\t// not on standard sliding.\n\t\tif ( delimit ) {\n\t\t\tif ( c < 0 ) {\n\t\t\t\td += Math.abs(c);\n\t\t\t}\n\t\t\tif ( d > 100 ) {\n\t\t\t\tc -= ( d - 100 );\n\t\t\t}\n\n\t\t\t// Limit values to 0 and 100.\n\t\t\treturn [limit(c), limit(d)];\n\t\t}\n\n\t\treturn [c,d];\n\t}", "function sumDigPow(a, b) {\n const ans = [];\n while (a <= b) {\n if (a.toString().split('').reduce((x, y, i) => x + +y * (i + 1), 0) == a) { ans.push(a); }\n a++;\n }\n return ans;\n}", "function ex_10_I(a,b){\n var c=new Array;\n for (i=0;i<b;i++){\n c[i]=a;\n }\n return c;\n\n}", "function vecSub(a, b) {\n\t// console.log(typeof [b[0] - a[0], b[1] - a[1]][0]);\n\treturn [b[0] - a[0], b[1] - a[1]];\n}", "function f(a) {\n\tif (a.length === 2) {\n\t\treturn [a[0]+\"+\"+a[1], a[0]+\"-\"+a[1], a[0]+a[1]];\n\t}\n\tvar ldigit = a.pop();\n\tvar prev = f(a);\n\tvar next = [];\n\tfor (var i = 0; i < prev.length; i++) {\n\t\tnext.push(prev[i]+\"+\"+ldigit, prev[i]+\"-\"+ldigit, prev[i]+ldigit);\n\t}\n\treturn next;\n}", "function swap(a, b) {\n return [...fromTo(a, b), ...fromTo(b, a)];\n}", "function intList(start, end) {\n var newArray = [];\n for (var i = start; i <= end; i += 1) {\n newArray.push(i);\n\n }\n return newArray;\n}", "function intList(start, end) {\n var newArray = [];\n for (var i = start; i <= end; i += 1) {\n newArray.push(i);\n }\n return newArray;\n}", "function getPositions(a, b, delimit) {\n // Add movement to current position.\n var c = a + b[0],\n d = a + b[1];\n // Only alter the other position on drag,\n // not on standard sliding.\n if (delimit) {\n if (c < 0) {\n d += Math.abs(c);\n }\n if (d > 100) {\n c -= (d - 100);\n }\n // Limit values to 0 and 100.\n return [limit(c), limit(d)];\n }\n return [c, d];\n }", "function getPositions ( a, b, delimit ) {\r\n\r\n\t\t// Add movement to current position.\r\n\t\tvar c = a + b[0], d = a + b[1];\r\n\r\n\t\t// Only alter the other position on drag,\r\n\t\t// not on standard sliding.\r\n\t\tif ( delimit ) {\r\n\t\t\tif ( c < 0 ) {\r\n\t\t\t\td += Math.abs(c);\r\n\t\t\t}\r\n\t\t\tif ( d > 100 ) {\r\n\t\t\t\tc -= ( d - 100 );\r\n\t\t\t}\r\n\r\n\t\t\t// Limit values to 0 and 100.\r\n\t\t\treturn [limit(c), limit(d)];\r\n\t\t}\r\n\r\n\t\treturn [c,d];\r\n\t}", "function getSum(a, b) {\n let arr = []\n let sum = 0\n if (a === b) {\n return a\n } else if (a !== b) {\n for (let i = a; i <= b; i++) {\n arr.push(i)\n }\n for (let j = 0; j < arr.length; j++) {\n sum += arr[j]\n }\n }\n return sum\n}", "function getPositions ( a, b, delimit ) {\n\t\n\t\t\t// Add movement to current position.\n\t\t\tvar c = a + b[0], d = a + b[1];\n\t\n\t\t\t// Only alter the other position on drag,\n\t\t\t// not on standard sliding.\n\t\t\tif ( delimit ) {\n\t\t\t\tif ( c < 0 ) {\n\t\t\t\t\td += Math.abs(c);\n\t\t\t\t}\n\t\t\t\tif ( d > 100 ) {\n\t\t\t\t\tc -= ( d - 100 );\n\t\t\t\t}\n\t\n\t\t\t\t// Limit values to 0 and 100.\n\t\t\t\treturn [limit(c), limit(d)];\n\t\t\t}\n\t\n\t\t\treturn [c,d];\n\t\t}", "function getPositions ( a, b, delimit ) {\r\n\r\n\t\t\t// Add movement to current position.\r\n\t\t\tvar c = a + b[0], d = a + b[1];\r\n\r\n\t\t\t// Only alter the other position on drag,\r\n\t\t\t// not on standard sliding.\r\n\t\t\tif ( delimit ) {\r\n\t\t\t\tif ( c < 0 ) {\r\n\t\t\t\t\td += Math.abs(c);\r\n\t\t\t\t}\r\n\t\t\t\tif ( d > 100 ) {\r\n\t\t\t\t\tc -= ( d - 100 );\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// Limit values to 0 and 100.\r\n\t\t\t\treturn [limit(c), limit(d)];\r\n\t\t\t}\r\n\r\n\t\t\treturn [c,d];\r\n\t\t}", "function multiply(a, b) {\n return [a[0] * b[0] + a[1] * b[3], a[0] * b[1] + a[1] * b[4], a[0] * b[2] + a[1] * b[5] + a[2], a[3] * b[0] + a[4] * b[3], a[3] * b[1] + a[4] * b[4], a[3] * b[2] + a[4] * b[5] + a[5]];\n}", "function makeAbba(a, b) {\n\treturn a + b + b + a;\n}", "function AS(a,b){\n\ta=mod(a,size);\n\tb=mod(b,size);\n\treturn compose2(\n\t\tF(b-1,-b),\n\t\tS(a),S(a+1)\n\t);\n}", "function generateArrayLength(a, b) {\r\n var arr = []\r\n arr.push(a);\r\n var count = a;\r\n for (var i = 0; i < b - 1; i++) {\r\n count++;\r\n arr.push(count);\r\n }\r\n return arr\r\n}", "function makePair(num1, num2){\n return [num1, num2];\n }", "function twoParams2(a, b) {\n a.forEach(() => b.forEach((item) => console.log(item)));\n}", "function sc_vector2list(a) {\n var res = null;\n for (var i = a.length-1; i >= 0; i--)\n\tres = sc_cons(a[i], res);\n return res;\n}", "function makeAbba(a, b){\n return a+b+b+a\n}", "function display(a) {\n\tlet start = a;\n\tlet result = [];\n\twhile (start > 0) {\n\t\tresult.push(start--);\n\t}\nreturn result.reverse();\n}", "function zip(a, b) {\r\n const zipped = [];\r\n\r\n // zip\r\n for (let i = 0; i < a.length; i += 1) {\r\n zipped.push({ a: a[i], b: b[i] });\r\n }\r\n\r\n zipped.sort((x, y) => ((x.a < y.a) ? -1 : 1));\r\n\r\n const c = [];\r\n const d = [];\r\n\r\n for (let i = 0; i < zipped.length; i += 1) {\r\n c[i] = zipped[i].a;\r\n d[i] = zipped[i].b;\r\n }\r\n return [c, d];\r\n }", "function difference(a, b) {\n var ret = [];\n for (var i = 0, len = a.length; i < len; i++) {\n if (b.indexOf(a[i]) < 0) {\n ret.push(a[i]);\n }\n }\n\n return ret;\n}", "function list(head,tail){return[head].concat(tail);}", "function $a(a) {\n var r = new Array();\n for (var i = 0, l = a.length; i < l; i++) {\n r.push(a[i]);\n }\n return r;\n}", "function filterRange(arr,a,b){\n let resultArr=[];\n for(let i in arr ){\n (arr[i] > a && arr[i] < b || arr[i] <a && arr[i] >b) ? resultArr.push(arr[i]) : '';\n }\n return '[' + resultArr + ']'\n}", "function collect(q, a, b, x, s, t) {\n a = add32(add32(a, q), add32(x, t));\n /// The right shift is to make it a circular shift\n return add32((a << s) | (a >>> (32 - s)), b);\n}", "function getIntersection(a, b) {\n\tvar c = b.slice();\n\tvar res = Array();\n\tfor (i = 0; i < a.length; i++) {\n\t\tif (c.indexOf(a[i]) > -1) {\n\t\t\tres.push(a[i]);\n\t\t\tc.splice(c.indexOf(a[i]), 1);\n\t\t}\n\t}\n\treturn res;\n}", "function diff(a, b) {\n \tvar i,\n \t j,\n \t result = a.slice();\n\n \tfor (i = 0; i < result.length; i++) {\n \t\tfor (j = 0; j < b.length; j++) {\n \t\t\tif (result[i] === b[j]) {\n \t\t\t\tresult.splice(i, 1);\n \t\t\t\ti--;\n \t\t\t\tbreak;\n \t\t\t}\n \t\t}\n \t}\n \treturn result;\n }", "function B(t,e){var n=\"function\"===typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{while((void 0===e||e-- >0)&&!(r=i.next()).done)a.push(r.value)}catch(l){o={error:l}}finally{try{r&&!r.done&&(n=i[\"return\"])&&n.call(i)}finally{if(o)throw o.error}}return a}", "function twoSum(a, b) {\n const x = a + b;\n const bv = x - a;\n return [(a - (x - bv)) + (b - bv), x];\n}", "function diff( a, b ) {\n var result = a.slice();\n\tfor ( var i = 0; i < result.length; i++ ) {\n\t\tfor ( var j = 0; j < b.length; j++ ) {\n\t\t\tif ( result[i] === b[j] ) {\n\t\t\t\tresult.splice(i, 1);\n\t\t\t\ti--;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\treturn result;\n}", "function twoParams1(a, b) {\n a.forEach((item) => console.log(item));\n b.forEach((item) => console.log(item));\n}", "function arrayDiff(a, b) {\n let holder=[];\n \n for(let x=0;x<a.length;x++)\n {\n if(!b.includes(a[x]))\n {\n holder.push(a[x]);\n }\n }\n \n return holder;\n }", "function bp(b,states)\n{\n if(b===true)\n return states;\n else return [];\n}", "function zip(a, b) {\n var arr = [];\n\n for (var ch in a) {\n arr.push([a[ch], b[ch]]);\n }\n\n return arr;\n}", "function indexMultiple (a1) {\n let newArray = []\n a1.forEach((item, i) => {if(item%i===0){newArray.push(item)}});\n return newArray\n}", "function merge(a, b){\n var arr = [];\n while (a.length && b.length) {\n if (a[0] < b[0]) {\n arr.push(a.shift());\n } else {\n arr.push(b.shift());\n }\n }\n while (a.length) {\n arr.push(a.shift());\n }\n while (b.length) {\n arr.push(b.shift());\n }\n return arr;\n}", "function zip(a, b) {\n var accum = [],\n i;\n \n for(i = 0; i < Math.min(a.length, b.length); i++) {\n accum.push([a[i], b[i]]);\n }\n \n return accum;\n }", "function diff( a, b ) {\n\tvar i, j,\n\t\tresult = a.slice();\n\n\tfor ( i = 0; i < result.length; i++ ) {\n\t\tfor ( j = 0; j < b.length; j++ ) {\n\t\t\tif ( result[ i ] === b[ j ] ) {\n\t\t\t\tresult.splice( i, 1 );\n\t\t\t\ti--;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\treturn result;\n}", "function diff( a, b ) {\n\tvar result = a.slice();\n\tfor ( var i = 0; i < result.length; i++ ) {\n\t\tfor ( var j = 0; j < b.length; j++ ) {\n\t\t\tif ( result[i] === b[j] ) {\n\t\t\t\tresult.splice(i, 1);\n\t\t\t\ti--;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\treturn result;\n}", "function diff( a, b ) {\n\tvar result = a.slice();\n\tfor ( var i = 0; i < result.length; i++ ) {\n\t\tfor ( var j = 0; j < b.length; j++ ) {\n\t\t\tif ( result[i] === b[j] ) {\n\t\t\t\tresult.splice(i, 1);\n\t\t\t\ti--;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\treturn result;\n}", "function diff( a, b ) {\n\tvar result = a.slice();\n\tfor ( var i = 0; i < result.length; i++ ) {\n\t\tfor ( var j = 0; j < b.length; j++ ) {\n\t\t\tif ( result[i] === b[j] ) {\n\t\t\t\tresult.splice(i, 1);\n\t\t\t\ti--;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\treturn result;\n}", "function product_Range(a,b) {\n var prd = a,i = a;\n\n while (i++< b) {\n prd*=i;\n }\n return prd;\n}", "function zip(a, b) {\n var arr = [];\n\n for (var ch in a) arr.push([a[ch], b[ch]]);\n\n return arr;\n}", "function o(a){\n// flatten it\nfor(var b=[],c=p(a),d=0;d<c.length;d++)b.push.apply(b,c[d]);return b}", "function diff( a, b ) {\n\tvar i, j,\n\t\tresult = a.slice();\n\n\tfor ( i = 0; i < result.length; i++ ) {\n\t\tfor ( j = 0; j < b.length; j++ ) {\n\t\t\tif ( result[i] === b[j] ) {\n\t\t\t\tresult.splice( i, 1 );\n\t\t\t\ti--;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\treturn result;\n}", "function zip(a, b) {\n var arr = [];\n for (var ch in a) arr.push([a[ch], b[ch]]);\n return arr;\n}" ]
[ "0.63695604", "0.6344727", "0.62177485", "0.6195431", "0.6175984", "0.613707", "0.60956305", "0.6072965", "0.6031429", "0.60289586", "0.588813", "0.58420485", "0.58420485", "0.58222", "0.57652986", "0.5755816", "0.5748876", "0.572668", "0.57206714", "0.5679669", "0.56724924", "0.56724924", "0.56724924", "0.56724924", "0.56724924", "0.56724924", "0.56375754", "0.56327957", "0.5621164", "0.5607615", "0.5603055", "0.55901", "0.55583924", "0.55566734", "0.55555767", "0.5553331", "0.55375457", "0.55350614", "0.55350614", "0.5509503", "0.5504049", "0.55038977", "0.549965", "0.5494478", "0.5492623", "0.5469302", "0.545946", "0.5456195", "0.5442584", "0.5434895", "0.5434895", "0.5434895", "0.5426373", "0.54193175", "0.5414599", "0.54130226", "0.5409652", "0.5403204", "0.53980094", "0.5393742", "0.5376143", "0.5360565", "0.53592557", "0.53552175", "0.53545314", "0.53331953", "0.5330374", "0.532913", "0.5326836", "0.532398", "0.53199214", "0.53070205", "0.53028595", "0.5302829", "0.52992475", "0.52971476", "0.5295472", "0.529159", "0.5282518", "0.52776784", "0.5277002", "0.52731293", "0.52666086", "0.52597666", "0.52476996", "0.5233785", "0.5232955", "0.5229586", "0.52235657", "0.5222965", "0.52220386", "0.5220285", "0.5209893", "0.5209893", "0.5209893", "0.5209139", "0.52022904", "0.52021706", "0.52002573", "0.5199703" ]
0.5496269
43
Code as fast as you can! You need to double the integer and return it.
function doubleInteger(i) { // i will be an integer. Double it and return it. return i*2; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function doubleInteger(i) {\n return i*2;\n}", "function doubleInteger(i) {\n // i will be an integer. Double it and return it.\n return i * 2;\n}", "function getInt(n){\n return Math.floor(get() * (n + 1));\n}", "function doubleIT(num){\n var result = num * 2;\n return result;\n}", "function double(num){\n retrun num * 2;\n}", "function double(number) {\n number *= 2;\n return number;\n}", "function double(num){\n return 2*num;\n }", "function double(n){\n return n*2;\n}", "function doubleIt(originalNum) {\n return originalNum * 2;\n // doubleIt2(originalNum);\n}", "function double(num) {\n return (num * 2);\n}", "function doubleNum(num) {\n return num * 2;\n}", "function doubleIt(num){\n var result = num*2;\n //console.log(result);\n return result;\n}", "function doubleNumber (number) {\n return number * number\n }", "function rInt(n){\r\n\r\n }", "function double(number) {\n return number *= 2;\n}", "function double(num) {\n return num * 2;\n}", "function doubleSingle(number) {\n return number*2;\n}", "function double(num) {\n return num * 2;\n }", "function i(n){return n}", "function double (num) {\n return num * 2;\n}", "function duble(n) {\n\treturn n * 2;\n}", "function integer(n) {\r\n return n % (0xffffffff + 1);\r\n}", "function findTwice(number){\n\treturn number * number;\n}", "function numberDubler(number){\n return number*2;\n}", "function double(x) {\r\n return x *= 2\r\n}", "function double(x) { return x*2 }", "function bnIntValue() {\nif(this.s < 0) {\n if(this.t == 1) return this.data[0]-this.DV;\n else if(this.t == 0) return -1;\n} else if(this.t == 1) return this.data[0];\nelse if(this.t == 0) return 0;\n// assumes 16 < DB < 32\nreturn ((this.data[1]&((1<<(32-this.DB))-1))<<this.DB)|this.data[0];\n}", "function bnIntValue() {\nif(this.s < 0) {\n if(this.t == 1) return this.data[0]-this.DV;\n else if(this.t == 0) return -1;\n} else if(this.t == 1) return this.data[0];\nelse if(this.t == 0) return 0;\n// assumes 16 < DB < 32\nreturn ((this.data[1]&((1<<(32-this.DB))-1))<<this.DB)|this.data[0];\n}", "function bnIntValue() {\nif(this.s < 0) {\n if(this.t == 1) return this.data[0]-this.DV;\n else if(this.t == 0) return -1;\n} else if(this.t == 1) return this.data[0];\nelse if(this.t == 0) return 0;\n// assumes 16 < DB < 32\nreturn ((this.data[1]&((1<<(32-this.DB))-1))<<this.DB)|this.data[0];\n}", "function bnIntValue() {\nif(this.s < 0) {\n if(this.t == 1) return this.data[0]-this.DV;\n else if(this.t == 0) return -1;\n} else if(this.t == 1) return this.data[0];\nelse if(this.t == 0) return 0;\n// assumes 16 < DB < 32\nreturn ((this.data[1]&((1<<(32-this.DB))-1))<<this.DB)|this.data[0];\n}", "function bnIntValue() {\nif(this.s < 0) {\n if(this.t == 1) return this.data[0]-this.DV;\n else if(this.t == 0) return -1;\n} else if(this.t == 1) return this.data[0];\nelse if(this.t == 0) return 0;\n// assumes 16 < DB < 32\nreturn ((this.data[1]&((1<<(32-this.DB))-1))<<this.DB)|this.data[0];\n}", "function bnIntValue() {\nif(this.s < 0) {\n if(this.t == 1) return this.data[0]-this.DV;\n else if(this.t == 0) return -1;\n} else if(this.t == 1) return this.data[0];\nelse if(this.t == 0) return 0;\n// assumes 16 < DB < 32\nreturn ((this.data[1]&((1<<(32-this.DB))-1))<<this.DB)|this.data[0];\n}", "function bnIntValue() {\nif(this.s < 0) {\n if(this.t == 1) return this.data[0]-this.DV;\n else if(this.t == 0) return -1;\n} else if(this.t == 1) return this.data[0];\nelse if(this.t == 0) return 0;\n// assumes 16 < DB < 32\nreturn ((this.data[1]&((1<<(32-this.DB))-1))<<this.DB)|this.data[0];\n}", "function double() {\n var carry = 0;\n for (let i = num.length - 1; i >= 0; i--) {\n var newDigit = num[i] * 2 + carry;\n num[i] = newDigit % 10;\n carry = Math.floor(newDigit / 10);\n }\n if (carry > 0) {\n num.unshift(carry);\n carry = 0;\n }\n }", "function double(x) {\n return x * 2;\n}", "function double(x){\n\treturn x*2;\n\t\n}", "function getNumber(){\n return (1 + Math.floor(48 * Math.random()));\n}", "function double(x) {\r\n return 2 * x;\r\n}", "double(num) {\n return num * 2;\n }", "function ranToRpsInt(){\n return Math.floor(Math.random()*3);\n \n}", "function integer(n)\r\n{\r\n return Number(n);\r\n}", "static INT(d){\r\n if(d>0){\r\n return Math.floor(d);\r\n }\r\n if(d==Math.floor(d)){\r\n return d;\r\n }\r\n return Math.floor(d)-1;\r\n }", "function doublerOne(x) {\n return x * 2;\n}", "getInt64() {\n var low, high;\n if (this.littleEndian) {\n low = this.getUint32();\n high = this.getUint32();\n }\n else {\n high = this.getUint32();\n low = this.getUint32();\n }\n // calculate negative value\n if (high & 0x80000000) {\n high = ~high & 0xFFFFFFFF;\n low = ~low & 0xFFFFFFFF;\n if (low === 0xFFFFFFFF)\n high = (high + 1) & 0xFFFFFFFF;\n low = (low + 1) & 0xFFFFFFFF;\n return -(high * 0x100000000 + low);\n }\n return high * 0x100000000 + low;\n }", "function nextInt (a) {\n \treturn a + 1;\n }", "function double(x) {\n return x*2;\n}", "static generateRandomInteger() {\n var int_ = Math.floor(0 + Math.random() * (1 + 1 - 0))\n switch (int_) {\n case 0:\n return -1.2;\n break;\n case 1:\n return 1.2;\n break\n }\n }", "function multiply(a, b) {\n int1 = a * b;\n return int1;\n}", "function bnIntValue() {\n if(this.s < 0) {\n if(this.t == 1) return this[0]-this.DV;\n else if(this.t == 0) return -1;\n }\n else if(this.t == 1) return this[0];\n else if(this.t == 0) return 0;\n // assumes 16 < DB < 32\n return ((this[1]&((1<<(32-this.DB))-1))<<this.DB)|this[0];\n}", "function bnIntValue() {\n if(this.s < 0) {\n if(this.t == 1) return this[0]-this.DV;\n else if(this.t == 0) return -1;\n }\n else if(this.t == 1) return this[0];\n else if(this.t == 0) return 0;\n // assumes 16 < DB < 32\n return ((this[1]&((1<<(32-this.DB))-1))<<this.DB)|this[0];\n}", "function bnIntValue() {\n if(this.s < 0) {\n if(this.t == 1) return this[0]-this.DV;\n else if(this.t == 0) return -1;\n }\n else if(this.t == 1) return this[0];\n else if(this.t == 0) return 0;\n // assumes 16 < DB < 32\n return ((this[1]&((1<<(32-this.DB))-1))<<this.DB)|this[0];\n}", "function bnIntValue() {\n if(this.s < 0) {\n if(this.t == 1) return this[0]-this.DV;\n else if(this.t == 0) return -1;\n }\n else if(this.t == 1) return this[0];\n else if(this.t == 0) return 0;\n // assumes 16 < DB < 32\n return ((this[1]&((1<<(32-this.DB))-1))<<this.DB)|this[0];\n}", "function bnIntValue() {\n if(this.s < 0) {\n if(this.t == 1) return this[0]-this.DV;\n else if(this.t == 0) return -1;\n }\n else if(this.t == 1) return this[0];\n else if(this.t == 0) return 0;\n // assumes 16 < DB < 32\n return ((this[1]&((1<<(32-this.DB))-1))<<this.DB)|this[0];\n}", "function mult4(i) {\r\n\treturn i*4;\r\n}", "function bnIntValue() {\n if (this.s < 0) {\n if (this.t == 1) return this[0] - this.DV;\n else if (this.t === 0) return -1;\n }\n else if (this.t == 1) return this[0];\n else if (this.t === 0) return 0;\n// assumes 16 < DB < 32\n return ((this[1] & ((1 << (32 - this.DB)) - 1)) << this.DB) | this[0];\n}", "function multiplyByTwo(number) {return number * 2;}", "function multiplyByTen(num) {\n //return num after multiplying it by ten\n //code here\n\n return num * 10;\n}", "function bnIntValue() {\n if (this.s < 0) {\n if (this.t == 1) return this[0] - this.DV\n else if (this.t == 0) return -1\n } else if (this.t == 1) return this[0]\n else if (this.t == 0) return 0\n // assumes 16 < DB < 32\n return ((this[1] & ((1 << (32 - this.DB)) - 1)) << this.DB) | this[0]\n}", "function bnIntValue() {\n if (this.s < 0) {\n if (this.t == 1) return this[0] - this.DV\n else if (this.t == 0) return -1\n } else if (this.t == 1) return this[0]\n else if (this.t == 0) return 0\n // assumes 16 < DB < 32\n return ((this[1] & ((1 << (32 - this.DB)) - 1)) << this.DB) | this[0]\n}", "function bnIntValue() {\n if (this.s < 0) {\n if (this.t == 1) return this[0] - this.DV\n else if (this.t == 0) return -1\n } else if (this.t == 1) return this[0]\n else if (this.t == 0) return 0\n // assumes 16 < DB < 32\n return ((this[1] & ((1 << (32 - this.DB)) - 1)) << this.DB) | this[0]\n}", "function bnIntValue() {\n if (this.s < 0) {\n if (this.t == 1) return this[0] - this.DV\n else if (this.t == 0) return -1\n } else if (this.t == 1) return this[0]\n else if (this.t == 0) return 0\n // assumes 16 < DB < 32\n return ((this[1] & ((1 << (32 - this.DB)) - 1)) << this.DB) | this[0]\n}", "function bnIntValue() {\n if (this.s < 0) {\n if (this.t == 1) return this[0] - this.DV\n else if (this.t == 0) return -1\n } else if (this.t == 1) return this[0]\n else if (this.t == 0) return 0\n // assumes 16 < DB < 32\n return ((this[1] & ((1 << (32 - this.DB)) - 1)) << this.DB) | this[0]\n}", "function bnIntValue() {\n if (this.s < 0) {\n if (this.t == 1) return this[0] - this.DV\n else if (this.t == 0) return -1\n } else if (this.t == 1) return this[0]\n else if (this.t == 0) return 0\n // assumes 16 < DB < 32\n return ((this[1] & ((1 << (32 - this.DB)) - 1)) << this.DB) | this[0]\n}", "function bnIntValue() {\n if (this.s < 0) {\n if (this.t == 1) return this[0] - this.DV\n else if (this.t == 0) return -1\n } else if (this.t == 1) return this[0]\n else if (this.t == 0) return 0\n // assumes 16 < DB < 32\n return ((this[1] & ((1 << (32 - this.DB)) - 1)) << this.DB) | this[0]\n}", "function squareOrDouble(n) {\n // Your code here\n if (n % 2 != 0) {\n return n*n;\n } else {\n return n*2;\n }\n}", "function bnIntValue() {\n if(this.s < 0) {\n if(this.t == 1) return this[0]-this.DV;\n else if(this.t == 0) return -1;\n }\n else if(this.t == 1) return this[0];\n else if(this.t == 0) return 0;\n // assumes 16 < DB < 32\n return ((this[1]&((1<<(32-this.DB))-1))<<this.DB)|this[0];\n }", "function bnIntValue() {\n if(this.s < 0) {\n if(this.t == 1) return this[0]-this.DV;\n else if(this.t == 0) return -1;\n }\n else if(this.t == 1) return this[0];\n else if(this.t == 0) return 0;\n // assumes 16 < DB < 32\n return ((this[1]&((1<<(32-this.DB))-1))<<this.DB)|this[0];\n }", "function bnIntValue() {\n if(this.s < 0) {\n if(this.t == 1) return this[0]-this.DV;\n else if(this.t == 0) return -1;\n }\n else if(this.t == 1) return this[0];\n else if(this.t == 0) return 0;\n // assumes 16 < DB < 32\n return ((this[1]&((1<<(32-this.DB))-1))<<this.DB)|this[0];\n }", "function bnIntValue() {\n if(this.s < 0) {\n if(this.t == 1) return this[0]-this.DV;\n else if(this.t == 0) return -1;\n }\n else if(this.t == 1) return this[0];\n else if(this.t == 0) return 0;\n // assumes 16 < DB < 32\n return ((this[1]&((1<<(32-this.DB))-1))<<this.DB)|this[0];\n }", "function bnIntValue() {\n if(this.s < 0) {\n if(this.t == 1) return this[0]-this.DV;\n else if(this.t == 0) return -1;\n }\n else if(this.t == 1) return this[0];\n else if(this.t == 0) return 0;\n // assumes 16 < DB < 32\n return ((this[1]&((1<<(32-this.DB))-1))<<this.DB)|this[0];\n }", "function bnIntValue() {\n if(this.s < 0) {\n if(this.t == 1) return this[0]-this.DV;\n else if(this.t == 0) return -1;\n }\n else if(this.t == 1) return this[0];\n else if(this.t == 0) return 0;\n // assumes 16 < DB < 32\n return ((this[1]&((1<<(32-this.DB))-1))<<this.DB)|this[0];\n }", "function bnIntValue() {\n if(this.s < 0) {\n if(this.t == 1) return this[0]-this.DV;\n else if(this.t == 0) return -1;\n }\n else if(this.t == 1) return this[0];\n else if(this.t == 0) return 0;\n // assumes 16 < DB < 32\n return ((this[1]&((1<<(32-this.DB))-1))<<this.DB)|this[0];\n }", "function bnIntValue() {\n if(this.s < 0) {\n if(this.t == 1) return this[0]-this.DV;\n else if(this.t == 0) return -1;\n }\n else if(this.t == 1) return this[0];\n else if(this.t == 0) return 0;\n // assumes 16 < DB < 32\n return ((this[1]&((1<<(32-this.DB))-1))<<this.DB)|this[0];\n }", "function bnIntValue() {\n if(this.s < 0) {\n if(this.t == 1) return this[0]-this.DV;\n else if(this.t == 0) return -1;\n }\n else if(this.t == 1) return this[0];\n else if(this.t == 0) return 0;\n // assumes 16 < DB < 32\n return ((this[1]&((1<<(32-this.DB))-1))<<this.DB)|this[0];\n }", "function bnIntValue() {\n if(this.s < 0) {\n if(this.t == 1) return this[0]-this.DV;\n else if(this.t == 0) return -1;\n }\n else if(this.t == 1) return this[0];\n else if(this.t == 0) return 0;\n // assumes 16 < DB < 32\n return ((this[1]&((1<<(32-this.DB))-1))<<this.DB)|this[0];\n }", "function bnIntValue() {\n if(this.s < 0) {\n if(this.t == 1) return this[0]-this.DV;\n else if(this.t == 0) return -1;\n }\n else if(this.t == 1) return this[0];\n else if(this.t == 0) return 0;\n // assumes 16 < DB < 32\n return ((this[1]&((1<<(32-this.DB))-1))<<this.DB)|this[0];\n }", "function bnIntValue() {\n if(this.s < 0) {\n if(this.t == 1) return this[0]-this.DV;\n else if(this.t == 0) return -1;\n }\n else if(this.t == 1) return this[0];\n else if(this.t == 0) return 0;\n // assumes 16 < DB < 32\n return ((this[1]&((1<<(32-this.DB))-1))<<this.DB)|this[0];\n }", "function bnIntValue() {\n if(this.s < 0) {\n if(this.t == 1) return this[0]-this.DV;\n else if(this.t == 0) return -1;\n }\n else if(this.t == 1) return this[0];\n else if(this.t == 0) return 0;\n // assumes 16 < DB < 32\n return ((this[1]&((1<<(32-this.DB))-1))<<this.DB)|this[0];\n }", "function bnIntValue() {\n if(this.s < 0) {\n if(this.t == 1) return this[0]-this.DV;\n else if(this.t == 0) return -1;\n }\n else if(this.t == 1) return this[0];\n else if(this.t == 0) return 0;\n // assumes 16 < DB < 32\n return ((this[1]&((1<<(32-this.DB))-1))<<this.DB)|this[0];\n }", "function bnIntValue() {\n if(this.s < 0) {\n if(this.t == 1) return this[0]-this.DV;\n else if(this.t == 0) return -1;\n }\n else if(this.t == 1) return this[0];\n else if(this.t == 0) return 0;\n // assumes 16 < DB < 32\n return ((this[1]&((1<<(32-this.DB))-1))<<this.DB)|this[0];\n }", "function bnIntValue() {\n if(this.s < 0) {\n if(this.t == 1) return this[0]-this.DV;\n else if(this.t == 0) return -1;\n }\n else if(this.t == 1) return this[0];\n else if(this.t == 0) return 0;\n // assumes 16 < DB < 32\n return ((this[1]&((1<<(32-this.DB))-1))<<this.DB)|this[0];\n }", "function bnIntValue() {\n if(this.s < 0) {\n if(this.t == 1) return this[0]-this.DV;\n else if(this.t == 0) return -1;\n }\n else if(this.t == 1) return this[0];\n else if(this.t == 0) return 0;\n // assumes 16 < DB < 32\n return ((this[1]&((1<<(32-this.DB))-1))<<this.DB)|this[0];\n }", "function bnIntValue() {\n if(this.s < 0) {\n if(this.t == 1) return this[0]-this.DV;\n else if(this.t == 0) return -1;\n }\n else if(this.t == 1) return this[0];\n else if(this.t == 0) return 0;\n // assumes 16 < DB < 32\n return ((this[1]&((1<<(32-this.DB))-1))<<this.DB)|this[0];\n }", "function bnIntValue() {\n if(this.s < 0) {\n if(this.t == 1) return this[0]-this.DV;\n else if(this.t == 0) return -1;\n }\n else if(this.t == 1) return this[0];\n else if(this.t == 0) return 0;\n // assumes 16 < DB < 32\n return ((this[1]&((1<<(32-this.DB))-1))<<this.DB)|this[0];\n }", "function bnIntValue() {\n if(this.s < 0) {\n if(this.t == 1) return this[0]-this.DV;\n else if(this.t == 0) return -1;\n }\n else if(this.t == 1) return this[0];\n else if(this.t == 0) return 0;\n // assumes 16 < DB < 32\n return ((this[1]&((1<<(32-this.DB))-1))<<this.DB)|this[0];\n }", "function bnIntValue() {\n if(this.s < 0) {\n if(this.t == 1) return this[0]-this.DV;\n else if(this.t == 0) return -1;\n }\n else if(this.t == 1) return this[0];\n else if(this.t == 0) return 0;\n // assumes 16 < DB < 32\n return ((this[1]&((1<<(32-this.DB))-1))<<this.DB)|this[0];\n }", "function bnIntValue() {\n if(this.s < 0) {\n if(this.t == 1) return this[0]-this.DV;\n else if(this.t == 0) return -1;\n }\n else if(this.t == 1) return this[0];\n else if(this.t == 0) return 0;\n // assumes 16 < DB < 32\n return ((this[1]&((1<<(32-this.DB))-1))<<this.DB)|this[0];\n }", "function bnIntValue() {\n if(this.s < 0) {\n if(this.t == 1) return this[0]-this.DV;\n else if(this.t == 0) return -1;\n }\n else if(this.t == 1) return this[0];\n else if(this.t == 0) return 0;\n // assumes 16 < DB < 32\n return ((this[1]&((1<<(32-this.DB))-1))<<this.DB)|this[0];\n }", "function bnIntValue() {\n if(this.s < 0) {\n if(this.t == 1) return this[0]-this.DV;\n else if(this.t == 0) return -1;\n }\n else if(this.t == 1) return this[0];\n else if(this.t == 0) return 0;\n // assumes 16 < DB < 32\n return ((this[1]&((1<<(32-this.DB))-1))<<this.DB)|this[0];\n }", "function bnIntValue() {\n if(this.s < 0) {\n if(this.t == 1) return this[0]-this.DV;\n else if(this.t == 0) return -1;\n }\n else if(this.t == 1) return this[0];\n else if(this.t == 0) return 0;\n // assumes 16 < DB < 32\n return ((this[1]&((1<<(32-this.DB))-1))<<this.DB)|this[0];\n }", "function bnIntValue() {\n if(this.s < 0) {\n if(this.t == 1) return this[0]-this.DV;\n else if(this.t == 0) return -1;\n }\n else if(this.t == 1) return this[0];\n else if(this.t == 0) return 0;\n // assumes 16 < DB < 32\n return ((this[1]&((1<<(32-this.DB))-1))<<this.DB)|this[0];\n }", "function bnIntValue() {\n if(this.s < 0) {\n if(this.t == 1) return this[0]-this.DV;\n else if(this.t == 0) return -1;\n }\n else if(this.t == 1) return this[0];\n else if(this.t == 0) return 0;\n // assumes 16 < DB < 32\n return ((this[1]&((1<<(32-this.DB))-1))<<this.DB)|this[0];\n }", "function bnIntValue() {\n if(this.s < 0) {\n if(this.t == 1) return this[0]-this.DV;\n else if(this.t == 0) return -1;\n }\n else if(this.t == 1) return this[0];\n else if(this.t == 0) return 0;\n // assumes 16 < DB < 32\n return ((this[1]&((1<<(32-this.DB))-1))<<this.DB)|this[0];\n }", "function bnIntValue() {\n if(this.s < 0) {\n if(this.t == 1) return this[0]-this.DV;\n else if(this.t == 0) return -1;\n }\n else if(this.t == 1) return this[0];\n else if(this.t == 0) return 0;\n // assumes 16 < DB < 32\n return ((this[1]&((1<<(32-this.DB))-1))<<this.DB)|this[0];\n }", "function bnIntValue()\n{\n if (this.s < 0)\n {\n if (this.t == 1) return this[0] - this.DV;\n else if (this.t == 0) return -1;\n }\n else if (this.t == 1) return this[0];\n else if (this.t == 0) return 0;\n // assumes 16 < DB < 32\n return ((this[1] & ((1 << (32 - this.DB)) - 1)) << this.DB) | this[0];\n}", "function bnIntValue() {\n\tif(this.s < 0) {\n\t if(this.t == 1) return this[0]-this.DV;\n\t else if(this.t == 0) return -1;\n\t}\n\telse if(this.t == 1) return this[0];\n\telse if(this.t == 0) return 0;\n\t// assumes 16 < DB < 32\n\treturn ((this[1]&((1<<(32-this.DB))-1))<<this.DB)|this[0];\n }", "function bnIntValue() {\n\t if(this.s < 0) {\n\t if(this.t == 1) return this[0]-this.DV;\n\t else if(this.t == 0) return -1;\n\t }\n\t else if(this.t == 1) return this[0];\n\t else if(this.t == 0) return 0;\n\t // assumes 16 < DB < 32\n\t return ((this[1]&((1<<(32-this.DB))-1))<<this.DB)|this[0];\n\t }", "function bnIntValue() {\n if (this.s < 0) {\n if (this.t == 1) return this[0] - this.DV;\n else if (this.t == 0) return -1;\n } else if (this.t == 1) return this[0];\n else if (this.t == 0) return 0;\n // assumes 16 < DB < 32\n return ((this[1] & ((1 << (32 - this.DB)) - 1)) << this.DB) | this[0];\n}", "function bnIntValue() {\n\t if(this.s < 0) {\n\t if(this.t == 1) return this[0]-this.DV;\n\t else if(this.t == 0) return -1;\n\t }\n\t else if(this.t == 1) return this[0];\n\t else if(this.t == 0) return 0;\n\t // assumes 16 < DB < 32\n\t return ((this[1]&((1<<(32-this.DB))-1))<<this.DB)|this[0];\n\t }", "function bnIntValue() {\n\t if(this.s < 0) {\n\t if(this.t == 1) return this[0]-this.DV;\n\t else if(this.t == 0) return -1;\n\t }\n\t else if(this.t == 1) return this[0];\n\t else if(this.t == 0) return 0;\n\t // assumes 16 < DB < 32\n\t return ((this[1]&((1<<(32-this.DB))-1))<<this.DB)|this[0];\n\t }" ]
[ "0.74438244", "0.74044526", "0.7052231", "0.69679093", "0.667166", "0.65629786", "0.6411179", "0.63856465", "0.6376736", "0.63684785", "0.6325474", "0.63242817", "0.63145906", "0.63068527", "0.628197", "0.6243972", "0.6173825", "0.61356324", "0.61268353", "0.6111958", "0.61006606", "0.60964227", "0.6064608", "0.60329497", "0.60276604", "0.5998202", "0.5912533", "0.5912533", "0.5912533", "0.5912533", "0.5912533", "0.5912533", "0.5912533", "0.58797985", "0.5875498", "0.5871773", "0.5866639", "0.58600974", "0.58306086", "0.58075446", "0.58037394", "0.58023566", "0.5800159", "0.57973635", "0.5774482", "0.5738628", "0.57316023", "0.57269335", "0.57253903", "0.57253903", "0.57253903", "0.57253903", "0.57253903", "0.57230103", "0.5719098", "0.57185924", "0.5712824", "0.57087135", "0.57087135", "0.57087135", "0.57087135", "0.57087135", "0.57087135", "0.57087135", "0.5698015", "0.56966025", "0.56966025", "0.56966025", "0.56966025", "0.56966025", "0.56966025", "0.56966025", "0.56966025", "0.56966025", "0.56966025", "0.56966025", "0.56966025", "0.56966025", "0.56966025", "0.56966025", "0.56966025", "0.56966025", "0.56966025", "0.56966025", "0.56966025", "0.56966025", "0.56966025", "0.56966025", "0.56966025", "0.56966025", "0.56966025", "0.56966025", "0.56966025", "0.56966025", "0.5695834", "0.56945896", "0.56759906", "0.56754625", "0.5672016", "0.5672016" ]
0.74575794
0
Function name: add module Author: Reccion, Jeremy Date Modified: 2018/04/02 Description: creates a new collection by the name inputted by the user. it is then registered to the "modules" collection. Parameter(s): Object. includes: name: required. string type fields: optional. Array type. initialized if not existing from input Return: Promise
function addModule(newModule){ //imitate angular promise. start by initializing this var deferred = Q.defer(); newModule.name = newModule.name.toLowerCase(); //check if there is an existing module db.modules.findOne({name: newModule.name}, function(err, aModule){ if(err){ deferred.reject(err); } //already exists else if(aModule){ deferred.reject(exists); } else{ //unique, so proceed //create table first before adding a new document to 'modules' collection (not necessary?) db.createCollection(newModule.name, function(err){ if(err){ deferred.reject(err); } else{ //initialize fields property as empty array if there are none in the input if(newModule.fields == undefined){ newModule.fields = []; } db.modules.insert(newModule, function(err){ if(err){ deferred.reject(err); } else{ deferred.resolve(); } }); } }); } }); //return the promise along with either resolve or reject return deferred.promise; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addModuleDoc(moduleName, newDoc){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n\n db.bind(moduleName);\n\n db[moduleName].insert(newDoc, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n deferred.resolve();\n }\n });\n\n return deferred.promise;\n}", "function addModuleDoc(moduleName, newDoc){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n\n service.findDuplicateDoc(moduleName, newDoc).then(function(){\n db.bind(moduleName);\n\n db[moduleName].insert(newDoc, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n deferred.resolve();\n }\n });\n }).catch(function(err){\n deferred.reject(err);\n });\n\n return deferred.promise;\n}", "function addModuleField(moduleName, fieldObject){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n\n //create a new objectID to used as query for updates and delete\n fieldObject.id = new ObjectID();\n\n db.modules.update({name: moduleName}, {$push: {fields: fieldObject}}, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n deferred.resolve();\n }\n });\n\n return deferred.promise;\n}", "function addModuleField(moduleName, fieldObject){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n\n //create a new objectID to used as query for updates and delete\n fieldObject.id = new ObjectID();\n\n //the query searches for the module name that do not have the inputted field name\n //this is to avoid pushing same field names on the 'fields' array of the specified module\n //writeResult will determine if the update was successful or not (i.e. writeResult.result.nModified)\n db.modules.update({name: moduleName, fields: {$not: {$elemMatch: {name: fieldObject.name}}}}, {$push: {fields: fieldObject}}, function(err, writeResult){\n if(err){\n deferred.reject(err);\n }\n else{\n //console.log(writeResult.result);\n //check the status of the update, if it failed, it means that there is an existing field name\n if(writeResult.result.nModified == 0){\n deferred.reject(exists);\n }\n else{\n deferred.resolve();\n }\n }\n });\n\n return deferred.promise;\n}", "async function createCollection(req, res) {\n\t\n\tlet data = req.body\n\n\tif (!data.projectId || !data.name) return res.status(400).send({ message: 'ERROR: projectId and name are required' })\n\n\ttry {\n\t\tlet newCollection = {\n\t\t\tid: generate(alphabet, 10),\n\t\t\tprojectId: data.projectId,\n\t\t\tname: data.name,\n\t\t\tmodel: data.model || []\n\t\t}\n\n\t\tconsole.log(newCollection)\n\n\t\t// let project = await Project.findOne({id: data.projectId})\n\t\t// project.collections.push(newCollection)\n\t\t// await project.update()\n\t\tlet collection = await Collection.create(newCollection)\n\n\t\treturn res.status(200).json(collection)\n\t}\n\tcatch(error) {\n\t\treturn res.status(500).send({ error: error.message })\n\t}\n}", "function updateModule(updateModule){\n var deferred = Q.defer();\n\n updateModule.name = updateModule.name.toLowerCase();\n\n //fields array should not be editable when using this function. therefore, delete it from input\n delete updateModule.fields;\n\n //check if the name of the selected module has not changed\n db.modules.findOne({_id: mongo.helper.toObjectID(updateModule._id)}, function(err, aModule){\n if(err){\n deferred.reject(err);\n }\n else if(aModule){\n //if names are different, renaming the collection must be executed, then proceed to update\n if(aModule.name != updateModule.name){\n db.bind(aModule.name);\n db[aModule.name].rename(updateModule.name, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n update();\n }\n });\n }\n }\n else{\n update();\n }\n });\n\n //updates the document in the 'modules' collection\n function update(){\n\n //create another object and copy. then delete the '_id' property of the new copy\n var forUpdate = {};\n Object.assign(forUpdate, updateModule);\n delete forUpdate._id;\n \n db.modules.update({_id: mongo.helper.toObjectID(updateModule._id)}, {$set: forUpdate}, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n deferred.resolve();\n }\n });\n }\n\n return deferred.promise;\n}", "function addModuleToPipeline(moduleID, moduleName){\n\n var module_name = ''\n var documentation = ''\n var moduleSourceCode_settings = ''\n var moduleSourceCode_main = ''\n var moduleSourceCode_html = ''\n\n $.ajax({\n type: \"POST\",\n cache: false,\n url: \"/get_module_details\",\n data: 'p_module_key=' + moduleName,\n success: function (option) {\n\n module_name = option.module_name\n documentation = option.documentation\n moduleSourceCode_settings = option.moduleSourceCode_settings\n moduleSourceCode_main = option.moduleSourceCode_main\n moduleSourceCode_html = option.moduleSourceCode_html\n user_role = option.user_role\n\n user_role_based_edit = ''\n if (user_role == 'image_researcher') {\n user_role_based_edit = '| <a style=\"font-size:12px;color:#000000;\" href=\"#\" class=\"btn_edit_code\"> Edit </a> | <a style=\"font-size:12px;color:#000000;\" href=\"#\" > Contact Author </a>';\n }\n\n\n\n\n //append new module to the pipeline...\n $(\"#img_processing_screen\").append(\n '<div style=\"background-color:#EEE;width:100%\" class=\"module\" id=\"module_id_'+ moduleID +'\">' +\n\n '<!-- Documentation -->' +\n '<div style=\"margin:10px;font-size:17px;color:#000000;\">' +\n ' ' + module_name + '<hr/>' +\n ' Documentation: <a style=\"font-size:12px;color:#000000;\" href=\"#\" class=\"documentation_show_hide\">(Show/Hide)</a>' +\n '<div class=\"documentation\" style=\"background-color:#888888;display:none;font-size:14px;\">' + documentation + '</div>' +\n '</div>' +\n\n\n '<!-- Settings -->' +\n '<div style=\"margin:10px;font-size:17px;color:#000000;\">' +\n ' Settings: <a style=\"font-size:12px;color:#000000;\" href=\"#\" class=\"settings_show_hide\">(Show/Hide)</a>' +\n ' <div class=\"settings\" style=\"background-color:#888888;display:none;font-size:14px;\">' + moduleSourceCode_html + '</div>' +\n '</div>' +\n\n\n '<div style=\"margin:10px;font-size:17px;color:#000000;\" class=\"setting_section\">' +\n ' Source Code: <a style=\"font-size:12px;color:#000000;\" href=\"#\" class=\"code_show_hide\">(Show/Hide)</a>' + user_role_based_edit +\n\n ' <div class=\"edit_code\" style=\"background-color:#888888;display:none;font-size:14px;\">' +\n ' <textarea rows=7 cols=180 class=\"code_settings\">' + moduleSourceCode_settings + '</textarea>' +\n ' <p style=\"color:#000000;\">Main Implementation: </p>' +\n ' <textarea rows=10 cols=180>' + moduleSourceCode_main + '</textarea>' +\n '</div>' +\n\n ' <pre style=\"background-color:#333333;width:100%;\" class=\"pre_highlighted_code\">' + '<code class=\"python highlighted_code\" style=\"display:none;\">' + moduleSourceCode_settings +\n ' ' +\n moduleSourceCode_main + '</code></pre>' +\n\n ' </div>' +\n\n '</div>'\n\n\n );//end of append\n\n if(isItMyFloor() == false)lockParamsSettings();\n\n $('pre code').each(function (i, block) {\n hljs.highlightBlock(block);\n });\n\n\n },\n error: function (xhr, status, error) {\n alert(xhr.responseText);\n }\n\n });//end of ajax\n\n\n}", "function addModuleToPipeline(moduleID, moduleName){\n\n var module_name = ''\n var documentation = ''\n var moduleSourceCode_settings = ''\n var moduleSourceCode_main = ''\n var moduleSourceCode_html = ''\n\n $.ajax({\n type: \"POST\",\n cache: false,\n url: \"/get_module_details\",\n data: 'p_module_key=' + moduleName,\n success: function (option) {\n //alert(\"@ success\");\n module_name = option.module_name\n documentation = option.documentation\n moduleSourceCode_settings = option.moduleSourceCode_settings\n moduleSourceCode_main = option.moduleSourceCode_main\n moduleSourceCode_html = option.moduleSourceCode_html\n user_role = option.user_role\n\n user_role_based_edit = ''\n if (user_role == 'image_researcher') {\n user_role_based_edit = '| <a style=\"font-size:12px;color:#000000;\" href=\"#\" class=\"btn_edit_code\"> Edit </a> | <a style=\"font-size:12px;color:#000000;\" href=\"#\" > Contact Author </a>';\n }\n\n //Parse the givn XML for tool definition\n var xmlDoc = $.parseXML( moduleSourceCode_html );\n var $xml_tool_definition = $(xmlDoc);\n\n //the tool configuration.\n //TODO: add the input port info.\n var tool_configs = $xml_tool_definition.find(\"toolConfigurations\");\n tool_configs = tool_configs.html();\n\n\n\n var tool_documentation = $xml_tool_definition.find(\"toolDocumentation\");\n tool_documentation = tool_documentation.html();\n\n\n var ioInformation = '';\n\n var $toolInput = $xml_tool_definition.find(\"toolInput\");\n\n $toolInput.each(function(){\n\n var label = $(this).find('label').text(),\n dataFormat = $(this).find('dataFormat').text(),\n referenceVariable = $(this).find('referenceVariable').text();\n\n ioInformation += '<input type=\"text\" style=\"display:none;\" class=\"setting_param module_input '+ referenceVariable + '\" ' + ' size=\"45\"/>';\n\n\n });\n\n\n var $toolOutput = $xml_tool_definition.find(\"toolOutput\");\n\n $toolOutput.each(function(){\n\n var label = $(this).find('label').text(),\n dataFormat = $(this).find('dataFormat').text(),\n referenceVariable = $(this).find('referenceVariable').text();\n\n //var thisPortOutput = 'module_id_' + moduleID + '_' + referenceVariable+'.' + dataFormat;\n //var thisPortOutputPath = referenceVariable + '=\"' + thisPortOutput + '\"';\n\n ioInformation += '<input type=\"text\" style=\"display:none;\" class=\"setting_param module_output '+ referenceVariable + '\" size=\"45\"/>';\n\n\n });\n\n\n\n\n\n\n\n//Parse the givn XML\n//var xmlDoc = $.parseXML( xml );\n\n//var $xml = $(xmlDoc);\n\n // Find Person Tag\n//var $person = $xml.find(\"toolConfigurations\");\n\n\n //append new module to the pipeline...\n $(\"#img_processing_screen\").append(\n '<div style=\"background-color:#EEE;width:100%;display:none;\" class=\"module\" id=\"module_id_'+ moduleID +'\">' +\n\n '<!-- Documentation -->' +\n '<div style=\"margin:10px;font-size:17px;color:#000000;\">' +\n ' ' + module_name + ' (Module ' + moduleID + ')'+ '<hr/>' +\n ' Documentation: <a style=\"font-size:12px;color:#000000;\" href=\"#\" class=\"documentation_show_hide\">(Show/Hide)</a>' +\n '<div class=\"documentation\" style=\"background-color:#DDDDDD;display:none;font-size:14px;\">' + tool_documentation + '</div>' +\n '</div>' +\n\n\n '<!-- Settings -->' +\n '<div style=\"margin:10px;font-size:17px;color:#000000;\">' +\n ' Settings: <a style=\"font-size:12px;color:#000000;\" href=\"#\" class=\"settings_show_hide\">(Show/Hide)</a>' +\n ' <div class=\"settings\" style=\"background-color:#DDDDDD;font-size:14px;\">' + tool_configs + '<br/>' + ioInformation +\n '<input type=\"hidden\" class=\"setting_param \" size=\"45\" id=\"module_id_'+ moduleID +'_output_destination\"/>'+\n '</div>' +\n '</div>' +\n\n\n '<div style=\"margin:10px;font-size:17px;color:#000000;\" class=\"setting_section\">' +\n ' <a style=\"display:none;font-size:12px;color:#000000;\" href=\"#\" class=\"code_show_hide\">(Show/Hide)</a>' + user_role_based_edit +\n\n ' <div class=\"edit_code\" style=\"background-color:#888888;font-size:14px;display:none;\">' +\n ' <textarea rows=7 cols=150 class=\"code_settings\">' + moduleSourceCode_settings + '</textarea>' +\n ' <p style=\"color:#000000;\">Main Implementation: </p>' +\n ' <textarea rows=10 cols=150>' + moduleSourceCode_main + '</textarea>' +\n '</div>' +\n\n ' <pre style=\"background-color:#333333;width:100%;display:none;\" class=\"pre_highlighted_code\">' + '<code class=\"python highlighted_code\" style=\"display:none;\">' + moduleSourceCode_settings +\n ' ' +\n moduleSourceCode_main + '</code></pre>' +\n\n ' </div>' +\n\n '</div>'\n\n\n );//end of append\n\n\n\n\n\n\n\n\n $(\"#module_id_\"+ moduleID + \"_output_destination\").val(\"output_destination = '/home/ubuntu/Webpage/app_collaborative_sci_workflow/workflow_outputs/test_workflow/Module_\" + moduleID + \"'\").trigger('change');\n\n\n\n\n\n\n\n\n\n\n\n var listOfInputPorts = [];\n var listOfOutputPorts = [];\n\n\n\n //input port definition\n var $toolInput = $xml_tool_definition.find(\"toolInput\");\n\n $toolInput.each(function(){\n\n var label = $(this).find('label').text(),\n dataFormat = $(this).find('dataFormat').text(),\n referenceVariable = $(this).find('referenceVariable').text();\n\n //$(\"#ProfileList\" ).append('<li>' +label+ ' - ' +dataFormat+ ' - ' + idn +'</li>');\n\n var aNewInputPort = makePort(dataFormat,referenceVariable,true);\n listOfInputPorts.push(aNewInputPort);\n\n\n\n var thisPortInput = 'module_id_' + moduleID + '_NO_INPUT_SOURCE_SELECTED_.' + dataFormat;\n thisPortInput = referenceVariable + '=\"' + WORKFLOW_OUTPUTS_PATH + THIS_WORKFLOW_NAME + '/' +thisPortInput + '\"';\n\n $(\"#module_id_\"+moduleID + ' .' + referenceVariable).val(thisPortInput).trigger('change');\n\n });\n\n\n\n\n\n //output port definition\n var $toolOutput = $xml_tool_definition.find(\"toolOutput\");\n\n $toolOutput.each(function(){\n\n var label = $(this).find('label').text(),\n dataFormat = $(this).find('dataFormat').text(),\n referenceVariable = $(this).find('referenceVariable').text();\n\n //$(\"#ProfileList\" ).append('<li>' +label+ ' - ' +dataFormat+ ' - ' + idn +'</li>');\n\n var aNewOutputPort = makePort(dataFormat,referenceVariable,false);\n listOfOutputPorts.push(aNewOutputPort);\n\n\n var thisPortOutput = 'module_id_' + moduleID + '_' + referenceVariable+'.' + dataFormat;\n thisPortOutput = referenceVariable + '=\"' + WORKFLOW_OUTPUTS_PATH + THIS_WORKFLOW_NAME + '/' +thisPortOutput + '\"';\n\n $(\"#module_id_\"+moduleID + ' .' + referenceVariable).val(thisPortOutput).trigger('change');\n\n });\n\n\n\n\n\n makeTemplate(moduleName,\"images/55x55.png\", \"white\",\n listOfInputPorts,\n listOfOutputPorts);\n\n\n\n\n\n\n //Update the DAG\n //var newWorkflowModule = workflow.add(\"Module_\"+moduleID, \"Module_0\", workflow.traverseDF);\n //newWorkflowModule.nodeName = moduleName;\n //redrawWorkflowStructure();\n\n\n //alert(\"Add\");\n myDiagram.startTransaction(\"add node\");\n // have the Model add the node data\n var newnode = {\"key\":\"module_id_\" + moduleID, \"type\":moduleName, \"name\":moduleName, \"module_id\": \"Module \"+moduleID};\n myDiagram.model.addNodeData(newnode);\n // locate the node initially where the parent node is\n // diagram.findNodeForData(newnode).location = node.location;\n // and then add a link data connecting the original node with the new one\n //var newlink = { from: node.data.key, to: newnode.key };\n //diagram.model.addLinkData(newlink);\n // finish the transaction -- will automatically perform a layout\n myDiagram.commitTransaction(\"add node\");\n\n\n\n\n\n\n if(isItMyFloor() == false)lockParamsSettings();\n\n /*$('pre code').each(function (i, block) {\n hljs.highlightBlock(block);\n });*/\n\n\n },\n error: function (xhr, status, error) {\n alert(xhr.responseText);\n }\n\n });//end of ajax\n\n\n}", "function createModule(name) {\n var newModule = new Module(name);\n modules.push(newModule);\n return newModule;\n }", "function addModule() {\n $('<section>')\n .attr('id', 'rsw-discord')\n .addClass('rsw-custom-module rail-module')\n .append(\n $('<a>')\n .attr('href', ('https://discord.gg/s63bxtW'))\n .append(\n $('<img>')\n .attr('src', 'https://vignette.wikia.nocookie.net/vocaloid/images/2/2d/Discord-Logo-Color.png')\n ),\n $('<div>')\n .append(\n $('<p>')\n .append(\n 'Le Wiki VOCALOID a un serveur officiel de Discord ! Clique le bouton ci-dessous pour rejoindre et dialoguer avec les fans et des contributeurs en direct, ou clique ',\n $('<a>')\n .attr('href', mw.util.wikiGetlink('Wiki Vocaloid:Discord'))\n .text('ici'),\n ' pour lire les règles du tchat de ce serveur.'\n ),\n $('<a>')\n .attr('href', 'https://discord.gg/s63bxtW')\n .addClass('wds-button')\n .text('Recevoir une invitation')\n )\n )\n .insertBefore('#wikia-recent-activity');\n }", "function onAdd(ev){\n ev.preventDefault();\n\n if(lectureInput.value == '' || dataInput.value == '' \n || dataInput.value.includes('mm') || moduleInput.value == '' \n || moduleInput.value.includes('Select module')){\n return;\n }\n\n if(modules.textContent.includes(moduleInput.value.toUpperCase())){\n const ulModule = Array.from(document.querySelectorAll('div[class=modules] > div[class=module]'))\n .find(m => m.textContent.includes(moduleInput.value.toUpperCase()))\n .querySelector('ul');\n \n const li = document.createElement('li');\n li.setAttribute('class', 'flex');\n const header = document.createElement('h4');\n const date = dataInput.value.split('T');\n header.textContent = `${lectureInput.value} - ${date[0].split('-').join('/')} - ${date[1]}`;\n const delButton = document.createElement('button');\n delButton.setAttribute('class', 'red');\n delButton.textContent = 'Del';\n delButton.addEventListener('click', onDelete);\n\n li.appendChild(header);\n li.appendChild(delButton);\n\n ulModule.appendChild(li);\n\n const headers = Array.from(document.querySelectorAll('div[class=modules] > div[class=module] > ul li')).sort((a, b) => {\n const firstDate = a.children[0].textContent.split(' - ')[1];\n const secondDate = b.children[0].textContent.split(' - ')[1];\n\n return firstDate.localeCompare(secondDate);\n });\n ulModule.textContent = '';\n headers.forEach(h => ulModule.appendChild(h));\n }else{\n const module = document.createElement('div');\n module.setAttribute('class', 'module');\n\n const hModule = document.createElement('h3');\n hModule.textContent = moduleInput.value.toUpperCase() + '-MODULE';\n\n const ul = document.createElement('ul');\n const li = document.createElement('li');\n li.setAttribute('class', 'flex');\n\n const header = document.createElement('h4');\n const date = dataInput.value.split('T');\n header.textContent = `${lectureInput.value} - ${date[0].split('-').join('/')} - ${date[1]}`;\n const delButton = document.createElement('button');\n delButton.setAttribute('class', 'red');\n delButton.textContent = 'Del';\n delButton.addEventListener('click', onDelete);\n\n li.appendChild(header);\n li.appendChild(delButton);\n ul.appendChild(li);\n module.appendChild(hModule);\n module.appendChild(ul);\n\n modules.appendChild(module);\n }\n }", "function updateModule(updateModule){\n var deferred = Q.defer();\n\n updateModule.name = updateModule.name.toLowerCase();\n\n //fields array should not be editable when using this function. therefore, delete it from input\n delete updateModule.fields;\n\n db.modules.find({$or: [\n {_id: mongo.helper.toObjectID(updateModule._id)},\n {name: updateModule.name}\n ]}).toArray(function(err, modules){\n if(err){\n deferred.reject(err);\n }\n else if(modules.length == 0){\n deferred.reject(notFound);\n }\n //vali inputs, no other document have the same name\n else if(modules.length == 1){\n var oldModule = modules[0];\n \n //rename if old & new names are different\n if(oldModule.name != updateModule.name){\n db.bind(oldModule.name);\n db[oldModule.name].rename(updateModule.name, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n update();\n }\n });\n }\n //go straight to update\n else{\n update();\n }\n }\n //another module document with the same name exists\n else{\n deferred.reject(exists);\n }\n }); \n\n //updates the document in the 'modules' collection\n function update(){\n\n //create another object and copy. then delete the '_id' property of the new copy\n var forUpdate = {};\n Object.assign(forUpdate, updateModule);\n delete forUpdate._id;\n \n db.modules.update({_id: mongo.helper.toObjectID(updateModule._id)}, {$set: forUpdate}, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n deferred.resolve();\n }\n });\n }\n\n return deferred.promise;\n}", "function addModule(module) {\n function addIndividualModule(module) {\n if (!mapNames[module.moduleName]) {\n mapNames[module.moduleName] = true;\n allModules.push(module);\n ModuleRegistry.register(module);\n }\n }\n addIndividualModule(module);\n if (module.dependantModules) {\n module.dependantModules.forEach(addModule);\n }\n }", "function addNewModule() {\n\tcountOfModules++;\n\tvar modulename = document.getElementById(\"module_name\").value;\n\tconsole.log(\"Created Module : \"+modulename);\n\tconsole.log(\"Number of existing modules \"+countOfModules);\n\tvar node = '<div class = \"module\" id=\"Module'+countOfModules+'\" onClick=openModuleDetails(\"'+modulename+'\")><div class=\"moduletitle\"><p id = \"ModuleP'+countOfModules+'\">'+modulename+'</p></div><div class=\"modulePrecentage\"><p>69%</p></div></div>';\n\tdocument.getElementById('module_elements').innerHTML += node;\n\n\t//Close popupup and save the modules\n\tclosepopup();\n\tsaveModules();\n\n}", "function addCollectiontoDB() {\n var name = $(\"#colName\").val();\n var owner = sessionStorage.getItem(\"collectionOwner\");\n var itemName = $(\"#item\").val();\n var itemDesc = $(\"#desc\").val();\n\n $.post(\"/newCollection\", {owner: owner, name: name, itemName: itemName, itemDesc: itemDesc}, function(data) {\n $(\"#addResults\").append(\"<h4>Collection \" + data.collection + \" Added!</h4>\");\n $(\"#collectionName\").append(\"<option>\" + data.collection + \"</option>\");\n });\n}", "function addModule(name, body) {\n\n try {\n availableModules[name] = body;\n\n if (loadingModules.hasOwnProperty(name)) {\n evaluateModule(name);\n }\n\n if (moduleConfig) {\n cacheModule(name, body);\n } else {\n pendingCacheables[name] = body;\n }\n } catch(exception) {\n failModule(name, exception);\n }\n }", "function addToCollection( newTitle, newArtist, newYearPublished, newTracks ){ \n// - Create a new object having the above properties\n let album = {\n title : newTitle,\n artist : newArtist,\n year : newYearPublished,\n tracks : newTracks\n } //end object literal\n// - Add the new object to the end of the `collection` array\nrecordCollection.push( album );\n// - Return the newly created object\nreturn console.log( 'New record added to the collection:', album );\n}", "addObject(name, collection, config) {\n\t\tthis.objectManager.addObject(name, collection, config);\n\t}", "function postGroup(req, res) {\n cors.setHeader(res);\n let moduleId = req.swagger.params.body.value.module_id;\n\n // Only allow people in the module to create groups.\n // Administrators have can_view set for every module.\n rightsModule.getModuleRights(req)\n .then(rights => {\n var moduleRights;\n for (var x in rights.modules_rights) {\n if (rights.modules_rights[x].id === moduleId) {\n moduleRights = rights.modules_rights[x];\n }\n }\n console.log(moduleRights);\n if (!(moduleRights && moduleRights.can_view)) {\n res.status(401).json({});\n return;\n }\n });\n\n // Refuse groups without module id.\n if (typeof moduleId === 'undefined') {\n res.status(405).json({});\n return;\n }\n\n (async () => {\n const client = await db.connect();\n try {\n // Create a new group in the database for the given module.\n const result = await client.query(sqlStatements.addGroup, [moduleId]);\n // Add the module id to the result to conform to API specification.\n result.rows[0].module_id = moduleId;\n // Add the current user to the newly created group.\n await client.query(sqlStatements.addUserToGroup, [result.rows[0].id, req.user.id]);\n\n res.status(201).json(result.rows[0]);\n } finally {\n client.release();\n }\n })().catch(e => {\n console.log(e.stack);\n res.status(500).json({});\n });\n}", "function saveForm() {\r\n let nameBox = document.getElementById(\"name_box\").value\r\n let numberBox =\r\n document.getElementById(\"number_box\").value\r\n let addressBox =\r\n document.getElementById(\"address_box\").value\r\n\r\n let savedContact = {\r\n name: nameBox,\r\n number: numberBox,\r\n address: addressBox\r\n }\r\n\r\n\r\n// the line below is calling the contactCollection function from contactCollection.js file and performing the addContact function while passing the argument savedContact. That will ulitimately post data to database.\r\n contactCollection.addContact(savedContact)\r\n}", "function addModule(module) {\n var newIndex = modules.push(module) - 1,\n $host;\n // add base functions and properties\n module._values = {};\n module.isRunning = false;\n module.val = function (name, newValue, source) {\n if (!source) source = module;\n if (newValue === undefined) return this._values[name];\n\n this._values[name] = newValue;\n $(module).trigger(\"valueChanged\", { name: name, value: newValue, source: source });\n return newValue;\n }\n\n module.getValues = function () {\n return this._values;\n }\n moduleIDIndex[module.id] = newIndex;\n\n // create ui\n $('#moduleContainer').append(\n $host =\n $('<div />', { id: module.id, 'class': 'moduleContent' })\n .css('display', 'none')\n );\n $('#changeModuleMenu .menuItemsPanel').append(\n $('<li>' + module.name + '</li>').click(function () {\n $(this).parent().hide();\n showModule.call(this, module);\n }));\n\n // add any saved values\n if (my.startupModuleValues[module.id]) {\n var modValues = my.startupModuleValues[module.id];\n for (var i in modValues) {\n // we don't want to trigger onValueChanged since the module isn't initialized.\n module._values[i] = modValues[i];\n }\n }\n \n module.init($host);\n }", "_onRestoreDB() {\n this.modulesCollection = this._db.getCollection(this.modulesCollectionName);\n if (!this.modulesCollection) {\n this.modulesCollection = this._db.addCollection(this.modulesCollectionName);\n this._dbInitialized = true;\n } else {\n\n const parseAndRegister = (m) => {\n if (typeof m === 'string') {\n m = JSON.parse(m);\n }\n return this.register(m);\n };\n\n Promise.all(this.modulesCollection.find().map(parseAndRegister))\n .then(() => {\n logger.debug(`Database loaded with, ${this.modulesCollection.count()} modules`);\n this._dbInitialized = true;\n });\n }\n }", "async save() {\n\t\tconst title = this.title;\n\n\t\tif (!title) {\n\t\t\twinston.error(`Error ingesting Collection ${this.repoLocal}`);\n\t\t\treturn null;\n\t\t}\n\n\t\tconsole.log(this.urn);\n\n\t\tconst collection = await Collection.create({\n\t\t\ttitle: title.slice(0, 250),\n\t\t\turn: this.urn,\n\t\t\trepository: this.repoRemote,\n\t\t});\n\n\t\tfor (let i = 0; i < this.textGroups.length; i += 1) {\n\t\t\tawait this.textGroups[i].generateInventory(collection); // eslint-disable-line\n\t\t}\n\t}", "function addProduct() {\n var currentHttpParameterMap = request.httpParameterMap;\n\n\n\n var Product = null;\n\n if (Product === null) {\n if (currentHttpParameterMap.pid.stringValue !== null) {\n var ProductID = currentHttpParameterMap.pid.stringValue;\n\n var GetProductResult = new Pipelet('GetProduct').execute({\n ProductID: ProductID\n });\n if (GetProductResult.result === PIPELET_ERROR) {\n return {\n error: true\n };\n }\n Product = GetProductResult.Product;\n }\n }\n\n\n var GetProductListsResult = new Pipelet('GetProductLists').execute({\n Customer: customer,\n Type: ProductList.TYPE_GIFT_REGISTRY\n });\n var ProductLists = GetProductListsResult.ProductLists;\n\n //var ProductList = null;\n\n if (typeof(ProductLists) !== 'undefined' && ProductLists !== null && !ProductLists.isEmpty()) {\n if (ProductLists.size() === 1) {\n ProductList = ProductLists.iterator().next();\n } else {\n selectOne();\n return;\n }\n } else {\n createOne();\n return;\n }\n\n\n //var UpdateProductOptionSelectionsResult = new Pipelet('UpdateProductOptionSelections').execute({\n // Product: Product\n //});\n\n\n //var ProductOptionModel = UpdateProductOptionSelectionsResult.ProductOptionModel;\n\n\n // var AddProductToProductListResult = new Pipelet('AddProductToProductList', {\n // DisallowRepeats: true\n // }).execute({\n // Product: Product,\n // ProductList: ProductList,\n // Quantity: currentHttpParameterMap.Quantity.getIntValue(),\n // ProductOptionModel: ProductOptionModel,\n // Priority: 2\n // });\n\n\n showRegistry({\n ProductList: ProductList\n });\n return;\n}", "function add(body) {\n return DB(\"resources\").insert(body);\n // .then(id => {\n // findById(id);\n // });\n}", "async function addRoutine(req, res) {\n const db = req.app.get(\"db\");\n\n const {\n userId,\n skinType,\n time,\n firstCleanser,\n secondCleanser,\n exfoliator,\n toner,\n essence,\n eyeSerum,\n eyeMoisturizer,\n faceSerum,\n faceMoisturizer,\n neckSerum,\n neckMoisturizer,\n mask,\n sunscreen,\n note\n } = req.body;\n\n const addedRoutine = await db.routines.addRoutine([\n userId,\n skinType,\n time,\n firstCleanser,\n secondCleanser,\n exfoliator,\n toner,\n essence,\n eyeSerum,\n eyeMoisturizer,\n faceSerum,\n faceMoisturizer,\n neckSerum,\n neckMoisturizer,\n mask,\n sunscreen,\n note\n ]);\n if (db) {\n res.status(200).json(addedRoutine);\n }\n}", "add(title, description = \"\", template = 100, enableContentTypes = false, additionalSettings = {}) {\r\n const addSettings = extend({\r\n \"AllowContentTypes\": enableContentTypes,\r\n \"BaseTemplate\": template,\r\n \"ContentTypesEnabled\": enableContentTypes,\r\n \"Description\": description,\r\n \"Title\": title,\r\n \"__metadata\": { \"type\": \"SP.List\" },\r\n }, additionalSettings);\r\n return this.postCore({ body: jsS(addSettings) }).then((data) => {\r\n return { data: data, list: this.getByTitle(addSettings.Title) };\r\n });\r\n }", "function addProject() {\n const inputname = document.querySelector('.project_name_input').value; //get input data from dom\n if (inputname == '')\n return;\n data.projects.push(new project(inputname, data.projects.length)) //add new project with name and id to list\n\n }", "function update(){\n\n //create another object and copy. then delete the '_id' property of the new copy\n var forUpdate = {};\n Object.assign(forUpdate, updateModule);\n delete forUpdate._id;\n \n db.modules.update({_id: mongo.helper.toObjectID(updateModule._id)}, {$set: forUpdate}, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n deferred.resolve();\n }\n });\n }", "function update(){\n\n //create another object and copy. then delete the '_id' property of the new copy\n var forUpdate = {};\n Object.assign(forUpdate, updateModule);\n delete forUpdate._id;\n \n db.modules.update({_id: mongo.helper.toObjectID(updateModule._id)}, {$set: forUpdate}, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n deferred.resolve();\n }\n });\n }", "async registerModules() {\n const { modules } = this.options;\n\n for (let index = 0; index < Object.keys(modules).length; index += 1) {\n const name = Object.keys(modules)[index];\n const module = modules[name];\n\n // eslint-disable-next-line no-await-in-loop\n await module.then((loadedModule) => {\n const { routes, store } = loadedModule.default;\n this.registerModuleRoutes(routes);\n this.registerModuleStore(name, store);\n });\n }\n }", "function addToMongo() {\n var dbName = 'aa_group_meetings';\n // var groupNamesColl = 'group_names'; \n var meetingsColl = 'meetings';\n\n request(jsonMeetings, function(error, response, body) {\n\n var url = 'mongodb://' + process.env.IP + ':27017/' + dbName;\n var MongoClient = require('mongodb').MongoClient;\n MongoClient.connect(url, function(err, db) {\n if (err) { return console.dir(err); }\n var collection = db.collection(meetingsColl);\n collection.insert(jsonMeetings);\n db.close();\n \n });\n });\n}", "function createModules() {\n $(\"#base\").empty();\n var $o = makeSelect(mods);\n\n for (var key in modules) {\n if (modules.hasOwnProperty(key)) {\n var obj = modules[key];\n $o.find('select').append('<option value=\"' + obj.name + '\">' + obj.name + '</option>');\n }\n }\n\n $('#base').prepend($o);\n }", "function addToCollection({title, artist, yearPublished}) {\n //- Create a new object having the above properties\n let myQuranObj = {\n title : title ,\n artist : artist,\n yearPublished: yearPublished\n } \n //- Add the new object to the end of the `collection` array\n collection.push(myQuranObj)\n //- Return the newly created object\n return collection;\n }", "function getConfigAndCreateModule(config) {\n\t\tExt.Ajax.request({\n\t\t\tmethod : \"GET\",\n\t\t\turl : loadUrl.get('APP_URL') + loadUrl.get('APP_PROJECTS_MODULES_URL') + \"/\" + config.id,\n\t\t\tscope : this,\n\t\t\tsuccess : function (response) {\n\t\t\t\tvar json = Ext.decode(response.responseText);\n\t\t\t\tif (json.success) {\n\t\t\t\t\tvar configModule = Ext.applyIf(config, json.projectModule || {});\n\t\t\t\t\tvar module = createModule(configModule);\n\t\t\t\t\tSitoolsDesk.app.modules.push(module);\n\t\t\t\t} else {\n\t\t\t\t\tExt.Msg.alert(i18n.get('label.error'), String.format(i18n\n\t\t\t\t\t\t\t\t\t\t\t.get('label.undefinedModule'),\n\t\t\t\t\t\t\t\t\tconfig.name));\n\t\t\t\t\t//if all includes are done, Add 1 to the modulesCharges \n\t\t\t\t\tSitoolsDesk.modulesCharges++;\n\t\t\t\t\t//test if all modules are loaded.\n\t\t\t\t\tif (SitoolsDesk.modulesCharges === SitoolsDesk.modulesACharger) {\n\t\t\t\t\t\t//End of loading all Javascript files. \n\t\t\t\t\t\tSitoolsDesk.app.fireEvent('allJsIncludesDone', this);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\tfailure : alertFailure\n\t\t});\n\t}", "function addChannel(req, cb){\n console.log(req.body)\n var channel_users = req.body.channel_users\n var group_id = req.body.group_id\n \n var new_channel = new channel_model({\n channel_name: req.body.channel_name,\n group_id: group_id,\n channel_users: [channel_users]\n });\n \n console.log(new_channel)\n new_channel.save((err,channel) => {\n if(err){\n cb ({'success':false,'message': err});\n return\n }\n cb ({'success':true,'message':channel});\n return\n })\n}", "registerApiModule (name, module, meta) {\n registerModuleEventListener(name, module, meta)\n if (!protocol.apiModule[name]) {\n protocol.apiModule[name] = module\n }\n else {\n for (const key in module) {\n if (module.hasOwnProperty(key)) {\n protocol.apiModule[name][key] = module[key]\n }\n }\n }\n // register API module's meta info to jsframework\n if (meta) {\n protocol.setApiModuleMeta(meta)\n global.registerModules(protocol.getApiModuleMeta(name), true)\n }\n }", "registerApiModule (name, module, meta) {\n registerModuleEventListener(name, module, meta)\n if (!protocol.apiModule[name]) {\n protocol.apiModule[name] = module\n }\n else {\n for (const key in module) {\n if (module.hasOwnProperty(key)) {\n protocol.apiModule[name][key] = module[key]\n }\n }\n }\n // register API module's meta info to jsframework\n if (meta) {\n protocol.setApiModuleMeta(meta)\n global.registerModules(protocol.getApiModuleMeta(name), true)\n }\n }", "makeCollection(name) {\n if (this.config.collections[this.database].includes(name)) {\n return new Promise((resolve, reject) => {\n resolve(false);\n });\n }\n return new Promise((resolve, reject) => {\n chrome.storage.sync.set({ [name]: [] }, () => {\n this.config.collections[this.database].push(name);\n resolve(true);\n });\n });\n }", "async function addData(collectionName, data) {\n const collection = db.get(collectionName);\n await collection.insert(data);\n}", "add(req, res) {\n return businesses\n .create({\n name: req.body.name,\n description: req.body.description,\n category: req.body.category,\n link: req.body.link\n })\n .then((result) => res.status(201).send(result))\n .catch((error) => res.status(400).send(error))\n }", "function addStage(req, res) {\n if (!validator.isValid(req.body.stageName)) {\n res.json({\n code: Constant.ERROR_CODE,\n message: Constant.FIELD_REQUIRED\n });\n }\n else {\n stage.findOne({stageName: {$regex: new RegExp('^' + req.body.stageName + '$', \"i\")}, moduleType: req.body.moduleType, companyId: req.body.companyId, deleted: false}, function(err, industryData) {\n if (err) {\n res.json({code: Constant.ERROR_CODE, message: err});\n }\n else {\n if (industryData) {\n res.json({\n code: Constant.ERROR_CODE,\n message: Constant.CONTACT_INDUSTRY_EXIST\n });\n }\n else {\n var industryDataField = {\n stageName: req.body.stageName,\n companyId: req.body.companyId,\n moduleType: req.body.moduleType\n };\n stage(industryDataField).save(function(err, data) {\n if (err) {\n res.json({code: Constant.ERROR_CODE, message: err});\n } else {\n res.json({code: Constant.SUCCESS_CODE, data: data});\n }\n });\n }\n\n }\n });\n }\n\n}", "function deleteModule(id, moduleName){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n\n //drop the collection\n db.bind(moduleName);\n db[moduleName].drop();\n\n //remove document from 'modules' collection\n db.modules.remove({_id: mongo.helper.toObjectID(id)}, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n deferred.resolve();\n }\n });\n\n return deferred.promise;\n}", "queueModule(modulePath) {\n this.modulesToAdd.push(modulePath);\n }", "function processAdd(req, plus, oauth2Client, res) {\n if (req.body.description.length <= 0) {\n console.log('Empty string for a description.');\n res.send('Need a description', 400);\n } else {\n gplus.getDatabaseUserWithPermission(pool, plus, oauth2Client, \"can_add=1\", function(err, gp_user, db_user) {\n if (err != null) {\n res.send(err.message, err.code)\n } else {\n console.log(\"Found a whitelisted user!\");\n console.log(gp_user.displayName + \", \" + gp_user.id);\n\n var query = 'insert into tasks (ordering,description) SELECT 1 + coalesce((SELECT max(ordering)' +\n ' FROM tasks),0), ' + pool.escape(req.body.description) + ';';\n pool.query(query, function(err, info, fields) {\n if (err) {\n console.log('error insert: ' + err);\n res.send('Invalid insertion query', 500);\n } else {\n console.log(info.insertId);\n console.log(\"Submission complete!\");\n res.send({taskId : info.insertId, \n description : req.body.description}, 200);\n }\n });\n }\n });\n }\n}", "addProject(){\n return this.get('projects').pushObject(this.store.createRecord('project'));\n }", "function insertModules( tx ) {\n\tvar query = \"\";\n\tvar localData = parsedData.products;\n\t\n\tconsole.log( \"Inserting data into \" + tableModules + \" table.\" );\n\tfor( var i = 0; i < localData.length; i++ ) {\n\t\tquery = \"INSERT INTO \" + tableModules + \"(name, description, category, cost, quantity, image) VALUES(?,?,?,?,?,?)\";\n\t\t//--console.log( \"query: \" + query );\n\t\ttx.executeSql( query, [localData[i].name, localData[i].decription, localData[i].category, localData[i].cost, \n\t\t localData[i].quantity, localData[i].image],\n\t\t\t\tfunction(){}, errorCB );\n\t}\n}", "function addResource(newResource){\n return db('resources')\n .insert(newResource, 'id')\n .then(id => {\n return getResourceById(id[0])\n })\n}", "function add() {\n // TODO: your code here\n}", "function addOpportunitySource(req, res) {\n if (!validator.isValid(req.body.sourceName)) {\n res.json({\n code: Constant.ERROR_CODE,\n message: Constant.FIELD_REQUIRED\n });\n }\n else {\n source.findOne({sourceName: {$regex: new RegExp('^' + req.body.sourceName + '$', \"i\")}, moduleType: req.body.moduleType, deleted: false, companyId: req.body.companyId}, function(err, statusData) {\n if (err) {\n res.json({code: Constant.ERROR_CODE, message: err});\n }\n else {\n if (statusData) {\n res.json({\n code: Constant.ERROR_CODE,\n message: Constant.SOURCE_ALREADY_EXIST\n });\n }\n else {\n var sourceDataField = {\n sourceName: req.body.sourceName,\n companyId: req.body.companyId,\n userId: req.body.userId,\n moduleType: req.body.moduleType\n };\n source(sourceDataField).save(function(err, data) {\n if (err) {\n res.json({code: Constant.ERROR_CODE, message: err});\n } else {\n res.json({code: Constant.SUCCESS_CODE, data: data});\n }\n });\n }\n\n }\n });\n }\n\n\n}", "function createCollection(applicationId, collectionName, success, failure) {\n var collections = {};\n collections[collectionName] = {};\n var metadata = {\n metadata: {\n collections: collections\n }\n };\n apiRequest(\"PUT\", \"/\" + self.currentOrganization + \"/\" + applicationId, null, JSON.stringify(metadata), success, failure);\n }", "function addToCollection(artist, title, yearPublished){\n// - Create a new object having the above properties\n let record = {artist , title , yearPublished}\n// - Add the new object to the end of the `collection` array\nconsole.log(artist, 'has been added to the collection');\ncollection.push(record);\n}", "async [FETCH_MODULES]({ commit }, successRoute) {\n // If user is logged in 'data' will contain an array of module data.\n // Otherwise 'data' will contain an error message.\n try {\n const { data } = await callApi(MODULES_URL);\n const { message } = data;\n\n if (message === 'NOT_AUTHORIZED') {\n router.push('/login');\n return;\n }\n\n const { entities } = normalize(data, moduleSchema);\n const { modules, reactions } = entities;\n\n commit(LOAD_MODULES, modules);\n commit(LOAD_REACTIONS, reactions);\n commit(FETCH_MODULES_SUCCESS);\n\n if (successRoute) {\n router.push(successRoute);\n }\n } catch (error) {\n console.log(error);\n }\n }", "function reqAddToCollection (req) {\n return [ req.params.id, req.params.collection, req.body ];\n}", "function deleteModule(moduleName){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n\n //drop the collection\n db.bind(moduleName);\n db[moduleName].drop(function(err){\n if(err){\n if(err.codeName == 'NamespaceNotFound'){\n deferred.reject(notFound);\n }\n else{\n deferred.reject(err);\n }\n }\n else{\n //remove document from 'modules' collection\n db.modules.remove({name: moduleName}, function(err, writeResult){\n if(err){\n deferred.reject(err);\n }\n else{\n //n is used to know if the document was removed\n if(writeResult.result.n == 0){\n deferred.reject(notFound);\n }\n else{\n deferred.resolve();\n }\n }\n });\n }\n });\n\n return deferred.promise;\n}", "function addSoftware(s){\n\tdb.run(`insert into softwares (name) values ('${s.name}')`);\n}", "function writeNewCollection(uid, name) {\n\n return new Promise(function(resolve,reject){\n\n // A Collection Entry\n var collectionData = {\n name: name,\n dateCreated: new Date().toString(),\n public: true,\n }\n\n db.ref('/user-posts/' + uid + '/collections/').push(collectionData).once(\"value\")\n .then(function(snapshot) {\n state.currentCollection.id = snapshot.key\n state.currentCollection.data = snapshot.val()\n resolve();\n });\n\n });\n\n }", "async function addService(req, res){\ntry{\n let user= await User.findById(req.headers.user);\n user.services.push(req.body);\n await user.save();\n res.status(200).json(user.services);\n} catch(err){\n res.status(400).json(err);\n}\n}", "function addToModels(file){\n\tvar model = JSON.parse(fse.readFileSync(file, 'utf8'));\t\n\tconsole.log(\"Model Created\" + model.name);\n\tu.enhance(model);\n\tapp.models.push(model);\t\n}", "async addList(req, res){\n const response = await user.findById(req.userId);\n if(response.userType === 'comum'){ \n const saveList = await GitUserList.create({\n ...req.body, user: req.userId\n });\n res.status(201).send(saveList);\n }\n else{\n res.status(400).json({error: 'User does not have permission'});\n }\n }", "add(url) {\r\n return this.clone(Folders_1, `add('${url}')`).postCore().then((data) => {\r\n return {\r\n data,\r\n folder: this.getByName(url),\r\n };\r\n });\r\n }", "async beforeAddTask(task) {\n // await mongo.persist(async (client) => {\n // await client.collection('demo').insertOne({type: 'list'});\n // });\n return true;\n }", "async add(collection, document) {\n console.log(\"adding collection\")\n console.log(collection) \n try {\n const docRef = await this.api\n .collection(collection)\n .add(document);\n return docRef.id;\n }\n catch (error) {\n return 'Error adding document: ' + error;\n }\n }", "storeAdd(params) {\n \n }", "function getListOfModulesAndCreateModules(projectAttachment, configs) {\n\t\tExt.Ajax.request({\n\t\t\tmethod : \"GET\",\n\t\t\turl : projectAttachment + \"/projectModules\",\n\t\t\tscope : this,\n\t\t\tsuccess : function (response) {\n\t\t\t\tvar json = Ext.decode(response.responseText);\n\t\t\t\tExt.each(json.data, function (projectModule) {\n\t\t\t\t\tvar projectConfig = findProjectModuleConfig(configs, projectModule.id);\n\t\t\t\t\tif (!Ext.isEmpty(projectConfig)) {\n\t\t\t\t\t\tvar configModule = Ext.applyIf(projectConfig, projectModule\t|| {});\n\t\t\t\t\t\tvar module = createModule(configModule);\t\t\t\t\t\t\n\t\t\t\t\t\tSitoolsDesk.app.modules.push(module);\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tExt.Msg.alert(i18n.get('label.error'), String.format(i18n\n\t\t\t\t\t\t\t\t\t\t\t.get('label.undefinedModule'),\n\t\t\t\t\t\t\t\t\tprojectModule.name));\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t//if all includes are done, Add 1 to the modulesCharges \n\t\t\t\t\t\tSitoolsDesk.modulesCharges++;\n\t\t\t\t\t\t//test if all modules are loaded.\n\t\t\t\t\t\tif (SitoolsDesk.modulesCharges === SitoolsDesk.modulesACharger) {\n\t\t\t\t\t\t\t//End of loading all Javascript files. \n\t\t\t\t\t\t\tSitoolsDesk.app.fireEvent('allJsIncludesDone', this);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\t\t\t\t\t\n\t\t\t\t}, this);\n\t\t\t},\n\t\t\tfailure : alertFailure\n\t\t});\t\t\n\t}", "static getModules(modules, container){\n\t\t/* Add modules */\n\t\tvar res = new Vector();\n\t\tvar cache = new Map();\n\t\tthis._getModules(res, cache, modules, container);\n\t\tres = res.removeDublicatesIm();\n\t\treturn res.toCollection();\n\t}", "addCollection(collName) {\n\n this.db.set(collName, [])\n .write();\n\n this.db.read();\n return this.getCollection(collName);\n }", "function loadModuleRelated()\n{\n moduleID = $('#module').val();\n projectID = $('#project').val();\n setStories(moduleID, projectID);\n}", "async function addDepartment() {\n\n}", "addEntity(name, collection, config) {\n\t\tthis.entityManager.addEntity(name, collection, config);\n\t}", "function updateModuleDoc(moduleName, updateDoc){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n\n db.bind(moduleName);\n\n //create another object and copy. then delete the '_id' property of the new copy\n var forUpdate = {};\n Object.assign(forUpdate, updateDoc);\n delete forUpdate._id;\n\n db[moduleName].update({_id: mongo.helper.toObjectID(updateDoc._id)}, {$set: forUpdate}, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n deferred.resolve();\n }\n });\n\n return deferred.promise;\n}", "function addIndustry(req, res) {\n if (!validator.isValid(req.body.industryName)) {\n res.json({\n code: Constant.ERROR_CODE,\n message: Constant.FIELD_REQUIRED\n });\n }\n else {\n industry.findOne({industryName: {$regex: new RegExp('^' + req.body.industryName + '$', \"i\")}, moduleType: req.body.moduleType, companyId: req.body.companyId, deleted: false}, function(err, industryData) {\n if (err) {\n res.json({code: Constant.ERROR_CODE, message: err});\n }\n else {\n if (industryData) {\n res.json({\n code: Constant.ERROR_CODE,\n message: Constant.CONTACT_INDUSTRY_EXIST\n });\n }\n else {\n var industryDataField = {\n industryName: req.body.industryName,\n companyId: req.body.companyId,\n userId: req.body.contactId,\n moduleType: req.body.moduleType\n };\n industry(industryDataField).save(function(err, data) {\n if (err) {\n res.json({code: Constant.ERROR_CODE, message: err});\n } else {\n res.json({code: Constant.SUCCESS_CODE, data: data});\n }\n });\n }\n\n }\n });\n }\n\n}", "addProduct (product) {\n\n }", "add(what) {\n if (this.isVirtual) throw new Meteor.Error('not-allowed', 'Add/Remove operations should be done from the owner of the relationship');\n\n if (!_.isArray(what)) what = [what];\n let _ids = _.map(what, el => this._identity(el));\n let field = this.getLinkStorageField();\n\n if (typeof(this.object[field]) != 'array') {\n this.object[field] = [];\n }\n\n this.object[field] = _.union(this.object[field], _ids);\n\n let modifier = {\n $pushAll: {\n [field]: _ids\n }\n };\n\n this.linker.getMainCollection().update(this.object._id, modifier);\n }", "function addToDb(collectionName, document, callback)\r\n{ \r\n const collection = db.collection(collectionName); \r\n collection.insertOne(document,\r\n function(err){\r\n if(err) { \r\n console.log(\"failed to add a document to \" + collection + \" collection\");\r\n return callback(err);\r\n } \r\n return callback(null, document);\r\n }); \r\n}", "function addPro(project){\n return db.insert(project,\"*\").into(\"projects\");\n}", "function doc(moduleName) {\n exports.modules.push(moduleName);\n}", "async openCollection(name) {\n errors.assertArgCount(arguments, 1, 1);\n errors.assertParamValue(typeof name === 'string', 1);\n const options = {autoCommit: settings.autoCommit};\n const collImpl = await this._impl.openCollection(name, options);\n if (collImpl) {\n const coll = new SodaCollection();\n coll._impl = collImpl;\n return coll;\n }\n }", "function createMod(paneName, position, modId) {\n var postData = {\n Module: modId,\n Page: '',\n Pane: paneName,\n Position: -1,\n Sort: position,\n Visibility: 0,\n AddExistingModule: false,\n CopyModule: false,\n };\n return sendDnnAjax(null, 'controlbar/AddModule', {\n type: 'POST',\n data: postData,\n success: function () { return window.location.reload(); },\n });\n}", "async addTask({ commit }, { title, date }) {\n await db.collection('tasks').add({\n id: new Date().getTime(),\n title: title,\n date: date,\n done: false\n });\n\n await commit('getTasks');\n }", "function add(project) {\n return db('projects')\n .insert(project, 'id')\n}", "function changeModName() {\n //console.log('Modname' + modName);\n db.collection('modules')\n .doc(module.value)\n .update({\n 'module.name': modName,\n })\n .then(function () {\n console.log('modName updated successfully');\n history.push('/success');\n });\n }", "compose(options, module) {\n let schema = [];\n\n // Useful for finding good unit test cases\n // self.apos.util.log(JSON.stringify(_.pick(options, 'addFields', 'removeFields', 'arrangeFields'), null, ' '));\n\n if (options.addFields) {\n // loop over our addFields\n _.each(options.addFields, function (field) {\n let i;\n // remove it from the schema if we've already added it, last one wins\n for (i = 0; i < schema.length; i++) {\n if (schema[i].name === field.name) {\n schema.splice(i, 1);\n break;\n }\n }\n // add the new field to the schema\n schema.push(field);\n });\n }\n\n if (options.removeFields) {\n schema = _.filter(schema, function (field) {\n return !_.includes(options.removeFields, field.name);\n });\n }\n\n if (options.requireFields) {\n _.each(options.requireFields, function (name) {\n const field = _.find(schema, function (field) {\n return field.name === name;\n });\n if (field) {\n field.required = true;\n }\n });\n }\n\n // If nothing else will do, just modify the schema with a function\n if (options.alterFields) {\n options.alterFields(schema);\n }\n\n const groups = self.composeGroups(schema, options.arrangeFields);\n\n // all fields in the schema will end up in this variable\n let newSchema = [];\n\n // loop over any groups and orders we want to respect\n _.each(groups, function (group) {\n\n _.each(group.fields, function (field) {\n // find the field we are ordering\n let f = _.find(schema, { name: field });\n\n if (!f) {\n // May have already been migrated due to subclasses re-grouping fields\n f = _.find(newSchema, { name: field });\n }\n\n // make sure it exists\n if (f) {\n // set the group for this field\n const g = _.clone(group, true);\n delete g.fields;\n f.group = g;\n\n // push the field to the new schema, if it is a\n // duplicate due to subclasses pushing more\n // groupings, remove the earlier instance\n let fIndex = _.findIndex(newSchema, { name: field });\n if (fIndex !== -1) {\n newSchema.splice(fIndex, 1);\n }\n\n newSchema.push(f);\n\n // remove the field from the old schema, if that is where we got it from\n fIndex = _.findIndex(schema, { name: field });\n if (fIndex !== -1) {\n schema.splice(fIndex, 1);\n }\n }\n });\n });\n\n // put remaining fields in the default group\n _.each(schema, function (field) {\n const g = _.clone(groups[0], true);\n delete g.fields;\n field.group = g;\n });\n\n // add any fields not in defined groups to the end of the schema\n schema = newSchema.concat(schema);\n\n // If a field is not consecutive with other fields in its group,\n // move it after the last already encountered in its group,\n // to simplify rendering logic\n\n newSchema = [];\n const groupIndexes = {};\n _.each(schema, function (field) {\n if (field.group && field.group.name) {\n if (_.has(groupIndexes, field.group.name)) {\n newSchema.splice(groupIndexes[field.group.name], 0, field);\n groupIndexes[field.group.name]++;\n } else {\n newSchema.push(field);\n groupIndexes[field.group.name] = newSchema.length;\n }\n }\n });\n schema = newSchema;\n\n // Move the leftover group to the end, it's just too\n // obnoxious otherwise with one-off fields popping up\n // before title etc.\n\n schema = _.filter(schema, function (field) {\n return !(field.group && field.group.name === defaultGroup.name);\n }).concat(_.filter(schema, function (field) {\n return field.group && field.group.name === defaultGroup.name;\n }));\n\n // Shallowly clone the fields. This allows modules\n // like workflow to patch schema fields of various modules\n // without inadvertently impacting other apos instances\n // when running with @apostrophecms/multisite\n schema = _.map(schema, function (field) {\n return _.clone(field);\n });\n\n _.each(schema, function(field) {\n // For use in resolving options like \"choices\" when they\n // contain a method name. For bc don't mess with possible\n // existing usages in custom schema field types predating\n // this feature\n self.setModuleName(field, module);\n });\n return schema;\n }", "function add() {}", "function createModules() {\n\t\tvar moduleElements = document.documentElement.querySelectorAll(\"[data-module]\"), moduleName = \"\";\n\t\tif (moduleElements.length) {\n\t\t\t// If this page requires any modules to be created, attempt to comply for each of them\n\t\t\tvar i = 0, length = moduleElements.length;\n\t\t\tfor (; i < length; i++) {escape\n\t\t\t\tmoduleName = moduleElements[i].getAttribute(\"data-module\");\n\t\t\t\tif (BISDT.modules[moduleName]) {\n\t\t\t\t\t// If this module does actually exist, create it\n\t\t\t\t\tif (!activeModules[moduleName]) activeModules[moduleName] = [];\n\t\t\t\t\tactiveModules[moduleName].push(new BISDT.modules[moduleName].Controller(moduleElements[i]));\n\t\t\t\t} else {\n\t\t\t\t\tif (window.console && console.warn) console.warn(\"Found a module request for '\" + moduleName + \"', but no module with that name exists.\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "function memadd_http(adds, cb) {\n var axopts = { headers: { Authorization: \"bearer \"+atok, \"content-type\": \"application/json\"} };\n async.map(adds, memsadd, (err, results) => {\n if (err) { var emsg = \"Some items had problems\"; console.log(emsg); return cb(emsg, null); }\n console.log(\"async memadd success\");\n return cb(null, results);\n });\n // Add to single project\n function memsadd(item, cb) {\n var url = cfg.url + \"project/\"+item.pn+\"/assign\";\n var msg = { userNames: item.unames };\n axios.put(url, msg, axopts).then( (resp) => {\n console.log(\"memadd ok with RP\");\n return cb(null, item.pn);\n }).catch( (ex) => {\n console.log(\"memadd fail with RP\");\n return cb(\"memadd fail with RP\", null);\n });\n }\n}", "addSettingsModule(aId, aName, aSettingFieldName, aClass) {\n\t\t\n\t\tthis._settingModules[aId] = {\"name\": aName, \"fieldName\": aSettingFieldName, \"reactClass\": aClass};\n\t\t\n\t}", "registerModules() {\n const { modules } = this.options;\n\n if (Object.keys(modules).length) {\n Object.keys(modules).forEach((moduleName) => {\n const module = modules[moduleName];\n const hasPromisse = typeof module.then === 'function';\n\n // Loaded module\n if (!hasPromisse) {\n this.registerModuleRoutes(module.routes);\n this.registerModuleStore(moduleName, module.store);\n\n return;\n }\n\n // Load lazy modules\n module.then((moduleLoaded) => {\n const { routes, store } = moduleLoaded.default;\n\n this.registerModuleRoutes(routes);\n this.registerModuleStore(moduleName, store);\n });\n });\n }\n }", "function addCollection(collection, callback){\n var id = generateCollectionID();\n conn.query('INSERT INTO Collections (collection_id, collection_title, ' + \n 'collection_description, creator_email, visible, email_interval)' + \n 'VALUES ($1, $2, $3, $4, $5, $6)', \n [\n id,\n collection.collection_title,\n collection.collection_description,\n collection.creator_email,\n collection.visible,\n collection.email_interval\n ]).on('error', console.error).on('end', function() {\n callback(id);\n });\n}", "add(id, name, description = \"\", group = \"Custom Content Types\", additionalSettings = {}) {\r\n const postBody = jsS(Object.assign(metadata(\"SP.ContentType\"), {\r\n \"Description\": description,\r\n \"Group\": group,\r\n \"Id\": { \"StringValue\": id },\r\n \"Name\": name,\r\n }, additionalSettings));\r\n return this.postCore({ body: postBody }).then((data) => {\r\n return { contentType: this.getById(data.id), data: data };\r\n });\r\n }", "addImport(variableName, moduleName) {\n this._imports[variableName] = moduleName;\n }", "init () {\n this.pm.addModuleType(this.schemaModuleTypeKey, 'migrations/schemas', '**/+([0-9]).+([0-9]).+([0-9])-*.js')\n this.pm.addModuleType(this.dataModuleTypeKey, 'migrations/data', '**/+([0-9]).+([0-9]).+([0-9])-*.js')\n }", "addTeammate(req, res) {\n Assembly.findById({ _id: req.params.id })\n .then((assembly) => {\n // create teammate\n let newTeammate = new Teammate(req.body); \n // push teammate\n assembly.team.push(newTeammate); \n // save teammate\n assembly.save() \n .then((data) => {\n res.json(data);\n })\n .catch((err) => {\n res.status(400).json(err);\n })\n })\n .catch(err => res.status(400).json(err))\n }", "addItem(req, res) {\n //grab the new item and push it to the list\n const { addOn } = req.body;\n list.push(addOn);\n res.status(200).send(list);\n }", "_addItem () {\n if (this.state.input === '' ) return\n realm.write(() => {\n realm.create('Categories', { name: this.state.input })\n })\n }", "addToApi() {\n // Invoke the factory function, passing along the form field values to\n const newJournalEntry = renderDom.buildEntry();\n // console.log(\"newJournalEntry\", newJournalEntry)\n API.postJournalEntry(newJournalEntry);\n }", "async function add(db, nam, o) {\n var o = _.merge({}, OPTIONS, VALUE, o), db = db||o.db;\n db = typeof db==='string'? await setup(db, o):db;\n var nam = nam||o.input, v = _.pick(o, ['priority', 'references', 'status']);\n if(o.log) console.log('-add:', nam, v);\n await db.run('INSERT OR IGNORE INTO \"pages\" VALUES (?, ?, ?, ?)', nam, v.priority, v.references, v.status);\n return nam;\n}", "add(fields) {\r\n\t\t\tconst addField = (path, options) => {\r\n\t\t\t\tif (obsidian.Field === options || obsidian.Field === options.type) {\r\n\t\t\t\t\tthrow new Error(\"The field type must be a child class of obsidian.Field\");\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// Check if the options param is a Field\r\n\t\t\t\tif (obsidian.Field.isPrototypeOf(options)) {\r\n\t\t\t\t\toptions = {type: options};\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// Make sure the type field is a Field\r\n\t\t\t\tif (!obsidian.Field.isPrototypeOf(options.type)) {\r\n\t\t\t\t\tthrow new Error(\"The type parameter must be an instance of the Field class\");\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.schemaFields[path] = new options.type(this, path, options);\r\n\t\t\t}\r\n\r\n\t\t\tconst processFieldDefinition = (definition, prefix = \"\") => {\r\n\t\t\t\tObject.keys(definition).forEach((key) => {\r\n\t\t\t\t\tconst obj = definition[key];\r\n\r\n\t\t\t\t\tif (!obj) {\r\n\t\t\t\t\t\tthrow new Error(`Invalid value for schema path ${prefix+key} in ${this.listName}`);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (isPlainObject(obj) && !obj.type && Object.keys(obj).length) {\r\n\t\t\t\t\t\t// obj is a nested field\r\n\t\t\t\t\t\tprocessFieldDefinition(obj, prefix + key + \".\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\taddField(prefix + key, obj);\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\t// Recursivly process the field definitions\r\n\t\t\tprocessFieldDefinition(fields);\r\n\t\t}", "async add(fields) {\n for (const [key, value] of Object.entries(fields)) {\n this.data[key] = value;\n }\n // todo: fields.createdBy = current user\n const category = new CategoryModel(this.data);\n const newCategory = await category.save();\n return {\n id: newCategory._id,\n };\n }" ]
[ "0.69070256", "0.6625662", "0.6408294", "0.6319275", "0.6271609", "0.5992774", "0.59464574", "0.58238715", "0.57643443", "0.5700712", "0.5631341", "0.56060815", "0.5589861", "0.5577479", "0.5543143", "0.54741263", "0.5458044", "0.54475826", "0.54274565", "0.54143834", "0.5408807", "0.53791624", "0.5370691", "0.53652924", "0.5351806", "0.5340384", "0.53248024", "0.530509", "0.5286065", "0.5286065", "0.52594703", "0.524807", "0.5248025", "0.52421236", "0.52396816", "0.5237483", "0.5236462", "0.5236462", "0.5233316", "0.5231015", "0.5218936", "0.5211224", "0.52052146", "0.5203705", "0.5199897", "0.51879513", "0.51867676", "0.5186395", "0.51805395", "0.5170703", "0.51686877", "0.516022", "0.51475054", "0.5147029", "0.5134338", "0.51269174", "0.51262844", "0.5119943", "0.5115788", "0.5115191", "0.51108104", "0.5106823", "0.510629", "0.5071762", "0.5068979", "0.506655", "0.5060742", "0.5057656", "0.5051529", "0.5043896", "0.504335", "0.50424594", "0.50377065", "0.5036681", "0.50338006", "0.50331354", "0.5031867", "0.5029601", "0.50295514", "0.502865", "0.50265956", "0.50258076", "0.502399", "0.5022639", "0.5019676", "0.501589", "0.50016046", "0.49985924", "0.4997679", "0.49898803", "0.49894246", "0.49765483", "0.4976357", "0.49761236", "0.4972535", "0.4970842", "0.49643818", "0.49630702", "0.4962757" ]
0.72655445
1
Function name: get all modules Author: Reccion, Jeremy Date Modified: 2018/04/02 Description: gets all documents from 'modules' collection Parameter(s): none Return: Promise
function getAllModules(){ var deferred = Q.defer(); db.modules.find().toArray(function(err, modules){ if(err){ deferred.reject(err); } else{ deferred.resolve(modules); } }); return deferred.promise; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getAllModuleDocs(moduleName){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n\n db.bind(moduleName);\n\n db[moduleName].find().toArray(function(err, moduleDocs){\n if(err){\n deferred.reject(err);\n }\n else{\n deferred.resolve(moduleDocs);\n }\n });\n\n return deferred.promise;\n}", "function getAllModuleDocs(moduleName){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n\n db.bind(moduleName);\n\n db[moduleName].find().toArray(function(err, moduleDocs){\n if(err){\n deferred.reject(err);\n }\n else{\n deferred.resolve(moduleDocs);\n }\n });\n\n return deferred.promise;\n}", "async function getModules() {\n\n const pool = await db.dbConnection()\n\n const getQuery = `SELECT * FROM public.modules`;\n\n try {\n pool.query(getQuery, function (err, recordset) {\n\n if (err) {\n\n console.log('getModules', err)\n\n } else {\n\n // send records as a response\n return recordset.rows;\n }\n });\n }\n\n catch (error) {\n res.status(402).json('record insert failed with error: ' + parseError(error, getQuery))\n }\n}", "function queryModNames() {\n db.collection('modules')\n .get()\n .then((querySnapshot) => {\n querySnapshot.forEach((doc) => {\n let modNameObj = {};\n modNameObj.value = doc.id;\n modNameObj.label = doc.data().module.name;\n if (modNameObj.label !== 'Jumpshot Tutor') {\n allModules.push(modNameObj);\n }\n setModNamesIsLoading(false);\n });\n return allModules;\n });\n }", "function getAllModules(req, res) {\n\t// Get projectID from query parameters to fetch only project's modules\n\t// Create query to get modules by projectID\n\tconst moduleProjectID = req.params.projectID;\n\tconst query = Module.find({moduleProjectID});\n\n\t// Execute query and return all modules that have the same projectID\n\tquery.exec((err, modules) => {\n\t\tif (err) {\n\t\t\tres.status(400).json({message: `Following error was encountered: ${err}`});\n\t\t} else if (!modules) {\n\t\t\tres.status(404).json({message: 'No modules found.'});\n\t\t} else {\n\t\t\tres.status(200).json(modules);\n\t\t}\n\t});\n}", "getModuleList() {\n return this.http.get(this.url + '/cesco/getmodule', this.httpOptions);\n }", "function getModules() {\n\n queries.executeRequest('GET', 'permissions/modules')\n .then(function (result) {\n if (result.success) {\n $scope.modules = result.data;\n }\n });\n }", "async function exploreModules(auth) {\n const mapping = readModuleMapping();\n const modulesInfo = await queryModulesAPI(auth);\n // Filter out modules that haven't been mapped in MODULES.txt\n const filteredModulesInfo = modulesInfo.filter(moduleInfo => {\n return Object.keys(mapping).includes(moduleInfo['name']);\n });\n // Map module codes according to user-defined module mappings\n const modules = filteredModulesInfo.map(moduleInfo => {\n return new Module(moduleInfo['id'], mapping[moduleInfo['name']], moduleInfo['courseName']);\n });\n\n // Recursively explore its children for folders\n const promises = modules.map(module => {\n return new Promise(async (resolve, reject) => {\n if (PRINT) console.log('Exploring ' + module.code + ': ' + module.name + ' ...');\n const folders = await exploreFolders(auth, module.id);\n module.populateFolders(folders);\n resolve();\n });\n });\n await Promise.all(promises);\n if (PRINT) console.log();\n\n return modules;\n}", "async function getAllModules(type, role_id = null) {\n let conditions = { parent_id: null, type };\n let conditions_lookup_childs = {\n $expr: {\n $eq: [\"$parent_id\", \"$$id\"],\n }\n };\n let sort = { sort: 1, _id: -1 };\n\n if (role_id === null) {\n let opt = [\n {\n $lookup: {\n from: \"tbl_modules\",\n let: { id: \"$_id\" },\n pipeline: [\n { $match: conditions_lookup_childs },\n { $sort: sort }\n ],\n as: \"childs\"\n }\n },\n { $match: conditions },\n { $sort: sort },\n {\n $project: {\n name: 1,\n position: 1,\n icon: 1,\n component: 1,\n link: 1,\n childs: 1,\n publish: 1,\n title: 1\n }\n }\n ];\n return Module.aggregate(opt).then(modules => {\n let arr_module = [];\n modules.forEach(row => {\n if (row.childs.length > 0 || row.component !== '') {\n arr_module.push(row);\n }\n });\n return { modules: arr_module };\n });\n } else if (type === BE) {\n // find role of user\n return RoleAccess.find({}, { list_action: 1, controller: 1 }).then(async (roles) => {\n let results = {};\n if (roles.length > 0) {\n await Promise.all(roles.map(async (role) => {\n const conditions = { role_id, controller: role.controller };\n return RoleAccess.findOne(conditions, { list_action: 1, controller: 1 }).then(roles_user => {\n let list_action = [];\n if (roles_user) {\n list_action = roles_user.list_action.filter(action => {\n if (role.list_action.indexOf(action) !== -1) return true;\n return false;\n });\n }\n return { [role.controller]: list_action };\n });\n })).then(roles => {\n let new_roles = {};\n roles.forEach(role => {\n new_roles = merge(new_roles, role);\n });\n results.roles = new_roles;\n });\n\n let arr_controllers = [\"\"];\n for (var controller in results.roles) {\n if (results.roles.hasOwnProperty(controller)) {\n if (results.roles[controller].length > 0) {\n arr_controllers.push(controller);\n }\n }\n }\n conditions.component = { $in: arr_controllers };\n // conditions.childs = { $not: { $size: 0 } };\n conditions_lookup_childs.component = { $in: arr_controllers };\n }\n else results.roles = [];\n\n let opt = [\n {\n $lookup: {\n from: \"tbl_modules\",\n let: { id: \"$_id\" },\n pipeline: [\n { $match: conditions_lookup_childs },\n { $sort: sort }\n ],\n as: \"childs\"\n }\n },\n { $match: conditions },\n { $sort: sort },\n {\n $project: {\n name: 1,\n icon: 1,\n component: 1,\n link: 1,\n childs: 1,\n publish: 1,\n title: 1\n }\n }\n ];\n return Module.aggregate(opt).then(modules => {\n let arr_module = [];\n modules.forEach(row => {\n if (row.childs.length > 0 || row.component !== '') {\n arr_module.push(row);\n }\n });\n results.modules = arr_module;\n return results;\n });\n });\n }\n}", "function requestModuleListData() {\n cr.sendWithPromise('requestModuleList').then(returnModuleList);\n}", "static getModules(modules, container){\n\t\t/* Add modules */\n\t\tvar res = new Vector();\n\t\tvar cache = new Map();\n\t\tthis._getModules(res, cache, modules, container);\n\t\tres = res.removeDublicatesIm();\n\t\treturn res.toCollection();\n\t}", "function getTutorialsOfModule(req, res) {\n\t// Get projectID from query parameters to fetch only project's tutorials\n\t// Create query to get tutorials by projectID\n\tconst tutorialModuleID = req.params.moduleID;\n\tconst query = Tutorial.find({tutorialModuleID});\n\n\t// Execute query and return all modules that have the same projectID\n\tquery.exec((err, tutorials) => {\n\t\tif (err) {\n\t\t\tres.status(400).json({message: `Following error was encountered: ${err}`});\n\t\t} else if (!tutorials) {\n\t\t\tres.status(404).send('No tutorials found.');\n\t\t} else {\n\t\t\tres.status(200).json(tutorials);\n\t\t}\n\t});\n}", "function getAllModules () {// jshint ignore:line\n\tvar modules = [\n\t\t'combat',\n\t\t'inventory/bank',\n\t\t'quest',\n\t\t'skill/common',\n\t\t'skill/farming',\n\t\t'skill/firemaking',\n\t\t'skill/invention'\n\t];\n\n\tvar ArrayList = Java.type('java.util.ArrayList');\n\n\t//Need to wrap the response in an ArrayList so Java can understand it\n\treturn new ArrayList(modules);\n}", "getModules(){\n return this.#fetchAdvanced(this.#getModulesURL()).then((responseJSON) => {\n let moduleBOs = ModuleBO.fromJSON(responseJSON);\n // console.info(moduleBOs);\n return new Promise(function (resolve) {\n resolve(moduleBOs);\n })\n })\n\n }", "function repoList(req, res, template, block, next) {\n\n var Repo = calipso.db.model('Repo');\n var type = req.moduleParams.type || \"module\";\n\n // TODO - Add pager\n\n Repo.find({type:type})\n .sort('name')\n .limit(100)\n .find(function(err,all) {\n calipso.theme.renderItem(req,res,template,block,{\n type:type,\n all:all\n },next);\n\n });\n\n}", "function getAllDocuments (req, res) {\n Documents.query().then(data => res.json(data));\n\n}", "function getModules(getModulesCallback) {\n canvas.get(`/api/v1/courses/${course.info.canvasOU}/modules`, function (err, modules) {\n if (err) {\n course.error(err);\n getModulesCallback(err);\n return;\n }\n // due to async nature of the programm, sometimes it may need some\n // time delay before it starts getting the modules\n // the if {...} handles that issue\n if (modules.length === 0) {\n course.warning(`Course modules have not loaded yet for the \"${courseName}\" course (canvasOU: ${course.info.canvasOU}). Trying again.`);\n getModules(getModulesCallback);\n return;\n }\n getModulesCallback(null, modules);\n });\n }", "getAll(req, res) {\n // Blank .find param gets all\n Assembly.find({})\n .then(Assemblies => res.json(Assemblies))\n .catch(err => res.status(400).json(err))\n }", "async function getModules(){\n await microcredapi.get(`/unit/${unitId}/${window.localStorage.getItem('userId')}`).then(response => {\n setCanSubmit(response.data.submittable)\n let publishedModulesCount = 0;\n const updatedModules = []\n const grade = {\n finalGrade: response.data.finalGrade,\n cumulativeScore: response.data.cumulativeScore\n }\n response.data.modules.map((module, key) => {\n const newModule = {\n ...module, \n // use Object.keys() to handle key value mismatch\n numAttempts: response.data.numAttempts[key+ parseInt(Object.keys(response.data.numAttempts)[0])],\n highestScore: response.data.highestScore[key+ parseInt(Object.keys(response.data.highestScore)[0])],\n }\n console.log(module);\n if(module.published){publishedModulesCount = publishedModulesCount + 1}\n updatedModules.push(newModule)\n return true\n })\n console.log(publishedModulesCount);\n setPublishedModules(publishedModulesCount)\n setModules(updatedModules)\n setGrade(grade)\n \n })\n \n }", "GetAllDocuments() {\n return this.Start().then(Cache.DB).then(db => new Promise((resolve, reject) => {\n db.all('SELECT id, rev, body FROM couchbasesync WHERE dbName = ?', this[sDbName], (err, rows) => {\n if (err) {\n return reject(err);\n }\n\n const docs = [];\n rows.forEach((row) => {\n let JSONData = {};\n try {\n JSONData = JSON.parse(row.body);\n } catch (e) {\n this.emit('error', `Failed to parse JSON object for document body: ${row.id}`);\n }\n\n docs.push({\n id: row.id,\n rev: row.rev,\n doc: JSONData,\n });\n });\n\n return resolve(docs);\n });\n }));\n }", "getAll(req, res) {\n const { page, limit } = req.params;\n\n return Document.find({})\n .skip((page - 1) * limit)\n .limit(limit)\n .then((documents) => res.json(documents))\n .catch((err) => res.send(err));\n }", "async [FETCH_MODULES]({ commit }, successRoute) {\n // If user is logged in 'data' will contain an array of module data.\n // Otherwise 'data' will contain an error message.\n try {\n const { data } = await callApi(MODULES_URL);\n const { message } = data;\n\n if (message === 'NOT_AUTHORIZED') {\n router.push('/login');\n return;\n }\n\n const { entities } = normalize(data, moduleSchema);\n const { modules, reactions } = entities;\n\n commit(LOAD_MODULES, modules);\n commit(LOAD_REACTIONS, reactions);\n commit(FETCH_MODULES_SUCCESS);\n\n if (successRoute) {\n router.push(successRoute);\n }\n } catch (error) {\n console.log(error);\n }\n }", "function getAllItems(modules, getItemsCallback) {\n asyncLib.map(modules, getModuleItems, function (err, allItems) {\n if (err) {\n course.error(err);\n getItemsCallback(err);\n return;\n }\n getItemsCallback(null, allItems);\n });\n }", "getModules(pkg: Package): Module[] {\n return this.modules.get(pkg) || []\n }", "function list() {\n return db.allDocs({\n /*This tells the server to get all docs that start with article*/\n startkey: 'article',\n endkey: 'article{}',\n inclusive_end: true,\n /*Include not just the key but all fields*/\n include_docs: true\n })\n .then(function(res) {\n console.log(res.rows);\n return res.rows.map(function(r) {\n return r.doc;\n });\n });\n }", "async function getAllDocsAndFoldersFromCatalog() {\n\n var docsArray = [];\n var foldersArray = [];\n\n try {\n docsArray = await catalog.docs.toArray();\n foldersArray = await catalog.folders.toArray();\n } catch (error) {\n handleError(\"[CATALOG] Couldn't get all docs or folders from catalog\", error);\n return false;\n }\n\n return docsArray.concat(foldersArray);\n\n}", "function getAllModuleLicenses(callback)\n {\n getModuleLicenses(\"all\", callback);\n }", "getModules() { return this.fModuleList; }", "async getAll() {\n let items = [];\n let collection = await this.collection();\n await collection.find({}).forEach((item) => {items.push(item)});\n this.dbClient.close();\n return items;\n }", "async getAll(){\n let db;\n try {\n db = await mongo.getConnection();\n } catch (e) {\n throw e;\n }\n let collection = db.collection(\"games\");\n let result;\n try {\n result = await collection.find();\n } catch (e) {\n throw e;\n }\n return result;\n }", "async function getDocuments() {\n const snapshot = await collectionG1.get();\n\n if (snapshot.empty) {\n console.log(\"No documents found...\");\n return;\n } else {\n // List with data of documents\n var docsList = snapshot.docs.map((doc) => doc.data());\n // List with documents\n // var docsList = snapshot.docs.map((doc) => doc);\n return docsList;\n }\n}", "async function getDocument(req, res, next){\n\n document.findAll({ attributes: ['name'] })\n .then(document => {\n res.status(200).send(document)\n })\n .catch(err => {\n res.status(400).send(e);\n })\n}", "getAllDocumentsByRoleAdministrator(req, res) {\n const { page, limit } = req.params;\n\n return Document.find({})\n .populate('ownerId')\n .skip((page - 1) * limit)\n .limit(limit)\n .sort([['dateCreated', 'descending']])\n .then((documents) => {\n const filtered = documents.filter(\n (obj) => obj.ownerId.role === 'Administrator',\n );\n\n return res.json(filtered);\n })\n .catch((err) => res.send(err));\n }", "async getAllProcess() {\n const processList = [];\n const snapshot = await firebase.firestore().collection('process').get();\n snapshot.forEach(doc => {\n processList.push(doc.data());\n });\n return processList;\n }", "function getListItems() {\n var request = $http({\n method: \"get\",\n url: \"/api/documents\",\n params: {\n action: \"get\"\n }\n });\n\n return(request.then(handleSuccess, handleError));\n }", "static async getAll() {\n let projection = {\n shipmentStatus: 1,\n referenceNo: 1,\n courier: 1,\n receivedBy: 1,\n nosOfSamples: 1\n };\n try {\n let result = await DatabaseService.getAll(collectionName, projection);\n return result;\n } catch (err) {\n throw err;\n }\n }", "function repoFindJson(req, res, template, block, next) {\n\n var Repo = calipso.db.model('Repo');\n var query = req.moduleParams.query || \"*\";\n var type = req.moduleParams.type || \"module\";\n\n // Deal with wildcards\n var qryRegex = new RegExp(query,\"ig\");\n\n Repo.find({type:type, $or: [{name: qryRegex}, {description: qryRegex}] })\n .sort('name')\n .limit(10)\n .find(function(err,all) {\n var op = all.map(function(a) {\n return {name:a.name,\n description:a.description,\n author:a.author,\n versions:a.versions.map(function(b){\n return {version:b.version,url:b.url}\n })\n\n };\n });\n res.end(JSON.stringify(op),'UTF-8');\n });\n\n}", "async function getModuleInfoFromFirebase() {\n console.log(module.value);\n db.collection('modules')\n .doc(module.value)\n .get()\n .then((doc) => {\n setModuleVideos(doc.data());\n });\n }", "getPublications() {\n return this.perform('get', '/publications');\n }", "async function getContacts(){\n const contacts = await loadContacts('[DB_NAME]','[COLLECTION]','[MONGO_CONNECTION_STRING]'); //CONNECT TO MONGO\n const res = await contacts.find().toArray(); //GET THE CONTACTS\n return res\n}", "function getAllItemsREST(callback) {\n\tvar PATH = \"/items/_all_docs?include_docs=true\";\n\tvar options = {\n\t\thostname : CLOUDANT_REST_URL,\n\t\tport : '80',\n\t\tpath : PATH,\n\t\tmethod : 'GET',\n\t\theaders : {\n\t\t\t 'Authorization': 'Basic MmJlMjg0NTctY2JhNy00NDlhLWE4NzAtYjFjYWE0NWQ5MzUwLWJsdWVtaXg6MjRjNzI5NWFkOWM5OWQ5NmQ4Y2JmYmEzZGVlYzdmODU1ZGU2NTA0ODY2ZTcyYzc2YWZjMjQ0Y2FiZTJjNzk3Mg=='\n\t\t},\n\t\trejectUnauthorized : false,\n\t\tagent : false,\n\t};\n\tvar req = http.request(options, function(res) {\n\t\tvar resultString = '';\n\t\tres.on('data', function(chunk) {\n\t\t\tconsole.log('get response: ' + chunk);\n\t\t\tresultString += chunk;\n\t\t});\n\t\tres.on('error', function(c) {\n\t\t\tconsole.log('get error: ' + c);\n\t\t});\n\t\tres.on('end', function() {\n\t\t\tconsole.log('get status ' + res.statusCode);\n\t\t\tif (res.statusCode === 200) {\n\t\t\t\tcallback(JSON.parse(resultString));\n\t\t\t} else {\n\t\t\t\tcallback(); // error case\n\t\t\t}\n\t\t});\n\t});\n\treq.end();\n}", "function getAll (){\n return Mentor.find({});\n}", "function repoGetJson(req, res, template, block, next) {\n\n var Repo = calipso.db.model('Repo');\n var type = req.moduleParams.type || \"module\";\n var name = req.moduleParams.name || \"\";\n var version = req.moduleParams.version || \"master\";\n\n // TODO - Add pager\n Repo.find({type:type, name:name})\n .sort('name')\n .limit(10)\n .find(function(err,all) {\n var op = all.map(function(a) {\n return {name:a.name,\n description:a.description,\n versions:a.versions.map(function(b){\n return {version:b.version,url:b.url}\n })\n };\n });\n res.end(JSON.stringify(op),'UTF-8');\n });\n\n}", "async function getCollection(accessToken,url) {\n let res;\n const collection = [];\n console.log({accessToken})\n while(url) {\n res = await request(url,{\n headers:{\n \"Authorization\":`Bearer ${accessToken}`\n }\n });\n let page = await res.json();\n console.log(\"got page\",{page})\n collection.push(...page.entries);\n url = page.next_collection_link;\n }\n return collection;\n}", "function getDocLibraryList() {\n $scope.loading = true;\n DocLibraryService.getDocLibraryList().then(\n function (response) {\n $scope.loading = false;\n if (response.data.Error) {\n ToastrService.error(response.data.message)\n } else {\n vm.docsForMapping = response.data.documents;\n // vm.docsForMapping = $filter('filter')(vm.docsForMapping, { 'settings': settings.length });\n }\n },\n function (err) {\n ToastrService.error($rootScope.errorMsgs.MSG201);\n }\n )\n }", "function getMovies() {\n MovieService.movies().then(res => {\nconsole.log(res.data.rows)\n let movies = res.data.rows;\n movies = movies.map((obj) => obj.doc);\n displayMovies(movies)\n })\n .catch((err) => {\n console.error(err);\n });\n\n}", "static async getAll() {\n try {\n let result = await DatabaseService.getAll(collectionName);\n return result;\n } catch (err) {\n throw err;\n }\n\n }", "async function getCourses() {\n const courses = await Course.find({ author: \"Mosh\", isPublished: true });\n console.log(courses);\n}", "function getContributions(callback){\n db.collection(\"pollination\").find().toArray(callback);\n }", "getAll(request, response, next) {\n this.model.find({}, (err, data) => {\n if (err) {\n return next(err);\n }\n response.json(data);\n });\n }", "function load () {\n const modules = registerModules(api)\n\n api.modules = modules\n\n return Promise.resolve(modules)\n }", "getModulesForCurrentCourse(callback, error) {\n const courseId = this.getCurrentCourseId();\n this.listModulesForCourse(callback, error, courseId);\n }", "find_modules(flow){\n let modules = {}\n\n let nodes = flow.flow.nodes;\n\n for(var i = 0; i < nodes.length; i++){ \n modules[nodes[i].module_name] = this.modules[nodes[i].module_name]\n }\n \n let retArr = []\n for(var k in modules){\n modules[k].uuid = uuid.v4()\n retArr.push(modules[k])\n }\n return retArr\n }", "async function getBooks() {\r\n\ttry{\r\n\t\t// lean() transforms mongoose object to json object\r\n\t\tconst data = await newBoek.find().lean();\r\n\t\treturn data;\r\n\t} catch (error) {\r\n\t\tconsole.log('getBooks failed ' + error);\r\n\t}\r\n}", "async function getCourses() {\n\n const pageNumber = 2;\n const pageSize = 10;\n\n const courses = await Course\n .find({ author: 'Vivek', isPublished: true })\n // .find()\n // .or([ {author: 'Vivek'}, {isPublished: false} ])\n // .and([])\n\n // // starts with Vivek\n // .find({ author: /^Vivek/ })\n // // ends with Malhan\n // .find({ author: /Malhan$/i }) // i for case-insensitive\n // // contains Vivek\n // .find({ author: /.*Vivek.*/ })\n\n // pagination - to get the documents in the given page\n .skip((pageNumber - 1) * pageSize)\n .limit(pageSize)\n\n .sort({ name: 1 })\n .select({ name: 1, tags: 1, author: 1, isPublished: 1 })\n // .estimatedDocumentCount();\n console.log(courses);\n}", "_fetchModules(){\n var directories = fs.readdirSync('./features/');\n for (let directory of directories){\n if (!directory.includes('.')) { //means is a directory\n this._requireModules('./features/' + directory, directory);\n }\n }\n }", "function getAllModuleService(tick) {\n try {\n return baseSvc.executeQuery(getModuleUrl, { tick: tick });\n } catch (e) {\n throw e;\n }\n }", "function getDescribeObjects(accessibleModules, moduleName, callback) {\n\t\tvtinst.describeObject(moduleName, handleError(function (result) {\n\t\t\tvar parent = referencify(result);\n\t\t\tvar fields = parent['fields'];\n\t\t\tvar referenceFields = filter(function (e) {\n\t\t\t\treturn e['type']['name'] == 'reference';\n\t\t\t},\n\t\t\t\t\tfields);\n\t\t\tvar referenceFieldModules =\n\t\t\t\t\tmap(\n\t\t\t\t\t\t\tfunction (e) {\n\t\t\t\t\t\t\t\treturn e['type']['refersTo'];\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\treferenceFields\n\t\t\t\t\t\t\t);\n\t\t\tfunction union(a, b) {\n\t\t\t\tvar newfields = filter(function (e) {\n\t\t\t\t\treturn !contains(a, e);\n\t\t\t\t}, b);\n\t\t\t\treturn a.concat(newfields);\n\t\t\t}\n\t\t\tvar relatedModules = reduceR(union, referenceFieldModules, [parent['name']]);\n\n\t\t\t// Remove modules that is no longer accessible\n\t\t\trelatedModules = diff(accessibleModules, relatedModules);\n\n\t\t\tfunction executer(parameters) {\n\t\t\t\tvar failures = filter(function (e) {\n\t\t\t\t\treturn e[0] == false;\n\t\t\t\t}, parameters);\n\t\t\t\tif (failures.length != 0) {\n\t\t\t\t\tvar firstFailure = failures[0];\n\t\t\t\t\tcallback(false, firstFailure[1]);\n\t\t\t\t} else {\n\t\t\t\t\tvar moduleDescriptions = map(function (e) {\n\t\t\t\t\t\treturn referencify(e[1]);\n\t\t\t\t\t},\n\t\t\t\t\t\t\tparameters);\n\t\t\t\t\tvar modules = dict(map(function (e) {\n\t\t\t\t\t\treturn [e['name'], e];\n\t\t\t\t\t},\n\t\t\t\t\t\t\tmoduleDescriptions));\n\t\t\t\t\tcallback(true, modules);\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar p = parallelExecuter(executer, relatedModules.length);\n\t\t\t$.each(relatedModules, function (i, v) {\n\t\t\t\tp(function (callback) {\n\t\t\t\t\tvtinst.describeObject(v, callback);\n\t\t\t\t});\n\t\t\t});\n\t\t}));\n\t}", "getAll() {\r\n return __awaiter(this, void 0, void 0, function* () {\r\n return yield this.repository.find();\r\n });\r\n }", "getAll() {\r\n return __awaiter(this, void 0, void 0, function* () {\r\n return yield this.repository.find();\r\n });\r\n }", "async function getMenu() {\n return new Promise(async (resolve, reject) => {\n let allProducts = await productCollection.find({}, { _id: 0 }).toArray();\n resolve(allProducts);\n });\n }", "_loadModules() {\n const modules = includeAll({\n dirname: this.loadPath,\n filter: this.filter\n });\n\n Object.keys(modules).forEach(module => {\n const moduleName = module.toLowerCase()\n .replace(\"_\", \"\")\n .replace(\"-\", \"\")\n .replace(this.type, \"\");\n\n const key = inflect.singularize(moduleName);\n\n if (!modules[key]) {\n modules[key] = modules[module];\n\n delete modules[module];\n }\n });\n\n return modules;\n }", "static async getAllAlbum(req, res, next) {\n try {\n const galleries = await gallery.findAll({\n attributes: ['albumId'],\n group: ['albumId'],\n })\n res.status(200).json(galleries)\n } catch (error) {\n next(error)\n }\n }", "static async getTasksByModule(module) {\n try {\n let res = await axios.get(`${url}/getByModule/${module}`);\n let data = res.data;\n if (data != 'No Tasks.') {\n return data;\n }\n }\n catch (err) {\n console.log(err);\n return [];\n }\n }", "function getListOfModulesAndCreateModules(projectAttachment, configs) {\n\t\tExt.Ajax.request({\n\t\t\tmethod : \"GET\",\n\t\t\turl : projectAttachment + \"/projectModules\",\n\t\t\tscope : this,\n\t\t\tsuccess : function (response) {\n\t\t\t\tvar json = Ext.decode(response.responseText);\n\t\t\t\tExt.each(json.data, function (projectModule) {\n\t\t\t\t\tvar projectConfig = findProjectModuleConfig(configs, projectModule.id);\n\t\t\t\t\tif (!Ext.isEmpty(projectConfig)) {\n\t\t\t\t\t\tvar configModule = Ext.applyIf(projectConfig, projectModule\t|| {});\n\t\t\t\t\t\tvar module = createModule(configModule);\t\t\t\t\t\t\n\t\t\t\t\t\tSitoolsDesk.app.modules.push(module);\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tExt.Msg.alert(i18n.get('label.error'), String.format(i18n\n\t\t\t\t\t\t\t\t\t\t\t.get('label.undefinedModule'),\n\t\t\t\t\t\t\t\t\tprojectModule.name));\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t//if all includes are done, Add 1 to the modulesCharges \n\t\t\t\t\t\tSitoolsDesk.modulesCharges++;\n\t\t\t\t\t\t//test if all modules are loaded.\n\t\t\t\t\t\tif (SitoolsDesk.modulesCharges === SitoolsDesk.modulesACharger) {\n\t\t\t\t\t\t\t//End of loading all Javascript files. \n\t\t\t\t\t\t\tSitoolsDesk.app.fireEvent('allJsIncludesDone', this);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\t\t\t\t\t\n\t\t\t\t}, this);\n\t\t\t},\n\t\t\tfailure : alertFailure\n\t\t});\t\t\n\t}", "async function getAll(){\n const roomCollections = await rooms();\n const targets = await roomCollections.find({}).toArray();\n return targets;\n}", "listModulesForCourse(callback, error, cid) {\n let href = `/api/v1/courses/${cid}/modules?per_page=100`;\n $.getJSON(href, modules => {\n const noOfModules = modules.length;\n let asyncsDone = 0;\n modules.forEach((module, index) => {\n const href = `/api/v1/courses/${cid}/modules/${\n module.id\n }/items?per_page=100`;\n $.getJSON(\n href,\n (function(j) {\n return function(items) {\n modules[j].items = items;\n asyncsDone++;\n\n asyncsDone === noOfModules && callback(modules);\n };\n })(index) // calling the function with the current value\n );\n });\n });\n }", "async function getCourses(){\r\n const pageNumber = 2;\r\n const pageSize=10;\r\n \r\n const courses= await Course\r\n .find({ author : 'Mosh', isPublished :true})\r\n .skip( (pageNumber-1) * pageSize )\r\n //formula for pagination is pagenumber-1 * pagesize\r\n .limit(10)\r\n .sort({name: 1})\r\n //.select({ name:1 , tags: 1}); \r\n //instead of displaying the data of documents we need to display the count of documents so we use .count()\r\n .count();\r\n console.log(courses);\r\n}", "static getAllProject(req, res, next) {\n let id = new ObjectId(req.decoded.id);\n Project.find({\n member: {\n $in: [id]\n }\n })\n .then(response => {\n if (response.length > 0) {\n res.status(200).json(response);\n } else {\n throw {\n status: 400,\n message: \"No have Project\"\n };\n }\n })\n .catch(next);\n }", "function getModuleItems(module, getModuleItemsCallback) {\n canvas.get(`/api/v1/courses/${course.info.canvasOU}/modules/${module.id}/items`, function (err, moduleItems) {\n if (err) {\n course.error(err);\n getModuleItemsCallback(err);\n return;\n }\n getModuleItemsCallback(null, moduleItems);\n });\n }", "async function fetchModule() {\n\t\t\t const module = await getUserModule(userId, instanceId);\n\t\t\t setModule(module);\n\n\t\t\t // Setting up audio message ref (if any audio message is present).\n\t\t\t if (module.audioMessageURL) {\n\t\t\t\t audioMessageRef.current = new Audio(module.audioMessageURL);\n\t\t\t }\n\n\t\t\t // Getting the module's author info\n\t\t\t const user = await getUserDocument(userId);\n\t\t\t setUser(user);\n\t\t}", "getAllDocumentsByRoleUser(req, res) {\n const { page, limit } = req.params;\n\n return Document.find({})\n .populate('ownerId')\n .skip((page - 1) * limit)\n .limit(limit)\n .sort([['dateCreated', 'descending']])\n .then((documents) => {\n const filtered = documents.filter((obj) => obj.ownerId.role === 'User');\n\n return res.json(filtered);\n })\n .catch((err) => res.send(err));\n }", "function fetchListAndDocuments(page, per_page) {\n return fetchList(page, per_page)\n .then((collection) => {\n return Promise.all(collection.map((item) => fetchDocument(item)));\n });\n}", "function getModules( category ) {\n\tvar query = \"\";\n\t\n\tinitializeDB();\n\t\n\tdb.transaction( function( tx ){\n\t\tvar htmlContent = '';\n\t\t$( \"#general_form\" ).html( \"\" );\n\t\t$( \"#general_form\" ).trigger( \"refresh\" );\n\t\t\n\t\tvar lsearch = getLocalValue( \"search_word\" );\n\t\tvar lsearchId = getLocalValue( \"search_id\" );\n\t\t\n\t\tif(lsearch.length > 0) {\n\t\t\tquery = \"SELECT * FROM \" + tableModules + \" WHERE name LIKE '%\" + lsearch + \"%'\";\n\t\t\twindow.localStorage.setItem( \"search_word\", \"\" );\n\t\t}\n\t\telse if( lsearchId.length > 0 ) {\n\t\t\tquery = \"SELECT * FROM \" + tableModules + \" WHERE id = \" + lsearchId;\n\t\t\twindow.localStorage.setItem( \"search_id\", \"\" );\n\t\t}\n\t\telse {\n\t\t\t/* Query for fixed modules */\n\t\t\tquery = \"SELECT * FROM \" + tableModules + \" WHERE category = \" + category;\n\t\t}\n\t\tconsole.log(\"consulta: \" + query);\n\t\ttx.executeSql( query, [], function( tx, result ) {\n\t\t\tvar len = result.rows.length;\n\t\t\t//--htmlContent = '<fieldset data-role=\"controlgroup\" data-iconpos=\"right\" id=\"category_modules\">';\n\t\t\t$(\"#general_form\").html( \"\" );\n\t\t\tfor( var i = 0; i < len; i++ ) {\n\t\t\t\thtmlContent += '<li data-icon=\"false\" class=\"listado1\">';\n\t\t\t\tconsole.log(\"el valor de i \" + i);\n\t\t\t\tconsole.log(\"el valor de otro id \" + result.rows.item(i).id);\n\n\t\t\t\tif( result.rows.item(i).image.length > 0 )\n\t\t\t\t\thtmlContent += '<img src=\"images/productos/' + result.rows.item(i).image + '\" width=\"60\" />';\n\t\t\t\telse\n\t\t\t\t\thtmlContent += '<img src=\"images/productos/icon_product2.png\" width=\"60\" />';\n\t\t\t\t\n\t\t\t\thtmlContent += '<h2><span id=\"name_item_' + result.rows.item(i).id + '\">' + result.rows.item(i).name + '</span></h2>';\n\t\t\t\thtmlContent += '<p><span class=\"note\">Cantidad: </span>';\n\t\t\t\thtmlContent += '<span id=\"stock_value_' + result.rows.item(i).id + '\">' + result.rows.item(i).quantity + '</span>';\n\t\t\t\thtmlContent += ' <span class=\"note\">Costo (Bs): </span>';\n\t\t\t\thtmlContent += '<span id=\"stock_cost_' + result.rows.item(i).id +'\">';\n\t\t\t\t\n\t\t\t\tif( result.rows.item(i).cost.length > 0 )\n\t\t\t\t\thtmlContent += result.rows.item(i).cost;\n\t\t\t\telse\n\t\t\t\t\thtmlContent += \"175\";\n\t\t\t\t\n\t\t\t\thtmlContent += '</span>';\n\t\t\t\t//--htmlContent += '<div class=\"pedidos\">';\n\t\t\t\thtmlContent += '<div class=\"ui-grid-a\">';\n\t\t\t\thtmlContent += '<div class=\"ui-block-a\">';\n\t\t\t\thtmlContent += '<input ';\n\t\t\t\thtmlContent += ' onblur=\"showAllToolbars(' + result.rows.item(i).id + ')\"';\n\t\t\t\t\n\t\t\t\thtmlContent += ' onclick=\"hideAllToolbars(\\'custom_value_' + result.rows.item(i).id + '\\', ' + result.rows.item(i).id + ')\"';\n\t\t\t\t//--htmlContent += ' onfocus=\"hideAllToolbars(\\'custom_value_' + result.rows.item(i).id + '\\', ' + result.rows.item(i).id + ')\"';\n\t\t\t\t//--htmlContent += ' onchange=\"changeValues(\\'custom_value_' + result.rows.item(i).id + '\\',' + result.rows.item(i).id + ')\"';\n\t\t\t\thtmlContent += ' id=\"custom_value_' + result.rows.item(i).id + '\" class=\"bigInput\" ';\n\t\t\t\thtmlContent += ' type=\"number\" data-mini=\"true\" value=\"\" size=\"3\" />';\n\t\t\t\thtmlContent += '</div>';\n\t\t\t\thtmlContent += '<div class=\"ui-block-b\">';\n\t\t\t\t//--htmlContent += '<input type=\"button\" class=\"order_button\" id=\"order_button_' + result.rows.item(i).id + '\" name=\"order_button_' + result.rows.item(i).id + '\" ';\n\t\t\t\thtmlContent += '<input type=\"button\" class=\"order_button\" id=\"' + result.rows.item(i).id + '\" name=\"order_button_' + result.rows.item(i).id + '\" ';\n\t\t\t\thtmlContent += ' data-inline=\"true\" data-mini=\"true\" data-theme=\"c\" value=\"Pedir\" class=\"bigInput2\"';\n\t\t\t\thtmlContent += ' onclick=\"changeValues(\\'custom_value_' + result.rows.item(i).id + '\\',' + result.rows.item(i).id + ')\" data-icon=\"check\" />';\n\t\t\t\thtmlContent += '</div>';\n\t\t\t\thtmlContent += '</div>';\n\t\t\t\t//--htmlContent += '</div>';\n\t\t\t\thtmlContent += '</p>';\n\t\t\t\thtmlContent += '</li>';\n\t\t\t}\n\t\t\t\n\t\t\t//--htmlContent += '</fieldset>';\n\t\t\t\n\t\t\t$(\"#general_form\").html( $(\"#general_form\" ).html() + htmlContent );\n\t\t\t$(\"#general_form\").listview(\"refresh\");\n\t\t\t$(\"#general_form\").trigger( \"create\" );\n\t\t\t\n\t\t\tif( populateDatabase ) {\n\t\t\t\tpopulateList();\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}, errorCB );\n\t}, errorCB, successCB );\n}", "function getAllByID(db, ids, cb) {\n // Does a bulk get request...one request gets all of the documents given by their ids\n dbService.bulkFetchFunction(db,ids, (err, body) => {\n if (err) {\n\t\tconsole.log(err)\n cb(err);\n } else {\n\t\tconsole.log(db,' bulkFetchFunction results ', ids)\n\t\tconsole.log(body)\n\t\tvar documents = body.flatMap(item => item.docs);\n\t\tdocuments = documents.map(item => item.ok);\n // var documents = _.map(body, 'doc');\n\t \n cb(null, documents);\n }\n });\n}", "function getAllFields(){\n\t\t\t\n ModulesService.getModuleByName('users').then(function(response){\n $scope.fields = response.fields;\n $scope.id = response._id;\n \n $scope.fieldsLength = Object.size(response.fields);\n \n }).catch(function(err){\n alert(err.msg_error);\n });\n }", "static async getAllGallery(req, res, next) {\n try {\n const galleries = await gallery.findAll(\n {\n attributes: {\n exclude: ['updatedAt', 'createdAt']\n }\n }\n )\n res.status(200).json(galleries)\n } catch (error) {\n next(error)\n }\n }", "function getAllRobots(db, callback){\n\n // Get the robots collection\n var collection = db.collection('robots');\n\n // Read all the robots\n collection.find({}).toArray(function (err, docs) {\n\n console.log(docs);\n\n callback();\n\n });\n\n\n}", "get(req, res) {\n const { id } = req.params;\n\n return Document.find({ _id: id })\n .then((documents) => res.json(documents))\n .catch((err) => res.send(err));\n }", "async function getCourses() {\n const allCourses = await Course.find();\n console.log(allCourses);\n}", "async getDocs(req) {\n const limit = 50\n let skip = 0\n const { getCollection, generateSearch } = this.imports\n const { page, postType, category } = req.params\n const collection = await getCollection()\n let search = {}\n\n if (page) {\n skip = (page - 1) * limit\n }\n\n if (postType) {\n search['cms.postType'] = postType\n }\n\n if (category) {\n search['properties.category'] = {\n $in: [category],\n }\n }\n\n search = generateSearch(search)\n const docs = await collection\n .find(search)\n .limit(limit)\n .skip(skip)\n .sort({ indexDate: 'desc' })\n .exec()\n return docs\n }", "function pesquisarModulos() {\n\n apiService.get('/api/menu/modulos', null,\n moduloLoadCompleted,\n moduloLoadFailed);\n }", "function allProjects(){\n return new Promise((resolve,reject) => {\n projectModel.find((err,docs) => {\n if (err){\n return reject(err)\n }\n else{\n resolve(docs)\n }\n })\n })\n}", "async getAllByLevel(req, res) {\n StudentServices.getAllByLevel([\n req.params.levelid,\n req.params.year,\n req.params.pagenumber\n ])\n .then((students) => {\n res.status(students.status).send({\n status: students.status,\n message: students.message,\n students: students.students.rows,\n totalPages:students.totalPages\n });\n })\n .catch((err) => {\n res.status(400).send({\n message: err.message,\n });\n });\n }", "async function getListCourse() {\n return await Course\n .find({isPublished: true})\n .or([\n {price: {$gte: 15}}\n , {name: /.*by.*/i}\n ])\n .sort({name: 1})\n .select({name: 1, author: 1});\n}", "function readRequests(findParams, callback, collectionName){\n var client = new MongoClient(url);\n client.connect((err)=>{\n assert.equal(null, err);\n //console.log(\"Connected successfully to server\");\n\n const db = client.db(dbName);\n const collection= db.collection(collectionName)\n\n collection.find(findParams).toArray(function(err, docs) {\n assert.equal(err, null);\n callback(docs)\n });\n client.close();\n })\n}", "function getTutorialsOfProject(req, res) {\n\t// Get projectID from query parameters to fetch only project's tutorials\n\t// Create query to get tutorials by projectID\n\tconst tutorialProjectID = req.params.projectID;\n\tconst query = Tutorial.find({tutorialProjectID}).populate('tutorialModuleID');\n\n\t// Execute query and return all modules that have the same projectID\n\tquery.exec((err, tutorials) => {\n\t\tif (err) {\n\t\t\tres.status(400).json({message: `Following error was encountered: ${err}`});\n\t\t} else if (!tutorials) {\n\t\t\tres.status(404).send('No tutorials found.');\n\t\t} else {\n\t\t\tres.status(200).json(tutorials);\n\t\t}\n\t});\n}", "function listByUser(user) {\n return db.query('my_index2/by_user', {\n key: user,\n include_docs: true\n })\n .then(function(res) {\n /*Gets*/\n console.log(res.rows);\n return res.rows.map(function(r) {\n return r.doc;\n });\n });\n }", "all() {\r\n return Object.keys(this._documents).map(key => this._documents[key]);\r\n }", "all() {\r\n return Object.keys(this._documents).map(key => this._documents[key]);\r\n }", "findModules(modulesPath){\n return fs.readdirSync(modulesPath).filter((file) => {\n debug('files ', file)\n return fs.statSync(path.join(modulesPath, file)).isDirectory()\n })\n }", "function updateModule(updateModule){\n var deferred = Q.defer();\n\n updateModule.name = updateModule.name.toLowerCase();\n\n //fields array should not be editable when using this function. therefore, delete it from input\n delete updateModule.fields;\n\n db.modules.find({$or: [\n {_id: mongo.helper.toObjectID(updateModule._id)},\n {name: updateModule.name}\n ]}).toArray(function(err, modules){\n if(err){\n deferred.reject(err);\n }\n else if(modules.length == 0){\n deferred.reject(notFound);\n }\n //vali inputs, no other document have the same name\n else if(modules.length == 1){\n var oldModule = modules[0];\n \n //rename if old & new names are different\n if(oldModule.name != updateModule.name){\n db.bind(oldModule.name);\n db[oldModule.name].rename(updateModule.name, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n update();\n }\n });\n }\n //go straight to update\n else{\n update();\n }\n }\n //another module document with the same name exists\n else{\n deferred.reject(exists);\n }\n }); \n\n //updates the document in the 'modules' collection\n function update(){\n\n //create another object and copy. then delete the '_id' property of the new copy\n var forUpdate = {};\n Object.assign(forUpdate, updateModule);\n delete forUpdate._id;\n \n db.modules.update({_id: mongo.helper.toObjectID(updateModule._id)}, {$set: forUpdate}, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n deferred.resolve();\n }\n });\n }\n\n return deferred.promise;\n}", "registerModules() {\n const { modules } = this.options;\n\n if (Object.keys(modules).length) {\n Object.keys(modules).forEach((moduleName) => {\n const module = modules[moduleName];\n const hasPromisse = typeof module.then === 'function';\n\n // Loaded module\n if (!hasPromisse) {\n this.registerModuleRoutes(module.routes);\n this.registerModuleStore(moduleName, module.store);\n\n return;\n }\n\n // Load lazy modules\n module.then((moduleLoaded) => {\n const { routes, store } = moduleLoaded.default;\n\n this.registerModuleRoutes(routes);\n this.registerModuleStore(moduleName, store);\n });\n });\n }\n }", "async get() {\r\n let params = {\r\n where: this.getWheres(),\r\n include: this.getIncludes(),\r\n order: this.getOrders(),\r\n group: this.getGroup()\r\n };\r\n\r\n if (!_.isArray(this.getAttributes()) && this.getAttributes().length > 0) {\r\n params = _.assign(params, { attributes: this.getAttributes() });\r\n }\r\n let model = this.Models();\r\n if (this.getScopes().length > 0) {\r\n _.forEach(this.getScopes(), scope => {\r\n model = model.scope(scope);\r\n });\r\n }\r\n const result = await model.findAll(params);\r\n\r\n return result;\r\n }", "function getDocuments(page, callback) {\n var query = ALL_DOC_QUERY + '&limit=' + PER_PAGE + '&skip=' + (PER_PAGE * page);\n var url = buildQuery(query, DATABASE);\n Vue.http.get(url).then(function (res) {\n if (callback) callback(unpackAttribute(res.data.rows, 'doc'));\n }, function (res) {\n if (callback) callback(null, 'Could not fetch data from cloudant');\n });\n}", "function getAll(){\n //imitate angular promise. start by initializing this\n var deferred = Q.defer();\n\n // Asset.find({}, {__v: false}, function(err, assets)\n //need to use toArray() when using find({})\n db.assets.find({}).toArray(function(err, assets){\n //console.log('assets.service');\n //standard error\n //reject means error status is sent as response\n if(err) deferred.reject(err);\n\n //if documents are present\n //console.log(assets);\n if(assets.length > 0) {\n //resolve means ok status is sent as response\n deferred.resolve(assets);\n }\n //empty collection\n else{\n //respond with an empty object\n deferred.resolve([]);\n }\n });\n\n //return the promise along with either resolve or reject\n return deferred.promise;\n}", "async getAll() {\n try {\n const db = await this.conexion.conectar();\n const collection = db.collection('Encargados');\n const findResult = await collection.find({}).toArray();\n await this.conexion.desconectar();\n return (findResult);\n }\n catch (e) {\n throw e;\n }\n }", "getModules() {\n if(!this.modules) {\n var baseDir = './src';//todo get this from config\n this.modules = fs.readdirSync(baseDir).filter(function(file) {\n if(fs.statSync(path.join(baseDir, file)).isDirectory()) {\n return true;\n } else {\n return false;\n }\n });\n }\n return this.modules;\n }", "static async getAll() {\n const query = `{\n projectCollection(order: [order_ASC]) {\n total\n items {\n sys {\n id\n }\n name\n description\n link\n linkText\n order\n gitHubRepoName\n image {\n ${GraphQLStringBlocks.imageAsset()}\n }\n }\n }\n }`;\n\n const response = await this.callContentful(query);\n\n const projectCollection = response.data.projectCollection.items\n ? response.data.projectCollection.items\n : [];\n\n const mergeProjectsWithGitHubData = async (_) => {\n const promises = projectCollection.map(async (project) => {\n return {\n ...project,\n gitHubStats: await GitHub.getRepoForksAndStars(\n project.gitHubRepoName,\n ),\n };\n });\n\n return await Promise.all(promises);\n };\n\n const fullData = await mergeProjectsWithGitHubData();\n\n return fullData;\n }" ]
[ "0.76914924", "0.76914924", "0.71097285", "0.70054066", "0.69624513", "0.6716536", "0.66984975", "0.6599894", "0.6338829", "0.63069487", "0.62283856", "0.6196353", "0.61157167", "0.6098662", "0.60881853", "0.6008931", "0.5953479", "0.5945948", "0.5880202", "0.5841107", "0.58377033", "0.5799088", "0.57576907", "0.5754063", "0.5750353", "0.57176995", "0.5709267", "0.5689537", "0.56680274", "0.56656003", "0.5647687", "0.56281537", "0.5619355", "0.5604262", "0.5594162", "0.5561932", "0.5531639", "0.5530858", "0.5524487", "0.5517395", "0.5496429", "0.5492242", "0.54670966", "0.545033", "0.5444237", "0.54411143", "0.5437717", "0.54371995", "0.5431654", "0.5427028", "0.54173183", "0.54138327", "0.5408845", "0.54069734", "0.5405079", "0.5399843", "0.5399622", "0.53932625", "0.5379256", "0.5379256", "0.5377568", "0.537687", "0.5373462", "0.53700405", "0.5365311", "0.5365111", "0.5360721", "0.53524506", "0.5340571", "0.5339973", "0.5334385", "0.53317225", "0.53270537", "0.5317109", "0.5311888", "0.5307982", "0.5297154", "0.52934724", "0.52922606", "0.5292214", "0.5291558", "0.5291166", "0.52883637", "0.52731276", "0.52633226", "0.5262262", "0.52621746", "0.52607614", "0.52467155", "0.52467155", "0.5242523", "0.52419764", "0.524128", "0.52402717", "0.5238773", "0.52363825", "0.5229757", "0.522968", "0.52233285" ]
0.751723
3
Function name: update module Author: Reccion, Jeremy Date Modified: 2018/04/02 Description: updates the name of the module Parameter(s): Object. Includes: _id: required. string type name: required. string type Return: Promise
function updateModule(updateModule){ var deferred = Q.defer(); updateModule.name = updateModule.name.toLowerCase(); //fields array should not be editable when using this function. therefore, delete it from input delete updateModule.fields; db.modules.find({$or: [ {_id: mongo.helper.toObjectID(updateModule._id)}, {name: updateModule.name} ]}).toArray(function(err, modules){ if(err){ deferred.reject(err); } else if(modules.length == 0){ deferred.reject(notFound); } //vali inputs, no other document have the same name else if(modules.length == 1){ var oldModule = modules[0]; //rename if old & new names are different if(oldModule.name != updateModule.name){ db.bind(oldModule.name); db[oldModule.name].rename(updateModule.name, function(err){ if(err){ deferred.reject(err); } else{ update(); } }); } //go straight to update else{ update(); } } //another module document with the same name exists else{ deferred.reject(exists); } }); //updates the document in the 'modules' collection function update(){ //create another object and copy. then delete the '_id' property of the new copy var forUpdate = {}; Object.assign(forUpdate, updateModule); delete forUpdate._id; db.modules.update({_id: mongo.helper.toObjectID(updateModule._id)}, {$set: forUpdate}, function(err){ if(err){ deferred.reject(err); } else{ deferred.resolve(); } }); } return deferred.promise; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateModule(updateModule){\n var deferred = Q.defer();\n\n updateModule.name = updateModule.name.toLowerCase();\n\n //fields array should not be editable when using this function. therefore, delete it from input\n delete updateModule.fields;\n\n //check if the name of the selected module has not changed\n db.modules.findOne({_id: mongo.helper.toObjectID(updateModule._id)}, function(err, aModule){\n if(err){\n deferred.reject(err);\n }\n else if(aModule){\n //if names are different, renaming the collection must be executed, then proceed to update\n if(aModule.name != updateModule.name){\n db.bind(aModule.name);\n db[aModule.name].rename(updateModule.name, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n update();\n }\n });\n }\n }\n else{\n update();\n }\n });\n\n //updates the document in the 'modules' collection\n function update(){\n\n //create another object and copy. then delete the '_id' property of the new copy\n var forUpdate = {};\n Object.assign(forUpdate, updateModule);\n delete forUpdate._id;\n \n db.modules.update({_id: mongo.helper.toObjectID(updateModule._id)}, {$set: forUpdate}, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n deferred.resolve();\n }\n });\n }\n\n return deferred.promise;\n}", "function changeModName() {\n //console.log('Modname' + modName);\n db.collection('modules')\n .doc(module.value)\n .update({\n 'module.name': modName,\n })\n .then(function () {\n console.log('modName updated successfully');\n history.push('/success');\n });\n }", "async update({request, response, params: {id}}) {\n\n const name = await nameService.findNameBy('id', id);\n\n if (name) {\n name.status = request.input('status')\n console.log(name)\n name.save()\n\n return response.status(200).send({\n status: 200,\n message: \"name updated\"\n })\n }\n else{\n return response.status(400).send({\n status: 400,\n message: \"invalid name id\"\n })\n }\n }", "function update(){\n\n //create another object and copy. then delete the '_id' property of the new copy\n var forUpdate = {};\n Object.assign(forUpdate, updateModule);\n delete forUpdate._id;\n \n db.modules.update({_id: mongo.helper.toObjectID(updateModule._id)}, {$set: forUpdate}, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n deferred.resolve();\n }\n });\n }", "function update(){\n\n //create another object and copy. then delete the '_id' property of the new copy\n var forUpdate = {};\n Object.assign(forUpdate, updateModule);\n delete forUpdate._id;\n \n db.modules.update({_id: mongo.helper.toObjectID(updateModule._id)}, {$set: forUpdate}, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n deferred.resolve();\n }\n });\n }", "static async update(req, res) {\n \n try {\n const { id } = req.params\n const { changeName } = req.body\n\n const updateStudent = await studentService.updateById(id,{\n name:changeName\n })\n\n // create response\n const response = {\n success: true,\n data: {\n student: updateStudent\n }\n }\n res.send(response)\n } catch(e) {\n res.send(e)\n }\n }", "function updateModuleField(moduleName, fieldObject){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n\n fieldObject.id = new ObjectID(fieldObject.id);\n \n db.modules.update({name: moduleName, fields: {$elemMatch: {id: fieldObject.id}}}, {$set: {'fields.$': fieldObject}}, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n deferred.resolve();\n }\n });\n\n return deferred.promise;\n}", "function updateModuleField(moduleName, fieldObject){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n\n console.log(fieldObject);\n\n service.getModuleByName(moduleName).then(function(aModule){ \n //use array.filter() to get the duplicate fields\n var duplicateFields = aModule.fields.filter(function(field){\n //lesson learned: use toString() in id\n return field.id.toString() == fieldObject.id.toString() || field.name == fieldObject.name;\n });\n \n if(duplicateFields.length == 0){\n deferred.reject(notFound);\n }\n //valid inputs\n else if(duplicateFields.length == 1){\n //this is to ensure that the field is inside the specific module (in case of improper input parameters)\n\n fieldObject.id = new ObjectID(fieldObject.id);\n\n if(duplicateFields[0].id.toString() == fieldObject.id.toString()){\n db.modules.update({name: moduleName, fields: {$elemMatch: {id: fieldObject.id}}}, {$set: {'fields.$': fieldObject}}, function(err, writeResult){\n if(err){\n deferred.reject(err);\n }\n else{\n console.log(writeResult.result);\n deferred.resolve();\n }\n });\n }\n //the only element has the same name but is different id, therefore, not inside the module document\n else{\n deferred.reject(notFound);\n }\n }\n else{\n deferred.reject(exists);\n }\n }).catch(function(err){\n deferred.reject(err);\n });\n\n return deferred.promise;\n}", "function updateModuleDoc(moduleName, updateDoc){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n\n db.bind(moduleName);\n\n //create another object and copy. then delete the '_id' property of the new copy\n var forUpdate = {};\n Object.assign(forUpdate, updateDoc);\n delete forUpdate._id;\n\n db[moduleName].update({_id: mongo.helper.toObjectID(updateDoc._id)}, {$set: forUpdate}, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n deferred.resolve();\n }\n });\n\n return deferred.promise;\n}", "async update({ params, request, response }) {\n }", "async update({ params, request, response }) {}", "async update ({ params, request, response }) {\n }", "async update ({ params, request, response }) {\n }", "async update ({ params, request, response }) {\n }", "async update ({ params, request, response }) {\n }", "async update ({ params, request, response }) {\n }", "async update ({ params, request, response }) {\n }", "async update ({ params, request, response }) {\n }", "async update({ params, request, response }) {\n }", "async function update(name, id) {\n try {\n // Arrange\n const query = \"UPDATE actors SET name = ? WHERE id = ?\";\n const template = `%s Updated: \"name\" to %s at \"index\" %s`;\n const question = [{\n type: \"confirm\",\n name: \"restart\",\n message: \"Would you like to update someone else?\"\n }];\n​\n // Action\n // Query to update the name of the selected actor\n const { message } = await queryAsync(query, [name,id]);\n // --start Confirms if the user wants to update another actor's name\n const { restart } = await inquirer.prompt(question);\n​\n if (restart) {\n // Restarts the app\n return init();\n } else {\n // Logs the most recently updated value and ends the app\n console.log(template, message, name, id);\n process.exit();\n }\n // --end Confirms if the user wants to update another actor's name\n } catch(err) {\n throw err;\n }\n}", "function updateModuleDoc(moduleName, updateDoc){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n\n service.findDuplicateDoc(moduleName, updateDoc).then(function(){\n db.bind(moduleName);\n \n //convert '_id' to ObjectID\n updateDoc._id = new ObjectID(updateDoc._id);\n \n db[moduleName].update({_id: updateDoc._id}, {$set: updateDoc}, function(err, writeResult){\n if(err){\n deferred.reject(err);\n }\n else{\n if(writeResult.result.nModified == 0){\n deferred.reject(notFound);\n }\n else{\n deferred.resolve();\n }\n }\n });\n }).catch(function(err){\n deferred.reject(err);\n });\n\n return deferred.promise;\n}", "static updateTaskName(taskId, name='') {\n var updateQueryClause = `UPDATE ${Task.tableName} SET name = ? WHERE id = ? `;\n const params = [name, taskId]\n return this.repository.databaseLayer.executeSql(updateQueryClause, params)\n }", "async function updatedTitle(id, updatedTitle){\n if(!id){\n throw 'You must provide an id'\n }\n let obj = ObjectId(id)\n // var objId = require('mongodb').ObjectID\n // if(!objId.isValid(obj)){\n // throw ` ${objId} is not a proper mongo id`\n // }\n \n if(!updatedTitle){\n throw 'You must provide a title'\n }\n if(typeof updatedTitle != 'string'){\n throw 'Title must be a string'\n }\n \n const recipeCollection = await recipes();\n \n await recipeCollection.updateOne({ _id: obj }, { $set: { title: updatedTitle } });\n return await module.exports.getRecipeById(id);\n\n}", "update(name, code) {\n }", "update_name(_name) {\n this.updateCommon(\"updateName\", { name: _name, weight: -1, target_id: -1, x: -1, y: -1 });\n this.props.updateApp();\n }", "async function updateProduct(productId, name, numUnit, date, lotNumber, sessionId, callback) {\n\tvar updatedProduct = packIntoJson(name, numUnit, date, lotNumber);\n\t//return await productActions.updateProduct(productId, sessionId, updatedProduct);\n\tproductActions.updateProduct(productId, sessionId, updatedProduct, function(res){\n callback(res);\n });\n}", "function updateData(id, newName) {\n const body = {\n 'name': newName\n };\n fetch('http://localhost:3000/events/' + id, {\n method: 'put',\n body: JSON.stringify(body),\n headers: {\n 'Accept': 'application/json',\n 'Content-Type': 'application/json'\n },\n }).then((json) => {\n // console.table(json);\n getEvent(id);\n });\n }", "updateParameterName(commandId, oldName, newName) {\n this.db\n .get(\"commands\")\n .getById(commandId)\n .get(\"parameters\")\n .find({ name: oldName })\n .assign({ name: newName })\n .write();\n builder.build();\n return this.getCommandForId(commandId);\n }", "renameComponent({ type, path, newId }, fetchParams) {\n const url = `/api/${type}/${path}/rename`;\n const postData = { newId };\n const errorMessage = `Error changing id of ${type} ${path}`;\n return this.post(url, postData, fetchParams, errorMessage)\n .then( response => response.json() );\n }", "editName(id, nameId, updatedName) {\n const horselist = this.getHorselist(id);// getting the correct horselist or racecourse based on the id that was passed into the function\n const horses = horselist.horses;// we getting the horses array from that horselist\n const index = horses.findIndex(name => name.id === nameId);//checking wheather the current name id matches with the name id that has \n //been passed into the editName function. then checks eac name in the array until it finds a match. returns the index of the matching array element\n \n horses[index].title = updatedName.title;// updating the properties of the name object\n horses[index].artist = updatedName.artist;\n horses[index].genre = updatedName.genre;\n horses[index].duration = updatedName.duration;\n }", "async function editName() {\n try {\n // get Userinfo to fill out the missing variables in put requests\n const current = await api.get(`/users/${sessionStorage.getItem('id')}`);\n\n const requestBody = JSON.stringify({\n name: name,\n username: current.data.username,\n matrikelNr: current.data.matrikelNr\n });\n\n // Edit is sent to backend\n await api.put(`/users/${sessionStorage.getItem('id')}`, requestBody);\n\n } catch (error) {\n alert(`Something went wrong while editing the user: \\n${handleError(error)}`);\n }\n }", "function updateFieldArray(moduleName, fieldArray){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n\n //need to convert each 'id' property to an ObjectID\n for(var i = 0; i < fieldArray.length; i++){\n fieldArray[i].id = new ObjectID(fieldArray[i].id);\n }\n \n\n db.modules.update({name: moduleName}, {$set: {fields: fieldArray}}, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n deferred.resolve();\n }\n });\n\n return deferred.promise;\n}", "function update(req, res) {\n let data = [\n req.body.name,\n req.body.qty,\n req.body.amount,\n req.params.id\n ];\n\n connection.query('UPDATE items SET name = ?, qty = ?, amount = ? WHERE id = ?', data , function(error, results) {\n if (error) {\n res.status(500).send({\n message: `Error occured while updating item with id ${req.params.id}`\n });\n }\n\n apiResult = {\n message: 'Successfully updated',\n data: {\n id: req.params.id,\n name: req.body.name,\n qty: req.body.qty,\n amount: req.body.amount\n }\n };\n\n res.send(apiResult);\n });\n }", "static updateName(name) {\n this.name = name;\n return db.result(`update users set name=$2 where id=$1`, [this.id, name])\n .then(result => {\n return result.rowCount === 1;\n })\n }", "static async updateMaintab({maintabId, newName, user}) {\n\n const query = `\n UPDATE main_tabs\n SET name = $1, updated_at = NOW()\n WHERE main_tabs.id = $2 AND main_tabs.user_id = (SELECT id FROM users WHERE email=$3)\n RETURNING id, user_id, name, created_at, updated_at; \n `\n const result = await db.query(query, [newName, maintabId, user.email]);\n\n return result.rows[0];\n }", "handler(req, reply){\n const NameObject = req.payload.NameObject;\n const DescriptioObject = req.payload.DescriptioObject;\n const isAssociate = req.payload.isAssociate;\n const ImgVideoURL = req.payload.ImgVideoURL;\n const IdThingPeople = req.params.id;\n \n\n log.info('Calling /xpressPeopleThings/api/updatePTBy/{id}');\n\n PTService.updatePT(NameObject, DescriptioObject, isAssociate, ImgVideoURL, IdThingPeople)\n .then(function(){\n reply('succes').code(200);\n });\n }", "update(id) {\n\n }", "async update(req,res){\n try{\n let params = req.allParams();\n let attributes = {};\n\n if(params.name){\n attributes.name = params.name;\n }\n if(params.city){\n attributes.city = params.city;\n }\n if(params.phone){\n attributes.phone = params.phone;\n }\n\n const results = await Company.update({id: req.params.id}, attributes);\n return res.ok(results);\n }\n catch(err){\n return res.serverError(err);\n }\n }", "function updateAuthor(updatedname, id) {\n const query = {\n text: `update authors set full_name=$1 where id=$2`,\n values: [updatedname, id]\n };\n return client.query(query)\n // .then(() => console.log(\"updated in updateAuthor function\"))\n // .catch(err => console.error(\"went wrong in updateAuther\", err.stack));\n}", "updateProject(blockId) {\n //console.log('Update Project!' + blockId + '>');\n let that = this;\n\n fetch('https://api.webwizards.me/v1/projects?id=' + this.state.projectId, {\n method: 'PATCH',\n headers: {\n 'Accept': 'application/json',\n 'Content-Type': 'application/json',\n 'Authorization': localStorage.getItem('Authorization')\n },\n body: JSON.stringify({\n 'content': [blockId]\n })\n })\n .then(function (response) {\n that.setup_getProjectData();\n })\n .catch(err => {\n console.log('ERROR: ', err);\n });\n }", "function updateProduct(id) {\r\n var name = document.getElementById('productInputName').value;\r\n var type = document.getElementById('inputGroupSelect02').value;\r\n var id = id;\r\n \r\n var data = new Products(id, name, type);\r\n data = {\r\n Id: id, \r\n Name: name, \r\n ProductType: type \r\n } \r\n fetch('http://alpha.apexcode.ro/api/products/' + id, {\r\n method: 'PUT',\r\n headers: new Headers({\r\n 'Content-Type': 'application/json'\r\n }),\r\n body: JSON.stringify(data)\r\n }).then(function(response){\r\n if (!response.ok) {\r\n throw new Error('Bad status code from server.');\r\n }\r\n return response.json();\r\n }).catch(error => console.error(error))\r\n}", "async function modify(req, res) {\n try {\n const nameSong = req.params.name;\n const modi = req.body;\n const modifySongs = await controller.modifySongsCont(nameSong, modi);\n res.status(201).send(modifySongs);\n } catch (e) {\n res.status(400);\n res.send('la cancion no se pudo modificar');\n }\n}", "function orgUpdateField(org_id, fieldName, fieldValue ) {\n\n // var member = globalMembers.find(function (member) { return member.id === member_id; }); //get the member object\n \n var ckanParameters = { id: org_id };\n ckanParameters[fieldName] = fieldValue;\n\n\n\n\n debugger;\n var client = new CKAN.Client(ckanServer, myAPIkey);\n\n client.action('organization_patch', ckanParameters,\n function (err, result) {\n if (err != null) { //some error - try figure out what\n mylog(mylogdiv, \"orgUpdateField ERROR: \" + JSON.stringify(err));\n console.log(\"orgUpdateField ERROR: \" + JSON.stringify(err));\n //return false;\n return 0;\n } else // we have managed to update. We are getting the full info for the org as the result\n {\n console.log(\"orgUpdateField RETURN: \" + JSON.stringify(result.result));\n //return true;\n return 1;\n // update the globalMembers array\n // update the screen\n\n }\n\n });\n\n\n}", "update(puppy) {\n return http.put('/editPuppy', puppy); // pass the id??? Embedded in the puppy object\n }", "updateData(per) {\r\n console.log(\"Updating \");\r\n console.log (\"PER\"+per);\r\n let id = per.PersonalUniqueID;\r\n let promise = fetch (`http://localhost:4070/api/person/${id}`, {\r\n method: \"PUT\",\r\n headers: {\r\n \"Content-Type\": \"application/json\"\r\n },\r\n body: JSON.stringify (per)\r\n });\r\n return promise;\r\n }", "function updateFieldArray(moduleName, fieldArray){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n\n db.modules.update({name: moduleName}, {$set: {fields: fieldArray}}, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n deferred.resolve();\n }\n });\n\n return deferred.promise;\n}", "function changeDoc(req, res) {\n var id = req.swagger.params.id.value;\n var data = JSON.parse(req.swagger.params.docname.value);\n var userId = req.decoded.user_id;\n var clientId = req.decoded.client_id;\n var name = data.docname;\n var autor = data.autor;\n var filename = data.filename\n var query = '';\n //console.log(name); \n if (data.docname) {\n query = `Update sadrzaj set \n name = '` + name + `', \n modified_by = ` + userId + `,\n modified_ts = NOW()\n\n where id =` + id + ` `;\n }\n if (data.autor) {\n query = `Update ri.dokumentacija set \n autor = '` + autor + `'\n where id =` + id + ` `;\n }\n if(data.filename)\n {\n query = `Update ri.dokumentacija set \n link = '` + filename + `' \n where id =` + id + ` `;\n }\n console.log(query);\n \n var client = new pg.Client(conString);\n client.connect(function(err) {\n if (err) {\n return console.error('could not connect to postgres', err);\n } else { \n client.query(query, function(err, result) {\n if (err) {\n return console.error('error running query', err);\n } else {\n\n res.json(\"Changed\");\n }\n })\n }\n })\n\n \n}", "function updateFriend( id, name, description ) {\n\n\t\t\tvar request = $http({\n\t\t\t\tmethod: \"post\",\n\t\t\t\turl: baseUrl,\n\t\t\t\tdata: {\n\t\t\t\t\taction: \"update\",\n\t\t\t\t\tid: id,\n\t\t\t\t\tname: name,\n\t\t\t\t\tdescription: description\n\t\t\t\t}\n\t\t\t});\n\n\t\t\treturn( unwrapHttpResponse( request ) );\n\n\t\t}", "update(id, data, params) {}", "function update(req, res){\n Role.update({\n name: req.body.name,\n color: req.body.color,\n description: req.body.description,\n }, {\n where: {id: req.params.id} //CONSULTA WHERE\n }).then((result)=>{\n res.status(200).json(result)\n }).catch( (err) =>{\n res.status(500).json(err)\n });\n}", "async update (req, res, id) {\n throw new Error('update: Implementation Missing!')\n }", "function updateEmployeeManager(){\n connection.query(\"SELECT * FROM employee\", function (err, rows) {\n inquirer\n .prompt(\n [{\n name: \"id\",\n message: \"Select employee\",\n type: \"list\",\n choices: function () {\n let choices = [];\n for (let i = 0; i < rows.length; i++) {\n let choice = {\n name: `${rows[i].first_name} ${rows[i].last_name}`,\n value: rows[i].id\n }\n choices.push(choice);\n }\n\n return choices;\n },\n\n },\n {\n name: \"manager\",\n message: \"Who will be new manager?\",\n type: \"list\",\n choices: [\n \"Anil Kumar\",\n \"Barbara Corcoran\",\n \"Ray Dalio\",\n \"None\"\n ]\n }\n\n ]\n ).then((result)=>{\n var newId = result.id\n var newManager = result.manager;\n connection.query(\"UPDATE employee SET manager=? WHERE id=?\", [newManager, newId], function (err, result){\n if (err) throw err;\n console.log(\"Title is updated\");\n start();\n\n })\n })\n })\n }", "async update({ request, response, auth }) {\n try {\n let body = request.only(fillable)\n const id = request.params.id\n const data = await StudyProgram.find(id)\n if (!data || data.length === 0) {\n return response.status(400).send(ResponseParser.apiNotFound())\n }\n const isUniversityExists = await CheckExist(\n body.university_id,\n \"University\"\n )\n if (!isUniversityExists) {\n return response\n .status(422)\n .send(ResponseParser.apiValidationFailed(\"University not fund\"))\n }\n\n const isStudyNameExists = await CheckExist(\n body.study_name_id,\n \"StudyName\"\n )\n if (!isStudyNameExists) {\n return response\n .status(422)\n .send(ResponseParser.apiValidationFailed(\"StudyName not fund\"))\n }\n await data.merge(body)\n await data.save()\n await RedisHelper.delete(\"StudyProgram_*\")\n await RedisHelper.delete(\"StudyYear_*\")\n await RedisHelper.delete(\"MarketingTarget_*\")\n await data.loadMany([\"university\", \"studyName\", \"years\"])\n const jsonData = data.toJSON()\n const activity = `Update StudyProgram \"${jsonData.studyName.name}\" in \"${\n jsonData.university.name\n }\" university`\n await ActivityTraits.saveActivity(request, auth, activity)\n let parsed = ResponseParser.apiUpdated(data.toJSON())\n return response.status(200).send(parsed)\n } catch (e) {\n ErrorLog(request, e)\n return response.status(500).send(ResponseParser.unknownError())\n }\n }", "async update({params,request,response}){\n const id = params.id;\n const cat = await Categoria.find(id);\n\n const name = request.body.name;\n cat.name = name;\n cat.save();\n\n return response.json({\"category\": cat})\n }", "function updateDepartment() {\n con.query(\"SELECT * FROM departments\", function(err, data) {\n if (err) throw err;\n let choices = [];\n for (i = 0; i < data.length; i++) {\n choices.push({name: `${data[i].name}`, value: `${data[i].name}`});\n }\n inquirer.prompt(\n [\n {\n type: 'list',\n message: 'Select department to update',\n choices: choices,\n name: 'department'\n }\n ]\n ).then(function(answer){\n var departmentToUpdate = answer.department;\n inquirer.prompt(\n {\n type: 'input',\n message: 'Enter updated department name',\n name: 'newName'\n }\n ).then(function(answer) {\n var newName = answer.newName;\n con.query(\"UPDATE departments SET ? WHERE ?\",\n [\n {\n name: newName\n },\n {\n name: departmentToUpdate\n }\n ]\n );\n console.log(\"\\n\" + \"Department updated to \" + newName + \"\\n\");\n runManager();\n });\n });\n });\n }", "function updateTUser(name, id) {\n return promessQuery('UPDATE user SET user_name= \"' + name + '\" WHERE user_id= ' + id,\n callBackSucesso, callBackErro);\n }", "async update(ctx){\n try{\n const results = await ctx.db.Company.update({\n name: ctx.request.body.name,\n city: ctx.request.body.city,\n address: ctx.request.body.address\n }, {\n where: {\n id: ctx.params.id\n }\n });\n results == 0 ? ctx.throw(500,'invalid id provide') : ctx.body = `company is updated with id ${ctx.params.id}`;\n }\n catch (err) {\n ctx.throw(500, err)\n }\n }", "async function changeName(skillId, name){\n\n const collection = await getConnection();\n\n const updated = await collection.updateOne({_id: ObjectID(skillId)}, {$set: {name: name}})\n\n return !!updated\n }", "function addModuleField(moduleName, fieldObject){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n\n //create a new objectID to used as query for updates and delete\n fieldObject.id = new ObjectID();\n\n //the query searches for the module name that do not have the inputted field name\n //this is to avoid pushing same field names on the 'fields' array of the specified module\n //writeResult will determine if the update was successful or not (i.e. writeResult.result.nModified)\n db.modules.update({name: moduleName, fields: {$not: {$elemMatch: {name: fieldObject.name}}}}, {$push: {fields: fieldObject}}, function(err, writeResult){\n if(err){\n deferred.reject(err);\n }\n else{\n //console.log(writeResult.result);\n //check the status of the update, if it failed, it means that there is an existing field name\n if(writeResult.result.nModified == 0){\n deferred.reject(exists);\n }\n else{\n deferred.resolve();\n }\n }\n });\n\n return deferred.promise;\n}", "static update({ id, name, phone, email, sex }) {\r\n return new Promise(async resolve => {\r\n try {\r\n \r\n if( !ObjectID.isValid( id )){\r\n return resolve({ error : true , message : 'params_invalid' });\r\n }\r\n let listUser = await USER_COLL.findByIdAndUpdate( id, {\r\n name, phone, email, sex\r\n }\r\n ,{\r\n new: true\r\n });\r\n \r\n if(!listUser){\r\n return resolve({error: true, message:'cannot_update_list'});\r\n }\r\n return resolve({error: false, message:'update_data_success', data: listUser});\r\n\r\n\r\n } catch (error) {\r\n return resolve({ error: true, message: error.message });\r\n }\r\n })\r\n}", "async function updateEmployee(name, catagory, newVal) {\n const nameArr = name.split(\" \");\n const empId = await getEmployeeId(nameArr[0], nameArr[1]);\n let newValId;\n\n if (catagory === \"Role\") {\n newValId = await getRoleId(newVal);\n catagory = \"role_id\";\n } else {\n const managerNameArr = newVal.split(\" \");\n newValId = await getEmployeeId(managerNameArr[0], managerNameArr[1]);\n catagory = \"manager_id\";\n }\n\n const query = `\n UPDATE employee\n SET ${catagory}=\"${newValId}\"\n WHERE id=\"${empId}\"`;\n updateDB(query);\n}", "function UpdatePrduct (req,res) {\n const {nombre_prod,descripcion_prod,precio_prod,idunidad,idcategoria,idpresentacion,idmarca,idempleado} = req.body;\n const { id } = req.params;\n const query = `\n SET @id = ?;\n SET @nombre_prod = ?;\n SET @descripcion_prod = ?;\n SET @precio_prod = ?;\n SET @idunidad = ?;\n SET @idproveedor = ?;\n SET @idcategoria = ?;\n SET @idpresentacion = ?;\n SET @idmarca = ?;\n SET @idempleado = ?;\n CALL EditarOAgregarProducto(@id,@nombre_prod,@descripcion_prod,@precio_prod,@idunidad,@idcategoria,@idpresentacion,@idmarca,@idempleado);\n `;\n mysqlConn.query(query, [id,nombre_prod,descripcion_prod,precio_prod,idunidad,idcategoria,idpresentacion,idmarca], (err, rows, fields)=>{\n if(!err){\n res.json({Status:'Producto actualizado'});\n }else{\n console.log(err);\n };\n });\n}", "function updateEmployeeRole() {\n connection.query(\"SELECT * FROM employee\", function (err, rows) {\n inquirer\n .prompt(\n [{\n name: \"id\",\n message: \"Select employee\",\n type: \"list\",\n choices: function () {\n let choices = [];\n for (let i = 0; i < rows.length; i++) {\n let choice = {\n name: `${rows[i].first_name} ${rows[i].last_name}`,\n value: rows[i].id\n }\n choices.push(choice);\n }\n\n return choices;\n },\n\n },\n {\n name: \"title\",\n message: \"Please input new title\",\n type: \"input\",\n }\n\n ]\n ).then((result)=>{\n var newId = result.id\n var newRole = result.title;\n connection.query(\"UPDATE employee SET title=? WHERE id=?\", [newRole, newId], function (err, result){\n if (err) throw err;\n console.log(\"Title is updated\");\n start();\n\n })\n })\n })\n }", "function updateProduct(name, price, id){\r\n var index = getIndexById(id);\r\n shop.products[index].name = name;\r\n shop.products[index].price = price;\r\n\r\n dialogNameField.value = '';\r\n dialogPriceField.value = '';\r\n\r\n addProductBtn.value = '';\r\n updateProductList(); \r\n dialog.close();\r\n }", "static async update(id,data) {\n\n const { setCols, values } = sqlForPartialUpdate(\n data,\n {\n tite: \"title\",\n description: \"description\"\n }\n );\n const idVarIdx = \"$\" + (values.length + 1);\n\n const querySql = `UPDATE journals\n SET ${setCols}\n WHERE id = ${idVarIdx}\n RETURNING username,\n title,\n description,\n plant_id AS \"plantId\"`;\n const result = await db.query(querySql, [...values, id]);\n console.log(result);\n const journal = result.rows[0];\n\n return journal;\n\n }", "function update(req, res) {\n // find one project by id, update it based on request body,\n // and send it back as JSON\n\n db.Project.findById(req.params.id, function(err, foundProject) {\n if (err) { console.log('projectsController.update error', err); }\n foundProject.artistName = req.body.artistName;\n foundProject.name = req.body.name;\n foundProject.releaseDate = req.body.releaseDate;\n foundProject.save(function(err, savedProject) {\n if (err) { console.log('saving altered project failed'); }\n res.json(savedProject);\n });\n });\n}", "updateUser(request, response, next) {\n let attributes = {\n name: request.body.name\n };\n this._knex(this._user)\n .where('id', request.params.id)\n .update(attributes, '*')\n .then(result => {\n response.json(result);\n })\n .catch(err => {\n next(err);\n });\n }", "async function putSong(req, res){\n try {\n var songEditing = req.params.name;\n var songModify = req.body;\n const modifySong = await songsController.editSong(songEditing, songModify);\n res.status(200).send(modifySong);\n } catch (e) {\n res.status(500).send('No se pudo modificar la cancion ' + e,);\n }\n}", "update(req, res) {\n return __awaiter(this, void 0, void 0, function* () {\n const { id } = req.params;\n yield pool.query('UPDATE ticket set ? WHERE cod_ticket=?', [req.body, id]);\n res.json({ massage: 'El horario se ha sido actualizado' });\n });\n }", "function updateName(person) {\n person.name = 'Camilo';\n}", "updateName(_name) {\n return this;\n }", "function updateProvider(req,res){\n providers.findOne({firstName: req.params.firstName}, (err, provider) => {\n if (err) return handleError(err);\n provider.firstName = req.body.firstName;\n provider.save(function() {\n res.send(\"Your data is actualized\");\n });\n });\n }", "function updateId(inputId){\n id=inputId;\n}", "async function updateUser(pool, name, apikey = uuidv4()) {\n try {\n await pool.query(\"UPDATE public.user SET apikey = $1 WHERE name = $2\", [apikey, name]);\n } catch(err) {\n console.error(err);\n }\n}", "static update(request, response) {\r\n\r\n itemsModel.getById(request.body.id)\r\n .then( data => {\r\n if (data.length > 0) {\r\n\r\n //recupera do body os campos que serao atualizados na tabela\r\n const conditions = [\r\n {\r\n field: 'id',\r\n value: request.body.id\r\n },\r\n {\r\n field: 'title',\r\n value: request.body.title\r\n },\r\n {\r\n field: 'descr',\r\n value: request.body.descr\r\n },\r\n {\r\n field: 'photo',\r\n value: request.body.photo\r\n },\r\n {\r\n field: 'category',\r\n value: request.body.category\r\n },\r\n ];\r\n\r\n //chama rotina para atualizacao dos dados\r\n itemsModel.update(conditions) \r\n response.sendStatus(200);\r\n console.log('Item has been updated. ID: ', request.body.id); \r\n } else {\r\n response.sendStatus(404);\r\n console.log('Item not found. ID: ', request.body.id);\r\n }\r\n })\r\n .catch(err => {\r\n response.sendStatus(500);\r\n console.log('Error updating Item by ID: ', request.body.id, err);\r\n });\r\n \r\n }", "function change_artifact_name(portal_dir, artifact_id, new_name, on_success_func) {\n $.ajax({\n url: portal_dir + '/artifact/' + artifact_id + '/',\n type: 'PATCH',\n data: {'op': 'replace', 'path': '/name/', 'value': new_name},\n success: on_success_func,\n error: function(object, status, error_msg) {\n // Something went wrong, show the message\n bootstrapAlert(\"Error changing artifact name: \" + error_msg, \"danger\");\n }\n });\n}", "update(request, response) {\n console.log('request stuff', request.params, request.body);\n Resttask.findByIdAndUpdate(request.params._id, request.body, { new: true })\n .then(task => response.json(task))\n .catch(error => response.json(error));\n }", "update(Repo) {\n let sqlRequest = \"UPDATE actor SET \" +\n \"name=$name, \" +\n \"url=$url \" +\n \"WHERE id=$id\";\n\n let sqlParams = {\n $name: Repo.name,\n $url: Repo.url,\n $id: Repo.id\n };\n return this.common.run(sqlRequest, sqlParams);\n }", "function updateFolder(id, name, new_name) {\n\n if(!queryResource(2, 1, name, new_name, '')) return false;\n\n jQuery('#folder_title_'+id).text(new_name);\n\n return true;\n}", "function updateJenkins(jenkins_id,jenkins_name, jenkins_url){\n\n var db = getDatabase();\n var res = \"\";\n\n db.transaction(function(tx) {\n var rs = tx.executeSql('UPDATE jenkins_data SET jenkins_name=?, jenkins_url=? WHERE id=?;', [jenkins_name,jenkins_url,jenkins_id]);\n if (rs.rowsAffected > 0) {\n res = \"OK\";\n } else {\n res = \"Error\";\n }\n }\n );\n return res;\n }", "static modifyC(req, res) {\n const { titulo,grupo } = req.body\n return Cuadernos\n .findByPk(req.params.id)\n .then((data) => {\n data.update({ \n titulo: titulo || data.titulo,\n grupo: grupo || data.grupo\n })\n .then(update => {\n res.status(200).send({\n success: true,\n message: 'Cuaderno actualizado',\n data: { \n titulo: titulo || update.titulo,\n grupo: grupo || update.grupo\n }\n })\n })\n .catch(error => res.status(400).send({\n success: false,\n message: 'Actualizacion Fallida',\n error}));\n })\n .catch(error => res.status(400).send(error));\n }", "function updatedItem(id) {\n console.log(\"\");\n var query = connection.query(\"SELECT ID, Product_Name , Price, Stock_QTY FROM products WHERE ID = ?;\",[id],function(err, res) {\n if (err) throw err;\n console.log('Your item has been updated. Please see below:');\n console.table(res);\n console.log(\"\");\n managerAsk();\n \n });\n}", "function updateMemberDisplayName(user_id, name, nameField) {\n $.ajax({\n url : admin_url.ajax_url,\n type : 'post',\n data : {\n action : 'updateMemberDisplayName',\n user_id: user_id,\n name: name\n },\n success : function( response ) {\n response = JSON.parse(response);\n\n if (response.result) {\n alertify.success('User name has been updated successfully to: ' + response.name);\n updateLabels(response.name, nameField);\n } else {\n alertify.error('Something went wrong!');\n }\n },\n error: function (xhr) {\n alertify.error('Something went wrong: '+xhr);\n console.log(xhr);\n }\n });\n }", "async function updateById(data) {\t \n\ttry { \n\t\tif(data){ \n\t\t\tvar sql = \"UPDATE projects set ? WHERE id = ?\"; \n\t\t\treturn new Promise((resolve,reject)=>{\n\t\t\t\tconnectPool.query(sql,[data, data.id], (err, result) => {\n\t\t\t\t\tif (err) { \n\t\t\t\t\t\tconsole.log(data);\n\t\t\t\t\t\treject(err)\n\t\t\t\t\t} else { \n\t\t\t\t\t\tresolve(result)\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t}) \n\t\t}else{\n\t\t\treturn null;\n\t\t}\n\t} catch (err) {\n return err; \n } finally {\n\t\t//if (connectPool && connectPool.end) connectPool.end();\n\t} \n}", "function changeName(name, cb) {\n\t\tvar file_id = $('.file-builder').attr('data-file-id');\n\t\t$.ajax({\n\t\t\turl: '/api/v1/files/' + file_id + '/edit',\n\t\t\tmethod: 'put',\n\t\t\tdataType: 'json',\n\t\t\tdata: {\n\t\t\t\tname: name\n\t\t\t},\n\t\t\tcache: false,\n\t\t\tsuccess: function(data) {\n\t\t\t\tif(data.status !== 'success') {\n\t\t\t\t\t//$('#add_section_modal .error-msg').text(data.message);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tif(typeof cb === 'function') cb(data);\n\t\t\t\t}\n\t\t\t},\n\t\t\terror: function(err) {\n\t\t\t\tif(typeof ShopifyApp !== 'undefined') ShopifyApp.flashError(err.message);\n\t\t\t}\n\t\t});\n\t}", "async update(id, name, URL) {\n try {\n const API = baseURL + `/ingredientList/` + id;\n const responseGet = await axios.get(API);\n if (responseGet.status !== 200) throw Error(\"id doesn't exist\");\n\n const prevName = responseGet.data.name,\n prevURL = responseGet.data.imageURL;\n const response = await axios.put(baseURL + 'ingredientList/' + id, {\n ...responseGet,\n name: name || prevName,\n imageURL: URL || prevURL,\n });\n if (response.status !== 200) throw Error('not there!');\n this.props.location.onSubmit(id);\n } catch (error) {\n console.error(error);\n }\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}", "async putTask() {\n try {\n if (!this.ctx.params.id) {\n this.ctx.body = new Rep({\n code: 40000,\n msg: \"the param 'id' is invalid\",\n })\n } else if (!this.ctx.request.body.name) {\n this.ctx.body = new Rep({\n code: 40000,\n msg: \"the body param 'name' is invalid\",\n })\n } else {\n let res = await this.ctx.service.mrquery.putSearchTaskName(\n this.ctx.params.id,\n this.ctx.request.body.name\n )\n let response = new Rep({\n code: 50000,\n data: res.rowsAffected[0],\n })\n if (response.data === 1) response.code = 200\n this.ctx.body = response\n }\n } catch (error) {\n this.ctx.body = new Rep({ code: 50000, msg: error.message })\n }\n }", "updateEmployeeRole(firstName, lastName, title) {\n return new Promise((resolve, reject) => {\n let queryString = \"SELECT (id) FROM roles WHERE ?\";\n this.connection.query(queryString, [{title : title}], (err, results) => {\n if (err) return reject(err);\n const roleId = results[0].id;\n queryString = \"UPDATE employees SET ? WHERE ? AND ?\";\n this.connection.query(queryString, [{role_id : roleId}, {first_name : firstName}, {last_name : lastName}], (err, results) => {\n if (err) return reject(err);\n resolve();\n });\n });\n });\n }", "function toupdate(){\n const update_2 = document.getElementById('update_button_2');\n update_2.onclick = async function() {\n const email = document.getElementById('upemail').value;\n const password = document.getElementById('uppass').value;\n const name = document.getElementById('upname').value;\n\n if (!email && !password && !name){\n window.alert('At least one parameter must be given!');\n return false;\n }\n const user = {\n \"email\": email,\n \"name\": name,\n \"password\" : password\n };\n const headers = {\n 'Accept': 'application/json',\n 'Content-Type': 'application/json',\n 'Authorization' : 'Token ' + checkStore('token')\n };\n const method = 'PUT'; \n const path = 'user';\n\n await api.makeAPIRequest(path, {\n method, headers,\n body: JSON.stringify(user),\n })\n .then(function (){\n location.reload(); \n });\n }\n}", "updateSupplier(params) {\r\n return Api().post('/updatesupplier', params)\r\n }", "function update() {\n // DEFINE LOCAL VARIABLES\n // RETURN RESPONSE\n return new Promise(function (resolve, reject) {\n\n });\n}", "updateProgramName(id, name) {\n let index = this.state.programs.map(function (program) {\n return program.ep_id;\n }).indexOf(id);\n this.setState({programs: update(this.state.programs, {[index]: {ep_name: {$set: name}}})});\n }", "function employeeUpdate() {\n console.log('updating emp');\n inquirer\n .prompt({\n name: \"id\",\n type: \"input\",\n message: \"Enter employee id\",\n\n }).then(function (answer) {\n\n var id = answer.id;\n\n inquirer\n .prompt({\n name: \"roleId\",\n type: \"input\",\n message: \"Enter role id\",\n })\n .then(function (answer) {\n var roleId = answer.roleId;\n\n var query = \"UPDATE employee SET role_id=? WHERE id=?\";\n connection.query(query, [roleId, id], function (err, res) {\n if (err) {\n console.log(err);\n }\n runMenu();\n });\n });\n });\n}", "function updateEmployee() {\n const query = 'SELECT CONCAT(employee.first_name, \" \", employee.last_name) as name FROM employee';\n connection.query(query, (err, res) => {\n if (err) throw err;\n\n inquirer\n .prompt([{\n type: 'list',\n message: `Which employee would you like to update?`,\n name: 'employeeName',\n choices() {\n const choiceArray = [];\n res.forEach(({ name }) => {\n choiceArray.push(name);\n });\n return choiceArray;\n },\n },\n ])\n .then((response) => {\n const query = `SELECT employee.id, CONCAT (employee.first_name, \" \", employee.last_name) AS name FROM employee`;\n connection.query(query, (err, res) => {\n if (err) throw err;\n let oldEmployee = res.filter((employee) => {\n return response.employeeName == employee.name;\n })\n let id = JSON.parse(JSON.stringify(oldEmployee))[0].id\n updateEmployeeInformation(id, response.employeeName);\n });\n })\n });\n}", "async function update(db, nam, o) {\n var o = _.merge({}, OPTIONS, o), db = db||o.db;\n db = typeof db==='string'? await setup(db, o):db;\n var nam = nam||o.input||(await getUpload(db, o)).title;\n var v = _.pick(o, ['priority', 'references', 'status']);\n if(o.log) console.log('-update:', nam, v);\n var val = {$title: nam};\n for(var k in v) val['$'+k] = v[k];\n var set = Object.keys(v).map(col => `\"${col}\" = $${col}`).join(', ');\n db.run(`UPDATE \"pages\" SET ${set} WHERE \"title\" = $title`, val);\n return nam;\n}", "function addModuleField(moduleName, fieldObject){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n\n //create a new objectID to used as query for updates and delete\n fieldObject.id = new ObjectID();\n\n db.modules.update({name: moduleName}, {$push: {fields: fieldObject}}, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n deferred.resolve();\n }\n });\n\n return deferred.promise;\n}", "async function updateCourse(id) \n{\n \n // Creating an async await class to get the course by the id \n const course = await COURSE\n .findById(id); \n \n console.log(id); \n\n // if the course is empty, return a \"null\" value \n if ( !course ) return; \n\n // Changing the values \n // course.isPublished = true; \n // course.author = 'Changed Author'; \n\n course.set({\n isPublished: true, \n name: \"Python Course\", \n author: 'Mbonu Chinedu', \n price: 100.23\n }); \n\n // Saving the new changed values \n const resultOfSavedModifedCourse = await course.save();\n console.log(resultOfSavedModifedCourse); \n\n}", "async function author_update(request, response, next) {\n console.log('Author update');\n\n try {\n const id_author = request.params.id;\n const { url_author, full_name, full_name_orig, image_url } = request.body;\n\n const results = await pool.query('UPDATE authors SET url_author = $2, full_name = $3, full_name_orig = $4, image_url = $5 WHERE id_author = $1',\n [id_author, url_author, full_name, full_name_orig, image_url]);\n response.status(200).json(results.rows);\n } catch (error) {\n next(error);\n }\n}", "async update ({ params, request, response }) {\n const product = await Product.find(params.id)\n const data = request.only([\n \"name\", \n \"description\", \n \"price\"\n ])\n product.merge(data)\n if (product) {\n response.status(200).json({\n success: 'Product Updated',\n data: data\n })\n await product.save()\n } else {\n response.status(304).send({ error: 'Product Not Updated' })\n }\n }" ]
[ "0.7093112", "0.7071991", "0.68973994", "0.67273706", "0.67273706", "0.6495799", "0.6399463", "0.63616574", "0.6330262", "0.6246438", "0.62095666", "0.6175385", "0.6175385", "0.6175385", "0.6175385", "0.6175385", "0.6175385", "0.6175385", "0.61658496", "0.6108117", "0.61019385", "0.6100636", "0.6069959", "0.60698056", "0.6040906", "0.6035249", "0.6006061", "0.6003076", "0.59688085", "0.5964918", "0.5956383", "0.5956118", "0.5940474", "0.58537555", "0.58411306", "0.5838796", "0.5830993", "0.58206743", "0.5819065", "0.5810718", "0.5799046", "0.57851464", "0.57728666", "0.5714558", "0.5712879", "0.5711863", "0.5710485", "0.57002074", "0.56902164", "0.56888676", "0.56845397", "0.5681617", "0.5680685", "0.5645565", "0.5644171", "0.5633535", "0.5621743", "0.5607835", "0.55987614", "0.5570698", "0.55657476", "0.5565016", "0.55645967", "0.556206", "0.55578333", "0.5551862", "0.5549368", "0.5536143", "0.55331", "0.5527006", "0.5526702", "0.5519552", "0.55163807", "0.5515654", "0.5512277", "0.5509671", "0.5507541", "0.5495997", "0.54950523", "0.54946727", "0.54941195", "0.54867256", "0.54855615", "0.54777265", "0.5472416", "0.54721886", "0.5465238", "0.5462627", "0.5459324", "0.54579556", "0.54530615", "0.54524606", "0.54510653", "0.5449383", "0.54472613", "0.54471725", "0.5445867", "0.5445618", "0.54335934", "0.5430993" ]
0.7073509
1
updates the document in the 'modules' collection
function update(){ //create another object and copy. then delete the '_id' property of the new copy var forUpdate = {}; Object.assign(forUpdate, updateModule); delete forUpdate._id; db.modules.update({_id: mongo.helper.toObjectID(updateModule._id)}, {$set: forUpdate}, function(err){ if(err){ deferred.reject(err); } else{ deferred.resolve(); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateModuleDoc(moduleName, updateDoc){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n\n db.bind(moduleName);\n\n //create another object and copy. then delete the '_id' property of the new copy\n var forUpdate = {};\n Object.assign(forUpdate, updateDoc);\n delete forUpdate._id;\n\n db[moduleName].update({_id: mongo.helper.toObjectID(updateDoc._id)}, {$set: forUpdate}, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n deferred.resolve();\n }\n });\n\n return deferred.promise;\n}", "function updateModule(updateModule){\n var deferred = Q.defer();\n\n updateModule.name = updateModule.name.toLowerCase();\n\n //fields array should not be editable when using this function. therefore, delete it from input\n delete updateModule.fields;\n\n db.modules.find({$or: [\n {_id: mongo.helper.toObjectID(updateModule._id)},\n {name: updateModule.name}\n ]}).toArray(function(err, modules){\n if(err){\n deferred.reject(err);\n }\n else if(modules.length == 0){\n deferred.reject(notFound);\n }\n //vali inputs, no other document have the same name\n else if(modules.length == 1){\n var oldModule = modules[0];\n \n //rename if old & new names are different\n if(oldModule.name != updateModule.name){\n db.bind(oldModule.name);\n db[oldModule.name].rename(updateModule.name, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n update();\n }\n });\n }\n //go straight to update\n else{\n update();\n }\n }\n //another module document with the same name exists\n else{\n deferred.reject(exists);\n }\n }); \n\n //updates the document in the 'modules' collection\n function update(){\n\n //create another object and copy. then delete the '_id' property of the new copy\n var forUpdate = {};\n Object.assign(forUpdate, updateModule);\n delete forUpdate._id;\n \n db.modules.update({_id: mongo.helper.toObjectID(updateModule._id)}, {$set: forUpdate}, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n deferred.resolve();\n }\n });\n }\n\n return deferred.promise;\n}", "function updateModule(updateModule){\n var deferred = Q.defer();\n\n updateModule.name = updateModule.name.toLowerCase();\n\n //fields array should not be editable when using this function. therefore, delete it from input\n delete updateModule.fields;\n\n //check if the name of the selected module has not changed\n db.modules.findOne({_id: mongo.helper.toObjectID(updateModule._id)}, function(err, aModule){\n if(err){\n deferred.reject(err);\n }\n else if(aModule){\n //if names are different, renaming the collection must be executed, then proceed to update\n if(aModule.name != updateModule.name){\n db.bind(aModule.name);\n db[aModule.name].rename(updateModule.name, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n update();\n }\n });\n }\n }\n else{\n update();\n }\n });\n\n //updates the document in the 'modules' collection\n function update(){\n\n //create another object and copy. then delete the '_id' property of the new copy\n var forUpdate = {};\n Object.assign(forUpdate, updateModule);\n delete forUpdate._id;\n \n db.modules.update({_id: mongo.helper.toObjectID(updateModule._id)}, {$set: forUpdate}, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n deferred.resolve();\n }\n });\n }\n\n return deferred.promise;\n}", "async updateAllModuleSemantics() {\n await this.db.transaction('rw', this.db.files, this.db.classes, this.db.modules, this.db.functions, () => {\n this.db.files.where(\"type\").equals(\"file\").each((file) => {\n this.addModuleSemantics(file)\n })\n })\n }", "function updateModuleDoc(moduleName, updateDoc){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n\n service.findDuplicateDoc(moduleName, updateDoc).then(function(){\n db.bind(moduleName);\n \n //convert '_id' to ObjectID\n updateDoc._id = new ObjectID(updateDoc._id);\n \n db[moduleName].update({_id: updateDoc._id}, {$set: updateDoc}, function(err, writeResult){\n if(err){\n deferred.reject(err);\n }\n else{\n if(writeResult.result.nModified == 0){\n deferred.reject(notFound);\n }\n else{\n deferred.resolve();\n }\n }\n });\n }).catch(function(err){\n deferred.reject(err);\n });\n\n return deferred.promise;\n}", "function changeModName() {\n //console.log('Modname' + modName);\n db.collection('modules')\n .doc(module.value)\n .update({\n 'module.name': modName,\n })\n .then(function () {\n console.log('modName updated successfully');\n history.push('/success');\n });\n }", "function addModuleDoc(moduleName, newDoc){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n\n db.bind(moduleName);\n\n db[moduleName].insert(newDoc, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n deferred.resolve();\n }\n });\n\n return deferred.promise;\n}", "function updateModuleField(moduleName, fieldObject){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n\n fieldObject.id = new ObjectID(fieldObject.id);\n \n db.modules.update({name: moduleName, fields: {$elemMatch: {id: fieldObject.id}}}, {$set: {'fields.$': fieldObject}}, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n deferred.resolve();\n }\n });\n\n return deferred.promise;\n}", "function updateFieldArray(moduleName, fieldArray){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n\n //need to convert each 'id' property to an ObjectID\n for(var i = 0; i < fieldArray.length; i++){\n fieldArray[i].id = new ObjectID(fieldArray[i].id);\n }\n \n\n db.modules.update({name: moduleName}, {$set: {fields: fieldArray}}, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n deferred.resolve();\n }\n });\n\n return deferred.promise;\n}", "function doc(moduleName) {\n exports.modules.push(moduleName);\n}", "function addModuleDoc(moduleName, newDoc){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n\n service.findDuplicateDoc(moduleName, newDoc).then(function(){\n db.bind(moduleName);\n\n db[moduleName].insert(newDoc, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n deferred.resolve();\n }\n });\n }).catch(function(err){\n deferred.reject(err);\n });\n\n return deferred.promise;\n}", "function updateFieldArray(moduleName, fieldArray){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n\n db.modules.update({name: moduleName}, {$set: {fields: fieldArray}}, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n deferred.resolve();\n }\n });\n\n return deferred.promise;\n}", "function update(now) {\n\t\t\t\t\tlet req = new XMLHttpRequest;\n\t\t\t\t\treq.onreadystatechange = function() {\n\t\t\t\t\t\tif (req.readyState === 4) {\n\t\t\t\t\t\t\tif (req.status === 200) {\n\t\t\t\t\t\t\t\tmodules = JSON.parse(req.responseText);\n\t\t\t\t\t\t\t\tcommitButton.disabled = false;\n\t\t\t\t\t\t\t\tcommitButton.click();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tsetTimeout(update.bind(this, false), req.status === 200 ? 0 : 1000);\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t\treq.open('GET', '//127.0.0.1:9090/'+ (now ? 'get' : 'wait'), true);\n\t\t\t\t\treq.send();\n\t\t\t\t}", "function updateModuleConfig() {\n let config = {};\n $(\".module\").each(function _update_module() {\n let id = $(this).attr(\"id\");\n config[id] = getModuleSettings($(this));\n if (!window.liveStorage) {\n window.liveStorage = {};\n }\n window.liveStorage[id] = config[id];\n });\n mergeConfigObject(config);\n}", "async function example() {\n let course = await User.update(\n { id: _id },\n { $set: { \"subdoc.name\": \"sharath\" } },\n { new: true }\n );\n}", "moduleLinkPhase({moduleDoc}){\n /**\n * Remove lifecycle methods\n */ \n const classes = moduleDoc?.declarations?.filter(declaration => declaration.kind === 'class');\n\n classes?.forEach(klass => {\n if(!klass?.members) return;\n klass.members = klass?.members?.filter(member => {\n return !METHOD_DENYLIST.includes(member.name)\n });\n });\n\n /**\n * Events \n */\n classes?.forEach(klass => {\n if(!klass?.members) return;\n const eventsAsFields = klass.members\n ?.filter(member => events.some(event => event.field === member.name))\n ?.map(member => {\n delete member.privacy;\n delete member.kind;\n member.name = events.find(event => event.field === member.name).as;\n return member;\n }) || [];\n\n /* Add events as eventDocs */\n klass.events = [...(klass?.events || []), ...eventsAsFields];\n\n /* Remove events as class fields */\n klass.members = klass?.members?.filter(member => !events.some(event => event.field === member.name || event.as === member.name));\n });\n\n }", "async function getModules(){\n await microcredapi.get(`/unit/${unitId}/${window.localStorage.getItem('userId')}`).then(response => {\n setCanSubmit(response.data.submittable)\n let publishedModulesCount = 0;\n const updatedModules = []\n const grade = {\n finalGrade: response.data.finalGrade,\n cumulativeScore: response.data.cumulativeScore\n }\n response.data.modules.map((module, key) => {\n const newModule = {\n ...module, \n // use Object.keys() to handle key value mismatch\n numAttempts: response.data.numAttempts[key+ parseInt(Object.keys(response.data.numAttempts)[0])],\n highestScore: response.data.highestScore[key+ parseInt(Object.keys(response.data.highestScore)[0])],\n }\n console.log(module);\n if(module.published){publishedModulesCount = publishedModulesCount + 1}\n updatedModules.push(newModule)\n return true\n })\n console.log(publishedModulesCount);\n setPublishedModules(publishedModulesCount)\n setModules(updatedModules)\n setGrade(grade)\n \n })\n \n }", "function inc(document, update) {\r\n var fields, i;\r\n\r\n if (update.$inc) {\r\n fields = Object.keys(update.$inc);\r\n for (i = 0; i < fields.length; i++) {\r\n if (isNaN(update.$inc[fields[i]])) {\r\n // Validate the field; throw an exception if it is not a number (can't increment by NaN).\r\n throw new Error(\"Bad $inc parameter - value must be a number\")\r\n } else if (document[fields[i]]) {\r\n // If the field exists, increment it by the given amount.\r\n document[fields[i]] += update.$inc[fields[i]];\r\n } else {\r\n // Otherwise set the field to the given amount.\r\n document[fields[i]] = update.$inc[fields[i]];\r\n }\r\n }\r\n }\r\n }", "async function fetchModule() {\n\t\t\t const module = await getUserModule(userId, instanceId);\n\t\t\t setModule(module);\n\n\t\t\t // Setting up audio message ref (if any audio message is present).\n\t\t\t if (module.audioMessageURL) {\n\t\t\t\t audioMessageRef.current = new Audio(module.audioMessageURL);\n\t\t\t }\n\n\t\t\t // Getting the module's author info\n\t\t\t const user = await getUserDocument(userId);\n\t\t\t setUser(user);\n\t\t}", "update() {\n // Prepare collection with bundle schema.\n this.collection.simpleSchema = () => {\n return this.schema;\n };\n return this.collection.update.apply(this.collection, arguments);\n }", "function updateDepModuleVersions () {\n return request.post({\n url: `http://${HOST}/api/DepModuleVersions/add`,\n followAllRedirects: true,\n headers: {\n \"Authorization\": TOKEN\n },\n body: {\n obj: obj\n },\n json: true // Automatically stringifies the body to JSON\n }, (err, res, body) => {\n licenseObj(body);\n check(err, res, body);\n });\n}", "function changeSynchronized() {\n db.allDocs( { include_docs: true, descending: false } ).then( doc => {\n doc.rows.forEach( register => {\n register.doc.sincronizado = true;\n db.put( register.doc ).then( () => {\n console.log('Registro actualizado');\n }).catch( error => {\n console.log('Ha ocurrido un error al sincronizar: ', error);\n });\n });\n });\n}", "function updateDoc(doc, db){\n\tdb.update({ _refObjectUUID: doc._refObjectUUID }, doc, {}, function(err, count){\n\t\t//console.log('Update: ', count);\n\t});\n}", "async function handleModuleComplete(e) {\n if (\n confirm(\n 'Please make sure your last video has uploaded. If you are sure that you have completed your level, press OK. If not, press cancel and continue to upload videos.',\n )\n ) {\n setModuleVideos(moduleVideos.module.videos.unshift(levelAdded));\n e.preventDefault();\n db.collection('modules')\n .doc(module.value)\n .update({\n 'module.videos': moduleVideos.module.videos,\n })\n .then(() => console.log('Doc written successfully!'));\n clearVideoInfo();\n history.push('/success');\n }\n }", "link() {\n\t\t// Call super link to link members of Top Level (Identified)\n\t\tsuper.link();\n\n this._modules = this._sbolDocument.lookupURIs(this._modules);\n this._functionalComponents = this._sbolDocument.lookupURIs(this._functionalComponents);\n this._interactions = this._sbolDocument.lookupURIs(this._interactions);\n this._models = this._sbolDocument.lookupURIs(this._models);\n }", "function updateObjects(collectionName)\n{\n for (var i = 0; i < objects[collectionName].objects.length; i++)\n objects[collectionName].objects[i].update();\n}", "function set(document, update) {\r\n var fields, i;\r\n\r\n if (update.$set) {\r\n fields = Object.keys(update.$set);\r\n for (i = 0; i < fields.length; i++) {\r\n document[fields[i]] = update.$set[fields[i]];\r\n }\r\n }\r\n }", "set module(m) {\n this._module = m;\n }", "function runUpdate(){\n people.forEach(function(element){\n element.update();\n });\n }", "initModules() {\n for (let i = 0; i < this.modules.length; i++) {\n this.modules[i].init(this);\n }\n }", "function update() {\n\t\tUtil.txt.setLibraryBrowser( Util.fs.getLibraries() );\n\t\tUtil.txt.setFileBrowser( Util.fs.getNotes(currentLib) );\n\t\tUtil.txt.setInputText( Util.fs.getNoteContent(currentLib,currentNote) );\n\t}", "function update(XMLDoc) {\n\t\thideFolderTree();\n\n\t\tparseXML(XMLDoc);\n\t\tupdateHTML();\n\t}", "async process() {\n\t\tif (!this.dyno.isReady) return;\n\n\t\ttry {\n\t\t\tvar docs = await models.Moderation.find({ completedAt: { $lte: Date.now() } }).lean().exec();\n\t\t} catch (err) {\n\t\t\tthis.logger.error(err, { type: 'moderations.process' });\n\t\t}\n\n\t\tif (!docs || !docs.length) return;\n\n\t\teach(docs, async doc => {\n\t\t\tconst guild = this.client.guilds.get(doc.server);\n\t\t\tif (!guild) return;\n\n\t\t\tconst guildConfig = await this.dyno.guilds.getOrFetch(doc.server);\n\t\t\tif (!guildConfig) return;\n\n\t\t\tif (!this.module.isEnabled(guild, this.module, guildConfig)) return;\n\n\t\t\tif (this[doc.type]) {\n\t\t\t\tsetImmediate(this[doc.type].bind(this), guild, doc, guildConfig);\n\t\t\t}\n\t\t});\n\t}", "setModuleName(field, module) {\n field.moduleName = field.moduleName || (module && module.__meta.name);\n if ((field.type === 'array') || (field.type === 'object')) {\n _.each(field.schema || [], function(subfield) {\n self.setModuleName(subfield, module);\n });\n }\n }", "update(req, res) {\n // update only allowed for authorised user of their own documents or admin\n const isPermittedUser =\n req.decoded.role === 'Administrator' || req.decoded._id === req.params.id;\n\n if (!isPermittedUser) {\n return res.json(403, {\n message: 'Forbidden to update this document.',\n });\n }\n\n return Document.findOneAndUpdate(\n { _id: req.params.id },\n {\n title: req.body.title,\n content: req.body.content,\n },\n )\n .then((document) =>\n res.status(200).json({\n document,\n success: true,\n message: 'Successfully updated Document!',\n }),\n )\n .catch((err) => res.status(500).send(err));\n }", "updateItems() {\n\t\tthis.callItemR('update');\n\t}", "function updatedoc() {\n currentuseruid = auth.currentUser.uid\n var updatedata = {\n collection: 'new1',\n doc: 'newdoc2',\n contents: {\n newfield: 'updated',\n newfield2: 'newly added by abcd'\n }\n }\n // console.log(newdoc1)\n // get the current user\n db.collection(updatedata.collection).doc(updatedata.doc).update(updatedata.contents).then(d => {\n console.log('document updated')\n });\n }", "function updateAllProvider(req,res){\n providers.updateMany({firstName: req.params.firstName},{ $set: { firstName: req.body.firstName }},{ multi: true },(err, provider) => {\n if (err) return handleError(err);\n res.send(\"Your data is actualized\");\n })\n }", "function update(){\n\t\tsubHeader();\n\t\tpagePositions();\n\t}", "function updatePage() {\n \tcountLinks();\n \tgetDropDowns();\n \tquery();\n }", "function addModuletoDOM(module) {\r\n single_moduleEl.innerHTML = `\r\n <div class=\"single-module\">\r\n <h1>${module.moduleName}</h1>\r\n <h2>Course Code: ${module.moduleCode}</h2>\r\n <img src=\"nmu-logo.jpg\" alt=\"logo\" />\r\n <div class=\"single-module-info\">\r\n <p>Prescribed Textbook</p>\r\n <h3>${module.textbook}</h3>\r\n <small> isbn: ${module.isbn}</small>\r\n </div>\r\n </div>\r\n `;\r\n}", "function Update_Fields_inDocument() {\n cloudDB\n .collection(\"Students\")\n .doc(rollV)\n .update({\n // This is creating a new entry in the DB\n NameOfStd: nameV,\n Section: secV,\n Gender: genV,\n })\n .then(function () {\n console.log(\"Document updated with ID\", rollV);\n })\n .catch(function (error) {\n console.eroor(\"Error Updated document\", error);\n });\n}", "function initializeModules() {\r\n\r\n\t\t\t\t//Hide the full content divs\r\n\t\t\t\tmodules.find(\"div.full\").hide();\r\n\t\t\t\t\r\n\t\t\t\t//Apply link styling to the li summary and hide the summary anchors\r\n\t\t\t\tmodules.find(\"div.summary\").css(\"cursor\", \"pointer\").find(\"a\").hide();\r\n\t\t\t\t\r\n\t\t\t\t//Apply absolute positioning to the modules instead of floating them\r\n\t\t\t\tmodules.css({\r\n\t\t\t\t\tfloat: \"none\",\r\n\t\t\t\t\tposition: \"absolute\",\r\n\t\t\t\t\tbottom: 0\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t\tmodules.each(function(i) {\r\n\r\n\t\t\t\t\tvar startingLeftPosition = (summaryFullWidth + 2 + summaryMargin) * i; //The 2 is for border width\r\n\t\t\t\t\tvar smallLeftPosition = (summarySmallWidth + 2 + summaryMargin) * i;\r\n\t\t\t\t\t\r\n\t\t\t\t\tvar fullLeft = (summarySmallWidth + summaryMargin + 2) * i; //Calculates the left position of the module when it would be fully open\r\n\t\t\t\t\t\r\n\t\t\t\t\t//Initialize the data for this particular module\r\n\t\t\t\t\tmoduleData[i] = {\r\n\t\t\t\t\t\tanimating: false, //whether or not this particular module is currently animating\r\n\t\t\t\t\t\tatInitialState: true, //whether or not this particular module is currently in it's initial state\r\n\t\t\t\t\t\tatSmallSummaryState: false, //whether or not this item is currently in small summary state\r\n\t\t\t\t\t\tsummaryVisible: true, //whether or not the summary is visible\r\n\t\t\t\t\t\tsummaryImageVisible: true, //whether or not the summary image is visible\r\n\t\t\t\t\t\titemResized: false, //whether or not the item has been re-sized\r\n\t\t\t\t\t\tfullContentVisible: false, //whether or not the full content layer is visible\r\n\t\t\t\t\t\tfullContentShadowsAdded: false, //whether or not the full content layer has had drop-shadows applied\r\n\t\t\t\t\t\tstartingLeftPosition: startingLeftPosition, //the starting left position of this module in its initial state\r\n\t\t\t\t\t\tsmallSummaryLeftPosition: smallLeftPosition, //the base left position of the module when it's in small summary state\r\n\t\t\t\t\t\tfullLeftPosition: fullLeft, //the base left position of the module when it's at its fully open state\r\n\t\t\t\t\t\tlastCalledAnimation: \"shrink\", //the last animation type to happen\r\n\t\t\t\t\t\telem: $(this) //the jQuery object for this module\r\n\t\t\t\t\t};\r\n\t\t\t\t\t\r\n\t\t\t\t\t//Set the starting left position\r\n\t\t\t\t\tmoduleData[i].elem.css(\"left\", startingLeftPosition);\r\n\r\n\t\t\t\t});\r\n\r\n\t\t\t}", "function addDocToLibraries (doc) {\n //AppController.sharedInstance().librariesController().addAssetLibraryAtURL(doc.fileURL())\n\tdoc.saveAndAddLibrary()\n}", "static async modifyDocument (id, document) {\n if (typeof document !== 'object') {\n throw new Error('Bad Parameter');\n }\n const db = await Mongo.instance().getDb();\n const isValid = await Document.isDocument(document);\n if (isValid.valid) {\n // Create a new document\n // Uploaded document with new informations.\n const res = await db.collection(Document.COLLECTION).updateOne(\n {\n _id: ObjectId(id)\n },\n {\n $set: {\n ...document,\n updatedAt: moment().toDate()\n }\n }\n );\n return res;\n } else {\n log.debug('Warning - couldn\\'t modify document \\n', document);\n return null;\n }\n }", "reloadAllModules() {\r\n console.info(\"Reloading all modules.\")\r\n\r\n this.client.removeAllListeners()\r\n this.commands = {}\r\n this.modules = {}\r\n\r\n this.loadAllModules()\r\n this.configureClient()\r\n }", "init() {\n module_utils.patchModule(\n 'mongodb/lib/core/wireprotocol/index.js',\n 'insert',\n mongodbInsertWrapper,\n mongodb => mongodb\n );\n module_utils.patchModule(\n 'mongodb/lib/core/wireprotocol/index.js',\n 'update',\n mongodbUpdateWrapper,\n mongodb => mongodb\n );\n module_utils.patchModule(\n 'mongodb/lib/core/wireprotocol/index.js',\n 'remove',\n mongodbRemoveWrapper,\n mongodb => mongodb\n );\n module_utils.patchModule(\n 'mongodb/lib/core/wireprotocol/index.js',\n 'query',\n mongodbQueryWrapper,\n mongodb => mongodb\n );\n module_utils.patchModule(\n 'mongodb/lib/core/wireprotocol/index.js',\n 'getMore',\n mongodbGetMoreWrapper,\n mongodb => mongodb\n );\n module_utils.patchModule(\n 'mongodb/lib/core/wireprotocol/index.js',\n 'command',\n mongodbCommandWrapper,\n mongodb => mongodb\n );\n }", "function changeTrainers() {\n if (trainers) {\n db.collection('modules')\n .doc(module.value)\n .update({'module.trainers': trainers})\n .then(function () {\n console.log('trainers changed successfully');\n history.push('/success');\n });\n } else {\n alert('Please select at least one trainer');\n }\n }", "function updateModuleField(moduleName, fieldObject){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n\n console.log(fieldObject);\n\n service.getModuleByName(moduleName).then(function(aModule){ \n //use array.filter() to get the duplicate fields\n var duplicateFields = aModule.fields.filter(function(field){\n //lesson learned: use toString() in id\n return field.id.toString() == fieldObject.id.toString() || field.name == fieldObject.name;\n });\n \n if(duplicateFields.length == 0){\n deferred.reject(notFound);\n }\n //valid inputs\n else if(duplicateFields.length == 1){\n //this is to ensure that the field is inside the specific module (in case of improper input parameters)\n\n fieldObject.id = new ObjectID(fieldObject.id);\n\n if(duplicateFields[0].id.toString() == fieldObject.id.toString()){\n db.modules.update({name: moduleName, fields: {$elemMatch: {id: fieldObject.id}}}, {$set: {'fields.$': fieldObject}}, function(err, writeResult){\n if(err){\n deferred.reject(err);\n }\n else{\n console.log(writeResult.result);\n deferred.resolve();\n }\n });\n }\n //the only element has the same name but is different id, therefore, not inside the module document\n else{\n deferred.reject(notFound);\n }\n }\n else{\n deferred.reject(exists);\n }\n }).catch(function(err){\n deferred.reject(err);\n });\n\n return deferred.promise;\n}", "async before () {\n\t\tawait super.before();\t\t// set up mongo client and create a document directly in the database\n\t\tawait this.updateDocument();\t// do the find-and-modify update\n\t}", "_onRestoreDB() {\n this.modulesCollection = this._db.getCollection(this.modulesCollectionName);\n if (!this.modulesCollection) {\n this.modulesCollection = this._db.addCollection(this.modulesCollectionName);\n this._dbInitialized = true;\n } else {\n\n const parseAndRegister = (m) => {\n if (typeof m === 'string') {\n m = JSON.parse(m);\n }\n return this.register(m);\n };\n\n Promise.all(this.modulesCollection.find().map(parseAndRegister))\n .then(() => {\n logger.debug(`Database loaded with, ${this.modulesCollection.count()} modules`);\n this._dbInitialized = true;\n });\n }\n }", "function UpdatePouchDB() {\n console.log('updating pouchdb using google drive data');\n startUpdatingUI();\n }", "update(){}", "update(){}", "update(){}", "function updateDatabase(){\n db.collection(\"<collection>\").doc(\"<document>\").set({\n\tcongratulated: congratulated,\n\tcurrentCup: currentCup,\n\tgoal: goal,\n\tprogress: progress,\n \ttotalDailyWeight: totalWeight,\n\tcurrentMonth: currentMonth,\n\tcurrentDay: currentDay,\n\tdaysMetGoal: daysMetGoal,\n\ttotalMonthlyWeight: monthlyTotal,\n\tdaysInMonth: daysInMonth\n })\n}", "function update() {\n // Extract from the object id the corresponding index of the array\n let index = checkIndex(this.id)[0];\n\n // Update the array based on the existing value of the array\n if (binaryNumbers[index]) {\n binaryNumbers[index] = 0;\n } else {\n binaryNumbers[index] = 1;\n }\n\n setIconAndNumbers();\n setDecimal();\n}", "onChange(document) {\n if (fspath.basename(document.uri.fsPath) == \"property.json\") {\t\t\n this.refreshProperty.updateFolder(serve.opeParam.rootPath,serve.opeParam.workspacePath,document.uri.fsPath);\n this.refreshProperty.updatePrjInfo(serve.opeParam.rootPath,document.uri.fsPath);\n return;\n }\n if (!this.getHDLDocumentType(document)) {\n return;\n }\n else if (this.getHDLDocumentType(document) == 1 ) {\n this.HDLparam = this.parser.removeCurrentFileParam(document, this.HDLparam);\n this.parser.get_HDLfileparam(document, null, 0, null, this.HDLparam);\n this.parser.get_instModulePath(this.HDLparam);\n this.refresh();\n }\n }", "function updateField() {\r\n //update general text field\r\n for (var i = 0; i < glob_data.length; i++) {\r\n try {\r\n var this_node_key = glob_data[i].pk + '.' + glob_data[i].fields.node_name\r\n if (this_node_key == obj) {\r\n $('#node_details .description').text(glob_data[i].fields.node_description)\r\n $('#node_details .details').text(glob_data[i].fields.details)\r\n $('.node-name-details').text(glob_data[i].fields.node_name)\r\n $active_node_name = glob_data[i].fields.node_name\r\n }\r\n else { }\r\n }\r\n catch (err) {\r\n console.log(err)\r\n }\r\n }\r\n updatePicture()\r\n\r\n function updatePicture() { }\r\n // update picture set for slides\r\n var $target_slides = $('.slide img')\r\n\r\n for (var j = 0; j < $target_slides.length; j++) {\r\n $thisslide = $target_slides[j]\r\n $thisslide.src = \"\\\\static\\\\app\\\\content\\\\node_content\\\\\" + $active_node_name + \"images\\\\\" + (j + 1).toString() + \".jpg\"\r\n\r\n }\r\n }", "getModules() { return this.fModuleList; }", "enterDocument() {\n this.decorateChildren();\n UpdatableComponent.superClass_.enterDocument.call(this);\n this.updateAfterRedraw();\n }", "function addModuleField(moduleName, fieldObject){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n\n //create a new objectID to used as query for updates and delete\n fieldObject.id = new ObjectID();\n\n db.modules.update({name: moduleName}, {$push: {fields: fieldObject}}, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n deferred.resolve();\n }\n });\n\n return deferred.promise;\n}", "function updateModuleReferences() {\n if (!self.initialized) return;\n if (cmdScheduler && cmdScheduler.initialized) return;\n cmdScheduler = self.bot.getSubmodule('./cmdScheduling.js');\n if (!cmdScheduler || !cmdScheduler.initialized) {\n cmdScheduler = null;\n setTimeout(updateModuleReferences, 100);\n } else {\n cmdScheduler.on('shutdown', handleShutdown);\n cmdScheduler.on('commandRegistered', handleCommandRegistered);\n cmdScheduler.on('commandCancelled', handleCommandCancelled);\n }\n }", "function sortModules(){\n\n\t\t$('.container > section').each(function(n){\n\n\t\t\tvar id = $(this).attr('id'),\n\t\t\t\tnewId = id-1;\n\t\t\t// console.log(id)\n\t\t\tif(id !== undefined) {\n\t\t\t\t$('#' + id).insertAfter('#' + newId);\n\t\t\t} else {\n\t\t\t\t// console.log('fail')\n\t\t\t}\n \n\t\t});\n\n\t}", "function upcDoUpdate(){\n\tif(!singlePageSite){ //If it's not a single page site, remove the script for the modules loaded for the previous page\t\t\t\t\n\t\twhile($s(\"moduleScript\")) $(\"#moduleScript\").remove();\n\t}\t\t\t\t\n\tif(pageAjax.readyState===4){\n\t\tupdatePage();//parse response and finalize page update\n\t}\n}", "async updateDocument(ctx, documentId, newValue) {\n const exists = await this.documentExists(ctx, documentId);\n if (!exists) {\n throw new Error(`The document ${documentId} does not exist`);\n }\n const asset = { value: newValue };\n const buffer = Buffer.from(JSON.stringify(asset));\n await ctx.stub.putState(documentId, buffer);\n }", "async registerModules() {\n const { modules } = this.options;\n\n for (let index = 0; index < Object.keys(modules).length; index += 1) {\n const name = Object.keys(modules)[index];\n const module = modules[name];\n\n // eslint-disable-next-line no-await-in-loop\n await module.then((loadedModule) => {\n const { routes, store } = loadedModule.default;\n this.registerModuleRoutes(routes);\n this.registerModuleStore(name, store);\n });\n }\n }", "function updateAllId(){\n const bookContainers = document.querySelectorAll('.book-container');\n bookContainers.forEach((book, index) => {\n myLibrary[index].id = index;\n book.id = index;\n })\n}", "updateFeedbacks(name) {\n\n db.allDocs({\n startkey: 'Feedback_' + name,\n endkey: 'Feedback_' + name + '_\\uffff',\n include_docs: true\n }, (err, doc) => {\n\n if (err) {\n return this.error(err);\n }\n var feedbacks = [];\n doc.rows.forEach(function (feedback) {\n feedbacks.push(feedback.doc);\n });\n this.setState({\n clinicpageFeedbacks: feedbacks\n });\n });\n\n }", "function updateModules(containerId, moduleData, moduleType)\n{\n // get the UI tab for the appropriate module category\n let moduleTab = document.getElementById(containerId);\n\n // this clears out any elements that may already be present in the tab\n moduleTab.textContent = \"\";\n\n // get all the slot names and sort them\n let slots = Object.keys(moduleData);\n slots.sort((a, b) =>\n {\n /*\n The planetary approach suite is categorized as an optional internal module,\n though now that the Horizons expansion has been rolled into the main game,\n it will always be present. When modules like this have been made universal\n in the past (ex: discovery scanner) they eventually phased out the module\n altogether, and this may happen in the future. If it does, then this can\n be removed.\n */\n if (a === 'PlanetaryApproachSuite')\n {\n return 1;\n }\n if (b === 'PlanetaryApproachSuite')\n {\n return -1;\n }\n\n if (a === 'ShipCockpit')\n {\n return -1;\n }\n if (b === 'ShipCockpit')\n {\n return 1;\n }\n\n // fall back to the default string compare for all other modules\n return a.localeCompare(b);\n });\n\n for (let i = 0, len = slots.length; i < len; i++)\n {\n let slot = slots[i];\n let module = moduleData[slot];\n\n let shipModule = document.createElement(moduleType);\n shipModule.slotName = slot;\n shipModule.loadModuleData(module);\n moduleTab.appendChild(shipModule);\n }\n}", "function renumberPages(document){\n var pageStart = 1;\n for(var p=0;p < document.sections.length;p++){\n document.sections[p].continueNumbering = false;\n document.sections[p].pageNumberStart = pageStart;\n pageStart = pageStart + destination_doc.sections[p].length;\n }\n}", "async updateAllVersions(max) {\n \n var files = await this.db.transaction('rw', this.db.files, this.db.versions, () => {\n return this.db.files.where(\"type\").equals(\"file\").toArray()\n })\n files = files.filter(file => file.url && file.url.startsWith(lively4url))\n files = files.filter(file => file.name ) // && file.name.match(/\\.js$/)\n if (max) files = files.slice(0, max)\n for(let file of files) {\n console.log(\"[fileindex] add verions: \" + file.name)\n await this.addVersions(file)\n }\n }", "function CKupdate(){\n\t for ( instance in CKEDITOR.instances )\n\t CKEDITOR.instances[instance].updateElement();\n\t}", "update(add) {\r\n\t\tconst conf = _.assign({}, this.conf, add || {})\r\n\r\n this.set.title(conf)\r\n // this.set.meta(conf)\r\n\t}", "function addModule(newModule){\n //imitate angular promise. start by initializing this\n var deferred = Q.defer();\n\n newModule.name = newModule.name.toLowerCase();\n\n //check if there is an existing module\n db.modules.findOne({name: newModule.name}, function(err, aModule){\n if(err){\n deferred.reject(err);\n }\n //already exists\n else if(aModule){\n deferred.reject(exists);\n }\n else{\n //unique, so proceed\n //create table first before adding a new document to 'modules' collection (not necessary?)\n db.createCollection(newModule.name, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n //initialize fields property as empty array if there are none in the input\n if(newModule.fields == undefined){\n newModule.fields = [];\n }\n\n db.modules.insert(newModule, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n deferred.resolve();\n }\n });\n }\n });\n }\n \n });\n \n //return the promise along with either resolve or reject\n return deferred.promise;\n}", "function addModule(newModule){\n //imitate angular promise. start by initializing this\n var deferred = Q.defer();\n\n newModule.name = newModule.name.toLowerCase();\n\n //check if there is an existing module\n db.modules.findOne({name: newModule.name}, function(err, aModule){\n if(err){\n deferred.reject(err);\n }\n //already exists\n else if(aModule){\n deferred.reject(exists);\n }\n else{\n //unique, so proceed\n //create table first before adding a new document to 'modules' collection (not necessary?)\n db.createCollection(newModule.name, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n //initialize fields property as empty array if there are none in the input\n if(newModule.fields == undefined){\n newModule.fields = [];\n }\n\n db.modules.insert(newModule, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n deferred.resolve();\n }\n });\n }\n });\n }\n \n });\n \n //return the promise along with either resolve or reject\n return deferred.promise;\n}", "function update() {\n $spans.each(updateSpan);\n}", "function update() {\n $spans.each(updateSpan);\n}", "function update(req , res){\n\tvar model = getModel(req.params.model);\n\tif (!req.params.id){\n\t\treturn res.status(400).send({request:\"update\" , status:-1 , err:new Error(\"Missing id in update request\")});\n\t}\n\t// Params to be updated\n\tvar pars = _.keys(req.body);\n\t\n\t model.findById(req.params.id, function (err, found) {\n\t \tif (!found)\n\t \t\treturn res.status(400).send({request:\"update\" , status:-1 , err:new Error(\"Unknown documents \"+req.params.id)});\n\t\tpars.forEach(function(p , i){\n \t\t\tfound[p] = req.body[p];\n \t\t});\n\t\tfound.save(function (err) {\n\t\t\tif (!err) {\n\t\t\t\t// MAPS\n\t\t\t\t// Should we update something in maps?\n\t\t\t\tcheckDocumentInMap(found , req.params.model , found.lang, function(err , ret){\n\t\t\t\t\tif (err){\n\t\t\t\t\t\tlogToConsole(err);\n\t\t\t\t\t\treturn res.status(500).send({request:\"update\" , status:-1, err:err}); \n\t\t\t\t\t}else{\n\t\t\t\t\t\tif (ret.__changed__){\n\t\t\t\t\t\t\tret.save(function (err , ret) {\n\t\t\t\t\t\t\t\tif (!err) {\n\t\t\t\t\t\t\t\t\t// @FIXME: potrei avere piu elementi nell'array \n\t\t\t\t\t\t\t\t\treturn res.send({request:\"update\" , status:1 , _id:ret._id , map_id : ret._maps_to_[0]});\n\t\t\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t\t\t}else {\n\t\t\t\t\t\t\t\t\tlogToConsole(err);\n\t\t\t\t\t\t\t\t\treturn res.status(500).send({request:\"update\" , status:-1, err:err}); \n\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\treturn res.send({request:\"update\" , status:1});\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t} else {\n\t\t\t\treturn res.status(500).send({request:\"update\" , status:-1, err:err}); \n\t\t\t}\n\t\t});\n\t });\n}", "_update() {\n const revision = this.model.get('fileRevision');\n const diffRevision = this.model.get('diffRevision');\n\n if (diffRevision) {\n this._values = [diffRevision, revision];\n } else {\n this._values = [0, revision];\n }\n\n if (this._rendered) {\n this._updateHandles();\n }\n }", "_updateDOM() {\n this._updateAttributes();\n this._updateStyles();\n }", "function initialize_modules() {\n let modules = [];\n /* read all modules from modules directory */\n let files = fs.readdirSync(\"./modules\");\n for (file of files) {\n const mod = require(\"./modules/\" + file);\n for (event in mod.hooks) {\n client.on(event, mod.hooks[event]);\n }\n modules.push(mod);\n }\n bot.modules = modules;\n}", "function update(msg) {\n switch(msg.msg) {\n case CREATE_DOCS_FILES:\n createDirectory('docs')\n writeDocsFiles(msg.docsFiles)\n break\n case READ_DOCS:\n sendJsonDocs(msg.docsFile)\n break\n }\n}", "function updatePaddles()\n{\n updateObjects('paddles');\n}", "function updateDocument(docId, words) {\n return Promise.resolve()\n .then(() => {\n return this.wordIndex_removeDocument(docId);\n }).then(() => {\n return this.wordIndex_addDocument(docId, words);\n });\n}", "[LOAD_MODULES](state, modules) {\n state.modules = modules;\n }", "runModules (event) {\n if (event === 'init') {\n // Initializing a module should only be done if it has an init\n // function, which means it's not rendered in the template.\n for (let key in PNotify.modules) {\n if (!PNotify.modules.hasOwnProperty(key)) {\n continue;\n }\n if (typeof PNotify.modules[key].init === 'function') {\n const module = PNotify.modules[key].init(this);\n this.initModule(module);\n }\n }\n } else {\n const {_modules} = this.get();\n for (let module in _modules) {\n if (!_modules.hasOwnProperty(module)) {\n continue;\n }\n const moduleOptions = Object.assign({\n '_notice': this,\n '_options': this.get()\n }, this.get().modules[module]);\n _modules[module].set(moduleOptions);\n if (typeof _modules[module][event] === 'function') {\n _modules[module][event]();\n }\n }\n }\n }", "async function changeSMS(req, res) {\n let update = req.body.newSMS\n let doc = await Numbers.find({})\n doc[0].numbers.push(update);\n await doc[0].save();\n res.type('application/json').send(JSON.stringify(doc[0]));\n}", "function adminUpdate(data) {\n\t\t\t\n\t\t\t\n\t\t}", "function saveStorage() {\n store.set(planner.list.modules, modules.toJSON());\n }", "editGallery() {\n const { updateGalleries } = this.props;\n GalleriesService.update({_id: this.state.gallery._id}, {$set: { name: this.state.editGallery.name, description: this.state.editGallery.description}}, { multi: false, upset: false }, (error, item) => {\n if (error) {\n console.log(error)\n }\n else {\n let gallery = this.state.gallery\n gallery.name = this.state.editGallery.name\n gallery.description = this.state.editGallery.description\n this.setState({gallery: gallery})\n\n // Dispatch the update of the gallery.\n updateGalleries(gallery)\n\n this.toggleEditGalleryModal()\n }\n })\n }", "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 initModulesDiv(modules) {\n\t\tExt.each(projectGlobal.modulesInDiv, function (module) {\n\t\t\tvar contentEl = Ext.get(module.divIdToDisplay);\n\t\t\tif (Ext.isEmpty(contentEl)) {\n\t\t\t\tExt.Msg.alert(i18n.get('label.error'), String.format(i18n\n\t\t\t\t\t\t\t\t\t\t.get('label.invalidModuleDivId'),\n\t\t\t\t\t\t\t\tmodule.name, module.divIdToDisplay));\n\t\t\t} else {\n\t\t\t\tmodule = new Ext.Panel({\n\t\t\t\t\tid : module.id,\n\t\t\t\t\tborder : false,\n\t\t\t\t\tcls : \"sitools-module-panel\",\n\t\t\t\t\tlayout : 'fit',\n\t\t\t\t\trenderTo : module.divIdToDisplay,\n\t\t\t\t\tforceLayout : true,\n\t\t\t\t\theight : contentEl.getHeight(),\n\t\t\t\t\twidth : contentEl.getWidth(),\n items : [ {\n layout : 'fit',\n xtype : module.xtype,\n listProjectModulesConfig : module.listProjectModulesConfig,\n moduleProperties : module.properties\n } ],\n\t\t\t\t\tlisteners : {\n\t\t\t\t\t\tresize : function (me) {\n\t\t\t\t\t\t\tif (!SitoolsDesk.desktopMaximizeMode && module.container) {\n\t\t\t\t\t\t\t\tme.setSize(Ext.get(module.container).getSize());\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t},\n\t\t\t\t\t\tmaximizeDesktop : function (me) {\n\t\t\t\t\t\t\tme.hide();\n\t\t\t\t\t\t\tme.doLayout();\n\t\t\t\t\t\t},\n\t\t\t\t\t\tminimizeDesktop : function (me) {\n\t\t\t\t\t\t if (module.container) {\n me.setSize(Ext.get(module.container).getSize());\n }\n\t\t\t\t\t\t\tme.show();\n\t\t\t\t\t\t\tme.doLayout();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t});\n\t\t\t\tSitoolsDesk.app.modulesInDiv.push(module);\n\t\t\t}\n\t\t});\n\t}", "async update() {}", "function update() {}", "async getUpdatedDocumentsByProviders (req, res, next) {\n const updatedProvidersIds = Object.keys(req.body[0]);\n\n const oldDocuments = await this.service.getAlteredDocumentsByProviders(updatedProvidersIds);\n\n req.oldDocuments = oldDocuments;\n req.updatedProvidersIds = updatedProvidersIds;\n \n return next();\n }", "function mapModules(mapfn) {\n _.forEach(modules.modules, mapfn); \n }", "ensureDocs(modelName, docs, cb) {\n var upserts = docs.map(\n u => ({ updateOne: { q: {_id:u._id}, u, upsert: true } }) )\n\n collection(modelName).bulkWrite(upserts, {ordered:false}, cb)\n }", "function updateDocContents(aDoc) {\n\n // Updates UI\n let html = Asciidoctor().convert(aDoc.contents);\n html = html\n .replaceAll('<div class=\"title\">Important</div>', '<div class=\"title\" style=\"color:red\">❗ IMPORTANTE</div>')\n .replaceAll('<div class=\"title\">Warning</div>', '<div class=\"title\" style=\"color:orange\">⚠️ ATENCIÓN</div>');\n document.getElementById('adoc-contents').innerHTML = html;\n\n // Updates UI for 'Índice' section\n if (aDoc.name === 'indice') {\n html = '';\n index.forEach(doc => {\n html += `<tr>\n <td>${doc.source}</td>\n <td><a href=\"#\" onclick=\"goToDocSec('${doc.id}', '')\" title=\"Ir a ejercicio\">${doc.number} - ${doc.title}</a></td>\n <td>${doc.units.join(', ')}</td>\n <td>${doc.topics.join(', ')}</td>\n </tr>`;\n });\n document.getElementById('tabla-ejercicios-body').innerHTML = html;\n }\n \n // Updates Latex rendering\n MathJax.typeset();\n}" ]
[ "0.7028102", "0.68724585", "0.6806519", "0.65929127", "0.65024394", "0.62758046", "0.5672086", "0.54816806", "0.54205954", "0.541616", "0.53961957", "0.53902787", "0.536893", "0.53682184", "0.53382444", "0.53338647", "0.5300493", "0.52351755", "0.52254105", "0.5219383", "0.5167694", "0.51607734", "0.51335216", "0.5119554", "0.5103196", "0.50714856", "0.50629497", "0.5056583", "0.502096", "0.5011544", "0.5011251", "0.49912754", "0.49773523", "0.49455708", "0.4944217", "0.49345365", "0.4930737", "0.4922819", "0.4916703", "0.4902197", "0.48962402", "0.48919702", "0.4882101", "0.48783195", "0.48667967", "0.4865786", "0.48632798", "0.48566392", "0.48358947", "0.482095", "0.48187116", "0.4811508", "0.4811319", "0.4811319", "0.4811319", "0.48104435", "0.4802997", "0.48028433", "0.48003152", "0.47999394", "0.47978175", "0.47897288", "0.47783598", "0.47684202", "0.47680274", "0.47623414", "0.47615558", "0.47603244", "0.4745399", "0.472671", "0.47250426", "0.4723118", "0.4718196", "0.47168586", "0.4714361", "0.4714361", "0.47139433", "0.47139433", "0.47125882", "0.47113755", "0.47110292", "0.4710294", "0.47067845", "0.47067383", "0.47066718", "0.46975833", "0.46864927", "0.46729878", "0.46713486", "0.4665128", "0.46524727", "0.46523282", "0.4650343", "0.46501708", "0.4649248", "0.4648141", "0.46431276", "0.463778", "0.46377224" ]
0.6888609
2
Function name: delete module Author: Reccion, Jeremy Date Modified: 2018/04/23 Description: drops the specific collection then remove its document from the 'modules' collection Parameter(s): moduleName: string type Return: Promise
function deleteModule(moduleName){ var deferred = Q.defer(); moduleName = moduleName.toLowerCase(); //drop the collection db.bind(moduleName); db[moduleName].drop(function(err){ if(err){ if(err.codeName == 'NamespaceNotFound'){ deferred.reject(notFound); } else{ deferred.reject(err); } } else{ //remove document from 'modules' collection db.modules.remove({name: moduleName}, function(err, writeResult){ if(err){ deferred.reject(err); } else{ //n is used to know if the document was removed if(writeResult.result.n == 0){ deferred.reject(notFound); } else{ deferred.resolve(); } } }); } }); return deferred.promise; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function deleteModule(id, moduleName){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n\n //drop the collection\n db.bind(moduleName);\n db[moduleName].drop();\n\n //remove document from 'modules' collection\n db.modules.remove({_id: mongo.helper.toObjectID(id)}, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n deferred.resolve();\n }\n });\n\n return deferred.promise;\n}", "function deleteModuleDoc(moduleName, id){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n\n db.bind(moduleName);\n\n db[moduleName].remove({_id: mongo.helper.toObjectID(id)}, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n deferred.resolve();\n }\n });\n\n return deferred.promise;\n}", "function deleteModuleDoc(moduleName, id){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n\n db.bind(moduleName);\n\n db[moduleName].remove({_id: mongo.helper.toObjectID(id)}, function(err, writeResult){\n if(err){\n deferred.reject(err);\n }\n else{\n //n is used to know if the document was removed\n if(writeResult.result.n == 0){\n deferred.reject(notFound);\n }\n else{\n deferred.resolve();\n }\n }\n });\n\n return deferred.promise;\n}", "function deleteMod() {\n // eslint-disable-next-line no-restricted-globals\n if (\n confirm(\n 'Are you sure you want to delete this module? This cannot be undone.',\n )\n ) {\n db.collection('modules')\n .doc(module.value)\n .delete()\n .then(function () {\n history.push('/success');\n console.log('doc deleted successfully');\n return true;\n });\n } else {\n return false;\n }\n }", "function deleteModuleField(moduleName, fieldID){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n \n db.modules.update({name: moduleName}, {$pull: {fields: {id: mongo.helper.toObjectID(fieldID)}}}, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n deferred.resolve();\n }\n });\n\n return deferred.promise;\n}", "function deleteModuleField(moduleName, fieldID){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n \n db.modules.update({name: moduleName}, {$pull: {fields: {id: mongo.helper.toObjectID(fieldID)}}}, function(err, writeResult){\n if(err){\n deferred.reject(err);\n }\n else{\n if(writeResult.result.nModified == 0){\n deferred.reject(notFound);\n }\n else{\n deferred.resolve();\n }\n }\n });\n\n return deferred.promise;\n}", "_delete (moduleName){\n delete this._dynamicParentsMap[moduleName];\n // SystemJs doesn't do this?\n delete this._system.loads[moduleName];\n // Do regular delete\n return this._systemDelete.apply(this._system, arguments);\n }", "deleteModule(moduleId, passphrase) {\n return this.httpService({\n method: 'DELETE',\n url: `${this.rootURL}microAnalytics?microAnalyticsId=${moduleId}`,\n headers: {Authorization: `basic ${passphrase}`}\n });\n }", "removeModule() {\n this.props.firebase.database.ref('users')\n .child(this.props.firebase.auth.currentUser.uid)\n .child('appointments')\n .child('appointmentsArr')\n .once('value', snapshot => {\n snapshot.forEach(child => {\n console.log(child.val().title)\n if (child.val().title === this.props.module) {\n child.ref.remove();\n }\n })\n });\n this.props.firebase.database.ref('users')\n .child(this.props.firebase.auth.currentUser.uid)\n .child('appointments')\n .child('modsData')\n .child(this.props.module)\n .remove()\n }", "removeModule (path) {\n if (typeof path === 'string') path = [path]\n\n delete this.registeredModules[path.join('/')]\n\n if (_utils_shared_data__WEBPACK_IMPORTED_MODULE_1__[\"default\"].recordVuex) {\n this.addMutation(`Unregister module: ${path.join('/')}`, {\n path\n }, {\n unregisterModule: true\n })\n }\n }", "function updateModule(updateModule){\n var deferred = Q.defer();\n\n updateModule.name = updateModule.name.toLowerCase();\n\n //fields array should not be editable when using this function. therefore, delete it from input\n delete updateModule.fields;\n\n //check if the name of the selected module has not changed\n db.modules.findOne({_id: mongo.helper.toObjectID(updateModule._id)}, function(err, aModule){\n if(err){\n deferred.reject(err);\n }\n else if(aModule){\n //if names are different, renaming the collection must be executed, then proceed to update\n if(aModule.name != updateModule.name){\n db.bind(aModule.name);\n db[aModule.name].rename(updateModule.name, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n update();\n }\n });\n }\n }\n else{\n update();\n }\n });\n\n //updates the document in the 'modules' collection\n function update(){\n\n //create another object and copy. then delete the '_id' property of the new copy\n var forUpdate = {};\n Object.assign(forUpdate, updateModule);\n delete forUpdate._id;\n \n db.modules.update({_id: mongo.helper.toObjectID(updateModule._id)}, {$set: forUpdate}, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n deferred.resolve();\n }\n });\n }\n\n return deferred.promise;\n}", "function uninstallModule(options, cli, next) {\n\n // Get the module name\n var moduleName = options[1];\n if (!moduleName) {\n next(new Error(\"You must specify a module name (@version is ignored).\"));\n return;\n }\n\n // Split module / version\n var moduleVersion = moduleName.split('@')[1] || \"\";\n var moduleName = moduleName.split('@')[0];\n\n // Locate the module\n var installedModule = calipso.modules[moduleName];\n var installed = installedModule ? true : false;\n\n // Assume that we want to re-install the dependencies via NPM\n if (installed) {\n\n if (installedModule.type === \"core\") {\n next(new Error(\"You should not delete core modules unless you really know what you are doing!\"));\n return;\n }\n\n // This can't be messed with, as it is populated based on pre-existing path type/name.\n var path = __dirname + \"/../modules/\" + installedModule.type + \"/\" + installedModule.name;\n\n confirm('This will remove the module completely from the site and cannot be undone, continue? '.red.bold, function (ok) {\n if (ok) {\n process.stdin.destroy();\n console.log(\"Removing \" + installedModule.name.green.bold + \", please wait ...\");\n exec('rm -rf ' + path, { timeout:5000, cwd:__dirname }, function (error, stdout, stderr) {\n\n var err = ((error ? error.message : '') || stderr);\n\n if (!err) {\n console.log(stdout + \"Module \" + installedModule.name.green.bold + \" uninstalled completely.\");\n next();\n } else {\n next(new Error(err));\n }\n });\n\n } else {\n next();\n }\n });\n\n } else {\n\n console.log(\"Module \" + moduleName.green.bold + \" is not installed.\");\n next();\n\n }\n\n}", "static async deleteCollection(req, res) {\n const { collection } = req.params;\n await deleteItem({ collection });\n return res.status(404).json({ message: `collection '${collection}' deleted` });\n }", "function updateModule(updateModule){\n var deferred = Q.defer();\n\n updateModule.name = updateModule.name.toLowerCase();\n\n //fields array should not be editable when using this function. therefore, delete it from input\n delete updateModule.fields;\n\n db.modules.find({$or: [\n {_id: mongo.helper.toObjectID(updateModule._id)},\n {name: updateModule.name}\n ]}).toArray(function(err, modules){\n if(err){\n deferred.reject(err);\n }\n else if(modules.length == 0){\n deferred.reject(notFound);\n }\n //vali inputs, no other document have the same name\n else if(modules.length == 1){\n var oldModule = modules[0];\n \n //rename if old & new names are different\n if(oldModule.name != updateModule.name){\n db.bind(oldModule.name);\n db[oldModule.name].rename(updateModule.name, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n update();\n }\n });\n }\n //go straight to update\n else{\n update();\n }\n }\n //another module document with the same name exists\n else{\n deferred.reject(exists);\n }\n }); \n\n //updates the document in the 'modules' collection\n function update(){\n\n //create another object and copy. then delete the '_id' property of the new copy\n var forUpdate = {};\n Object.assign(forUpdate, updateModule);\n delete forUpdate._id;\n \n db.modules.update({_id: mongo.helper.toObjectID(updateModule._id)}, {$set: forUpdate}, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n deferred.resolve();\n }\n });\n }\n\n return deferred.promise;\n}", "async function removeReviewForFreelancer(db, freelancerId) {\n try {\n // let db = await MongoUtil.connect(mongoUrl, dbName);\n let result = await db.collection(collectionName).deleteMany({\n 'for': ObjectId(freelancerId)\n });\n return result\n } catch(e) {\n errorMsg = `\n Error encountered when removing data from DB.\n Collection: ${collectionName}, Freelancer Id: ${freelancerId}, Error: ${e}\n `\n console.error(errorMsg)\n throw new MongoUtil.DBError(errorMsg);\n }\n}", "function updateModuleDoc(moduleName, updateDoc){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n\n db.bind(moduleName);\n\n //create another object and copy. then delete the '_id' property of the new copy\n var forUpdate = {};\n Object.assign(forUpdate, updateDoc);\n delete forUpdate._id;\n\n db[moduleName].update({_id: mongo.helper.toObjectID(updateDoc._id)}, {$set: forUpdate}, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n deferred.resolve();\n }\n });\n\n return deferred.promise;\n}", "async function removeCourse(id) {\n // const result = await Course.deleteOne({ _id: id });\n // const result = await Course.deleteMany({ _id: id });\n const course = await Course.findByIdAndRemove(id);\n // console.log(result);\n console.log(course);\n}", "async function remove(db, nam, o) {\n var o = _.merge({}, OPTIONS, o), db = db||o.db;\n db = typeof db==='string'? await setup(db, o):db;\n var nam = nam||o.input||(await getUpload(db, o)).title;\n if(o.log) console.log('-remove:', nam);\n await db.run('DELETE FROM \"pages\" WHERE \"title\" = ?', nam);\n return nam;\n}", "_deleteDocument(req, res, next) {\n let documentId = req.params.id\n this.engine.deleteDocument(documentId, function(err, result) {\n if (err) return next(err)\n res.json(result)\n })\n }", "async deleteProduct(req, res, next) {\n console.log(\"inside delete function\");\n let document;\n try {\n document = await ProductDB.findOneAndDelete({ _id: req.params.id });\n // console.log(document.image);\n fs.unlink(document.image, (error) => {\n if (error) {\n return next(error);\n }\n });\n } catch (error) {\n return next(error);\n }\n res.json({ document });\n }", "function deleteData(req, res) {\n var p = config.getDB().then(function(db){\n db.collection(\"chartinsert\").remove({_id:ObjectID(req.params.id)},function(err,data){\n if(err) res.status(500).json({success:false,message:'something went wrong.'})\n else{\n // console.log(data)\n res.status(200).json({success:true, message:'deleted successfully'})\n }\n })\n })\n}", "async function removeCourse(id) {\n //return await Course.deleteOne({_id:id});\n\n //delete 1st one\n //Course.deleteOne({isPublish : false});\n //delete many\n //Course.deleteMany(id);\n const deletedCourse = await Course.findByIdAndRemove(id);\n return deletedCourse;\n //if specify delete id is not in db, it will return null, otherwise return the document b4 deleted.\n}", "deleteCollection(name) {\n return new Promise((resolve, reject) => {\n chrome.storage.sync.remove(name, () => {\n this.config.collections[this.database].splice(this.config.collections[this.database].indexOf(name), 1);\n resolve(true);\n });\n });\n }", "delete(req, res) {\n // delete only allowed for authorised user of their own documents or admin\n const isPermittedUser =\n req.decoded.role === 'Administrator' || req.decoded._id === req.params.id;\n\n if (!isPermittedUser) {\n return res.json(403, {\n message: 'Forbidden to delete this document.',\n });\n }\n\n return Document.findOneAndRemove({ _id: req.params.id })\n .then((document) => res.status(200).json({ message: document }))\n .catch((err) => res.status(500).json({ message: err }));\n }", "function deleteFromLiveMongo(request) {\n return new Promise(async function (resolve, reject) {\n try {\n var database = country_wise_database[request.country_code];\n var FP_ID = new ObjectId(request.fp_id);\n var local_database = await MongoClient.connect(liveDbUrl, { connectTimeoutMS: 90000, socketTimeoutMS: 90000 });\n\n let D_B = (request._index == 'dp_projects') ? MongoSettings.live.projects_database : MongoSettings.live.business_database;\n let collection = (request._type == 'projects') ? MongoSettings.live.projects_collection : MongoSettings.live.business_collection;\n\n var dbo = local_database.db(D_B);\n var query = { _id: FP_ID };\n\n var res = await dbo.collection(collection).remove(query);\n\n if (res.hasOwnProperty('result')) {\n //res.result.n\n let result = {\n type: \"LiveMongo\",\n status: 1,\n message: \"Delete listing from Live Mongo\"\n }\n resolve(result);\n\n } else {\n let result = {\n type: \"LiveMongo\",\n status: 0,\n message: \"Listing not deleted Live Mongo\"\n }\n resolve(result);\n }\n\n } catch (E) {\n let result = {\n type: \"LiveMongo\",\n status: 0,\n message: E.message\n }\n reject(result);\n }\n\n });\n}", "delModuleItem(state, idx) {\n const { imported } = state.info.basic\n // const tag = state.remains[imported[idx] - 1].tag\n // state.info[tag].forEach(v => (v.ref = false))\n imported.splice(idx, 1)\n }", "function deleteDocument(collectionName, id) {\n var collection = data[collectionName];\n if (!collection[id]) {\n throw new Error(`Collection ${collectionName} lacks an item with id ${id}!`);\n }\n delete collection[id];\n updated = true;\n}", "function deleteDocument(collectionName, id) {\n var collection = data[collectionName];\n if (!collection[id]) {\n throw new Error(`Collection ${collectionName} lacks an item with id ${id}!`);\n }\n delete collection[id];\n updated = true;\n}", "function deleteDocument(collectionName, id) {\n var collection = data[collectionName];\n if (!collection[id]) {\n throw new Error(`Collection ${collectionName} lacks an item with id ${id}!`);\n }\n delete collection[id];\n updated = true;\n}", "async deleteLesson(body){\n let gymId = body.gymId;\n let lesson_id = body.lesson_id;\n \n console.log(lesson_id)\n return Gym.findByIdAndUpdate(\n {_id: gymId},\n { $pull: { lessons: lesson_id } });\n }", "function _delete(req, res) {\n if (_adminCommonValidation(req, res, \"delete\")) {\n repository.deletePackageMetadata(req.params.name, req.user, function (err) {\n if (err) {\n var responseData = {\n errors: _toErrorMessageList(err),\n operation: \"delete\"\n };\n if (err.message === \"UNKNOWN_EXTENSION\") {\n res.status(404);\n _respond(req, res, \"adminFailed\", responseData);\n } else if (err.message === \"NOT_AUTHORIZED\") {\n _respondUnauthorized(req, res, \"adminFailed\", responseData);\n } else {\n res.status(400);\n _respond(req, res, \"adminFailed\", responseData);\n }\n } else {\n res.status(200);\n _respond(req, res, \"deleteSucceeded\", {\n name: req.params.name\n });\n }\n });\n }\n}", "remove(id) {\n const doc = this.connection.get(this.collectionName, id);\n doc.subscribe((err) => {\n if (err) throw err;\n doc.del();\n });\n\n this.OpsCollection.remove({'d': id});\n }", "async function removeCourse(id){\r\n //const result=await Course.deleteOne({_id:id});\r\n const result=await Course.findByIdAndRemove(id); // to get info about deleted course\r\n\r\n console.log(result);\r\n}", "async delete(req, res) {\n const projeto = await Projeto.findByPk(req.body.id);\n /*const cadastrosAl = await CadastroAluno.findAll({\n where: {fk_projeto: projeto.id}\n })\n if(cadastrosAl.length > 0){\n cadastrosAl.forEach(cadAl=>{\n await CadastroAluno.destroy(cadAl);\n })\n }*/\n await projeto.destroy();\n if (!projeto) {\n return res.status(400).json({\n Error: ['Não foi possivel deletar o projeto']\n })\n }\n return res.status(200).json({\n Sucess: ['Projeto removido com sucesso']\n })\n }", "async function deleteCourse(id){\n const result = await Course.deleteOne({_id: id});\n // Course.findByIdAndRemove(id);\n console.log(result);\n}", "removeDocument(_docId, event) {\n event.preventDefault();\n const { contractInst, account } = this.props;\n //condition for docid \n if (_docId) {\n contractInst.methods.removeNotarizedDocument(_docId).send({ from: account })\n .then(res => {\n //show toast message\n toast.success(\"Your document has been removed successfully !\");\n //update document list\n this.props.updateList(event);\n }).catch(err => {\n console.error(\"---Error while removing document---\".err);\n });\n }\n }", "function addModuleDoc(moduleName, newDoc){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n\n db.bind(moduleName);\n\n db[moduleName].insert(newDoc, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n deferred.resolve();\n }\n });\n\n return deferred.promise;\n}", "function updateModuleDoc(moduleName, updateDoc){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n\n service.findDuplicateDoc(moduleName, updateDoc).then(function(){\n db.bind(moduleName);\n \n //convert '_id' to ObjectID\n updateDoc._id = new ObjectID(updateDoc._id);\n \n db[moduleName].update({_id: updateDoc._id}, {$set: updateDoc}, function(err, writeResult){\n if(err){\n deferred.reject(err);\n }\n else{\n if(writeResult.result.nModified == 0){\n deferred.reject(notFound);\n }\n else{\n deferred.resolve();\n }\n }\n });\n }).catch(function(err){\n deferred.reject(err);\n });\n\n return deferred.promise;\n}", "function remove(req, res , next){\r\n res.setHeader('Access-Control-Allow-Origin','*');\r\n res.setHeader('Access-Control-Allow-Methods','OPTIONS,DELETE');\r\n var _item = JSON.parse(req.params.itemJson)[0];\r\n console.log(\"remove DELETE: action= \"+req.params.action+\" itemJson[0]: \"+JSON.stringify(_item));\r\n \r\n // ??????????????????????????\r\n db.collection(req.path().split(\"/\")[1]).remove({_id:mongojs.ObjectId(JSON.parse(req.params.itemJson)[0]._id)} , function(err , success){\r\n console.log('Response success '+success);\r\n console.log('Response error '+err);\r\n if(success){\r\n res.send(200 , success);\r\n return next();\r\n }\r\n return next(err);\r\n })\r\n \r\n}", "deleteGoal(id) {\n this.db.remove({ _id: id }, {}, function (err, docsRem) {\n if (err) {\n console.log(\"Error deleting document.\");\n } else {\n console.log(docsRem, \"Document(s) removed from database.\");\n }\n });\n }", "function removeById(resourceName, id) {\n\n \tconst collection = getModel(resourceName);\n\n \treturn collection.findOneAndRemove({_id: id})\n \t.then(data => {\n\n \t\tconst resp = {\n \t\t\tdoc: data,\n \t\t\tmetadata: {\n \t\t\t\tmodified: data.length\n \t\t\t}\n \t\t};\n\n \t\treturn resp;\n \t})\n \t.catch(err => {\n \t\tconsole.log(err);\n \t\tconsole.log(\"db.removeById error\");\n \t});\n }", "async delete(id) {\n let collection = await this.collection();\n await collection.deleteOne({_id: ObjectId(id)});\n this.dbClient.close();\n return console.log('Item successfully deleted')\n }", "async function eliminarDocumento(id){\n const result = await Curso.deleteOne({_id: id});\n console.log('Documento eliminado', result); \n}", "async deleteDoc(target) {\n let collection = await this.collection()\n let id = ObjectId(target)\n\n await collection.deleteOne({_id: id})\n\n }", "async function dropSpecificCollection(genre) {\n try {\n console.log('asdasd')\n movieModel[genre].collection.drop((err, result) => {\n if (err) return err;\n result && console.log(collection+ \"Collection successfully deleted.\");\n })\n }\n catch (error) {\n console.log(error)\n }\n}", "function deleteProject (req, res) {\n console.log('params.id', req.params.id)\n DESCRIPTION.destroy({\n where: {\n ProjectId: req.params.id\n }\n }).then(() => {\n IMAGEPATH.destroy({\n where: {\n ProjectId: req.params.id\n }\n }).then(() => {\n PROJECT.destroy({\n where: {\n id: req.params.id\n }\n }).then(() => {\n res.send(true)\n }).catch(err => {\n console.log(err)\n res.send(false)\n })\n }).catch(err => {\n console.log(err)\n res.send(false)\n })\n }).catch(err => {\n console.log(err)\n res.send(false)\n })\n}", "unloadModule(name) {\r\n if (!this.modules[name]) return\r\n\r\n delete this.modules[name]\r\n\r\n for (var cmd in this.commands) {\r\n if (this.commands[cmd].module.name == name) {\r\n delete this.commands[cmd]\r\n }\r\n }\r\n }", "supprimerParId(id) {\n mongoose.model('Publicite').findByIdAndDelete({_id : id}, cb).then((result)=>{\n console.log(\"suppression effectuée\");\n }).catch((error)=>{\n console.log(\"erreur suppression\");\n });\n }", "function deleteCard(Id) { \n if (AdminGroup.has(globaluser.uid)) { \n db.collection(\".messages\").doc(Id).delete().then(() => {\n console.log(\"Document successfully deleted!\"); \n}).catch((error) => {\n console.error(\"Error removing document: \", error);\n});\n} \n}", "function deleteCollection(collection_id) {\n conn.query('DELETE FROM Collections WHERE collection_id=$1',\n [collection_id])\n .on('error', console.error);\n}", "supprimerParId(id) {\n console.log(id + \" <=id \");\n mongoose.model('Article').deleteOne({\"_id\" : id}).then((result)=>{\n console.log('ok deleted');\n }).catch((err)=>{\n console.log(err);\n });\n }", "function removeCollection(){\n WL.JSONStore.get(collectionName).removeCollection().then(function () {\n showHideConsole(\"show\");\n document.getElementById(\"apiCommands_screen\").style.display = \"none\";\n document.getElementById(\"initCollection_screen\").style.display = \"block\";\n document.getElementById(\"resultsDiv\").innerHTML = \"Collection Removed Successfuly\";\n\t}).fail(function (errorObject) {\n\t\talert(\"Failed to Remove collection!\");\n\t});\n}", "function addModuleDoc(moduleName, newDoc){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n\n service.findDuplicateDoc(moduleName, newDoc).then(function(){\n db.bind(moduleName);\n\n db[moduleName].insert(newDoc, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n deferred.resolve();\n }\n });\n }).catch(function(err){\n deferred.reject(err);\n });\n\n return deferred.promise;\n}", "function deleteDB(){\n var MongoClient = require('mongodb').MongoClient;\n var url = \"mongodb://127.0.0.1:27017/jungleElementsDB\";\n\n // client id to be deleted to be in the var\n var dele_client_id = \"2\";\n\n\n MongoClient.connect(url, function(err, db) {\n if (err) throw err;\n // var delete_client_id = { client_id: dele_client_id };\n\n db.collection(\"customers\").removeOne({client_id:dele_client_id}, function(err, obj) {\n if (err) throw err;\n console.log(\"1 client removed from database : client id = \"+dele_client_id);\n db.close();\n });\n });\n\n}", "function remove(module, endpoint, auth) {\n return $.ajax(makeRequest('DELETE', module, endpoint, auth));\n }", "function removeProd() {\n var id = document.getElementById(\"idProdDel\").value;\n requestDB = db.transaction([\"produtos\"], \"readwrite\")\n .objectStore(\"produtos\")\n .delete(Number(id));\n\n requestDB.onsuccess = function () {\n console.log(\"Removido \" + id);\n };\n requestDB.onerror = function () {\n console.log(\"Erro ao remover\");\n };\n}", "clearDatabase() {\n const User = require(\"../../db/user.js\");\n const Course = require(\"../../db/course.js\");\n const Class = require(\"../../db/class.js\");\n const ClassEnrollment = require(\"../../db/classEnrollment.js\");\n const Deliverable = require(\"../../db/deliverable.js\");\n const DeliverableSubmission = require(\"../../db/deliverableSubmission.js\");\n\n // Set up the MongoDB.\n const mongoose = require(\"mongoose\");\n mongoose.connect(\"mongodb://localhost/cmsApp\");\n const db = mongoose.connection;\n db.on(\"error\", console.error.bind(console, \"MongoDB Connection Error:\"));\n\n // Clear the database.\n // NOTE: DO NOT USE THE 'AWAIT' KEYWORD HERE!!! IT DOES NOT WORK!!!\n\n // Delete all the student Users.\n User.deleteMany({accountType: \"student\"}, function(err) {\n if ( err ) {\n console.log(err); \n\t\t }\n });\n // Delete all the professor Users.\n User.deleteMany({accountType: \"professor\"}, function(err) {\n if ( err ) {\n console.log(err); \n\t\t }\n });\n // Delete all the Courses.\n Course.deleteMany({}, function(err) {\n if ( err ) {\n console.log(err); \n\t\t }\n\t });\n // Delete all the Classes.\n Class.deleteMany({}, function(err) {\n if ( err ) {\n console.log(err); \n\t\t }\n\t });\n // Delete all the ClassEnrollments.\n ClassEnrollment.deleteMany({}, function(err) {\n if ( err ) {\n console.log(err); \n\t\t }\n\t });\n // Delete all the Deliverables.\n Deliverable.deleteMany({}, function(err) {\n if ( err ) {\n console.log(err); \n\t\t }\n\t });\n // Delete all the DeliverableSubmissions.\n DeliverableSubmission.deleteMany({}, function(err) {\n if ( err ) {\n console.log(err); \n\t\t }\n\t });\n \n return null\n }", "function deleteCourse(code){\n var user = firebase.auth().currentUser;\n var userEmail = user.uid;\n var db = firebase.firestore().collection(\"temp\").doc(\"tempdoc\").collection(\"temp-\"+userEmail);\n\n db.doc(code).delete().then(function() {\n updateCoursePlanner();\n console.log(\"Document successfully deleted!\");\n }).catch(function(error) {\n console.error(\"Error removing document: \", error);\n });\n }", "deleteDocument(collection, query, cb) {\n\t\tif (!query) return (cb('Please provide a query (must be json object).'));\n\t\tif (query._id && !(query._id = this.toObjectId(query._id))) return (cb('Please provide a valid id.'));\n\t\tthis.findManyDocuments(collection, query, (err, results) => {\n\t\t\tif (err) return (cb(err));\n\t\t\tif (results.length > 1) return (cb('You cannot delete multiple elements at once using deleteDocument.'));\n\t\t\tthis.mdb.collection(collection).deleteMany(query, (err) => {\n\t\t\t\tif (err) return (cb(err));\n\t\t\t\treturn (cb(null));\n\t\t\t})\n\t\t})\n\t}", "async function deleteCourse(id) {\n return await Course.deleteOne({\"_id\":id});\n}", "async function eliminarDocumento(id){\n const result = await Curso.findByIdAndDelete(id);\n console.log('Documento eliminado', result); \n}", "async function removeCourse(id) {\n const course = await Course.deleteOne({ _id: id });\n console.log(course);\n}", "deleteByTaskId(id, callback) {\n try {\n id = new ObjectID(id)\n } catch (err) {\n callback(null)\n }\n collection.deleteMany({task: id}, callback)\n }", "deleteModalities(modalities){\n for (var i = 0; i < modalities.length; i++) {\n Modalities.remove({_id: modalities[i]});\n }\n }", "function deleteSituation(req, res){\n\n\tremoveDocument(req.swagger.params.thing.value, req.swagger.params.situation.value, function(err, items) {\n\t\tconsole.log(items)\n\t\tif (err || items.deletedCount == 0) {\n\t\t\tres.statusCode = 404;\n\t\t\tres.json({message: \"Document not found\"})\n\t\t} else {\n\t\t\tres.json({name: \"Deleted\"});\n\t\t}\n\t});\n}", "function wipe_module(name){\n\t\t\t\t\t\t//console.log(\"Reloading \"+define.fileName(name))\n\t\t\t\t\t\tfor(var key in define.factory){\n\t\t\t\t\t\t\tvar deps = define.factory[key].deps\n\t\t\t\t\t\t\tif(key !== name && define.module[key] && deps && deps.indexOf(name) !== -1){\n\t\t\t\t\t\t\t\t// remove module\n\t\t\t\t\t\t\t\tdefine.module[key] = undefined\n\t\t\t\t\t\t\t\t// try to wipe all modules that depend our this one\n\t\t\t\t\t\t\t\twipe_module(key)\n\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}", "function getAllModuleDocs(moduleName){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n\n db.bind(moduleName);\n\n db[moduleName].find().toArray(function(err, moduleDocs){\n if(err){\n deferred.reject(err);\n }\n else{\n deferred.resolve(moduleDocs);\n }\n });\n\n return deferred.promise;\n}", "function getAllModuleDocs(moduleName){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n\n db.bind(moduleName);\n\n db[moduleName].find().toArray(function(err, moduleDocs){\n if(err){\n deferred.reject(err);\n }\n else{\n deferred.resolve(moduleDocs);\n }\n });\n\n return deferred.promise;\n}", "function deleteCoin(coin) {\n return new Promise((resolve, reject) => {\n var url = process.env.MONGODB_URL;\n MongoClient.connect(url, { useNewUrlParser: true }, (err, db) => {\n if (err) throw err;\n var dbo = db.db(process.env.MONGODB_NAME);\n var query = { coin: coin };\n dbo.collection(\"articles\").deleteMany(query, (err, obj) => {\n if (err) throw err;\n console.log(obj.result.n + \" document(s) deleted\");\n db.close();\n });\n }); \n });\n}", "deleteByName(req, res) {\n Photo.findOneAndRemove({name: req.params.name}).then(result => {\n res.json(result);\n })\n .catch(err => {\n res.json(err);\n });\n }", "function deletePageForWebsite(websiteId,pageId) {\n return websiteModel\n .findById(websiteId)\n .then(function (website) {\n var index= website.pages.indexOf(pageId);\n //console.log(index);\n website.pages.splice(index,1);\n return website.save();\n });\n}", "async removeList(req,res){\n const {id} = req.params;\n const response = await user.findById(req.userId);\n if(response.userType === 'comum'){ \n await GitUserList.findByIdAndRemove(id);\n res.sendStatus(200);\n }\n else{\n res.status(400).json({error: 'User does not have permission'});\n }\n }", "function deleteProject(req, res) {\n\n\tconst _id = new ObjectID(req.params.id);\n\n\tProject.deleteOne({_id: _id})\n\t\t.then(result =>{\n\t\t\tres.json({ message: \"Project successfully deleted!\", result });\n\t\t})\n\t\t.catch(err =>{\n\t\t\tconsole.log(err);\n\t\t});\n}", "function deleteContentType(req,res,template,block,next) {\n\n var ContentType = calipso.lib.mongoose.model('ContentType');\n var id = req.moduleParams.id;\n\n ContentType.findById(id, function(err, c) {\n \n calipso.e.pre_emit('CONTENT_TYPE_DELETE',c);\n \n ContentType.remove({_id:id}, function(err) {\n if(err) {\n req.flash('info',req.t('Unable to delete the content type because {msg}.',{msg:err.message}));\n res.redirect(\"/content/type\");\n } else {\n calipso.e.post_emit('CONTENT_TYPE_DELETE',c);\n req.flash('info',req.t('The content type has now been deleted.'));\n res.redirect(\"/content/type\");\n }\n next();\n });\n\n });\n \n}", "async function removeData(collectionName, id) {\n const collection = db.get(collectionName);\n collection.remove({ _id: id });\n}", "function deleteComponent(cid)\n{\nvar m=0;\n //delete the module from pm\n for(var k=0; k < pm.modules.length; k++)\n {\n if(pm.modules[k].id == cid)\n {\n m=k;\n break;\n }\n \n } \n\n delete pm.modules[m];\n //delete the wires from pm \n for(var k=0; k < pm.wires.length; k++)\n {\n if((pm.wires[k].src[0].moduleid == cid)||(pm.wires[k].tgt[0].moduleid == cid))\n {\n m=k;\n delete pm.wires[k];\n \n }\n \n }\n \n //delete the module from layout\n for(var k=0; k < pm.layout.length; k++)\n {\n if(pm.layout[k].id == cid)\n {\n m=k;\n break;\n \n }\n }\n \n delete pm.layout[m];\n return;\n\n}", "function dbRemove(firebaseDependencies) {\r\n return Object(__WEBPACK_IMPORTED_MODULE_3_tslib__[\"__awaiter\"])(this, void 0, void 0, function () {\r\n var key, db, tx;\r\n return Object(__WEBPACK_IMPORTED_MODULE_3_tslib__[\"__generator\"])(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n key = getKey(firebaseDependencies);\r\n return [4 /*yield*/, getDbPromise()];\r\n case 1:\r\n db = _a.sent();\r\n tx = db.transaction(OBJECT_STORE_NAME, 'readwrite');\r\n return [4 /*yield*/, tx.objectStore(OBJECT_STORE_NAME).delete(key)];\r\n case 2:\r\n _a.sent();\r\n return [4 /*yield*/, tx.complete];\r\n case 3:\r\n _a.sent();\r\n return [2 /*return*/];\r\n }\r\n });\r\n });\r\n}", "function remove(appConfig) {\n return (0,tslib__WEBPACK_IMPORTED_MODULE_4__.__awaiter)(this, void 0, void 0, function () {\n var key, db, tx;\n return (0,tslib__WEBPACK_IMPORTED_MODULE_4__.__generator)(this, function (_a) {\n switch (_a.label) {\n case 0:\n key = getKey(appConfig);\n return [4 /*yield*/, getDbPromise()];\n case 1:\n db = _a.sent();\n tx = db.transaction(OBJECT_STORE_NAME, 'readwrite');\n return [4 /*yield*/, tx.objectStore(OBJECT_STORE_NAME).delete(key)];\n case 2:\n _a.sent();\n return [4 /*yield*/, tx.complete];\n case 3:\n _a.sent();\n return [2 /*return*/];\n }\n });\n });\n}", "async function eliminarUser(req, res) {\n\n try {\n\n console.log(req.params['id']); \n const usr = await db.collection('users').doc(req.params['id']+\"\").delete();\n let user = await User.findByIdAndRemove(req.params['id'] );\n\n \n res.status(200).send({ user: user });\n } catch (error) {\n res.status(500).send({ error: error });\n }\n\n}", "function dbRemove(firebaseDependencies) {\n return (0,tslib__WEBPACK_IMPORTED_MODULE_5__.__awaiter)(this, void 0, void 0, function () {\n var key, db, tx;\n return (0,tslib__WEBPACK_IMPORTED_MODULE_5__.__generator)(this, function (_a) {\n switch (_a.label) {\n case 0:\n key = getKey(firebaseDependencies);\n return [4 /*yield*/, getDbPromise()];\n case 1:\n db = _a.sent();\n tx = db.transaction(OBJECT_STORE_NAME, 'readwrite');\n return [4 /*yield*/, tx.objectStore(OBJECT_STORE_NAME).delete(key)];\n case 2:\n _a.sent();\n return [4 /*yield*/, tx.complete];\n case 3:\n _a.sent();\n return [2 /*return*/];\n }\n });\n });\n}", "function removeFromColl(wid){\n\n fetch('http://localhost:3000/favorites/',{\n method: 'DELETE',\n headers:{\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify({\n msg:{ action: 'remove', data: wid }\n })\n })\n .then(res => res.json())\n .then(data => {\n if(data.msg === \"S1\"){\n //Removes book from the Html file, after it's removed from the database.\n return document.querySelector(`#wid-${wid}`).remove();\n }else{\n return console.log(\"An error occured while removing the book.\");\n }\n })\n .catch(err => console.log(\"Oops.\"));\n}", "destroy(req, res) {\n if (req.query.mmid && req.query.nid) {\n logger.debug(\n `${callerType} findForMindMapNode -> \n mmid: ${req.body.mmid}, nid: ${req.body.nid}`\n );\n return Project.destroy({\n where: {\n mindmapId: parseInt(req.body.mmid),\n nodeId: parseInt(req.body.nid)\n }\n })\n .then(p => {\n logger.info(`${callerType} destroyByMindMapNode -> \n successful, count: ${p}`);\n res.status(200).send(p);\n })\n .catch(error => {\n logger.error(`${callerType} destroyByMindMapNode -> \n error: ${error.stack}`);\n res.status(400).send(error);\n });\n } else {\n let _obj = util.inspect(req.body, { showHidden: false, depth: null });\n logger.debug(`${callerType} destroy -> request: ${_obj}`);\n return Project.destroy({\n where: { id: parseInt(req.body.id) }\n })\n .then(p => {\n logger.info(`${callerType} destroy -> successful, count: ${p}`);\n res.status(200).send(p);\n })\n .catch(error => {\n logger.error(`${callerType} destroy -> error: ${error.stack}`);\n res.status(400).send(error);\n });\n }\n }", "function deleteProvider(req,res){\n providers.findOneAndRemove({firstName: req.params.firstName}, (err) =>{\n if(!err) {\n res.send(\"User was deleted\");\n } \n });\n}", "del(source = true) {\n return new Promise((resolve, reject) => {\n this.doc.del({ source }, (err) => {\n if (err) {\n reject(err);\n }\n else {\n this.sdb.deleteDoc(this);\n resolve();\n }\n });\n });\n }", "function deleteConductor(req, res){\n\tvar conductorId = req.params.id;\n\n\tPersona.findByIdAndRemove(conductorId, (err, conductorRemoved) =>{\n\t\tif(err){\n\t\t\tres.status(500).send({message: 'Error en el servidor'});\n\t\t}else{\n\t\t\tif(!conductorRemoved){\n\t\t\t\tres.status(404).send({message: 'No se ha borrado el conductor'});\n\t\t\t}else{\n\t\t\t\tres.status(200).send({persona: conductorRemoved});\n\t\t\t}\n\t\t}\n\t});\n}", "function doDestruct(moduleName) {\n var module = modules.modules[moduleName];\n module.isEnabled = false;\n module.destruct();\n }", "async deleteTodo(todo){\n\n // delete the todo from the database\n const result = await _mongoDb.collection(\"todos\").deleteOne({_id: ObjectId(todo.id)});\n\n // return result\n return result;\n\n }", "async destroy({view, auth, request, response,params}) {\n // const x = await auth.user.recipe().fetch().rows[params].id\n // console.log(x.rows[0].id)\n const recipeDataBase = await Recipe.findOrFail(params.id)\n await recipeDataBase.delete() \n }", "function findDuplicateDoc(moduleName, moduleDoc){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n\n //get the fields of the specific module\n service.getModuleByName(moduleName).then(function(aModule){\n //initialize array & object for querying\n var uniqueFields = [];\n var tempObj;\n\n //push the value of the document when a field is unique\n aModule.fields.forEach(function(field){\n if(field.unique){\n tempObj = {};\n tempObj[field.name] = moduleDoc[field.name];\n uniqueFields.push(tempObj);\n }\n });\n\n if(uniqueFields.length == 0){\n deferred.resolve();\n }\n else{\n //use $or for checking each field for uniqueness, not their combination\n db[moduleName].findOne({$or: uniqueFields}, function(err, duplicateDoc){\n if(err){\n deferred.reject(err);\n }\n //a duplicate exists, but needs further checking\n else if(duplicateDoc){\n //updating a module document\n if(moduleDoc._id){\n //different module documents with similar unique values\n if(moduleDoc._id != duplicateDoc._id){\n deferred.reject(exists);\n }\n //since it is the same document, it is not duplicate\n else{\n deferred.resolve();\n }\n }\n //adding new module documennt\n else{\n deferred.reject(exists);\n }\n }\n //does not exist\n else{\n deferred.resolve();\n }\n });\n }\n\n \n }).catch(function(err){\n deferred.reject(err);\n });\n\n return deferred.promise;\n}", "async deleteDocument(collection, document) {\n const deleteDoc = await this.db\n .collection(collection)\n .doc(document)\n .delete();\n }", "delete({ sponsor }, res) {\n sponsor.destroy()\n .then( ()=> res.json(sponsor) );\n }", "deleteFile(name) {\n let auth = this.auth;\n const drive = google.drive({ version: 'v3', auth });\n this.db.collection(\"filesCollection\").findOne({\"name\": name}).then(file => {\n console.log(`Deleting file ${name} with id ${file.fileId} and keyId ${file.keyId}`);\n drive.files.delete({\n 'fileId': file.fileId\n }).then(fileDeleteRes => {\n drive.files.delete({\n 'fileId': file.keyId\n }).then(keyDeleteRes => {\n this.db.collection(\"filesCollection\").deleteOne({\"name\": name}).then(res => console.log(\"File in the database deleted\"));\n });\n });\n });\n }", "function dbRemove(firebaseDependencies) {\n return Object(tslib__WEBPACK_IMPORTED_MODULE_3__[\"__awaiter\"])(this, void 0, void 0, function () {\n var key, db, tx;\n return Object(tslib__WEBPACK_IMPORTED_MODULE_3__[\"__generator\"])(this, function (_a) {\n switch (_a.label) {\n case 0:\n key = getKey(firebaseDependencies);\n return [4 /*yield*/, getDbPromise()];\n case 1:\n db = _a.sent();\n tx = db.transaction(OBJECT_STORE_NAME, 'readwrite');\n return [4 /*yield*/, tx.objectStore(OBJECT_STORE_NAME).delete(key)];\n case 2:\n _a.sent();\n return [4 /*yield*/, tx.complete];\n case 3:\n _a.sent();\n return [2 /*return*/];\n }\n });\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 }", "static deleteTemplate(req, res) {\n let type = req.params.type;\n let id = req.params.id;\n\n ConnectionHelper.getTemplateProvider(req.project, req.environment)\n .then((connection) => {\n if(!connection) { return Promise.reject(new Error('No template provider found')); }\n \n return connection.deleteTemplateById(type, id);\n })\n .then(() => {\n res.status(200).send('OK');\n })\n .catch((e) => {\n res.status(404).send(ApiController.printError(e, false));\n }); \n }", "async function deleteItem(req, res){\n const item=await Item.findById(req.params._id)\n if (!item){\n throw new Error(\"item notfound\")\n } else {\n const deletedItem=await item.remove()\n res.json(`${deletedItem.name} removed successfully`)\n }\n \n}", "async deleteDocument(ctx, documentId) {\n const exists = await this.documentExists(ctx, documentId);\n if (!exists) {\n throw new Error(`The document ${documentId} does not exist`);\n }\n await ctx.stub.deleteState(documentId);\n }", "async function DeleteRecords(req, res) {\n if(check_module.auth(req.query.api_key, res))\n try {\n res.json({ auth: 'OK', msg: `${await recordsmodel.del()}`})\n } catch (e) {\n res.status(404) // Not found (no records)\n res.json({ auth: \"OK\", api: 'DelRecords', error_msg: e })\n }\n}", "function deletePage(req, res) {\n var pageId = req.params.pageId;\n for(var p in pages) {\n if(pageId == pages[p]._id) {\n pages.splice(p,1);\n res.sendStatus(200);\n return;\n }\n }\n res.sendStatus(404);\n }", "function findDuplicateDoc(moduleName, moduleDoc){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n\n //get the fields of the specific module\n service.getModuleByName(moduleName).then(function(aModule){\n //initialize array & object for querying\n var uniqueValues = [];\n var tempObj;\n\n //push the value of the document when a field is unique\n aModule.fields.forEach(function(field){\n if(field.unique){\n tempObj = {};\n tempObj[field.name] = moduleDoc[field.name];\n uniqueValues.push(tempObj);\n }\n });\n\n if(uniqueValues.length == 0){\n deferred.resolve();\n }\n else{\n db.bind(moduleName);\n\n //use $or for checking each field for uniqueness, not their combination\n db[moduleName].findOne({$or: uniqueValues}, function(err, duplicateDoc){\n if(err){\n deferred.reject(err);\n }\n //a duplicate exists, but needs further checking\n else if(duplicateDoc){\n //updating a module document\n if(moduleDoc._id){\n //different module documents with similar unique values\n if(moduleDoc._id != duplicateDoc._id){\n deferred.reject(exists);\n }\n //since it is the same document, it is not duplicate\n else{\n deferred.resolve();\n }\n }\n //adding new module documennt\n else{\n deferred.reject(exists);\n }\n }\n //does not exist - similar to notFound. but it is not rejected based on design\n else{\n deferred.resolve();\n }\n });\n }\n }).catch(function(err){\n deferred.reject(err);\n });\n\n return deferred.promise;\n}" ]
[ "0.84370935", "0.7958818", "0.79092586", "0.7097685", "0.6860468", "0.67647773", "0.662002", "0.6473157", "0.62492627", "0.58944094", "0.5845492", "0.5764855", "0.57641274", "0.573505", "0.57172936", "0.5634599", "0.5621253", "0.56094986", "0.55869454", "0.5581452", "0.55264115", "0.5516268", "0.55095196", "0.5491623", "0.5455897", "0.5441675", "0.5439528", "0.5439528", "0.5439528", "0.54263014", "0.5405383", "0.5402001", "0.54013896", "0.5396028", "0.53892344", "0.5356459", "0.5341367", "0.5340494", "0.5339172", "0.53390664", "0.5334807", "0.5334711", "0.53340924", "0.5333343", "0.5332495", "0.5320947", "0.53046495", "0.5301785", "0.52946275", "0.5290146", "0.5289074", "0.52713966", "0.52705204", "0.5263369", "0.5259675", "0.52469987", "0.52458024", "0.52439886", "0.5241758", "0.52343935", "0.5222683", "0.52033824", "0.52016944", "0.52015495", "0.51945454", "0.5192257", "0.51876664", "0.51876664", "0.5183787", "0.5168109", "0.5165262", "0.51583683", "0.5156228", "0.51473093", "0.5140761", "0.51332057", "0.5133025", "0.5114444", "0.51125044", "0.5109536", "0.5106623", "0.5106156", "0.51053566", "0.51021796", "0.5099071", "0.50975376", "0.5095873", "0.50936246", "0.50867236", "0.5080252", "0.5079943", "0.507878", "0.5078667", "0.5077385", "0.50767815", "0.50764513", "0.5065861", "0.5065287", "0.50582504", "0.5054277" ]
0.87686384
0
Function name: add module field Author: Reccion, Jeremy Date Modified: 2018/04/20 Description: insert a new field object to the specific module's fields array Parameter(s): moduleName: required. string type fieldObject: required. object type. includes: name: required. string type unique: required. boolean type Return: Promise
function addModuleField(moduleName, fieldObject){ var deferred = Q.defer(); moduleName = moduleName.toLowerCase(); //create a new objectID to used as query for updates and delete fieldObject.id = new ObjectID(); //the query searches for the module name that do not have the inputted field name //this is to avoid pushing same field names on the 'fields' array of the specified module //writeResult will determine if the update was successful or not (i.e. writeResult.result.nModified) db.modules.update({name: moduleName, fields: {$not: {$elemMatch: {name: fieldObject.name}}}}, {$push: {fields: fieldObject}}, function(err, writeResult){ if(err){ deferred.reject(err); } else{ //console.log(writeResult.result); //check the status of the update, if it failed, it means that there is an existing field name if(writeResult.result.nModified == 0){ deferred.reject(exists); } else{ deferred.resolve(); } } }); return deferred.promise; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addModuleField(moduleName, fieldObject){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n\n //create a new objectID to used as query for updates and delete\n fieldObject.id = new ObjectID();\n\n db.modules.update({name: moduleName}, {$push: {fields: fieldObject}}, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n deferred.resolve();\n }\n });\n\n return deferred.promise;\n}", "function updateModuleField(moduleName, fieldObject){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n\n console.log(fieldObject);\n\n service.getModuleByName(moduleName).then(function(aModule){ \n //use array.filter() to get the duplicate fields\n var duplicateFields = aModule.fields.filter(function(field){\n //lesson learned: use toString() in id\n return field.id.toString() == fieldObject.id.toString() || field.name == fieldObject.name;\n });\n \n if(duplicateFields.length == 0){\n deferred.reject(notFound);\n }\n //valid inputs\n else if(duplicateFields.length == 1){\n //this is to ensure that the field is inside the specific module (in case of improper input parameters)\n\n fieldObject.id = new ObjectID(fieldObject.id);\n\n if(duplicateFields[0].id.toString() == fieldObject.id.toString()){\n db.modules.update({name: moduleName, fields: {$elemMatch: {id: fieldObject.id}}}, {$set: {'fields.$': fieldObject}}, function(err, writeResult){\n if(err){\n deferred.reject(err);\n }\n else{\n console.log(writeResult.result);\n deferred.resolve();\n }\n });\n }\n //the only element has the same name but is different id, therefore, not inside the module document\n else{\n deferred.reject(notFound);\n }\n }\n else{\n deferred.reject(exists);\n }\n }).catch(function(err){\n deferred.reject(err);\n });\n\n return deferred.promise;\n}", "function addField(fieldIndex){\n if(!fieldIndex){\n return;\n }\n var fieldTypes = [\n //Single Line Text Field\n {\"label\": \"New Text Field\", \"type\": \"TEXT\", \"placeholder\": \"New Field\"},\n //Date Field\n {\"label\": \"New Date Field\", \"type\": \"DATE\"},\n //DropDownField\n {\"label\": \"New Dropdown\", \"type\": \"OPTIONS\", \"options\": [\n {\"label\": \"Option 1\", \"value\": \"OPTION_1\"},\n {\"label\": \"Option 2\", \"value\": \"OPTION_2\"},\n {\"label\": \"Option 3\", \"value\": \"OPTION_3\"}\n ]},\n //Checkboxes Field\n {\"label\": \"New Checkboxes\", \"type\": \"CHECKBOXES\", \"options\": [\n {\"label\": \"Option A\", \"value\": \"OPTION_A\"},\n {\"label\": \"Option B\", \"value\": \"OPTION_B\"},\n {\"label\": \"Option C\", \"value\": \"OPTION_C\"}\n ]},\n //Radio Buttons Field\n {\"label\": \"New Radio Buttons\", \"type\": \"RADIOS\", \"options\": [\n {\"label\": \"Option X\", \"value\": \"OPTION_X\"},\n {\"label\": \"Option Y\", \"value\": \"OPTION_Y\"},\n {\"label\": \"Option Z\", \"value\": \"OPTION_Z\"}\n ]},\n //Multi Line Text Field\n {\"label\": \"New Text Field\", \"type\": \"TEXTAREA\", \"placeholder\": \"New Field\"},\n //Email Text field\n {\"label\": \"New Email Field\", \"type\": \"EMAIL\", \"placeholder\": \"New Field\"},\n //Password field\n {\"label\": \"New Password Field\", \"type\": \"PASSWORD\", \"placeholder\": \"New Field\"}\n\n ];\n\n FieldService\n .createFieldForForm(vm.formId, fieldTypes[fieldIndex])\n .then(function (response) {\n vm.fields = response.data;\n },\n function (error) {\n console.log(error.statusText);\n });\n\n\n }", "function updateModuleField(moduleName, fieldObject){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n\n fieldObject.id = new ObjectID(fieldObject.id);\n \n db.modules.update({name: moduleName, fields: {$elemMatch: {id: fieldObject.id}}}, {$set: {'fields.$': fieldObject}}, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n deferred.resolve();\n }\n });\n\n return deferred.promise;\n}", "add(fields) {\r\n\t\t\tconst addField = (path, options) => {\r\n\t\t\t\tif (obsidian.Field === options || obsidian.Field === options.type) {\r\n\t\t\t\t\tthrow new Error(\"The field type must be a child class of obsidian.Field\");\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// Check if the options param is a Field\r\n\t\t\t\tif (obsidian.Field.isPrototypeOf(options)) {\r\n\t\t\t\t\toptions = {type: options};\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// Make sure the type field is a Field\r\n\t\t\t\tif (!obsidian.Field.isPrototypeOf(options.type)) {\r\n\t\t\t\t\tthrow new Error(\"The type parameter must be an instance of the Field class\");\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.schemaFields[path] = new options.type(this, path, options);\r\n\t\t\t}\r\n\r\n\t\t\tconst processFieldDefinition = (definition, prefix = \"\") => {\r\n\t\t\t\tObject.keys(definition).forEach((key) => {\r\n\t\t\t\t\tconst obj = definition[key];\r\n\r\n\t\t\t\t\tif (!obj) {\r\n\t\t\t\t\t\tthrow new Error(`Invalid value for schema path ${prefix+key} in ${this.listName}`);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (isPlainObject(obj) && !obj.type && Object.keys(obj).length) {\r\n\t\t\t\t\t\t// obj is a nested field\r\n\t\t\t\t\t\tprocessFieldDefinition(obj, prefix + key + \".\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\taddField(prefix + key, obj);\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\t// Recursivly process the field definitions\r\n\t\t\tprocessFieldDefinition(fields);\r\n\t\t}", "function updateFieldArray(moduleName, fieldArray){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n\n //need to convert each 'id' property to an ObjectID\n for(var i = 0; i < fieldArray.length; i++){\n fieldArray[i].id = new ObjectID(fieldArray[i].id);\n }\n \n\n db.modules.update({name: moduleName}, {$set: {fields: fieldArray}}, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n deferred.resolve();\n }\n });\n\n return deferred.promise;\n}", "function updateFieldArray(moduleName, fieldArray){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n\n db.modules.update({name: moduleName}, {$set: {fields: fieldArray}}, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n deferred.resolve();\n }\n });\n\n return deferred.promise;\n}", "function addModule(newModule){\n //imitate angular promise. start by initializing this\n var deferred = Q.defer();\n\n newModule.name = newModule.name.toLowerCase();\n\n //check if there is an existing module\n db.modules.findOne({name: newModule.name}, function(err, aModule){\n if(err){\n deferred.reject(err);\n }\n //already exists\n else if(aModule){\n deferred.reject(exists);\n }\n else{\n //unique, so proceed\n //create table first before adding a new document to 'modules' collection (not necessary?)\n db.createCollection(newModule.name, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n //initialize fields property as empty array if there are none in the input\n if(newModule.fields == undefined){\n newModule.fields = [];\n }\n\n db.modules.insert(newModule, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n deferred.resolve();\n }\n });\n }\n });\n }\n \n });\n \n //return the promise along with either resolve or reject\n return deferred.promise;\n}", "function addModule(newModule){\n //imitate angular promise. start by initializing this\n var deferred = Q.defer();\n\n newModule.name = newModule.name.toLowerCase();\n\n //check if there is an existing module\n db.modules.findOne({name: newModule.name}, function(err, aModule){\n if(err){\n deferred.reject(err);\n }\n //already exists\n else if(aModule){\n deferred.reject(exists);\n }\n else{\n //unique, so proceed\n //create table first before adding a new document to 'modules' collection (not necessary?)\n db.createCollection(newModule.name, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n //initialize fields property as empty array if there are none in the input\n if(newModule.fields == undefined){\n newModule.fields = [];\n }\n\n db.modules.insert(newModule, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n deferred.resolve();\n }\n });\n }\n });\n }\n \n });\n \n //return the promise along with either resolve or reject\n return deferred.promise;\n}", "function addModuleDoc(moduleName, newDoc){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n\n db.bind(moduleName);\n\n db[moduleName].insert(newDoc, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n deferred.resolve();\n }\n });\n\n return deferred.promise;\n}", "function addModuleDoc(moduleName, newDoc){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n\n service.findDuplicateDoc(moduleName, newDoc).then(function(){\n db.bind(moduleName);\n\n db[moduleName].insert(newDoc, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n deferred.resolve();\n }\n });\n }).catch(function(err){\n deferred.reject(err);\n });\n\n return deferred.promise;\n}", "function addField(fieldName,value) {\n\tenv.log(\"setting field: \"+fieldName+\" value: \"+value);\n\tenv.addField(fieldName,value);\n}", "add(title, fieldType, properties) {\r\n const postBody = jsS(Object.assign(metadata(fieldType), {\r\n \"Title\": title,\r\n }, properties));\r\n return this.clone(Fields_1, null).postCore({ body: postBody }).then((data) => {\r\n return {\r\n data: data,\r\n field: this.getById(data.Id),\r\n };\r\n });\r\n }", "static addFieldCo(paylod) {\n return {\n type: FieldAction.ADDFIELD,\n payload\n }\n }", "addField(classId, fieldId, data) {\n this.fields[fieldId] = new FieldData(data);\n this.classes[classId].addField(fieldId);\n }", "setModuleName(field, module) {\n field.moduleName = field.moduleName || (module && module.__meta.name);\n if ((field.type === 'array') || (field.type === 'object')) {\n _.each(field.schema || [], function(subfield) {\n self.setModuleName(subfield, module);\n });\n }\n }", "addFieldValue() {\n this.add = this.add + 1;\n this.fieldArray.push(this.newAttribute);\n this.newAttribute = {};\n console.log(this.fieldArray);\n }", "addField(name, value) {\n this.manifest[name] = value;\n }", "addField(fieldArgs) {\n const formGroup = document.createElement(\"div\");\n const field = document.createElement(fieldArgs.type);\n\n formGroup.className = \"ms-form-group\";\n formGroup.id = `${fieldArgs.id}-group`;\n field.id = fieldArgs.id;\n field.placeholder = fieldArgs.placeholder;\n if (fieldArgs.rows) field.rows = fieldArgs.rows;\n\n formGroup.appendChild(field);\n this.form.appendChild(formGroup);\n }", "function addModuleToPipeline(moduleID, moduleName){\n\n var module_name = ''\n var documentation = ''\n var moduleSourceCode_settings = ''\n var moduleSourceCode_main = ''\n var moduleSourceCode_html = ''\n\n $.ajax({\n type: \"POST\",\n cache: false,\n url: \"/get_module_details\",\n data: 'p_module_key=' + moduleName,\n success: function (option) {\n //alert(\"@ success\");\n module_name = option.module_name\n documentation = option.documentation\n moduleSourceCode_settings = option.moduleSourceCode_settings\n moduleSourceCode_main = option.moduleSourceCode_main\n moduleSourceCode_html = option.moduleSourceCode_html\n user_role = option.user_role\n\n user_role_based_edit = ''\n if (user_role == 'image_researcher') {\n user_role_based_edit = '| <a style=\"font-size:12px;color:#000000;\" href=\"#\" class=\"btn_edit_code\"> Edit </a> | <a style=\"font-size:12px;color:#000000;\" href=\"#\" > Contact Author </a>';\n }\n\n //Parse the givn XML for tool definition\n var xmlDoc = $.parseXML( moduleSourceCode_html );\n var $xml_tool_definition = $(xmlDoc);\n\n //the tool configuration.\n //TODO: add the input port info.\n var tool_configs = $xml_tool_definition.find(\"toolConfigurations\");\n tool_configs = tool_configs.html();\n\n\n\n var tool_documentation = $xml_tool_definition.find(\"toolDocumentation\");\n tool_documentation = tool_documentation.html();\n\n\n var ioInformation = '';\n\n var $toolInput = $xml_tool_definition.find(\"toolInput\");\n\n $toolInput.each(function(){\n\n var label = $(this).find('label').text(),\n dataFormat = $(this).find('dataFormat').text(),\n referenceVariable = $(this).find('referenceVariable').text();\n\n ioInformation += '<input type=\"text\" style=\"display:none;\" class=\"setting_param module_input '+ referenceVariable + '\" ' + ' size=\"45\"/>';\n\n\n });\n\n\n var $toolOutput = $xml_tool_definition.find(\"toolOutput\");\n\n $toolOutput.each(function(){\n\n var label = $(this).find('label').text(),\n dataFormat = $(this).find('dataFormat').text(),\n referenceVariable = $(this).find('referenceVariable').text();\n\n //var thisPortOutput = 'module_id_' + moduleID + '_' + referenceVariable+'.' + dataFormat;\n //var thisPortOutputPath = referenceVariable + '=\"' + thisPortOutput + '\"';\n\n ioInformation += '<input type=\"text\" style=\"display:none;\" class=\"setting_param module_output '+ referenceVariable + '\" size=\"45\"/>';\n\n\n });\n\n\n\n\n\n\n\n//Parse the givn XML\n//var xmlDoc = $.parseXML( xml );\n\n//var $xml = $(xmlDoc);\n\n // Find Person Tag\n//var $person = $xml.find(\"toolConfigurations\");\n\n\n //append new module to the pipeline...\n $(\"#img_processing_screen\").append(\n '<div style=\"background-color:#EEE;width:100%;display:none;\" class=\"module\" id=\"module_id_'+ moduleID +'\">' +\n\n '<!-- Documentation -->' +\n '<div style=\"margin:10px;font-size:17px;color:#000000;\">' +\n ' ' + module_name + ' (Module ' + moduleID + ')'+ '<hr/>' +\n ' Documentation: <a style=\"font-size:12px;color:#000000;\" href=\"#\" class=\"documentation_show_hide\">(Show/Hide)</a>' +\n '<div class=\"documentation\" style=\"background-color:#DDDDDD;display:none;font-size:14px;\">' + tool_documentation + '</div>' +\n '</div>' +\n\n\n '<!-- Settings -->' +\n '<div style=\"margin:10px;font-size:17px;color:#000000;\">' +\n ' Settings: <a style=\"font-size:12px;color:#000000;\" href=\"#\" class=\"settings_show_hide\">(Show/Hide)</a>' +\n ' <div class=\"settings\" style=\"background-color:#DDDDDD;font-size:14px;\">' + tool_configs + '<br/>' + ioInformation +\n '<input type=\"hidden\" class=\"setting_param \" size=\"45\" id=\"module_id_'+ moduleID +'_output_destination\"/>'+\n '</div>' +\n '</div>' +\n\n\n '<div style=\"margin:10px;font-size:17px;color:#000000;\" class=\"setting_section\">' +\n ' <a style=\"display:none;font-size:12px;color:#000000;\" href=\"#\" class=\"code_show_hide\">(Show/Hide)</a>' + user_role_based_edit +\n\n ' <div class=\"edit_code\" style=\"background-color:#888888;font-size:14px;display:none;\">' +\n ' <textarea rows=7 cols=150 class=\"code_settings\">' + moduleSourceCode_settings + '</textarea>' +\n ' <p style=\"color:#000000;\">Main Implementation: </p>' +\n ' <textarea rows=10 cols=150>' + moduleSourceCode_main + '</textarea>' +\n '</div>' +\n\n ' <pre style=\"background-color:#333333;width:100%;display:none;\" class=\"pre_highlighted_code\">' + '<code class=\"python highlighted_code\" style=\"display:none;\">' + moduleSourceCode_settings +\n ' ' +\n moduleSourceCode_main + '</code></pre>' +\n\n ' </div>' +\n\n '</div>'\n\n\n );//end of append\n\n\n\n\n\n\n\n\n $(\"#module_id_\"+ moduleID + \"_output_destination\").val(\"output_destination = '/home/ubuntu/Webpage/app_collaborative_sci_workflow/workflow_outputs/test_workflow/Module_\" + moduleID + \"'\").trigger('change');\n\n\n\n\n\n\n\n\n\n\n\n var listOfInputPorts = [];\n var listOfOutputPorts = [];\n\n\n\n //input port definition\n var $toolInput = $xml_tool_definition.find(\"toolInput\");\n\n $toolInput.each(function(){\n\n var label = $(this).find('label').text(),\n dataFormat = $(this).find('dataFormat').text(),\n referenceVariable = $(this).find('referenceVariable').text();\n\n //$(\"#ProfileList\" ).append('<li>' +label+ ' - ' +dataFormat+ ' - ' + idn +'</li>');\n\n var aNewInputPort = makePort(dataFormat,referenceVariable,true);\n listOfInputPorts.push(aNewInputPort);\n\n\n\n var thisPortInput = 'module_id_' + moduleID + '_NO_INPUT_SOURCE_SELECTED_.' + dataFormat;\n thisPortInput = referenceVariable + '=\"' + WORKFLOW_OUTPUTS_PATH + THIS_WORKFLOW_NAME + '/' +thisPortInput + '\"';\n\n $(\"#module_id_\"+moduleID + ' .' + referenceVariable).val(thisPortInput).trigger('change');\n\n });\n\n\n\n\n\n //output port definition\n var $toolOutput = $xml_tool_definition.find(\"toolOutput\");\n\n $toolOutput.each(function(){\n\n var label = $(this).find('label').text(),\n dataFormat = $(this).find('dataFormat').text(),\n referenceVariable = $(this).find('referenceVariable').text();\n\n //$(\"#ProfileList\" ).append('<li>' +label+ ' - ' +dataFormat+ ' - ' + idn +'</li>');\n\n var aNewOutputPort = makePort(dataFormat,referenceVariable,false);\n listOfOutputPorts.push(aNewOutputPort);\n\n\n var thisPortOutput = 'module_id_' + moduleID + '_' + referenceVariable+'.' + dataFormat;\n thisPortOutput = referenceVariable + '=\"' + WORKFLOW_OUTPUTS_PATH + THIS_WORKFLOW_NAME + '/' +thisPortOutput + '\"';\n\n $(\"#module_id_\"+moduleID + ' .' + referenceVariable).val(thisPortOutput).trigger('change');\n\n });\n\n\n\n\n\n makeTemplate(moduleName,\"images/55x55.png\", \"white\",\n listOfInputPorts,\n listOfOutputPorts);\n\n\n\n\n\n\n //Update the DAG\n //var newWorkflowModule = workflow.add(\"Module_\"+moduleID, \"Module_0\", workflow.traverseDF);\n //newWorkflowModule.nodeName = moduleName;\n //redrawWorkflowStructure();\n\n\n //alert(\"Add\");\n myDiagram.startTransaction(\"add node\");\n // have the Model add the node data\n var newnode = {\"key\":\"module_id_\" + moduleID, \"type\":moduleName, \"name\":moduleName, \"module_id\": \"Module \"+moduleID};\n myDiagram.model.addNodeData(newnode);\n // locate the node initially where the parent node is\n // diagram.findNodeForData(newnode).location = node.location;\n // and then add a link data connecting the original node with the new one\n //var newlink = { from: node.data.key, to: newnode.key };\n //diagram.model.addLinkData(newlink);\n // finish the transaction -- will automatically perform a layout\n myDiagram.commitTransaction(\"add node\");\n\n\n\n\n\n\n if(isItMyFloor() == false)lockParamsSettings();\n\n /*$('pre code').each(function (i, block) {\n hljs.highlightBlock(block);\n });*/\n\n\n },\n error: function (xhr, status, error) {\n alert(xhr.responseText);\n }\n\n });//end of ajax\n\n\n}", "function addModuleToPipeline(moduleID, moduleName){\n\n var module_name = ''\n var documentation = ''\n var moduleSourceCode_settings = ''\n var moduleSourceCode_main = ''\n var moduleSourceCode_html = ''\n\n $.ajax({\n type: \"POST\",\n cache: false,\n url: \"/get_module_details\",\n data: 'p_module_key=' + moduleName,\n success: function (option) {\n\n module_name = option.module_name\n documentation = option.documentation\n moduleSourceCode_settings = option.moduleSourceCode_settings\n moduleSourceCode_main = option.moduleSourceCode_main\n moduleSourceCode_html = option.moduleSourceCode_html\n user_role = option.user_role\n\n user_role_based_edit = ''\n if (user_role == 'image_researcher') {\n user_role_based_edit = '| <a style=\"font-size:12px;color:#000000;\" href=\"#\" class=\"btn_edit_code\"> Edit </a> | <a style=\"font-size:12px;color:#000000;\" href=\"#\" > Contact Author </a>';\n }\n\n\n\n\n //append new module to the pipeline...\n $(\"#img_processing_screen\").append(\n '<div style=\"background-color:#EEE;width:100%\" class=\"module\" id=\"module_id_'+ moduleID +'\">' +\n\n '<!-- Documentation -->' +\n '<div style=\"margin:10px;font-size:17px;color:#000000;\">' +\n ' ' + module_name + '<hr/>' +\n ' Documentation: <a style=\"font-size:12px;color:#000000;\" href=\"#\" class=\"documentation_show_hide\">(Show/Hide)</a>' +\n '<div class=\"documentation\" style=\"background-color:#888888;display:none;font-size:14px;\">' + documentation + '</div>' +\n '</div>' +\n\n\n '<!-- Settings -->' +\n '<div style=\"margin:10px;font-size:17px;color:#000000;\">' +\n ' Settings: <a style=\"font-size:12px;color:#000000;\" href=\"#\" class=\"settings_show_hide\">(Show/Hide)</a>' +\n ' <div class=\"settings\" style=\"background-color:#888888;display:none;font-size:14px;\">' + moduleSourceCode_html + '</div>' +\n '</div>' +\n\n\n '<div style=\"margin:10px;font-size:17px;color:#000000;\" class=\"setting_section\">' +\n ' Source Code: <a style=\"font-size:12px;color:#000000;\" href=\"#\" class=\"code_show_hide\">(Show/Hide)</a>' + user_role_based_edit +\n\n ' <div class=\"edit_code\" style=\"background-color:#888888;display:none;font-size:14px;\">' +\n ' <textarea rows=7 cols=180 class=\"code_settings\">' + moduleSourceCode_settings + '</textarea>' +\n ' <p style=\"color:#000000;\">Main Implementation: </p>' +\n ' <textarea rows=10 cols=180>' + moduleSourceCode_main + '</textarea>' +\n '</div>' +\n\n ' <pre style=\"background-color:#333333;width:100%;\" class=\"pre_highlighted_code\">' + '<code class=\"python highlighted_code\" style=\"display:none;\">' + moduleSourceCode_settings +\n ' ' +\n moduleSourceCode_main + '</code></pre>' +\n\n ' </div>' +\n\n '</div>'\n\n\n );//end of append\n\n if(isItMyFloor() == false)lockParamsSettings();\n\n $('pre code').each(function (i, block) {\n hljs.highlightBlock(block);\n });\n\n\n },\n error: function (xhr, status, error) {\n alert(xhr.responseText);\n }\n\n });//end of ajax\n\n\n}", "addField(fieldDef) {\n let fieldObject = null;\n switch (fieldDef.type.toUpperCase()) {\n case \"TEXT\":\n fieldObject = new Text(fieldDef);\n break;\n\n case \"EMAIL\":\n fieldObject = new Email(fieldDef);\n break;\n\n case \"TEXTAREA\":\n fieldObject = new Textarea(fieldDef);\n break;\n case \"BUTTON\":\n fieldObject = new Button(fieldDef);\n // Is the submit button ?\n if (\n fieldDef.hasOwnProperty(\"buttonType\") &&\n fieldDef.buttonType.toUpperCase() === \"SUBMIT\"\n ) {\n this.submitButton = fieldObject;\n }\n break;\n }\n if (fieldDef.hasOwnProperty(\"placeholder\")) {\n fieldObject.setPlaceholder(fieldDef.placeholder);\n }\n\n this._fieldCollection.addField(fieldDef.id, fieldObject);\n\n return this;\n }", "function addField(){\n let fieldName = prompt('Enter field name:');\n if(doesFieldExist(fieldName)){\n return;\n }\n\n if(fieldName){\n let inputEl = document.createElement('input');\n inputEl.className = 'input-field';\n\n let fieldContainer = document.createElement('div');\n fieldContainer.className = 'field-container';\n\n let removeButton = createRemoveButton();\n\n let fieldNameContainer = createFieldNameContainer(fieldName);\n\n fieldContainer.appendChild(fieldNameContainer);\n fieldContainer.appendChild(inputEl);\n fieldContainer.appendChild(removeButton);\n\n let container = document.getElementById('container');\n\n let submitButton = document.getElementById('submit-button');\n\n\n /* if submit button exists then add field before button \n otherwise add field at the end\n */\n if(submitButton){\n container.insertBefore(fieldContainer, submitButton);\n } else {\n container.appendChild(fieldContainer);\n }\n fieldsCounter++;\n\n /* if add button disabled add tooltip on hover with text*/\n if(shouldDisableAddFieldButton()){\n let addFieldButton = document.getElementById('add-field-button');\n addFieldButton.disabled = true;\n let tooltip = createTooltip();\n addFieldButton.appendChild(tooltip);\n }\n }\n /* if amount of fields more than 0 and submit button doesnt exist\n create submit button and insert it as a child into container */\n if(fieldsCounter > 0){\n if(!document.getElementById('submit-button')){\n let submitButton = createSubmitButton();\n let container = document.getElementById('container');\n container.appendChild(submitButton);\n }\n }\n}", "function addMoreFields(field) {\n var name = \"product[\"+field+\"][]\";\n if(field == 'images')\n name += '[img_path]'\n $(\"<input type='text' value='' />\")\n .attr(\"name\", name)\n .appendTo(\"#\"+field);\n}", "function UpdateAddableField(fieldType, fieldKey, fieldValue)\n{\n\t// fildKey is the key required to save the fieldType, ex. mobile: 01009091995, mobile is the key\n\tTi.API.info(\"UpdateAddableField: \" + fieldType + \", \" + fieldKey + \", \" + fieldValue);\n\t\n\t// TODO: Replace this with return statement\n\tif(contact == null) alert(\"Contact must be initialized ya beheema !\");\n\t\n\t// Add the new addable field to its array in contact\n\t// If contact[fieldType] is not empty, append to it, else create a new array\n\tvar fieldDictionary = contact[fieldType];\t// A workaround for iOS\n\ttry\n\t{\n\t\tfieldDictionary[fieldKey].push(fieldValue);\n\t}\n\tcatch(exp)\n\t{\n\t\tfieldDictionary[fieldKey] = [fieldValue];\n\t}\n\tcontact[fieldType] = fieldDictionary;\n\talert(contact[fieldType]);\n}", "addField(e) {\n const c = this\n let path = this.props.keys.replace(/\\./g, \"/\")\n\n let value\n if (Array.isArray(c.state.value)) {\n value = this.state.value\n } else if (typeof c.state.value === 'string') {\n value = [this.state.value]\n } else {\n value = [\"\"]\n }\n\n value.push(\"\")\n this.setState({ value })\n //TODO: handle if need to set up an association here\n //use firebase.push() instead\n\n firebaseActions( path, value)\n }", "function AddPropertyToField() {\n var obj = {\n 'id': 5,\n 'grower': 'Joe',\n 'farm': 'Dream Farm'\n };\n myField.objInfo = obj;\n}", "addSettingsModule(aId, aName, aSettingFieldName, aClass) {\n\t\t\n\t\tthis._settingModules[aId] = {\"name\": aName, \"fieldName\": aSettingFieldName, \"reactClass\": aClass};\n\t\t\n\t}", "function addFields(p, ...fields) {\n if (!p.state.fields) {\n p.state.fields = [...fields]\n } else {\n fields.filter(f => !p.state.fields.includes(f)).forEach(f => p.state.fields.push(f));\n }\n}", "function addFields(field, currFieldName, realIndex) {\n if (field.group) {\n var isGroupCreated = false, property;\n for (var i = 0; i < self.displayData.length; i++) {\n if (self.displayData[i].name === field.group && self.displayData[i].container === 'g') {\n isGroupCreated = true;\n property = { 'name': currFieldName, 'realFieldIndex': realIndex };\n property.extensionName = field.extensionName;\n self.displayData[i].fields.push(property);\n break;\n }\n }\n if (!isGroupCreated) {\n var groupDetails = getGroupDetails(field.group);\n var group = {\n container: 'g',\n fields: [],\n name: groupDetails.id,\n groupDetails: {\n 'id': groupDetails.id,\n 'heading': $translate.instant(groupDetails.heading),\n 'collapsible': groupDetails.collapsible\n }\n };\n property = { 'name': currFieldName, 'realFieldIndex': realIndex };\n property.extensionName = field.extensionName;\n group.fields.push(property);\n self.displayData.push(group);\n }\n } else {\n var fieldContainerCreated = false;\n var displayDataLength = self.displayData.length;\n if (displayDataLength && self.displayData[displayDataLength - 1].container === 'f') {\n fieldContainerCreated = true;\n property = { 'name': currFieldName, 'realFieldIndex': realIndex };\n self.displayData[displayDataLength - 1].fields.push(property);\n }\n\n if (!fieldContainerCreated) {\n property = { 'container': 'f', 'name': currFieldName, 'realFieldIndex': realIndex, 'fields': [] };\n property.fields.push({ 'name': currFieldName, 'realFieldIndex': realIndex });\n self.displayData.push(property);\n }\n\n }\n\n if (typeof field.type === \"object\") {\n Object.getOwnPropertyNames(field.type).forEach(function (propName) {\n addFields(field.type[propName], currFieldName + \".\" + propName);\n });\n }\n }", "function addField(state = {}, action) {\n\n switch (action.type) {\n case \"formBuilder.AddField\": {\n // TODO: Promp for a key/field-name first.\n let key = \"new\" + Object.keys(state.properties).length;\n state.properties[key] = {\"type\": \"string\", \"title\": \"Textfield \" + Object.keys(state.properties).length};\n return state;\n }\n default:\n return state;\n }\n}", "addFields(fields) {\n if (fields[0] === false) {\n this.options.fields = false;\n\n return this;\n }\n\n this.options.fields = this.options.fields || {};\n\n fields.forEach((field) => {\n if (isArray(field)) {\n field.forEach((field) => {\n this.options.fields[field] = field;\n });\n } else if (isObject(field)) {\n this.options.fields = Object.assign(this.options.fields, field);\n } else if (isString(field)) {\n this.options.fields[field] = field;\n }\n });\n\n return this;\n }", "function createFormField(id, newField) {\n var deferred = q.defer();\n newField.id = guid(); // keep this since Mongo won't create\n // one for subdocs\n\n FormModel.findById(id, function(err, form) {\n if(err) {\n deferred.reject(err);\n } else {\n if(!form.fields) {\n form.fields = [];\n }\n form.fields.push(newField);\n form.save(function(err, form) {\n if(err) {\n deferred.reject(err);\n } else {\n deferred.resolve(form);\n }\n });\n }\n });\n\n return deferred.promise;\n }", "addGraphQLField(field) {\n this._graphQLFields.push(field);\n }", "addLookup(title, lookupListId, lookupFieldName, properties) {\r\n const props = extend({\r\n FieldTypeKind: 7,\r\n LookupFieldName: lookupFieldName,\r\n LookupListId: lookupListId,\r\n Title: title,\r\n }, properties);\r\n const postBody = jsS({\r\n \"parameters\": extend(metadata(\"SP.FieldCreationInformation\"), props),\r\n });\r\n return this.clone(Fields_1, \"addfield\").postCore({ body: postBody }).then((data) => {\r\n return {\r\n data: data,\r\n field: this.getById(data.Id),\r\n };\r\n });\r\n }", "function addModule(module) {\n function addIndividualModule(module) {\n if (!mapNames[module.moduleName]) {\n mapNames[module.moduleName] = true;\n allModules.push(module);\n ModuleRegistry.register(module);\n }\n }\n addIndividualModule(module);\n if (module.dependantModules) {\n module.dependantModules.forEach(addModule);\n }\n }", "addAttachmentField(aName, aValue) {}", "addFieldInterface(interfaceId, fieldId, data) {\n this.fields[fieldId] = new FieldData(data);\n this.interfaces[interfaceId].addField(fieldId);\n }", "function insert_in_baseModule_gfpc(module_gfpc,suppression)\n {\n //add\n var config =\n {\n headers : {'Content-Type': 'application/x-www-form-urlencoded;charset=utf-8;'}\n };\n \n var getId = 0;\n if (NouvelItemModule_gfpc==false)\n {\n getId = vm.selectedItemModule_gfpc.id; \n } \n \n var datas = $.param({\n supprimer: suppression,\n id: getId,\n date_previ_resti: convertionDate(module_gfpc.date_previ_resti),\n date_debut_reel_form: convertionDate(module_gfpc.date_debut_reel_form),\n date_fin_reel_form: convertionDate(module_gfpc.date_fin_reel_form),\n date_reel_resti:convertionDate(module_gfpc.date_reel_resti),\n nbr_previ_parti: module_gfpc.nbr_previ_parti,\n nbr_previ_fem_parti: module_gfpc.nbr_previ_fem_parti,\n date_debut_previ_form: convertionDate(module_gfpc.date_debut_previ_form),\n date_fin_previ_form: convertionDate(module_gfpc.date_fin_previ_form),\n id_contrat_partenaire_relai: vm.selectedItemContrat_partenaire_relai.id,\n lieu_formation: module_gfpc.lieu_formation,\n observation:module_gfpc.observation,\n validation : 0 \n });\n console.log(datas);\n //factory\n apiFactory.add(\"module_gfpc/index\",datas, config).success(function (data)\n {\n if (NouvelItemModule_gfpc == false)\n {\n // Update or delete: id exclu \n if(suppression==0)\n {\n //vm.selectedItemModule_gfpc.contrat_partenaire_relai = vm.selectedItemContrat_partenaire_relai;\n vm.selectedItemModule_gfpc.$selected = false;\n vm.selectedItemModule_gfpc.$edit = false;\n vm.selectedItemModule_gfpc ={};\n //vm.showbuttonNouvPassation= false;\n }\n else \n { \n vm.allmodule_gfpc = vm.allmodule_gfpc.filter(function(obj)\n {\n return obj.id !== vm.selectedItemModule_gfpc.id;\n });\n vm.showbuttonNouvformgfpc= true;\n }\n \n }\n else\n {\n //module_gfpc.contrat_partenaire_relai = vm.selectedItemContrat_partenaire_relai;\n\n module_gfpc.id = String(data.response); \n NouvelItemModule_gfpc=false;\n vm.showbuttonNouvformgfpc= false;\n }\n vm.stepparticipantgfpc=false;\n module_gfpc.validation=0;\n module_gfpc.$selected = false;\n module_gfpc.$edit = false;\n vm.selectedItemModule_gfpc = {};\n vm.showbuttonValidationformgfpc = false;\n }).error(function (data){vm.showAlert('Error','Erreur lors de l\\'insertion de donnée');});\n\n }", "function insert_in_baseModule_gfpc(module_gfpc,suppression)\n {\n //add\n var config =\n {\n headers : {'Content-Type': 'application/x-www-form-urlencoded;charset=utf-8;'}\n };\n \n var getId = 0;\n if (NouvelItemModule_gfpc==false)\n {\n getId = vm.selectedItemModule_gfpc.id; \n } \n \n var datas = $.param({\n supprimer: suppression,\n id: getId,\n date_previ_resti: convertionDate(module_gfpc.date_previ_resti),\n date_debut_reel_form: convertionDate(module_gfpc.date_debut_reel_form),\n date_fin_reel_form: convertionDate(module_gfpc.date_fin_reel_form),\n date_reel_resti:convertionDate(module_gfpc.date_reel_resti),\n nbr_previ_parti: module_gfpc.nbr_previ_parti,\n nbr_previ_fem_parti: module_gfpc.nbr_previ_fem_parti,\n date_debut_previ_form: convertionDate(module_gfpc.date_debut_previ_form),\n date_fin_previ_form: convertionDate(module_gfpc.date_fin_previ_form),\n id_contrat_partenaire_relai: vm.selectedItemContrat_partenaire_relai.id,\n lieu_formation: module_gfpc.lieu_formation,\n observation:module_gfpc.observation,\n validation : 0 \n });\n console.log(datas);\n //factory\n apiFactory.add(\"module_gfpc/index\",datas, config).success(function (data)\n {\n if (NouvelItemModule_gfpc == false)\n {\n // Update or delete: id exclu \n if(suppression==0)\n {\n //vm.selectedItemModule_gfpc.contrat_partenaire_relai = vm.selectedItemContrat_partenaire_relai;\n vm.selectedItemModule_gfpc.$selected = false;\n vm.selectedItemModule_gfpc.$edit = false;\n vm.selectedItemModule_gfpc ={};\n //vm.showbuttonNouvPassation= false;\n }\n else \n { \n vm.allmodule_gfpc = vm.allmodule_gfpc.filter(function(obj)\n {\n return obj.id !== vm.selectedItemModule_gfpc.id;\n });\n vm.showbuttonNouvformgfpc= true;\n }\n \n }\n else\n {\n //module_gfpc.contrat_partenaire_relai = vm.selectedItemContrat_partenaire_relai;\n\n module_gfpc.id = String(data.response); \n NouvelItemModule_gfpc=false;\n vm.showbuttonNouvformgfpc= false;\n }\n vm.stepparticipantgfpc=false;\n module_gfpc.validation=0;\n module_gfpc.$selected = false;\n module_gfpc.$edit = false;\n vm.selectedItemModule_gfpc = {};\n vm.showbuttonValidationformgfpc = false;\n }).error(function (data){vm.showAlert('Error','Erreur lors de l\\'insertion de donnée');});\n\n }", "function addFields(){\n var fields=[\"id\",\"query2\", \"sameAs\"];\n \n var ftag='<input class=\"object\" type=\"text\" ondrop=\"drop(event)\" onndragover=\"allowDrop(event)\" size=\"50\" placeholder=\"..escribe o arrastra etiqueta..\"'\n \n \n for(var i in fields){\n $(\"#fieldsarea\").append('<label for=\"'+fields[i]+'\">'+id2json(fields[i])+' </label><br>')\n .append(ftag+\" id='\"+fields[i]+\"'>\")\n .append('<br>');\n }\n}", "function addModule(module) {\n var newIndex = modules.push(module) - 1,\n $host;\n // add base functions and properties\n module._values = {};\n module.isRunning = false;\n module.val = function (name, newValue, source) {\n if (!source) source = module;\n if (newValue === undefined) return this._values[name];\n\n this._values[name] = newValue;\n $(module).trigger(\"valueChanged\", { name: name, value: newValue, source: source });\n return newValue;\n }\n\n module.getValues = function () {\n return this._values;\n }\n moduleIDIndex[module.id] = newIndex;\n\n // create ui\n $('#moduleContainer').append(\n $host =\n $('<div />', { id: module.id, 'class': 'moduleContent' })\n .css('display', 'none')\n );\n $('#changeModuleMenu .menuItemsPanel').append(\n $('<li>' + module.name + '</li>').click(function () {\n $(this).parent().hide();\n showModule.call(this, module);\n }));\n\n // add any saved values\n if (my.startupModuleValues[module.id]) {\n var modValues = my.startupModuleValues[module.id];\n for (var i in modValues) {\n // we don't want to trigger onValueChanged since the module isn't initialized.\n module._values[i] = modValues[i];\n }\n }\n \n module.init($host);\n }", "add(fieldTitleOrInternalName) {\r\n return this.clone(ViewFields_1, `addviewfield('${fieldTitleOrInternalName}')`).postCore();\r\n }", "function addAdField(app, tab, key, cnt, cb) {\n\tAdminFields.find({'appname':app, 'table':tab, 'name':key}, function(err, docs) {\n\t\tvar s_flag = true;\n\t\tvar thisfield = {};\n\t\tif (err) {\n\t\t\tconsole.log('error checking in on key ' + key + ' in ' + app + '\\'s ' + tab + 'table.');\n\t\t\tthrow err;\n\t\t}\n\t\tif (! docs.length) {\n\t\t\tthisfield = new AdminFields();\n\t\t\tthisfield.name = key;\n\t\t\tthisfield.appname = app;\n\t\t\tthisfield.table = tab;\n\t\t} else if (rejig_db == 'all') {\n\t\t\tthisfield = docs[0];\n\t\t} else s_flag=false;\n\t\tthisfield.listorder = thisfield.editorder = cnt++;\n\t\tif (s_flag) {\n\t\t\tif (key == 'id' || key == '_id' || key == 'modified_date' || key == 'created_date') {\n\t\t\t\tthisfield.listed = false;\n\t\t\t\tthisfield.edited = false;\n\t\t\t} else {\n\t\t\t\tthisfield.listed = true;\n\t\t\t\tthisfield.edited = true;\n\t\t\t}\n\t\t\tthisfield.save(function(err){\n\t\t\t\tif (err) {\n\tconsole.log('ERROR adding ' + key + ' in ' + tab + ' for ' + app);\n\tconsole.log(err);\n\t\t\t\t\tthrow err;\n\t\t\t\t}\n\t\t\t\tcb();\n\t\t\t});\n\t\t} else cb();\n\t});\n}", "function insert_in_baseModule_odc(module_odc,suppression)\n {\n //add\n var config =\n {\n headers : {'Content-Type': 'application/x-www-form-urlencoded;charset=utf-8;'}\n };\n \n var getId = 0;\n if (NouvelItemModule_odc==false)\n {\n getId = vm.selectedItemModule_odc.id; \n } \n \n var datas = $.param({\n supprimer: suppression,\n id: getId,\n date_previ_resti: convertionDate(module_odc.date_previ_resti),\n date_debut_reel_form: convertionDate(module_odc.date_debut_reel_form),\n date_fin_reel_form: convertionDate(module_odc.date_fin_reel_form),\n date_reel_resti:convertionDate(module_odc.date_reel_resti),\n nbr_previ_parti: module_odc.nbr_previ_parti,\n nbr_previ_fem_parti: module_odc.nbr_previ_fem_parti,\n date_debut_previ_form: convertionDate(module_odc.date_debut_previ_form),\n date_fin_previ_form: convertionDate(module_odc.date_fin_previ_form),\n id_contrat_partenaire_relai: vm.selectedItemContrat_partenaire_relai.id,\n lieu_formation: module_odc.lieu_formation,\n observation:module_odc.observation,\n validation : 0 \n });\n console.log(datas);\n //factory\n apiFactory.add(\"module_odc/index\",datas, config).success(function (data)\n {\n if (NouvelItemModule_odc == false)\n {\n // Update or delete: id exclu \n if(suppression==0)\n {\n //vm.selectedItemModule_odc.contrat_partenaire_relai = vm.selectedItemContrat_partenaire_relai;\n vm.selectedItemModule_odc.$selected = false;\n vm.selectedItemModule_odc.$edit = false;\n vm.selectedItemModule_odc ={};\n //vm.showbuttonNouvPassation= false;\n }\n else \n { \n vm.allmodule_odc = vm.allmodule_odc.filter(function(obj)\n {\n return obj.id !== vm.selectedItemModule_odc.id;\n });\n vm.showbuttonNouvformodc= true;\n }\n \n }\n else\n {\n //module_odc.contrat_partenaire_relai = vm.selectedItemContrat_partenaire_relai;\n\n module_odc.id = String(data.response); \n NouvelItemModule_odc=false;\n vm.showbuttonNouvformodc= false;\n }\n vm.stepparticipantodc=false;\n module_odc.validation=0;\n module_odc.$selected = false;\n module_odc.$edit = false;\n vm.selectedItemModule_odc = {};\n // vm.showbuttonValidationformodc = false;\n }).error(function (data){vm.showAlert('Error','Erreur lors de l\\'insertion de donnée');});\n\n }", "function insert_in_baseModule_odc(module_odc,suppression)\n {\n //add\n var config =\n {\n headers : {'Content-Type': 'application/x-www-form-urlencoded;charset=utf-8;'}\n };\n \n var getId = 0;\n if (NouvelItemModule_odc==false)\n {\n getId = vm.selectedItemModule_odc.id; \n } \n \n var datas = $.param({\n supprimer: suppression,\n id: getId,\n date_previ_resti: convertionDate(module_odc.date_previ_resti),\n date_debut_reel_form: convertionDate(module_odc.date_debut_reel_form),\n date_fin_reel_form: convertionDate(module_odc.date_fin_reel_form),\n date_reel_resti:convertionDate(module_odc.date_reel_resti),\n nbr_previ_parti: module_odc.nbr_previ_parti,\n nbr_previ_fem_parti: module_odc.nbr_previ_fem_parti,\n date_debut_previ_form: convertionDate(module_odc.date_debut_previ_form),\n date_fin_previ_form: convertionDate(module_odc.date_fin_previ_form),\n id_contrat_partenaire_relai: vm.selectedItemContrat_partenaire_relai.id,\n lieu_formation: module_odc.lieu_formation,\n observation:module_odc.observation,\n validation : 0 \n });\n console.log(datas);\n //factory\n apiFactory.add(\"module_odc/index\",datas, config).success(function (data)\n {\n if (NouvelItemModule_odc == false)\n {\n // Update or delete: id exclu \n if(suppression==0)\n {\n //vm.selectedItemModule_odc.contrat_partenaire_relai = vm.selectedItemContrat_partenaire_relai;\n vm.selectedItemModule_odc.$selected = false;\n vm.selectedItemModule_odc.$edit = false;\n vm.selectedItemModule_odc ={};\n //vm.showbuttonNouvPassation= false;\n }\n else \n { \n vm.allmodule_odc = vm.allmodule_odc.filter(function(obj)\n {\n return obj.id !== vm.selectedItemModule_odc.id;\n });\n vm.showbuttonNouvformodc= true;\n }\n \n }\n else\n {\n //module_odc.contrat_partenaire_relai = vm.selectedItemContrat_partenaire_relai;\n\n module_odc.id = String(data.response); \n NouvelItemModule_odc=false;\n vm.showbuttonNouvformodc= false;\n }\n vm.stepparticipantodc=false;\n module_odc.validation=0;\n module_odc.$selected = false;\n module_odc.$edit = false;\n vm.selectedItemModule_odc = {};\n // vm.showbuttonValidationformodc = false;\n }).error(function (data){vm.showAlert('Error','Erreur lors de l\\'insertion de donnée');});\n\n }", "addField (fieldName) {\n if (this._isOptimized) {\n throw new Error('Cannot add a field to an already-optimized index.');\n }\n\n fieldName = this._intern(fieldName);\n this._fields[`${fieldName}`] = {\n terms: {},\n documents: {}\n };\n\n this._index[`${fieldName}`] = {};\n }", "function processFieldArray(form, fields) {\n\n fields.forEach(function (field, key) {\n // Add it\n if (field.type) {\n form.fields.push(field);\n }\n // Remove it\n if (field.hide) {\n form = removeField(form, field.name);\n }\n });\n\n}", "addNewRecordByValue() {\n this.addNewRecord('value');\n }", "function createFieldForForm(formId, field) {\n return $http.post(\"/api/assignment/form/\"+formId+\"/field\", field);\n }", "function updateModule(updateModule){\n var deferred = Q.defer();\n\n updateModule.name = updateModule.name.toLowerCase();\n\n //fields array should not be editable when using this function. therefore, delete it from input\n delete updateModule.fields;\n\n //check if the name of the selected module has not changed\n db.modules.findOne({_id: mongo.helper.toObjectID(updateModule._id)}, function(err, aModule){\n if(err){\n deferred.reject(err);\n }\n else if(aModule){\n //if names are different, renaming the collection must be executed, then proceed to update\n if(aModule.name != updateModule.name){\n db.bind(aModule.name);\n db[aModule.name].rename(updateModule.name, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n update();\n }\n });\n }\n }\n else{\n update();\n }\n });\n\n //updates the document in the 'modules' collection\n function update(){\n\n //create another object and copy. then delete the '_id' property of the new copy\n var forUpdate = {};\n Object.assign(forUpdate, updateModule);\n delete forUpdate._id;\n \n db.modules.update({_id: mongo.helper.toObjectID(updateModule._id)}, {$set: forUpdate}, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n deferred.resolve();\n }\n });\n }\n\n return deferred.promise;\n}", "function deleteModuleField(moduleName, fieldID){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n \n db.modules.update({name: moduleName}, {$pull: {fields: {id: mongo.helper.toObjectID(fieldID)}}}, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n deferred.resolve();\n }\n });\n\n return deferred.promise;\n}", "function deleteModuleField(moduleName, fieldID){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n \n db.modules.update({name: moduleName}, {$pull: {fields: {id: mongo.helper.toObjectID(fieldID)}}}, function(err, writeResult){\n if(err){\n deferred.reject(err);\n }\n else{\n if(writeResult.result.nModified == 0){\n deferred.reject(notFound);\n }\n else{\n deferred.resolve();\n }\n }\n });\n\n return deferred.promise;\n}", "function registerManualField(id) {\n\tfieldsToCheck.push(id);\n}", "function processFieldArray(form, fields) {\n\n fields.forEach(function(field, key) {\n // Add it\n if(field.type) {\n form.fields.push(field);\n }\n // Remove it\n if(field.hide) {\n form = removeField(form, field.name);\n }\n });\n\n}", "function addExistingFieldToForm(fieldEntity) {\n var renderControl;\n var json;\n\n if (fieldEntity.isOfType && fieldEntity.isOfType.length > 0) {\n\n if (spFormBuilderService.fieldRenderControls) {\n renderControl = spFormBuilderService.fieldRenderControls[fieldEntity.isOfType[0].getAlias()];\n\n if (renderControl) {\n /////\n // Construct a JSON structure.\n /////\n json = {\n typeId: renderControl.getNsAlias(),\n 'console:fieldToRender': fieldEntity,\n 'console:renderingOrdinal': jsonInt(),\n 'console:renderingWidth': jsonInt(),\n 'console:renderingHeight': jsonInt(),\n 'console:renderingBackgroundColor': 'white',\n 'console:renderingHorizontalResizeMode': jsonLookup('console:resizeAutomatic'),\n 'console:renderingVerticalResizeMode': jsonLookup('console:resizeAutomatic'),\n };\n\n handleDataPath(json);\n\n return spEntity.fromJSON(json);\n }\n }\n }\n\n return undefined;\n }", "function addModule() {\n $('<section>')\n .attr('id', 'rsw-discord')\n .addClass('rsw-custom-module rail-module')\n .append(\n $('<a>')\n .attr('href', ('https://discord.gg/s63bxtW'))\n .append(\n $('<img>')\n .attr('src', 'https://vignette.wikia.nocookie.net/vocaloid/images/2/2d/Discord-Logo-Color.png')\n ),\n $('<div>')\n .append(\n $('<p>')\n .append(\n 'Le Wiki VOCALOID a un serveur officiel de Discord ! Clique le bouton ci-dessous pour rejoindre et dialoguer avec les fans et des contributeurs en direct, ou clique ',\n $('<a>')\n .attr('href', mw.util.wikiGetlink('Wiki Vocaloid:Discord'))\n .text('ici'),\n ' pour lire les règles du tchat de ce serveur.'\n ),\n $('<a>')\n .attr('href', 'https://discord.gg/s63bxtW')\n .addClass('wds-button')\n .text('Recevoir une invitation')\n )\n )\n .insertBefore('#wikia-recent-activity');\n }", "function addData(fName, lName, email, phone) {\n let object = {\n firstName: fName,\n lastName: lName,\n email: email,\n phoneNumber: phone\n }\n fBase.add(object);\n}", "function updateModule(updateModule){\n var deferred = Q.defer();\n\n updateModule.name = updateModule.name.toLowerCase();\n\n //fields array should not be editable when using this function. therefore, delete it from input\n delete updateModule.fields;\n\n db.modules.find({$or: [\n {_id: mongo.helper.toObjectID(updateModule._id)},\n {name: updateModule.name}\n ]}).toArray(function(err, modules){\n if(err){\n deferred.reject(err);\n }\n else if(modules.length == 0){\n deferred.reject(notFound);\n }\n //vali inputs, no other document have the same name\n else if(modules.length == 1){\n var oldModule = modules[0];\n \n //rename if old & new names are different\n if(oldModule.name != updateModule.name){\n db.bind(oldModule.name);\n db[oldModule.name].rename(updateModule.name, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n update();\n }\n });\n }\n //go straight to update\n else{\n update();\n }\n }\n //another module document with the same name exists\n else{\n deferred.reject(exists);\n }\n }); \n\n //updates the document in the 'modules' collection\n function update(){\n\n //create another object and copy. then delete the '_id' property of the new copy\n var forUpdate = {};\n Object.assign(forUpdate, updateModule);\n delete forUpdate._id;\n \n db.modules.update({_id: mongo.helper.toObjectID(updateModule._id)}, {$set: forUpdate}, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n deferred.resolve();\n }\n });\n }\n\n return deferred.promise;\n}", "function addExistingFieldGroupToForm(fieldGroupEntity) {\n var json;\n var fields;\n var relationships;\n\n /////\n // Construct a JSON structure.\n /////\n json = {\n typeId: 'console:verticalStackContainerControl',\n name: fieldGroupEntity.name,\n 'console:renderingOrdinal': jsonInt(),\n 'console:renderingWidth': jsonInt(),\n 'console:renderingHeight': jsonInt(),\n 'console:renderingBackgroundColor': 'white',\n 'console:renderingHorizontalResizeMode': jsonLookup('console:resizeAutomatic'),\n 'console:renderingVerticalResizeMode': jsonLookup('console:resizeAutomatic'),\n 'console:hideLabel': jsonBool(false),\n 'console:containedControlsOnForm': []\n };\n\n fields = spFormBuilderService.getFieldsBelongingToFieldGroup(fieldGroupEntity.id());\n relationships = spFormBuilderService.getRelationshipsBelongingToFieldGroup(fieldGroupEntity.id());\n\n var entries = _.sortBy(_.union(fields, relationships), function (entry) {\n return entry.getName();\n });\n\n spFormBuilderService.refreshMemoizedFunctions();\n\n _.forEach(entries, function (entry) {\n var entity;\n var renderCtrl;\n\n if (entry instanceof spResource.Field) {\n if (!spFormBuilderService.isFieldOnForm(entry)) {\n entity = entry.getEntity();\n\n renderCtrl = spFormBuilderService.fieldRenderControls[entity.isOfType[0].getAlias()];\n\n json['console:containedControlsOnForm'].push({\n typeId: renderCtrl.getNsAlias(),\n 'console:renderingOrdinal': jsonInt(),\n 'console:renderingWidth': jsonInt(),\n 'console:renderingHeight': jsonInt(),\n 'console:renderingBackgroundColor': 'white',\n 'console:renderingHorizontalResizeMode': jsonLookup('console:resizeAutomatic'),\n 'console:renderingVerticalResizeMode': jsonLookup('console:resizeAutomatic'),\n 'console:fieldToRender': entity\n });\n }\n } else if (entry instanceof spResource.Relationship) {\n if (!spFormBuilderService.isRelationshipOnForm(entry)) {\n entity = entry.getEntity();\n\n renderCtrl = spFormBuilderService.getRelationshipRenderControlAlias(entry);\n\n json['console:containedControlsOnForm'].push({\n typeId: renderCtrl,\n 'console:renderingOrdinal': jsonInt(),\n 'console:renderingWidth': jsonInt(),\n 'console:renderingHeight': jsonInt(),\n 'console:renderingBackgroundColor': 'white',\n 'console:renderingHorizontalResizeMode': jsonLookup('console:resizeAutomatic'),\n 'console:renderingVerticalResizeMode': jsonLookup('console:resizeAutomatic'),\n 'console:relationshipToRender': entity,\n 'console:isReversed': entry.isReverse()\n });\n }\n }\n\n });\n\n return spEntity.fromJSON(json);\n }", "function findAndCreate(fieldProperty) {\n //if 'fieldProperty' is fieldCode then convert into object.\n if(typeof fieldProperty == 'string') {\n fieldProperty = {fieldCode:fieldProperty};\n };\n\n var field = fields[ fieldProperty.fieldCode ];\n if(field) {\n field.updateProperty(fieldProperty);\n } else {\n field = fields[ fieldProperty.fieldCode ] = new Field( fieldProperty );\n }\n\n if(field.triggerUpdate) {\n // console.log('TRIGGER UPATE..', field.fieldCode)\n field.update = validate;\n }\n\n return field;\n }", "async addDrug(ctx, drugName, serialNo, mfgDate, expDate, companyCRN) {\n //Verifying the identity of the function caller\n let verifyManufacturer = ctx.clientIdentity.getMSPID();\n let arrayList = await this.getPartialKeyArray(ctx, 'org.pharma-network.pharmanet.lists.company', companyCRN);\n //Verify if the function is called by registered manufacturer\n if (verifyManufacturer === 'manufacturerMSP' && arrayList.length !== 0) {\n //converting array into jason object\n let jasonObject = JSON.parse(arrayList[0]);\n let companyName = jasonObject.companyId.companyName;\n //Create a new Request to add it in the blockchain\n let drugObject = {\n productId: {\n drugName: drugName,\n serialNo: serialNo\n },\n name: drugName,\n manufacturer: {\n comapnyCRN: companyCRN,\n companyName: companyName\n },\n manufacturingDate: mfgDate,\n expiryDate: expDate,\n owner: companyCRN,\n shipment: \"\",\n };\n //Create the instance of the model class to save it to blockchain\n let drugObj = Drug.createInstance(drugObject);\n await ctx.drugList.addDrug(drugObj);\n //returns the Jason object\n return drugObj;\n }\n }", "add(fieldTitleOrInternalName) {\n return spPost(this.clone(ViewFields, `addviewfield('${fieldTitleOrInternalName}')`));\n }", "function createProject(user, project_fields) {\n return db\n .collection(\"projects\")\n .add(project_fields).then((new_project) => {\n const {appID, adminKey } = algoliaConfig;\n const client = algoliasearch(appID, adminKey);\n const index = client.initIndex('projects')\n const {title, description, createdBy, owner} = project_fields\n const objectID = new_project.id;\n \n // add project to owner's list\n db\n .doc(`users/${user.uid}`)\n .collection('projects').doc(new_project.id)\n .set({\n favorited: false,\n pinned: true,\n });\n\n // attach owner to project\n db\n .doc(`projects/${new_project.id}`)\n .collection('admins').doc(user.uid)\n .set({\n date_added: project_fields.date_created,\n is_owner: true,\n });\n\n // add projects to algolia\n console.log('saving project...');\n console.log('index:')\n console.log(index.saveObject)\n index.saveObject({title,\n objectID,\n title,\n description,\n createdBy,\n owner,\n id:objectID\n }).then(({objectID}) => console.log);\n });\n \n}", "function insert_in_baseModule_emies(module_emies,suppression)\n {\n //add\n var config =\n {\n headers : {'Content-Type': 'application/x-www-form-urlencoded;charset=utf-8;'}\n };\n \n var getId = 0;\n if (NouvelItemModule_emies==false)\n {\n getId = vm.selectedItemModule_emies.id; \n } \n \n var datas = $.param({\n supprimer: suppression,\n id: getId,\n date_previ_resti: convertionDate(module_emies.date_previ_resti),\n date_debut_reel_form: convertionDate(module_emies.date_debut_reel_form),\n date_fin_reel_form: convertionDate(module_emies.date_fin_reel_form),\n date_reel_resti:convertionDate(module_emies.date_reel_resti),\n nbr_previ_parti: module_emies.nbr_previ_parti,\n nbr_previ_fem_parti: module_emies.nbr_previ_fem_parti,\n date_debut_previ_form: convertionDate(module_emies.date_debut_previ_form),\n date_fin_previ_form: convertionDate(module_emies.date_fin_previ_form),\n id_contrat_partenaire_relai: vm.selectedItemContrat_partenaire_relai.id,\n lieu_formation: module_emies.lieu_formation,\n observation:module_emies.observation,\n validation : 0 \n });\n console.log(datas);\n //factory\n apiFactory.add(\"module_emies/index\",datas, config).success(function (data)\n {\n if (NouvelItemModule_emies == false)\n {\n // Update or delete: id exclu \n if(suppression==0)\n {\n vm.selectedItemModule_emies.contrat_partenaire_relai = vm.selectedItemContrat_partenaire_relai;\n vm.selectedItemModule_emies.$selected = false;\n vm.selectedItemModule_emies.$edit = false;\n vm.selectedItemModule_emies ={};\n //vm.showbuttonNouvPassation= false;\n }\n else \n { \n vm.allmodule_emies = vm.allmodule_emies.filter(function(obj)\n {\n return obj.id !== vm.selectedItemModule_emies.id;\n });\n vm.showbuttonNouvformemies= true;\n }\n \n }\n else\n {\n module_emies.contrat_partenaire_relai = vm.selectedItemContrat_partenaire_relai;\n\n module_emies.id = String(data.response); \n NouvelItemModule_emies=false;\n vm.showbuttonNouvformemies= false;\n }\n vm.stepparticipantemies=false;\n module_emies.validation=0;\n module_emies.$selected = false;\n module_emies.$edit = false;\n vm.selectedItemModule_emies = {};\n vm.showbuttonValidationformemies = false;\n }).error(function (data){vm.showAlert('Error','Erreur lors de l\\'insertion de donnée');});\n\n }", "function insert_in_baseModule_emies(module_emies,suppression)\n {\n //add\n var config =\n {\n headers : {'Content-Type': 'application/x-www-form-urlencoded;charset=utf-8;'}\n };\n \n var getId = 0;\n if (NouvelItemModule_emies==false)\n {\n getId = vm.selectedItemModule_emies.id; \n } \n \n var datas = $.param({\n supprimer: suppression,\n id: getId,\n date_previ_resti: convertionDate(module_emies.date_previ_resti),\n date_debut_reel_form: convertionDate(module_emies.date_debut_reel_form),\n date_fin_reel_form: convertionDate(module_emies.date_fin_reel_form),\n date_reel_resti:convertionDate(module_emies.date_reel_resti),\n nbr_previ_parti: module_emies.nbr_previ_parti,\n nbr_previ_fem_parti: module_emies.nbr_previ_fem_parti,\n date_debut_previ_form: convertionDate(module_emies.date_debut_previ_form),\n date_fin_previ_form: convertionDate(module_emies.date_fin_previ_form),\n id_contrat_partenaire_relai: vm.selectedItemContrat_partenaire_relai.id,\n lieu_formation: module_emies.lieu_formation,\n observation:module_emies.observation,\n validation : 0 \n });\n console.log(datas);\n //factory\n apiFactory.add(\"module_emies/index\",datas, config).success(function (data)\n {\n if (NouvelItemModule_emies == false)\n {\n // Update or delete: id exclu \n if(suppression==0)\n {\n vm.selectedItemModule_emies.contrat_partenaire_relai = vm.selectedItemContrat_partenaire_relai;\n vm.selectedItemModule_emies.$selected = false;\n vm.selectedItemModule_emies.$edit = false;\n vm.selectedItemModule_emies ={};\n //vm.showbuttonNouvPassation= false;\n }\n else \n { \n vm.allmodule_emies = vm.allmodule_emies.filter(function(obj)\n {\n return obj.id !== vm.selectedItemModule_emies.id;\n });\n vm.showbuttonNouvformemies= true;\n }\n \n }\n else\n {\n module_emies.contrat_partenaire_relai = vm.selectedItemContrat_partenaire_relai;\n\n module_emies.id = String(data.response); \n NouvelItemModule_emies=false;\n vm.showbuttonNouvformemies= false;\n }\n vm.stepparticipantemies=false;\n module_emies.validation=0;\n module_emies.$selected = false;\n module_emies.$edit = false;\n vm.selectedItemModule_emies = {};\n vm.showbuttonValidationformemies = false;\n }).error(function (data){vm.showAlert('Error','Erreur lors de l\\'insertion de donnée');});\n\n }", "function askForField(done) {\n if (this.context.entityConfig)\n return;\n this.log(chalk.green(`\\nGenerating field #${this.context.fields.length + 1}\\n`));\n const fieldNamesUnderscored = this.context.fieldNamesUnderscored;\n const prompts = [\n {\n type: 'confirm',\n name: 'fieldAdd',\n message: 'Do you want to add a field to your entity?',\n default: true\n },\n {\n when: response => response.fieldAdd === true,\n type: 'input',\n name: 'fieldName',\n validate: (input) => {\n if (!(/^([a-zA-Z0-9_]*)$/.test(input))) {\n return 'Your field name cannot contain special characters';\n } else if (input === '') {\n return 'Your field name cannot be empty';\n } else if (input.charAt(0) === input.charAt(0).toUpperCase()) {\n return 'Your field name cannot start with an upper case letter';\n } else if (input === 'id' || fieldNamesUnderscored.includes(_.snakeCase(input))) {\n return 'Your field name cannot use an already existing field name';\n } \n else if (jhiCore.isReservedFieldName(input)) {\n return 'Your field name cannot contain a Java or Angular reserved keyword';\n } \n return true;\n },\n message: 'What is the name of your field?'\n },\n {\n when: response => response.fieldAdd === true,\n type: 'confirm',\n name: 'fieldValidate',\n message: 'Do you want to add validation rules to your field?',\n default: false\n },\n {\n when: response => response.fieldAdd === true && response.fieldValidate === true,\n type: 'checkbox',\n name: 'fieldValidateRules',\n message: 'Which validation rules do you want to add?',\n choices: (response) => {\n const opts = [\n {\n name: 'Required',\n value: 'required'\n }\n ];\n return opts;\n },\n default: 0\n },\n ];\n this.prompt(prompts).then((props) => {\n if (props.fieldAdd) {\n const field = {\n fieldName: props.fieldName,\n fieldKey: _.snakeCase(props.fieldName),\n fieldType: 'postgis',\n fieldValidateRules: props.fieldValidateRules,\n \n }; \n fieldNamesUnderscored.push(_.snakeCase(props.fieldName));\n this.context.fields.push(field);\n }\n logFieldsAndRelationships.call(this);\n if (props.fieldAdd) {\n askForField.call(this, done);\n } else {\n done();\n }\n });\n}", "createFieldAsXml(xml) {\r\n let info;\r\n if (typeof xml === \"string\") {\r\n info = { SchemaXml: xml };\r\n }\r\n else {\r\n info = xml;\r\n }\r\n const postBody = jsS({\r\n \"parameters\": extend(metadata(\"SP.XmlSchemaFieldCreationInformation\"), info),\r\n });\r\n return this.clone(Fields_1, \"createfieldasxml\").postCore({ body: postBody }).then((data) => {\r\n return {\r\n data: data,\r\n field: this.getById(data.Id),\r\n };\r\n });\r\n }", "addModule(day, month, year, hour, minutes, payload, passphrase) {\n return this.httpService({\n method: 'PUT',\n url: `${this.rootURL}microAnalytics?year=${year}&month=${month}&day=${day}&hour=${hour}&minutes=${minutes}`,\n headers: {'Content-Type': 'application/x-www-form-urlencoded', 'Authorization': `basic ${passphrase}`},\n transformRequest(obj) {\n const str = [];\n for (const p in obj) {\n if (obj.hasOwnProperty(p)) {\n str.push(`${encodeURIComponent(p)}=${encodeURIComponent(obj[p])}`);\n }\n }\n return str.join(\"&\");\n },\n transformResponse: undefined, // --> Do not treat Response as JSON (it is a plain status string)\n data: {newAnalytics: JSON.stringify(payload)}\n });\n }", "function addOpportunitySource(req, res) {\n if (!validator.isValid(req.body.sourceName)) {\n res.json({\n code: Constant.ERROR_CODE,\n message: Constant.FIELD_REQUIRED\n });\n }\n else {\n source.findOne({sourceName: {$regex: new RegExp('^' + req.body.sourceName + '$', \"i\")}, moduleType: req.body.moduleType, deleted: false, companyId: req.body.companyId}, function(err, statusData) {\n if (err) {\n res.json({code: Constant.ERROR_CODE, message: err});\n }\n else {\n if (statusData) {\n res.json({\n code: Constant.ERROR_CODE,\n message: Constant.SOURCE_ALREADY_EXIST\n });\n }\n else {\n var sourceDataField = {\n sourceName: req.body.sourceName,\n companyId: req.body.companyId,\n userId: req.body.userId,\n moduleType: req.body.moduleType\n };\n source(sourceDataField).save(function(err, data) {\n if (err) {\n res.json({code: Constant.ERROR_CODE, message: err});\n } else {\n res.json({code: Constant.SUCCESS_CODE, data: data});\n }\n });\n }\n\n }\n });\n }\n\n\n}", "function addModuleImportToModule(host, modulePath, moduleName, src) {\n const moduleSource = getSourceFile(host, modulePath);\n if (!moduleSource) {\n throw new schematics_1.SchematicsException(`Module not found: ${modulePath}`);\n }\n const changes = ast_utils_1.addImportToModule(moduleSource, modulePath, moduleName, src);\n const recorder = host.beginUpdate(modulePath);\n changes.forEach((change) => {\n if (change instanceof change_1.InsertChange) {\n recorder.insertLeft(change.pos, change.toAdd);\n }\n });\n host.commitUpdate(recorder);\n}", "function appendField(e,o){\n e.preventDefault();\n addField(o);\n}", "function addNewModule() {\n\tcountOfModules++;\n\tvar modulename = document.getElementById(\"module_name\").value;\n\tconsole.log(\"Created Module : \"+modulename);\n\tconsole.log(\"Number of existing modules \"+countOfModules);\n\tvar node = '<div class = \"module\" id=\"Module'+countOfModules+'\" onClick=openModuleDetails(\"'+modulename+'\")><div class=\"moduletitle\"><p id = \"ModuleP'+countOfModules+'\">'+modulename+'</p></div><div class=\"modulePrecentage\"><p>69%</p></div></div>';\n\tdocument.getElementById('module_elements').innerHTML += node;\n\n\t//Close popupup and save the modules\n\tclosepopup();\n\tsaveModules();\n\n}", "function datagrid_add_row(table, field_id, formurl) {\n\tdatagrid_show_form(field_id, formurl, function(rowdata, raw) {\n\t\t// update the field\n\t\tvar field = $('#' + field_id + '_gridvalue');\n\t\tvar field_data = $.evalJSON(field.val());\n\t\tfield_data.push(raw);\n\t\tfield.val($.toJSON(field_data));\n\n\t\t// show buttons\n\t\t//$('#' + field_id + '_editrow').show();\n\t\t//$('#' + field_id + '_deleterow').show();\n\t\t$('#' + field_id + '_editrow').removeClass(\"disabled\");\n\t\t$('#' + field_id + '_deleterow').removeClass(\"disabled\");\n\n\n\n\n\t\t// update the datagrid\n\t\ttable.fnAddData(raw);\n\t});\n}", "registerApiModule (name, module, meta) {\n registerModuleEventListener(name, module, meta)\n if (!protocol.apiModule[name]) {\n protocol.apiModule[name] = module\n }\n else {\n for (const key in module) {\n if (module.hasOwnProperty(key)) {\n protocol.apiModule[name][key] = module[key]\n }\n }\n }\n // register API module's meta info to jsframework\n if (meta) {\n protocol.setApiModuleMeta(meta)\n global.registerModules(protocol.getApiModuleMeta(name), true)\n }\n }", "registerApiModule (name, module, meta) {\n registerModuleEventListener(name, module, meta)\n if (!protocol.apiModule[name]) {\n protocol.apiModule[name] = module\n }\n else {\n for (const key in module) {\n if (module.hasOwnProperty(key)) {\n protocol.apiModule[name][key] = module[key]\n }\n }\n }\n // register API module's meta info to jsframework\n if (meta) {\n protocol.setApiModuleMeta(meta)\n global.registerModules(protocol.getApiModuleMeta(name), true)\n }\n }", "function addToAdmin(newObject){\n var line = {};\n line.Brand = newObject.brand;\n line.skuCode = newObject.skuCode;\n var supplierCode = newObject.supplierCodeList; \n line.attribute = newObject.attribute;\n line.attributeCount = newObject.attributeCount;\n line.ohmies = newObject.ohmies;\n line.wholesale = newObject.wholesale;\n line.msrp = newObject.msrp;\n var supplierRow = searchString(supplierCode);\n addNewRows(\"ADMIN_INFO\", supplierRow, 1, line)\n \n}", "function findDuplicateDoc(moduleName, moduleDoc){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n\n //get the fields of the specific module\n service.getModuleByName(moduleName).then(function(aModule){\n //initialize array & object for querying\n var uniqueFields = [];\n var tempObj;\n\n //push the value of the document when a field is unique\n aModule.fields.forEach(function(field){\n if(field.unique){\n tempObj = {};\n tempObj[field.name] = moduleDoc[field.name];\n uniqueFields.push(tempObj);\n }\n });\n\n if(uniqueFields.length == 0){\n deferred.resolve();\n }\n else{\n //use $or for checking each field for uniqueness, not their combination\n db[moduleName].findOne({$or: uniqueFields}, function(err, duplicateDoc){\n if(err){\n deferred.reject(err);\n }\n //a duplicate exists, but needs further checking\n else if(duplicateDoc){\n //updating a module document\n if(moduleDoc._id){\n //different module documents with similar unique values\n if(moduleDoc._id != duplicateDoc._id){\n deferred.reject(exists);\n }\n //since it is the same document, it is not duplicate\n else{\n deferred.resolve();\n }\n }\n //adding new module documennt\n else{\n deferred.reject(exists);\n }\n }\n //does not exist\n else{\n deferred.resolve();\n }\n });\n }\n\n \n }).catch(function(err){\n deferred.reject(err);\n });\n\n return deferred.promise;\n}", "fieldsInfo () {\n return [\n {\n text: this.$t('fields.id'),\n name: 'id',\n details: false,\n table: false,\n },\n\n {\n type: 'input',\n column: 'order_nr',\n text: 'order No.',\n name: 'order_nr',\n multiedit: false,\n required: true,\n disabled: true,\n create: false,\n },\n {\n type: 'input',\n column: 'name',\n text: 'person name',\n name: 'name',\n multiedit: false,\n required: false,\n edit: false,\n create: false,\n },\n\n {\n type: 'input',\n column: 'email',\n text: 'email',\n name: 'email',\n multiedit: false,\n required: false,\n edit: false,\n create: false,\n },\n\n {\n type: 'select',\n url: 'crm/people',\n list: {\n value: 'id',\n text: 'fullname',\n data: [],\n },\n column: 'user_id',\n text: this.$t('fields.person'),\n name: 'person',\n apiObject: {\n name: 'person.name',\n },\n table: false,\n },\n {\n type: 'input',\n column: 'package_points',\n text: 'package points',\n name: 'package_points',\n required: false,\n edit: false,\n create: false,\n },\n\n // package_points\n {\n type: 'select',\n url: 'crm/package',\n list: {\n value: 'id',\n text: 'full_name',\n data: [],\n },\n column: 'package_id',\n text: 'package name',\n name: 'package',\n apiObject: {\n name: 'package.package_name',\n },\n table: false,\n },\n {\n type: 'input',\n column: 'package_name',\n text: 'package name',\n name: 'package_name',\n multiedit: false,\n required: false,\n edit: false,\n create: false,\n },\n\n {\n type: 'input',\n column: 'package_price',\n text: 'package price',\n name: 'package_price',\n multiedit: false,\n required: false,\n edit: false,\n create: false,\n },\n\n {\n type: 'input',\n column: 'pur_date',\n text: 'purche date',\n name: 'pur_date',\n multiedit: false,\n required: false,\n edit: false,\n create: false,\n },\n ]\n }", "addImport(variableName, moduleName) {\n this._imports[variableName] = moduleName;\n }", "function addToInvalidFields(arr, fName, fValue) {\n arr.push({\"name\": fName, \"value\": fValue});\n}", "function AddModule(module, slots)\n{\n var tree = document.getElementById(\"device_list\");\n var item = document.createElement(\"treeitem\");\n var row = document.createElement(\"treerow\");\n var cell = document.createElement(\"treecell\");\n cell.setAttribute(\"label\", module);\n row.appendChild(cell);\n item.appendChild(row);\n var parent = document.createElement(\"treechildren\");\n for (var i = 0; i<slots.length; i++) {\n var child_item = document.createElement(\"treeitem\");\n var child_row = document.createElement(\"treerow\");\n var child_cell = document.createElement(\"treecell\");\n child_cell.setAttribute(\"label\", slots[i]);\n child_row.appendChild(child_cell);\n child_item.appendChild(child_row);\n child_item.setAttribute(\"pk11kind\", \"slot\");\n parent.appendChild(child_item);\n }\n item.appendChild(parent);\n item.setAttribute(\"pk11kind\", \"module\");\n item.setAttribute(\"open\", \"true\");\n item.setAttribute(\"container\", \"true\");\n tree.appendChild(item);\n}", "field(name, type, description, resolve) {\n if (typeof description === 'function') {\n /* eslint-disable no-param-reassign */\n resolve = description;\n description = null;\n /* eslint-enable no-param-reassign */\n }\n\n this._saveField();\n if(typeof name === 'string') {\n /// only allowed to update description and resolve\n if (this.fields[name]) {\n this._field = this.fields[name];\n if (description)\n this._field.description = description;\n if (resolve)\n this._field.resolve = resolve;\n if (type)\n this._field.type = type;\n if(name === 'id' && (description || resolve || type))\n console.log(this._field);\n }\n else {\n invariant(type,\n `field(...): '${name}' has an undefined or null type. If you ` +\n `are trying to refer to '${this.name}' then you should use a function`);\n\n this._field = {\n name,\n type,\n description,\n resolve,\n args: {}\n };\n }\n }\n else if(typeof name === 'object'){\n //console.log(name);\n invariant(name.name, 'Must supply a name for graph ql field')\n invariant(name.type, 'Must supply a graphql compatible type');\n if(this.fields[name.name]){\n this._field = this.fields[name.name];\n let {type, description, resolve, args} = name;\n this._field = {...name}\n }\n else\n this._field = {...name};\n }\n return this;\n }", "async add(fields) {\n for (const [key, value] of Object.entries(fields)) {\n this.data[key] = value;\n }\n // todo: fields.createdBy = current user\n const category = new CategoryModel(this.data);\n const newCategory = await category.save();\n return {\n id: newCategory._id,\n };\n }", "addDependentLookupField(displayName, primaryLookupFieldId, showField) {\r\n return this.clone(Fields_1, `adddependentlookupfield(displayName='${displayName}', primarylookupfieldid='${primaryLookupFieldId}', showfield='${showField}')`)\r\n .postCore()\r\n .then(data => {\r\n return {\r\n data,\r\n field: this.getById(data.Id),\r\n };\r\n });\r\n }", "function updateModuleDoc(moduleName, updateDoc){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n\n db.bind(moduleName);\n\n //create another object and copy. then delete the '_id' property of the new copy\n var forUpdate = {};\n Object.assign(forUpdate, updateDoc);\n delete forUpdate._id;\n\n db[moduleName].update({_id: mongo.helper.toObjectID(updateDoc._id)}, {$set: forUpdate}, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n deferred.resolve();\n }\n });\n\n return deferred.promise;\n}", "_pushFields(fields, indexValue, type = 'default') {\n if (!_.isUndefined(indexValue)) {\n let index = this._rowsIndex[type][indexValue];\n if (_.isUndefined(index)) {\n this._rowsIndex[type][indexValue] = this._rows[type].length;\n this._rows[type].push(fields);\n } else {\n //this._rowsIndex.default[indexValue] = this._rows.default.length;\n let checker = this._getRuleChecker().setFields({\n 'new': fields,\n 'old': this._rows[type][index]\n });\n _.each(this.config.rules, rule => {\n if (checker.check(rule)) {\n this._rows[type][index] = fields;\n\n return false; // rule is matching, break next iteration\n }\n });\n }\n } else {\n this._rows[type].push(fields);\n }\n }", "function fnAddField(varValue,intType){\n\t\tidx3++;\n\t\tif(varValue){\n\t\t\tif(intType==cNumber){\n\t\t\t\tvarValue=varValue.replace('.','');\n\t\t\t\tvarValue=parseInt(varValue,10);\n\t\t\t}\n\t\t\tarrRow[idx3]=varValue;\n\t\t}else{\n\t\t\tarrRow[idx3]=(intType==cNumber)?0:'';\n\t\t}\n\t}", "function orgUpdateField(org_id, fieldName, fieldValue ) {\n\n // var member = globalMembers.find(function (member) { return member.id === member_id; }); //get the member object\n \n var ckanParameters = { id: org_id };\n ckanParameters[fieldName] = fieldValue;\n\n\n\n\n debugger;\n var client = new CKAN.Client(ckanServer, myAPIkey);\n\n client.action('organization_patch', ckanParameters,\n function (err, result) {\n if (err != null) { //some error - try figure out what\n mylog(mylogdiv, \"orgUpdateField ERROR: \" + JSON.stringify(err));\n console.log(\"orgUpdateField ERROR: \" + JSON.stringify(err));\n //return false;\n return 0;\n } else // we have managed to update. We are getting the full info for the org as the result\n {\n console.log(\"orgUpdateField RETURN: \" + JSON.stringify(result.result));\n //return true;\n return 1;\n // update the globalMembers array\n // update the screen\n\n }\n\n });\n\n\n}", "function createProject(user, project_fields) {\n return db\n .collection(\"projects\")\n .add(project_fields).then((new_project) => {\n const {appID, adminKey } = algoliaConfig;\n const client = algoliasearch(appID, adminKey);\n const index = client.initIndex('projects')\n const {title, description, createdBy, owner, status} = project_fields\n const objectID = new_project.id;\n \n // add project to owner's list\n db\n .doc(`users/${user.uid}`)\n .collection('projects').doc(new_project.id)\n .set({\n favorited: false,\n pinned: true,\n });\n\n // // attach owner to project\n // db\n // .doc(`projects/${new_project.id}`)\n // .collection('members').doc(user.uid)\n // .set({\n // date_added: project_fields.date_created,\n // });\n\n // add projects to algolia\n console.log('saving project...');\n console.log('index:')\n console.log(index.saveObject)\n index.saveObject({\n objectID,\n title,\n description,\n createdBy,\n owner,\n status,\n id:objectID\n }).then(({objectID}) => console.log);\n });\n \n}", "addToApi() {\n // Invoke the factory function, passing along the form field values to\n const newJournalEntry = renderDom.buildEntry();\n // console.log(\"newJournalEntry\", newJournalEntry)\n API.postJournalEntry(newJournalEntry);\n }", "function setNewModuleNode(object,count,num,racknum){\n var number = GlobalPortIP; \n var modulename = \"\";\n var redflag = \"\";\n var moduledescription = \"\";\n var subchannel = \"\";\n var moduleid = \"\";\n var serialnumber = \"\";\n\tif(globalStructure == \"devrackslotport\"){\n\t\tvar moduledevname = \"Device_\"+deviceCtr+\".Rack_\"+racknum+\".Slot_\"+num;\n\t\tvar objectpath = \"Device_\"+deviceCtr+\".Rack_\"+racknum+\".Slot_\"+num+\".Module_\"+count;\n\t}else{\n \tvar objectpath = \"Device_\"+deviceCtr;\n \tvar moduledevname = \"Device_\"+deviceCtr+\".Module_\"+count;\n\t}\n var moduleresid = \"\";\n var updateflag = \"new\";\n var moduleslotid = \"\";\n\n\tvar JsonStr = '';\n\tJsonStr += '{ \"Number\":\"'+number+'\",\"ModuleName\":\"'+modulename+'\",\"RedFlag\":\"'+redflag+'\",\"ModuleDescription\":\"'+moduledescription+'\",\"SubChannel\":\"'+subchannel+'\",\"ObjectPath\":\"'+objectpath+'\",\"ModuleId\":\"'+moduleid+'\",\"SerialNumber\":\"'+serialnumber+'\",\"ModuleDevName\":\"'+moduledevname+'\",\"ModuleResId\":\"'+moduleresid+'\",\"UpdateFlag\":\"'+updateflag+'\",\"ModuleSlotId\":\"'+moduleslotid+'\"';\n\tJsonStr += ',\"PORT\":[] }';\n\tvar parseJ = $.parseJSON(JsonStr);\n\tvar physicalporttype = \"\";\n\tvar type = \"\";\t\t\n\tvar speed = \"\";\n\tvar objectpath = \"\";\n\tvar portname = \"\";\n\tvar portmap = \"\";\n\tvar portnameid = \"\";\n\tif(globalStructure == \"devslotmod\"){\n\t\tGlobalNewDevice[0].DEVICES[0].SLOT[num].MODULE.push(parseJ);\n\t\tvar portcount = arrModuleCount[num].Value\n\t}else if(globalStructure == \"devrackslotport\"){\n\t\tGlobalNewDevice[0].DEVICES[0].RACK[racknum].SLOT[num].MODULE.push(parseJ);\n\t\tvar portcount = arrModuleCount[num].Value\n\t}else{\n\t\tGlobalNewDevice[0].DEVICES[0].MODULE.push(parseJ);\n\t\tvar portcount = arrModuleCount[count].Value\n\t}\n\tportcount--\n\tfor(var i = 0; i <= portcount; i++){\n\t\tif(globalStructure == \"devslotmod\"){\n\t\t\tportid = \"Slot\"+num+\"_Module\"+count+\"_Port\"+i\n\t\t}else if(globalStructure == \"devrackslotport\"){\n\t\t\tportid = \"Rack\"+racknum+\"_Slot\"+num+\"_Module\"+count+\"_Port\"+i\n\t\t}else{\n\t\t\tportid = \"Module\"+count+\"_Port\"+i\n\t\t}\n\t\tpysicalport = arrModuleCount[count].PhysicalPortType\n\t\tfor(var x = 0; x < devPortInfoArray.length; x++){\n\t\t\tnewportid = devPortInfoArray[x].PortId\n\t\t\tif(newportid==portid){\n\t\t\t\ttype = \"untagged\";\n\t\t\t\tspeed = physicalPortTypeSpeed(physicalporttype);\n\t\t\t\tobjectpath = \"Device_\"+deviceCtr+\".Module_\"+count+\"Port_\"+x\n\t\t\t\tportnameid = devPortInfoArray[x].PortName\n\t\t\t\tportnameid = portnameid.split(\"_\");\n\t\t\t\tportname = portnameid[0]\n\t\t\t\tportmap = portnameid[1]\n\t\t\t\tports = setNewPortNode(physicalporttype,type,speed,objectpath,portname,\"new\",\"false\",portmap);\n\t\t\t\tif(globalStructure == \"devslotmod\"){\n\t\t\t\t\tGlobalNewDevice[0].DEVICES[0].SLOT[num].MODULE[count].PORT.push(ports);\n\t\t\t\t}else if(globalStructure == \"devrackslotport\"){\n\t\t\t\t\tGlobalNewDevice[0].DEVICES[0].RACK[racknum].SLOT[num].MODULE[count].PORT.push(ports);\n\t\t\t\t}else{\n\t\t\t\t\tGlobalNewDevice[0].DEVICES[0].MODULE[count].PORT.push(ports);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tGlobalPortIP++\n\treturn parseJ;\n\t\n}", "static add(value){\n return { \n type: 'ADDTODO'\n }\n }", "function insert_in_baseModule_dpp(module_dpp,suppression)\n {\n //add\n var config =\n {\n headers : {'Content-Type': 'application/x-www-form-urlencoded;charset=utf-8;'}\n };\n \n var getId = 0;\n if (NouvelItemModule_dpp==false)\n {\n getId = vm.selectedItemModule_dpp.id; \n } \n \n var datas = $.param({\n supprimer: suppression,\n id: getId,\n date_previ_resti: convertionDate(module_dpp.date_previ_resti),\n date_debut_reel_form: convertionDate(module_dpp.date_debut_reel_form),\n date_fin_reel_form: convertionDate(module_dpp.date_fin_reel_form),\n date_reel_resti:convertionDate(module_dpp.date_reel_resti),\n nbr_previ_parti: module_dpp.nbr_previ_parti,\n nbr_previ_fem_parti: module_dpp.nbr_previ_fem_parti,\n date_debut_previ_form: convertionDate(module_dpp.date_debut_previ_form),\n date_fin_previ_form: convertionDate(module_dpp.date_fin_previ_form),\n id_contrat_partenaire_relai: vm.selectedItemContrat_partenaire_relai.id,\n lieu_formation: module_dpp.lieu_formation,\n observation:module_dpp.observation,\n validation : 0 \n });\n console.log(datas);\n //factory\n apiFactory.add(\"module_dpp/index\",datas, config).success(function (data)\n {\n if (NouvelItemModule_dpp == false)\n {\n // Update or delete: id exclu \n if(suppression==0)\n {\n //vm.selectedItemModule_dpp.contrat_partenaire_relai = vm.selectedItemContrat_partenaire_relai;\n vm.selectedItemModule_dpp.$selected = false;\n vm.selectedItemModule_dpp.$edit = false;\n vm.selectedItemModule_dpp ={};\n //vm.showbuttonNouvPassation= false;\n }\n else \n { \n vm.allmodule_dpp = vm.allmodule_dpp.filter(function(obj)\n {\n return obj.id !== vm.selectedItemModule_dpp.id;\n });\n \n vm.showbuttonNouvformdpp= true;\n }\n \n }\n else\n {\n //module_dpp.contrat_partenaire_relai = vm.selectedItemContrat_partenaire_relai;\n\n module_dpp.id = String(data.response); \n NouvelItemModule_dpp=false;\n vm.showbuttonNouvformdpp= false;\n }\n module_dpp.validation=0;\n module_dpp.$selected = false;\n module_dpp.$edit = false;\n vm.selectedItemModule_dpp = {};\n vm.stepparticipantdpp=false;\n }).error(function (data){vm.showAlert('Error','Erreur lors de l\\'insertion de donnée');});\n\n }", "function insert_in_baseModule_dpp(module_dpp,suppression)\n {\n //add\n var config =\n {\n headers : {'Content-Type': 'application/x-www-form-urlencoded;charset=utf-8;'}\n };\n \n var getId = 0;\n if (NouvelItemModule_dpp==false)\n {\n getId = vm.selectedItemModule_dpp.id; \n } \n \n var datas = $.param({\n supprimer: suppression,\n id: getId,\n date_previ_resti: convertionDate(module_dpp.date_previ_resti),\n date_debut_reel_form: convertionDate(module_dpp.date_debut_reel_form),\n date_fin_reel_form: convertionDate(module_dpp.date_fin_reel_form),\n date_reel_resti:convertionDate(module_dpp.date_reel_resti),\n nbr_previ_parti: module_dpp.nbr_previ_parti,\n nbr_previ_fem_parti: module_dpp.nbr_previ_fem_parti,\n date_debut_previ_form: convertionDate(module_dpp.date_debut_previ_form),\n date_fin_previ_form: convertionDate(module_dpp.date_fin_previ_form),\n id_contrat_partenaire_relai: vm.selectedItemContrat_partenaire_relai.id,\n lieu_formation: module_dpp.lieu_formation,\n observation:module_dpp.observation,\n validation : 0 \n });\n console.log(datas);\n //factory\n apiFactory.add(\"module_dpp/index\",datas, config).success(function (data)\n {\n if (NouvelItemModule_dpp == false)\n {\n // Update or delete: id exclu \n if(suppression==0)\n {\n //vm.selectedItemModule_dpp.contrat_partenaire_relai = vm.selectedItemContrat_partenaire_relai;\n vm.selectedItemModule_dpp.$selected = false;\n vm.selectedItemModule_dpp.$edit = false;\n vm.selectedItemModule_dpp ={};\n //vm.showbuttonNouvPassation= false;\n }\n else \n { \n vm.allmodule_dpp = vm.allmodule_dpp.filter(function(obj)\n {\n return obj.id !== vm.selectedItemModule_dpp.id;\n });\n \n vm.showbuttonNouvformdpp= true;\n }\n \n }\n else\n {\n //module_dpp.contrat_partenaire_relai = vm.selectedItemContrat_partenaire_relai;\n\n module_dpp.id = String(data.response); \n NouvelItemModule_dpp=false;\n vm.showbuttonNouvformdpp= false;\n }\n module_dpp.validation=0;\n module_dpp.$selected = false;\n module_dpp.$edit = false;\n vm.selectedItemModule_dpp = {};\n vm.stepparticipantdpp=false;\n }).error(function (data){vm.showAlert('Error','Erreur lors de l\\'insertion de donnée');});\n\n }", "addProject(){\n return this.get('projects').pushObject(this.store.createRecord('project'));\n }", "function findDuplicateDoc(moduleName, moduleDoc){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n\n //get the fields of the specific module\n service.getModuleByName(moduleName).then(function(aModule){\n //initialize array & object for querying\n var uniqueValues = [];\n var tempObj;\n\n //push the value of the document when a field is unique\n aModule.fields.forEach(function(field){\n if(field.unique){\n tempObj = {};\n tempObj[field.name] = moduleDoc[field.name];\n uniqueValues.push(tempObj);\n }\n });\n\n if(uniqueValues.length == 0){\n deferred.resolve();\n }\n else{\n db.bind(moduleName);\n\n //use $or for checking each field for uniqueness, not their combination\n db[moduleName].findOne({$or: uniqueValues}, function(err, duplicateDoc){\n if(err){\n deferred.reject(err);\n }\n //a duplicate exists, but needs further checking\n else if(duplicateDoc){\n //updating a module document\n if(moduleDoc._id){\n //different module documents with similar unique values\n if(moduleDoc._id != duplicateDoc._id){\n deferred.reject(exists);\n }\n //since it is the same document, it is not duplicate\n else{\n deferred.resolve();\n }\n }\n //adding new module documennt\n else{\n deferred.reject(exists);\n }\n }\n //does not exist - similar to notFound. but it is not rejected based on design\n else{\n deferred.resolve();\n }\n });\n }\n }).catch(function(err){\n deferred.reject(err);\n });\n\n return deferred.promise;\n}", "compose(options, module) {\n let schema = [];\n\n // Useful for finding good unit test cases\n // self.apos.util.log(JSON.stringify(_.pick(options, 'addFields', 'removeFields', 'arrangeFields'), null, ' '));\n\n if (options.addFields) {\n // loop over our addFields\n _.each(options.addFields, function (field) {\n let i;\n // remove it from the schema if we've already added it, last one wins\n for (i = 0; i < schema.length; i++) {\n if (schema[i].name === field.name) {\n schema.splice(i, 1);\n break;\n }\n }\n // add the new field to the schema\n schema.push(field);\n });\n }\n\n if (options.removeFields) {\n schema = _.filter(schema, function (field) {\n return !_.includes(options.removeFields, field.name);\n });\n }\n\n if (options.requireFields) {\n _.each(options.requireFields, function (name) {\n const field = _.find(schema, function (field) {\n return field.name === name;\n });\n if (field) {\n field.required = true;\n }\n });\n }\n\n // If nothing else will do, just modify the schema with a function\n if (options.alterFields) {\n options.alterFields(schema);\n }\n\n const groups = self.composeGroups(schema, options.arrangeFields);\n\n // all fields in the schema will end up in this variable\n let newSchema = [];\n\n // loop over any groups and orders we want to respect\n _.each(groups, function (group) {\n\n _.each(group.fields, function (field) {\n // find the field we are ordering\n let f = _.find(schema, { name: field });\n\n if (!f) {\n // May have already been migrated due to subclasses re-grouping fields\n f = _.find(newSchema, { name: field });\n }\n\n // make sure it exists\n if (f) {\n // set the group for this field\n const g = _.clone(group, true);\n delete g.fields;\n f.group = g;\n\n // push the field to the new schema, if it is a\n // duplicate due to subclasses pushing more\n // groupings, remove the earlier instance\n let fIndex = _.findIndex(newSchema, { name: field });\n if (fIndex !== -1) {\n newSchema.splice(fIndex, 1);\n }\n\n newSchema.push(f);\n\n // remove the field from the old schema, if that is where we got it from\n fIndex = _.findIndex(schema, { name: field });\n if (fIndex !== -1) {\n schema.splice(fIndex, 1);\n }\n }\n });\n });\n\n // put remaining fields in the default group\n _.each(schema, function (field) {\n const g = _.clone(groups[0], true);\n delete g.fields;\n field.group = g;\n });\n\n // add any fields not in defined groups to the end of the schema\n schema = newSchema.concat(schema);\n\n // If a field is not consecutive with other fields in its group,\n // move it after the last already encountered in its group,\n // to simplify rendering logic\n\n newSchema = [];\n const groupIndexes = {};\n _.each(schema, function (field) {\n if (field.group && field.group.name) {\n if (_.has(groupIndexes, field.group.name)) {\n newSchema.splice(groupIndexes[field.group.name], 0, field);\n groupIndexes[field.group.name]++;\n } else {\n newSchema.push(field);\n groupIndexes[field.group.name] = newSchema.length;\n }\n }\n });\n schema = newSchema;\n\n // Move the leftover group to the end, it's just too\n // obnoxious otherwise with one-off fields popping up\n // before title etc.\n\n schema = _.filter(schema, function (field) {\n return !(field.group && field.group.name === defaultGroup.name);\n }).concat(_.filter(schema, function (field) {\n return field.group && field.group.name === defaultGroup.name;\n }));\n\n // Shallowly clone the fields. This allows modules\n // like workflow to patch schema fields of various modules\n // without inadvertently impacting other apos instances\n // when running with @apostrophecms/multisite\n schema = _.map(schema, function (field) {\n return _.clone(field);\n });\n\n _.each(schema, function(field) {\n // For use in resolving options like \"choices\" when they\n // contain a method name. For bc don't mess with possible\n // existing usages in custom schema field types predating\n // this feature\n self.setModuleName(field, module);\n });\n return schema;\n }", "addImageToField(image) {\n\t\tconst list = getArrayFromField(this.imagesField);\n\t\tlist.push(image);\n\t\tconsole.log('addImageToField -- list: ');\n\t\tconsole.log(list);\n\t\tsaveArrayToField(this.imagesField, list);\n\t}", "function ajoutModule_gfpc(module_gfpc,suppression)\n {\n if (NouvelItemModule_gfpc==false)\n {\n apiFactory.getAPIgeneraliserREST(\"module_gfpc/index\",'menu','getmodulevalideById','id_module',module_gfpc.id).then(function(result)\n { \n var module_gfpc_valide = result.data.response;\n if (module_gfpc_valide.length !=0)\n {\n var confirm = $mdDialog.confirm()\n .title('cette modification n\\'est pas autorisé. Les données sont déjà validées!')\n .textContent('')\n .ariaLabel('Lucky day')\n .clickOutsideToClose(true)\n .parent(angular.element(document.body))\n .ok('Fermer')\n \n $mdDialog.show(confirm).then(function()\n { \n vm.allmodule_gfpc = vm.allmodule_gfpc.filter(function(obj)\n {\n return obj.id !== module_gfpc.id;\n });\n vm.stepparticipantgfpc=false;\n }, function() {\n //alert('rien');\n });\n }\n else\n {\n test_existanceModule_gfpc (module_gfpc,suppression); \n }\n });\n } \n else\n {\n insert_in_baseModule_gfpc(module_gfpc,suppression);\n }\n }" ]
[ "0.8235917", "0.679162", "0.67566025", "0.6683053", "0.6612175", "0.6491345", "0.64870906", "0.6423668", "0.6423668", "0.6410956", "0.62967265", "0.62095296", "0.6172234", "0.6075467", "0.60152245", "0.5900019", "0.58819133", "0.585371", "0.5834094", "0.5774164", "0.57685655", "0.57522565", "0.5675252", "0.5660639", "0.5617301", "0.557433", "0.55416346", "0.55227864", "0.5520854", "0.5508505", "0.55082726", "0.54918826", "0.5458602", "0.54266965", "0.53978705", "0.53749937", "0.5356016", "0.535344", "0.5340685", "0.5340685", "0.5333026", "0.53056395", "0.53029937", "0.5287291", "0.5244799", "0.5244799", "0.5242807", "0.5238335", "0.5236283", "0.5234579", "0.5230702", "0.52298766", "0.52230924", "0.5222608", "0.52224123", "0.5205706", "0.5197823", "0.519599", "0.51739466", "0.5173822", "0.5159944", "0.5153162", "0.5150441", "0.5136045", "0.51319027", "0.51319027", "0.5107264", "0.51043177", "0.5101476", "0.5100787", "0.5097334", "0.50818413", "0.5079903", "0.50661963", "0.50658244", "0.50658244", "0.50581765", "0.5053973", "0.50515753", "0.5049939", "0.5049115", "0.5048119", "0.5045508", "0.50366724", "0.5032615", "0.50115347", "0.50082046", "0.4997328", "0.49894202", "0.49822336", "0.49792436", "0.49767998", "0.49764937", "0.4975967", "0.4975967", "0.4975328", "0.49678096", "0.49651203", "0.49581948", "0.49552566" ]
0.8132459
1
Function name: update module field Author: Reccion, Jeremy Date Modified: 2018/04/24 Description: update a field object from the specific module's fields array Parameter(s): moduleName: required. string type fieldObject: required. object type Return: Promise
function updateModuleField(moduleName, fieldObject){ var deferred = Q.defer(); moduleName = moduleName.toLowerCase(); console.log(fieldObject); service.getModuleByName(moduleName).then(function(aModule){ //use array.filter() to get the duplicate fields var duplicateFields = aModule.fields.filter(function(field){ //lesson learned: use toString() in id return field.id.toString() == fieldObject.id.toString() || field.name == fieldObject.name; }); if(duplicateFields.length == 0){ deferred.reject(notFound); } //valid inputs else if(duplicateFields.length == 1){ //this is to ensure that the field is inside the specific module (in case of improper input parameters) fieldObject.id = new ObjectID(fieldObject.id); if(duplicateFields[0].id.toString() == fieldObject.id.toString()){ db.modules.update({name: moduleName, fields: {$elemMatch: {id: fieldObject.id}}}, {$set: {'fields.$': fieldObject}}, function(err, writeResult){ if(err){ deferred.reject(err); } else{ console.log(writeResult.result); deferred.resolve(); } }); } //the only element has the same name but is different id, therefore, not inside the module document else{ deferred.reject(notFound); } } else{ deferred.reject(exists); } }).catch(function(err){ deferred.reject(err); }); return deferred.promise; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateModuleField(moduleName, fieldObject){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n\n fieldObject.id = new ObjectID(fieldObject.id);\n \n db.modules.update({name: moduleName, fields: {$elemMatch: {id: fieldObject.id}}}, {$set: {'fields.$': fieldObject}}, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n deferred.resolve();\n }\n });\n\n return deferred.promise;\n}", "function updateFieldArray(moduleName, fieldArray){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n\n //need to convert each 'id' property to an ObjectID\n for(var i = 0; i < fieldArray.length; i++){\n fieldArray[i].id = new ObjectID(fieldArray[i].id);\n }\n \n\n db.modules.update({name: moduleName}, {$set: {fields: fieldArray}}, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n deferred.resolve();\n }\n });\n\n return deferred.promise;\n}", "function updateFieldArray(moduleName, fieldArray){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n\n db.modules.update({name: moduleName}, {$set: {fields: fieldArray}}, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n deferred.resolve();\n }\n });\n\n return deferred.promise;\n}", "function addModuleField(moduleName, fieldObject){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n\n //create a new objectID to used as query for updates and delete\n fieldObject.id = new ObjectID();\n\n //the query searches for the module name that do not have the inputted field name\n //this is to avoid pushing same field names on the 'fields' array of the specified module\n //writeResult will determine if the update was successful or not (i.e. writeResult.result.nModified)\n db.modules.update({name: moduleName, fields: {$not: {$elemMatch: {name: fieldObject.name}}}}, {$push: {fields: fieldObject}}, function(err, writeResult){\n if(err){\n deferred.reject(err);\n }\n else{\n //console.log(writeResult.result);\n //check the status of the update, if it failed, it means that there is an existing field name\n if(writeResult.result.nModified == 0){\n deferred.reject(exists);\n }\n else{\n deferred.resolve();\n }\n }\n });\n\n return deferred.promise;\n}", "function addModuleField(moduleName, fieldObject){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n\n //create a new objectID to used as query for updates and delete\n fieldObject.id = new ObjectID();\n\n db.modules.update({name: moduleName}, {$push: {fields: fieldObject}}, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n deferred.resolve();\n }\n });\n\n return deferred.promise;\n}", "function updateModule(updateModule){\n var deferred = Q.defer();\n\n updateModule.name = updateModule.name.toLowerCase();\n\n //fields array should not be editable when using this function. therefore, delete it from input\n delete updateModule.fields;\n\n db.modules.find({$or: [\n {_id: mongo.helper.toObjectID(updateModule._id)},\n {name: updateModule.name}\n ]}).toArray(function(err, modules){\n if(err){\n deferred.reject(err);\n }\n else if(modules.length == 0){\n deferred.reject(notFound);\n }\n //vali inputs, no other document have the same name\n else if(modules.length == 1){\n var oldModule = modules[0];\n \n //rename if old & new names are different\n if(oldModule.name != updateModule.name){\n db.bind(oldModule.name);\n db[oldModule.name].rename(updateModule.name, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n update();\n }\n });\n }\n //go straight to update\n else{\n update();\n }\n }\n //another module document with the same name exists\n else{\n deferred.reject(exists);\n }\n }); \n\n //updates the document in the 'modules' collection\n function update(){\n\n //create another object and copy. then delete the '_id' property of the new copy\n var forUpdate = {};\n Object.assign(forUpdate, updateModule);\n delete forUpdate._id;\n \n db.modules.update({_id: mongo.helper.toObjectID(updateModule._id)}, {$set: forUpdate}, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n deferred.resolve();\n }\n });\n }\n\n return deferred.promise;\n}", "function updateModule(updateModule){\n var deferred = Q.defer();\n\n updateModule.name = updateModule.name.toLowerCase();\n\n //fields array should not be editable when using this function. therefore, delete it from input\n delete updateModule.fields;\n\n //check if the name of the selected module has not changed\n db.modules.findOne({_id: mongo.helper.toObjectID(updateModule._id)}, function(err, aModule){\n if(err){\n deferred.reject(err);\n }\n else if(aModule){\n //if names are different, renaming the collection must be executed, then proceed to update\n if(aModule.name != updateModule.name){\n db.bind(aModule.name);\n db[aModule.name].rename(updateModule.name, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n update();\n }\n });\n }\n }\n else{\n update();\n }\n });\n\n //updates the document in the 'modules' collection\n function update(){\n\n //create another object and copy. then delete the '_id' property of the new copy\n var forUpdate = {};\n Object.assign(forUpdate, updateModule);\n delete forUpdate._id;\n \n db.modules.update({_id: mongo.helper.toObjectID(updateModule._id)}, {$set: forUpdate}, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n deferred.resolve();\n }\n });\n }\n\n return deferred.promise;\n}", "function orgUpdateField(org_id, fieldName, fieldValue ) {\n\n // var member = globalMembers.find(function (member) { return member.id === member_id; }); //get the member object\n \n var ckanParameters = { id: org_id };\n ckanParameters[fieldName] = fieldValue;\n\n\n\n\n debugger;\n var client = new CKAN.Client(ckanServer, myAPIkey);\n\n client.action('organization_patch', ckanParameters,\n function (err, result) {\n if (err != null) { //some error - try figure out what\n mylog(mylogdiv, \"orgUpdateField ERROR: \" + JSON.stringify(err));\n console.log(\"orgUpdateField ERROR: \" + JSON.stringify(err));\n //return false;\n return 0;\n } else // we have managed to update. We are getting the full info for the org as the result\n {\n console.log(\"orgUpdateField RETURN: \" + JSON.stringify(result.result));\n //return true;\n return 1;\n // update the globalMembers array\n // update the screen\n\n }\n\n });\n\n\n}", "function updateModuleDoc(moduleName, updateDoc){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n\n db.bind(moduleName);\n\n //create another object and copy. then delete the '_id' property of the new copy\n var forUpdate = {};\n Object.assign(forUpdate, updateDoc);\n delete forUpdate._id;\n\n db[moduleName].update({_id: mongo.helper.toObjectID(updateDoc._id)}, {$set: forUpdate}, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n deferred.resolve();\n }\n });\n\n return deferred.promise;\n}", "setModuleName(field, module) {\n field.moduleName = field.moduleName || (module && module.__meta.name);\n if ((field.type === 'array') || (field.type === 'object')) {\n _.each(field.schema || [], function(subfield) {\n self.setModuleName(subfield, module);\n });\n }\n }", "function update(){\n\n //create another object and copy. then delete the '_id' property of the new copy\n var forUpdate = {};\n Object.assign(forUpdate, updateModule);\n delete forUpdate._id;\n \n db.modules.update({_id: mongo.helper.toObjectID(updateModule._id)}, {$set: forUpdate}, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n deferred.resolve();\n }\n });\n }", "function update(){\n\n //create another object and copy. then delete the '_id' property of the new copy\n var forUpdate = {};\n Object.assign(forUpdate, updateModule);\n delete forUpdate._id;\n \n db.modules.update({_id: mongo.helper.toObjectID(updateModule._id)}, {$set: forUpdate}, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n deferred.resolve();\n }\n });\n }", "function updateModuleDoc(moduleName, updateDoc){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n\n service.findDuplicateDoc(moduleName, updateDoc).then(function(){\n db.bind(moduleName);\n \n //convert '_id' to ObjectID\n updateDoc._id = new ObjectID(updateDoc._id);\n \n db[moduleName].update({_id: updateDoc._id}, {$set: updateDoc}, function(err, writeResult){\n if(err){\n deferred.reject(err);\n }\n else{\n if(writeResult.result.nModified == 0){\n deferred.reject(notFound);\n }\n else{\n deferred.resolve();\n }\n }\n });\n }).catch(function(err){\n deferred.reject(err);\n });\n\n return deferred.promise;\n}", "function updateField(formId, fieldId, field)\n\t\t{\n\t\t\tvar deferred = $q.defer();\t\n\t\t\t// PUT the updated field information in the specified field in the\n\t\t\t// specified form\n\t\t\t$http.put(\"/api/assignment/form/\" + formId + \"/field/\" + fieldId, field)\n\t\t\t.success(function(response) \n\t\t\t{\n\t\t\t\tdeferred.resolve(response);\n\t\t\t});\n\n\t\t\treturn deferred.promise;\n\t\t}", "function deleteModuleField(moduleName, fieldID){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n \n db.modules.update({name: moduleName}, {$pull: {fields: {id: mongo.helper.toObjectID(fieldID)}}}, function(err, writeResult){\n if(err){\n deferred.reject(err);\n }\n else{\n if(writeResult.result.nModified == 0){\n deferred.reject(notFound);\n }\n else{\n deferred.resolve();\n }\n }\n });\n\n return deferred.promise;\n}", "function updateField() {\r\n //update general text field\r\n for (var i = 0; i < glob_data.length; i++) {\r\n try {\r\n var this_node_key = glob_data[i].pk + '.' + glob_data[i].fields.node_name\r\n if (this_node_key == obj) {\r\n $('#node_details .description').text(glob_data[i].fields.node_description)\r\n $('#node_details .details').text(glob_data[i].fields.details)\r\n $('.node-name-details').text(glob_data[i].fields.node_name)\r\n $active_node_name = glob_data[i].fields.node_name\r\n }\r\n else { }\r\n }\r\n catch (err) {\r\n console.log(err)\r\n }\r\n }\r\n updatePicture()\r\n\r\n function updatePicture() { }\r\n // update picture set for slides\r\n var $target_slides = $('.slide img')\r\n\r\n for (var j = 0; j < $target_slides.length; j++) {\r\n $thisslide = $target_slides[j]\r\n $thisslide.src = \"\\\\static\\\\app\\\\content\\\\node_content\\\\\" + $active_node_name + \"images\\\\\" + (j + 1).toString() + \".jpg\"\r\n\r\n }\r\n }", "function deleteModuleField(moduleName, fieldID){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n \n db.modules.update({name: moduleName}, {$pull: {fields: {id: mongo.helper.toObjectID(fieldID)}}}, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n deferred.resolve();\n }\n });\n\n return deferred.promise;\n}", "function updateOneFieldTask(id, field, data){\n $cordovaSQLite.execute(db,\n 'UPDATE tasks SET '+ field +' = ? WHERE id = ?',\n [data, id])\n .then(function(result) {}, function(error) {\n console.error('updateOneFieldTask(): ' + error);\n });\n }", "function ex3_update_node(node_name, field_name, value) {\n get_node(node_name)[field_name] = value;\n // Update everything\n update_all();\n}", "function updateField(name, value) {\n const updatedEntity = Object.assign({}, entity, { [name]: value }); //create new object with the changes\n setEntity(updatedEntity); // update local entity\n debouncedUpdatedDraftEntity(updatedEntity, { URL, entityName }); // push to debounce to update\n }", "function updateDepModuleVersions () {\n return request.post({\n url: `http://${HOST}/api/DepModuleVersions/add`,\n followAllRedirects: true,\n headers: {\n \"Authorization\": TOKEN\n },\n body: {\n obj: obj\n },\n json: true // Automatically stringifies the body to JSON\n }, (err, res, body) => {\n licenseObj(body);\n check(err, res, body);\n });\n}", "function changeModName() {\n //console.log('Modname' + modName);\n db.collection('modules')\n .doc(module.value)\n .update({\n 'module.name': modName,\n })\n .then(function () {\n console.log('modName updated successfully');\n history.push('/success');\n });\n }", "function updateField(table, column, field, id, objectid, callback) {\n\tpg.connect(connectionString,\t\t\t\t\t\t\t\t\t\t\t\t// try to connect to the database\n\t\tfunction (error, database, done) {\n\t\t\tif (error) return callback(error);\t\t\t\t\t\t\t\t\t// if there was an error, return it\n\n\t\t\tvar querystring = updateWhere(\t\t\t\t\t\t\t\t\t\t// generate the update query string\n\t\t\t\ttable, [column], [field], map(id, objectid)\n\t\t\t);\n\t\t\tquery(database, done, querystring,\t\t\t\t\t\t\t\t\t// query the database\n\t\t\t\tfunction (error, result) {\n\t\t\t\t\tif (error) return callback(error);\t\t\t\t\t\t\t// if there was an error, return it\n\t\t\t\t\treturn callback(SUCCESS, result);\t\t\t\t\t\t\t// otherwise, return the object\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\t);\n}", "updateField(recordId: number, key: string, value: string|number) {\n // Retrieving the record that is requested to go over the field update \n let record = this.crudStore.getData().get(recordId);\n\n // Asserting record retrieved successfully\n if (record) {\n // Updating field of record\n record[key] = value;\n\n // Updating record\n this.updateRecord(recordId, record)\n }\n else {\n throw \"CRUDActions.updateField: record wasn't retrieved successfully\"\n }\n }", "updateFieldItems() {\n this.fieldItems = this.getFieldItems();\n this.fullQueryFields = this.getFullQueryFields();\n this.availableFieldItemsForFieldMapping = this.getAvailableFieldItemsForFieldMapping();\n this.availableFieldItemsForMocking = this.getAvailableFieldItemsForMocking();\n this.mockPatterns = this.getMockPatterns();\n }", "static update(fields, value) {\n if (typeof value === 'number') {\n fields.position = value;\n } else if (typeof value === 'string') {\n fields.insertString = value;\n } else if (typeof value === 'object' && value.d !== undefined) {\n fields.delNum = value.d;\n }\n }", "function inviteUpdate(project,email,username){\r\n var s=/*LibraryjsUtil.*/dbParse({verb:\"get\",project:project,className:\"invite\",query:{email:email}}).results[0]//;Logger.log(s),var x\r\n , t=/*LibraryjsUtil.*/dbParse({verb:\"put\",project:project,className:\"invite\",obid:s.objectId,ob:{username:username}})\r\n ;return t}//function test(){Logger.log(inviteUpdate(\"dealDigger\",\"cooldude89@suremail.info\",\"cooldude89\"))}//Sample call: var t=LibraryjsUtil.inviteUpdate(pname,ob.email,ob.username);", "async function updateField(roomid, field, newValue) {\n if(!db){\n initIDB();\n }\n\n if(db){\n try{\n let tx = await db.transaction(STORE_NAME, 'readwrite');\n let store = await tx.objectStore(STORE_NAME);\n let index = await store.index('rooms');\n\n //Change field\n const roomObj = await index.get(IDBKeyRange.only(roomid));\n roomObj[field] = newValue;\n\n //Update idb\n store.put(roomObj, roomid);\n await tx.complete;\n }\n catch (error){\n console.log(error);\n }\n }\n}", "async updatePlayerField(nickname, fieldName, value) {\n const fields = this.getSupportedFields();\n\n if (!fields.hasOwnProperty(fieldName))\n throw new Error(`${fieldName} is not a field known to me. Please check !supported.`);\n \n const field = fields[fieldName];\n switch (field.type) {\n case AccountDatabase.kTypeNumber:\n return this._updateNumericPlayerField(nickname, field.table, fieldName, value);\n case AccountDatabase.kTypeString:\n return this._updateStringPlayerField(nickname, field.table, fieldName, value);\n case AccountDatabase.kTypeCustom:\n return this._updateCustomPlayerField(nickname, field.table, fieldName, value);\n default:\n throw new Error(`${fieldName} has an invalid type defined in the code.`);\n }\n }", "update(field, value) {\n return new code.Update(field, value);\n }", "updateFieldsStatus () {\n let service = dependencyService\n service.updateFieldsStatus(this.formParameters)\n }", "static async updateUser(id, formFields) {\n const { username, fName, lName, email, category = null } = formFields;\n\t\tconst query = `\n\t\t\tUPDATE users\n\t\t\tSET \n username = $1,\n first_name = $2,\n last_name = $3,\n email = $4,\n category = $5\n\t\t\tWHERE id = $6 \n\t\t\tRETURNING id, \n username, \n first_name AS \"fName\",\n last_name AS \"lName\",\n email,\n category\n ;`;\n\n\t\tconst result = await db.query(query, [username, fName, lName, email, category, id]);\n\n\t\tconst updatedUser = result.rows[0];\n\n\t\tif (!updatedUser) throw new NotFoundError(`User with id - ${id} not found.`);\n console.log('&&&&&&&&&&', updatedUser)\n\t\treturn updatedUser;\n }", "updateFieldInternal(payload){ // payload = {field (req), newValue (req)}\n var self = this;\n var editField, newVal;\n var val = null, displayVal = '', valObj = null;\n\n if(payload.hasOwnProperty('field') && payload.field && payload.hasOwnProperty('newValue')){\n newVal = payload.newValue;\n if(newVal == \"\") newVal = null;\n \n editField = payload.field;\n //else if(payload.hasOwnProperty('storeName') && payload.hasOwnProperty('propname')) editField = clone(self.state.form[payload.storeName][payload.propname]);\n\n editField.dbVal = newVal;\n\n if(newVal != null){\n if(editField.valType == 'number'){\n val = newVal;\n displayVal = newVal.toString();\n }\n else if(editField.valType == 'text' || editField.valType == 'textarea'){\n displayVal = newVal;\n val = newVal.toString().toUpperCase();\n }\n else if(editField.valType == 'boolean'){\n if (currVal == true || currVal == 1){\n val = true;\n }\n else{\n val = false;\n }\n displayVal = val ? 'true' : 'false';\n }\n else if (editField.valType == 'combobox'){\n var subset, valObj;\n var joinSet = editField.JoinSet;\n if(joinSet){\n if(this.state.form[joinSet].length > 0 || this.state.database[joinSet].length > 0){\n if(self.state.form[joinSet].length > 0) subset = 'form';\n else subset = 'database';\n\n if(this.state[subset][joinSet].length > 0 && this.state[subset][joinSet][0].hasOwnProperty(editField.ValProp)){\n valObj = self.state[subset][joinSet].find(function(s){\n if(typeof(s[editField.ValProp]) === \"object\") return s[editField.ValProp].val == newVal;\n else return s[editField.ValProp] == newVal;\n });\n if(valObj){\n if(typeof(valObj[editField.ValProp]) === \"object\") val = valObj[editField.ValProp].val;\n else val = valObj[editField.ValProp];\n\n if(typeof(valObj[editField.TextProp]) === \"object\") displayVal = valObj[editField.TextPron].displayVal;\n else displayVal = valObj[editField.TextProp];\n }\n else{\n if(this.errDebug) console.error('ERROR: getValObj - NOT FOUND IN STATE.' + subset + '.' + joinSet + ' - ' + newVal);\n }\n }\n }\n else if(newVal !== null){\n if(this.errDebug) console.error('ERROR: getValObj - ' + joinSet + ' NOT LOADED')\n val = newVal;\n displayVal = newVal.toString();\n }\n }\n else {\n if(self.errDebug) console.error('ERROR: getValObj - NO JOINSET SPECIFIED')\n val = currVal;\n displayVal = currVal.toString();\n }\n }\n else{\n if (this.errDebug) console.error('ERROR: updateFieldInternal: TYPE NOT HANDLED - ' + this.payloadToStr(payload));\n /* NEED TO DO SOMETHING HERE */\n }\n }\n editField.val = val;\n editField.displayVal = displayVal\n\n //this.updateObjectProp({storeName: payload.storeName, propname: payload.propname, valObj: newValObj});\n }\n else{\n if (this.errDebug) console.error('ERROR: updateFieldInternal: PAYLOAD - ' + this.payloadToStr(payload));\n }\n }", "function UpdateNonAddableField(fieldName, fieldValue)\n{\n\tTi.API.info(\"UpdateNonAddableField: \" + fieldName + \", \" + fieldValue);\n\t\n\t// TODO: Replace this with return statement\n\tif(contact == null) alert(\"Contact must be initialized ya beheema !\");\n\t\n\t// Job title is supported only by iOS\n\tif(fieldName == \"jobTitle\" && OS_ANDROID) return;\n\t\n\t// Add \"Bofff Me:\" to nickname\n\tif(fieldName == \"nickname\") fieldName = \"Bofff Me: \" + fieldName;\n\t\n\tcontact[fieldName] = fieldValue;\n}", "function _Update(objRequest, objResponse) {\n nlapiLogExecution('AUDIT','UPDATE Courses', '=====START=====');\n var stCustId = objRequest['CustomerId'];\n var httpBody = objRequest;\n nlapiLogExecution('AUDIT', 'Update Course', 'Update function in Departments executed.');\n\n var objDataResponse = {\n Response: 'F',\n Message: 'Default Value',\n ReturnId: ''\n };\n\n var loadedICourseRecord = nlapiLoadRecord('customrecord_rc_course', httpBody.Id);\n\n try {\n loadedICourseRecord.setFieldValue('custrecord_rc_course_title', httpBody.Title),\n loadedICourseRecord.setFieldValue('custrecord_rc_course_number', httpBody.Number),\n loadedICourseRecord.setFieldValue('custrecord_rc_course_credit_level', httpBody.CreditLevel.Id),\n loadedICourseRecord.setFieldValue('custrecord_rc_course_credit_hours', httpBody.CreditHours),\n loadedICourseRecord.setFieldValue('custrecord_rc_course_syllabi_name', httpBody.SyllabiName),\n loadedICourseRecord.setFieldValue('custrecord_rc_course_institution', httpBody.ModeOfInstruction),\n loadedICourseRecord.setFieldValue('custrecord_rc_course_reg_course', httpBody.RegisteredCourseId)\n objDataResponse.ReturnId = nlapiSubmitRecord(loadedICourseRecord, true)\n }\n catch (ex) {\n nlapiLogExecution('ERROR', 'Something broke trying to set fields' + ex.message)\n }\n\n if(objDataResponse.ReturnId){\n objDataResponse.Response = 'T';\n objDataResponse.Message = 'Yo it seems as though we have been successful with dis otha endevour' + JSON.stringify(loadedICourseRecord)\n }\n\n // Ask john.\n //1.)How to deal with \"missing\" values. What values must be supplied at any given stage\n // Mode up is required(looking at ns)\n\n // its either a list OR a record A list has id and value when writing i only provide an ID, don't pass anything but the id\n // think of it as an Enumerator, a number that means something else.\n //2.)How to deal with list objects\n\n nlapiLogExecution('AUDIT','UPDATE Courses', '======END======');\n return JSON.stringify(objDataResponse)\n}", "async updateMetafield(data) {\n await axios({\n method: \"put\",\n url: updateMetafield(this.metaId),\n data: data,\n })\n .then((res) => console.log(res.data.metafields))\n .catch((err) => console.log(err));\n }", "modifyField(field) {\r\n\r\n // Ask user for value\r\n var value = prompt(field.description || field.name, this.props.action.options[field.id] || \"\")\r\n if (!value)\r\n return\r\n\r\n // Store value\r\n this.props.action.options[field.id] = value\r\n this.forceUpdate()\r\n\r\n }", "function update_project_data(project_id) {\n\n // The authentication token for pipefy's api\n var user_token = 'Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJ1c2VyIjp7ImlkIjozMDExMTU0MjgsImVtYWlsIjoicGVkcm8uY3J1ekBtZWNhdHJvbi5vcmcuYnIiLCJhcHBsaWNhdGlvbiI6MzAwMTA0NTIzfX0.5UCErNgzErJD6if93Hn8-OlnCiXkyTIYazKKf_d2GFHPVeJZWuZdfVQHmL9ISloOdsKnkTLs4pRFYxZphe3a1w';\n\n\n // Get all cards on the project's pipe\n var cards_data = get_pipe_data(project_id, user_token);\n\n // Iterate through all the cards\n for (var card of cards_data) {\n card = card['node'];\n\n // If the card is a deliverable, update the deliverable's sheets, Otherwise, update the subdeliverable's sheets\n if (is_deliverable(card)) {\n update_deliverables(card, project_id);\n }\n else {\n update_subdeliverables(card, project_id);\n }\n\n\n }\n\n}", "function updateHeaderFields() {\n data.fields.forEach(field => {\n let id = GatherComponent.idByGatherTeamField(gatherMakers, gatherMakers.team, field);\n field.attributes.name = elementById(id).value;\n });\n}", "_updateCommonFields(updateData, {\n firstName, lastName, picture, website, interests, careerGoals, retired,\n }) {\n if (firstName) {\n updateData.firstName = firstName;\n }\n if (lastName) {\n updateData.lastName = lastName;\n }\n if (picture) {\n updateData.picture = picture;\n }\n if (website) {\n updateData.website = website;\n }\n if (interests) {\n updateData.interestIDs = Interests.getIDs(interests);\n }\n if (careerGoals) {\n updateData.careerGoalIDs = CareerGoals.getIDs(careerGoals);\n }\n if (_.isBoolean(retired)) {\n updateData.retired = retired;\n }\n // console.log('_updateCommonFields', updateData);\n }", "setUserData(field, value) {\r\n\r\n // Get all user data\r\n var userData = this.getUserData()\r\n\r\n // Set new field\r\n userData[field] = value\r\n\r\n // Update entity\r\n Entities.editEntity(this.id, JSON.stringify(userData))\r\n\r\n }", "updateProject(blockId) {\n //console.log('Update Project!' + blockId + '>');\n let that = this;\n\n fetch('https://api.webwizards.me/v1/projects?id=' + this.state.projectId, {\n method: 'PATCH',\n headers: {\n 'Accept': 'application/json',\n 'Content-Type': 'application/json',\n 'Authorization': localStorage.getItem('Authorization')\n },\n body: JSON.stringify({\n 'content': [blockId]\n })\n })\n .then(function (response) {\n that.setup_getProjectData();\n })\n .catch(err => {\n console.log('ERROR: ', err);\n });\n }", "function updateSomething(modifiedField) {\n\tconsole.log(\"updating \" + modifiedField);\n\n\tvar username = document.getElementById('username').innerHTML;\n var newVal = document.getElementById(modifiedField+'field').value;\n\n $.post(\"../DatabaseRelated/updateuserfield.php\",\n {name:username,field:modifiedField,newval:newVal},\n function(data){\n if (data == \"Success\"){\n\t\t\t\tdocument.getElementById('updateresult').innerHTML = modifiedField + \" successfully updated\";\n }\n\t\t\t else {\n\t\t\t\tdocument.getElementById('updateresult').innerHTML = \"Error updating \" + modifiedField + \": \" + data;\n }\n })\n}", "function update_field(name, path, type, content) {\n\t\t$.ajax({\n\t\t\ttype: 'post',\n\t\t\turl: WSData.server_path + '/admin/fields',\n\t\t\tdata: {name: name, path: path, type: type, content: content}\n\t\t}).done(function (d) {\n\t\t\t$('#ws-saving-status').html('<i class=\"icon-check\"></i> Saved.');\n\t\t}).fail(function (d) {\n\t\t\t$('#ws-saving-status').html('<i class=\"icon-remove\"></i> Error saving.');\n\t\t});\n\t}", "function updateUserField(field, value) {\n return new Promise(function (resolve, reject) {\n // Emulate an API call.\n // Randomly reject some calls\n setTimeout(function () {\n if (Math.random() > 0.95) {\n reject({\n code: 401\n });\n }\n\n resolve(value);\n }, 1000);\n });\n}", "_setFields (fields, valueOptions = {}) {\n if (typeof fields !== 'object') {\n throw new Error(\"Expected an object but got \" + typeof fields);\n }\n\n for (let field in fields) {\n this._set(field, fields[field], valueOptions);\n }\n }", "handleFieldsChangeByPlugin(e, value) {\n let name = value.name;\n\n if (this.currentComponent && name){\n let fields = Object.assign({}, this.currentComponent.state.fields);\n fields[name] = value.value;\n\n this.currentComponent.setState({fields: fields});\n }\n }", "update(properties, fieldType = \"SP.Field\") {\r\n const postBody = jsS(extend(metadata(fieldType), properties));\r\n return this.postCore({\r\n body: postBody,\r\n headers: {\r\n \"X-HTTP-Method\": \"MERGE\",\r\n },\r\n }).then((data) => {\r\n return {\r\n data,\r\n field: this,\r\n };\r\n });\r\n }", "function updateFormField(id, fieldid, updatedField) {\n var deferred = q.defer();\n\n FormModel.findById(id, function(err, form) {\n if(err) {\n deferred.reject(err);\n } else {\n // iterate over form fields\n for(var i = 0; i < form.fields.length; i ++) {\n if(form.fields[i].id == fieldid) {\n // field found! update it\n for(var attr in updatedField) {\n if(updatedField.hasOwnProperty(attr))\n form.fields[i].attr = updatedField.attr;\n }\n form.save(function(err, form) {\n if(err) {\n deferred.reject(err);\n } else {\n deferred.resolve(form);\n }\n });\n }\n }\n }\n });\n\n return deferred.promise;\n }", "function updateFieldsInRecords(fields, records, replacements) {\n // Use object-literal syntax (faster than alternative)\n var convertBody = 'return {' + fields.map(function(name) {\n var key = JSON.stringify(name);\n return key + ': ' + (replacements[name] ? 'replacements[' + key + '][i]' : 'rec[' + key + ']');\n }).join(', ') + '}';\n var convert = new Function('rec', 'replacements', 'i', convertBody);\n records.forEach(function(rec, i) {\n records[i] = convert(rec, replacements, i);\n });\n }", "function updateDetails(method, url, payload, objectString, formName){\n\n var httpRequest = createHttpRequest(method, url);\n\n httpRequest.onreadystatechange = function(){\n if (httpRequest.readyState == 4 && httpRequest.status == 200) {\n alert(objectString + \" updated successfully!\");\n resetForm(formName);\n }\n }\n httpRequest.onerror = onError;\n sendHttpRequest(httpRequest, method, url, \"application/x-www-form-urlencoded\", payload);\n}", "@action\n saveFieldRequest(id, currentValue) {\n const initialValue = this.initialData[id];\n\n // Don't save if field hasn't changed\n // Don't need to check for error state since initialData wouldn't have updated since last error\n if (\n currentValue === initialValue ||\n (currentValue === '' && !defined(initialValue))\n ) {\n return null;\n }\n\n // Check for error first\n this.validateField(id);\n if (!this.isValidField(id)) {\n return null;\n }\n\n // shallow clone fields\n let saveSnapshot = this.createSnapshot();\n\n // Save field + value\n this.setSaving(id, true);\n\n const fieldDescriptor = this.fieldDescriptor.get(id);\n\n // Check if field needs to handle transforming request object\n const getData =\n typeof fieldDescriptor.getData === 'function' ? fieldDescriptor.getData : (a) => a;\n\n const request = this.doApiRequest({\n data: getData(\n {[id]: this.getTransformedValue(id)},\n {model: this, id, form: this.getData()}\n ),\n });\n\n request\n .then((data) => {\n this.setSaving(id, false);\n\n // save snapshot\n if (saveSnapshot) {\n saveSnapshot();\n saveSnapshot = null;\n }\n\n // Update initialData after successfully saving a field as it will now be the baseline value\n this.initialData[id] = this.getValue(id);\n\n return data;\n })\n .catch((resp) => {\n // should we revert field value to last known state?\n saveSnapshot = null;\n\n // Field can be configured to reset on error\n // e.g. BooleanFields\n const shouldReset = this.getDescriptor(id, 'resetOnError');\n if (shouldReset) {\n this.setValue(id, initialValue);\n }\n\n // API can return a JSON object with either:\n // 1) map of {[fieldName] => Array<ErrorMessages>}\n // 2) {'non_field_errors' => Array<ErrorMessages>}\n if (resp && resp.responseJSON) {\n // Show resp msg from API endpoint if possible\n if (Array.isArray(resp.responseJSON[id]) && resp.responseJSON[id].length) {\n // Just take first resp for now\n this.setError(id, resp.responseJSON[id][0]);\n } else if (\n Array.isArray(resp.responseJSON.non_field_errors) &&\n resp.responseJSON.non_field_errors.length\n ) {\n addErrorMessage(resp.responseJSON.non_field_errors[0], 10000);\n // Reset saving state\n this.setError(id, '');\n } else {\n this.setError(id, 'Failed to save');\n }\n } else {\n // Default error behavior\n this.setError(id, 'Failed to save');\n }\n\n // eslint-disable-next-line no-console\n console.error('Error saving form field', resp && resp.responseJSON);\n });\n\n return request;\n }", "function updateField(event) {\n const val = event.target.value;\n changeAct(val);\n }", "static async updateContact(ContactId, obj, userId) {\n const contactFields = {};\n if (obj.name) contactFields.name = obj.name;\n if (obj.email) contactFields.email = obj.email;\n if (obj.phone) contactFields.phone = obj.phone;\n if (obj.type) contactFields.type = obj.type;\n console.log(contactFields);\n const contact = await Contact.findById({ _id: ContactId });\n\n if (!contact) {\n throw new Error(\"Contact not found\");\n }\n\n // Make sure user owns contact\n if (contact.user.toString() !== userId) {\n return new Error(\"Unauthorized access\");\n }\n\n const updatedContact = await Contact.findByIdAndUpdate(\n ContactId,\n { $set: contactFields },\n { new: true }\n );\n return updatedContact;\n }", "static update({ id, name, phone, email, sex }) {\r\n return new Promise(async resolve => {\r\n try {\r\n \r\n if( !ObjectID.isValid( id )){\r\n return resolve({ error : true , message : 'params_invalid' });\r\n }\r\n let listUser = await USER_COLL.findByIdAndUpdate( id, {\r\n name, phone, email, sex\r\n }\r\n ,{\r\n new: true\r\n });\r\n \r\n if(!listUser){\r\n return resolve({error: true, message:'cannot_update_list'});\r\n }\r\n return resolve({error: false, message:'update_data_success', data: listUser});\r\n\r\n\r\n } catch (error) {\r\n return resolve({ error: true, message: error.message });\r\n }\r\n })\r\n}", "function updateField(fieldId, updateValue) {\n fieldId.innerText = updateValue; \n calculateTotalPrice();\n updateTotal();\n}", "function updateOpportunitySource(req, res) {\n if (!validator.isValid(req.body.sourceName)) {\n res.json({\n code: Constant.ERROR_CODE,\n message: Constant.FIELD_REQUIRED\n });\n }\n else {\n source.findOne({sourceName: {$regex: new RegExp('^' + req.body.sourceName + '$', \"i\")}, moduleType: req.body.moduleType, deleted: false, companyId: req.body.companyId}, function(err, statusData) {\n if (err) {\n res.json({code: Constant.ERROR_CODE, message: err});\n }\n else {\n if (statusData) {\n res.json({\n code: Constant.ERROR_CODE,\n message: Constant.CONTACT_STATUS_EXIST\n });\n }\n else {\n var sourceDataField = {\n sourceName: req.body.sourceName,\n companyId: req.body.companyId,\n userId: req.body.userId\n\n };\n source.findByIdAndUpdate(req.body.sourceId, sourceDataField, function(err, data) {\n if (err) {\n res.json({code: Constant.ERROR_CODE, message: err});\n } else {\n res.json({code: Constant.SUCCESS_CODE, data: data});\n }\n });\n }\n\n }\n });\n }\n\n\n}", "sendUpdatedField(newDisplayname, newOptional, newType, newMin, newMax){\n var optional=null;\n newOptional === true ? optional = '1' : optional = '0'\n this.setState({\n edit: false\n })\n $.ajax({url: '/php/update_signup_field.php', type: 'POST',\n dataType: 'json',\n data: {\n 'name': newDisplayname,\n 'optional': optional,\n 'type': newType,\n 'minimum': newMin,\n 'maximum': newMax,\n 'DataID': this.state.signupFields[this.state.currentIndex].DataID\n },\n success: response => {\n this.checkifLive();\n this.getFields();\n },\n error: response => {\n alert(\"An error occured, please refresh the page!\")\n }\n });\n }", "static update(request, response) {\r\n\r\n itemsModel.getById(request.body.id)\r\n .then( data => {\r\n if (data.length > 0) {\r\n\r\n //recupera do body os campos que serao atualizados na tabela\r\n const conditions = [\r\n {\r\n field: 'id',\r\n value: request.body.id\r\n },\r\n {\r\n field: 'title',\r\n value: request.body.title\r\n },\r\n {\r\n field: 'descr',\r\n value: request.body.descr\r\n },\r\n {\r\n field: 'photo',\r\n value: request.body.photo\r\n },\r\n {\r\n field: 'category',\r\n value: request.body.category\r\n },\r\n ];\r\n\r\n //chama rotina para atualizacao dos dados\r\n itemsModel.update(conditions) \r\n response.sendStatus(200);\r\n console.log('Item has been updated. ID: ', request.body.id); \r\n } else {\r\n response.sendStatus(404);\r\n console.log('Item not found. ID: ', request.body.id);\r\n }\r\n })\r\n .catch(err => {\r\n response.sendStatus(500);\r\n console.log('Error updating Item by ID: ', request.body.id, err);\r\n });\r\n \r\n }", "updateField(field) {\n this.setState({\n [field.target.id]: field.target.value\n });\n console.log(\"ESTADO :\" + field.target.id + \" Valor :\" + field.target.value);\n }", "function updateModelField(field, model, cloner = null){\r\n\t if(!field) return false\r\n\t // quit if field id does not following the underscore convention\r\n\t if(!(n = getFieldIndex(field))) return false;\r\n\r\n\t // update the essential elements of a typical field\r\n\t indexfyAttr(field.querySelector('.remove-field'),'data-field',n);\r\n\t field.querySelector('.remove-field').setAttribute('onclick','removeField(document.getElementById(\"'+field.id+'\"))');\r\n\t indexfyAttr(field.querySelector('.collapse-detail'),'data-target',n);\r\n\t replaceClasses(field.querySelectorAll('.'+model+'-field_1'),model+'-field_1',model+'-field_'+ n);\r\n\t changeId(field.querySelector('#collapseDetail_1'),'collapseDetail_'+ n);\r\n\t changeId(field.querySelector('#childFields_1'),'childFields_'+ n);\r\n\t changeId(field.querySelector('#amountField_1'),'amountField_'+ n);\r\n\r\n\t // sync the shift & replaced elements on smaller devices\r\n\t if((els = field.querySelectorAll('.shift-on-small')).length >=1) {\r\n\t\t for(var i=0; i<els.length; i++) {\r\n\t\t\t indexfyAttr(els[i],'data-small-parent',n);\r\n\t\t\t indexfyAttr(els[i],'data-return-before',n);\r\n\t\t }\r\n\t }\r\n\r\n\t if((els = field.querySelectorAll('.append-field-on-small')).length >=1) {\r\n\t\t for(var i=0; i<els.length; i++) indexfyAttr(els[i],'id',n);\r\n\t }\r\n\r\n\t // fill the correct name of the field type, on the classes model-name\r\n\t var model_names = field.querySelectorAll('.model-name');\r\n\t for(var i=0; i<model_names.length; i++)\tmodel_names[i].innerHTML = model;\r\n\r\n\t // sync the edit toggle element with the actuall fields which are not editable by default\r\n\t if(el = field.querySelector('.toggle-editable')) el.setAttribute('data-inputs',field.id);\r\n\t replaceClasses(field.querySelectorAll('.not-editable'),'not-editable',field.id);\r\n\t if(el = field.querySelector('.toggle-editable')) setToggleEditableTriggers(el);\r\n\r\n\t // for cloned elements which are associated with a modal\r\n\t // to sync with where to place the items after selecting an option from modal,\r\n\t // this parent will be passed to the cloner in the modal by the manageAction -> makeIfCloner function,\r\n\t if(el = field.querySelector('.fields-parent')) indexfyAttr(el,'id',n);\r\n\t if(el = field.querySelector('.action-trigger')) indexfyAttr(el,'data-parent',n);\r\n\r\n\t //pass the services and transactiontype to child elements\r\n\t if(service = cloner.getAttribute(\"data-service\")) field.setAttribute(\"data-service\",service);\r\n\t if(model = cloner.getAttribute(\"data-model\")) field.setAttribute(\"data-model\",model);\r\n\t if(transaction_type = cloner.getAttribute(\"data-transaction-type\")) field.setAttribute(\"data-transaction-type\",transaction_type);\r\n\r\n\t // pass the service and transaction type to the modal triggerer, so as to trigger the right modal\r\n\t if(el = field.querySelector('.action-trigger')){\r\n\t\t if(service) el.setAttribute(\"data-service\",service);\r\n\t\t if(transaction_type) el.setAttribute(\"data-transaction-type\",transaction_type);\r\n\t }\r\n\r\n\t // prepare showing the modal if the transaction for the service is sale\r\n\t if(service) {\r\n\t\t\t if(el && model ==\"sale\") configToShowModal(el);\r\n\t\t\t if(el && model !=\"sale\") makeIfCloner(el);\r\n\t }\r\n\r\n\t // reset the cloners and triggers with in the cloned field\r\n\t setCloners();\r\n\t setTriggers();\r\n}", "function findDuplicateDoc(moduleName, moduleDoc){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n\n //get the fields of the specific module\n service.getModuleByName(moduleName).then(function(aModule){\n //initialize array & object for querying\n var uniqueFields = [];\n var tempObj;\n\n //push the value of the document when a field is unique\n aModule.fields.forEach(function(field){\n if(field.unique){\n tempObj = {};\n tempObj[field.name] = moduleDoc[field.name];\n uniqueFields.push(tempObj);\n }\n });\n\n if(uniqueFields.length == 0){\n deferred.resolve();\n }\n else{\n //use $or for checking each field for uniqueness, not their combination\n db[moduleName].findOne({$or: uniqueFields}, function(err, duplicateDoc){\n if(err){\n deferred.reject(err);\n }\n //a duplicate exists, but needs further checking\n else if(duplicateDoc){\n //updating a module document\n if(moduleDoc._id){\n //different module documents with similar unique values\n if(moduleDoc._id != duplicateDoc._id){\n deferred.reject(exists);\n }\n //since it is the same document, it is not duplicate\n else{\n deferred.resolve();\n }\n }\n //adding new module documennt\n else{\n deferred.reject(exists);\n }\n }\n //does not exist\n else{\n deferred.resolve();\n }\n });\n }\n\n \n }).catch(function(err){\n deferred.reject(err);\n });\n\n return deferred.promise;\n}", "function update(module, endpoint, auth, data){\n\n let requestObj = makeRequest('PUT', module, endpoint, auth);\n requestObj.data = data; // MOJE DA E : JSON.stringify(data);\n \n return $.ajax(requestObj);\n }", "function onRegFieldUpdate(fieldEdited) {\n var fieldId = fieldEdited.id;\n var fieldContent = fieldEdited.text;\n switch (fieldId) {\n case \"regFirstNameInput\":\n //D007: Adding code to capitalize first character for fieldContent and fieldContent\n //volunteerRegObject.firstname = fieldContent;\n volunteerRegObject.firstName = fieldContent.charAt(0).toUpperCase() + fieldContent.slice(1);\n //End of D007\n break;\n case \"regLastNameInput\":\n //D007: Adding code to capitalize first character for fieldContent and fieldContent\n //volunteerRegObject.lastname = fieldContent;\n volunteerRegObject.lastName = fieldContent.charAt(0).toUpperCase() + fieldContent.slice(1);\n //End of D007\n break;\n case \"regUsernameInput\":\n volunteerRegObject.username = fieldContent;\n break;\n case \"regPasswordInput\":\n volunteerRegObject.password = fieldContent;\n break;\n case \"regReenterPasswordInput\":\n volunteerRegObject.reenteredPassword = fieldContent;\n break;\n case \"regWorkDetailsInput\":\n volunteerRegObject.workDetails = fieldContent;\n break;\n case \"regAboutMeInput\":\n volunteerRegObject.aboutMe = fieldContent;\n break;\n case \"regCompanyInput\":\n //Start of D012\n volunteerRegObject.companyName = fieldEdited.selectedKey;\n if (volunteerRegObject.companyName === \"Select\" || volunteerRegObject.companyName === null || volunteerRegObject.companyName === \"\") {\n volunteerRegObject.companyName = \"\";\n }\n //End of D012\n break;\n case \"regRoleInput\":\n volunteerRegObject.role = fieldContent;\n break;\n case \"regBusinessUnitInput\":\n volunteerRegObject.businessUnit = fieldContent;\n break;\n case \"regStateInput\":\n volunteerRegObject.state = fieldEdited.selectedKey;\n if (volunteerRegObject.state === \"Select\" || volunteerRegObject.state === null || volunteerRegObject.state === \"\") {\n volunteerRegObject.state = \"\";\n }\n break;\n case \"regAddressInput\":\n volunteerRegObject.address = fieldContent;\n break;\n case \"regCityInput\":\n volunteerRegObject.city = fieldContent;\n break;\n case \"regContactNumberInput\":\n volunteerRegObject.contactNumber = fieldContent;\n break;\n case \"regEmailAddressInput\":\n volunteerRegObject.emailAddress = fieldContent;\n break;\n default:\n break;\n }\n}", "function updateStage(req, res) {\n if (!validator.isValid(req.body.stageName)) {\n res.json({\n code: Constant.ERROR_CODE,\n message: Constant.FIELD_REQUIRED\n });\n }\n else {\n stage.findOne({stageName: {$regex: new RegExp('^' + req.body.stageName + '$', \"i\")}, moduleType: req.body.moduleType, companyId: req.body.companyId, deleted: false}, function(err, stageData) {\n if (err) {\n res.json({code: Constant.ERROR_CODE, message: err});\n }\n else {\n if (stageData) {\n res.json({\n code: Constant.ERROR_CODE,\n message: Constant.CONTACT_STAGE_EXIST\n });\n }\n else {\n var stageField = {\n stageName: req.body.stageName,\n companyId: req.body.companyId,\n moduleType: req.body.moduleType\n };\n stage.findByIdAndUpdate(req.body.stageId, stageField, function(err, data) {\n if (err) {\n res.json({code: Constant.ERROR_CODE, message: err});\n } else {\n res.json({code: Constant.SUCCESS_CODE, data: data});\n }\n });\n }\n\n }\n });\n }\n\n}", "function RecordUpdate(baseName, dataGroup) {\n //test OK!\n console.log(\"dataGroup = \");\n console.log(dataGroup);\n\n return new Promise((resolve, reject) => {\n let text = \"\";\n if (dataGroup) {\n base(baseName).update(dataGroup, { typecast: true }, function(\n err,\n records\n ) {\n if (err) {\n console.error(err);\n return;\n }\n records.forEach(function(record) {\n text =\n \"record ID \" +\n record.id +\n \" from base \" +\n baseName +\n \" is UPDATED!\";\n });\n resolve(text);\n });\n } else {\n reject();\n }\n }).catch(err => {\n console.log(err);\n });\n }", "_assignToActorField (fields, value) {\n const actorData = duplicate(this.actor)\n const lastField = fields.pop()\n fields.reduce((data, field) => data[field], actorData)[lastField] = value\n this.actor.update(actorData)\n }", "moveMaterialSchemaValue(fieldName, newField, oldField) {\n this.fields[fieldName].attributes[newField] = this.fields[fieldName].attributes[oldField]; // Copy the oldField value to the newField value\n this.fields[fieldName].attributes[oldField] = null; // And now remove the oldField by Nulling\n }", "function updateFunit(adSql,params, asObjectRow){\n $fairCmd.update(cmd,{\n sqlType: 'UPDATE',\n name: adSql,\n parameter: params,\n asObjectRow: asObjectRow === undefined ? true : asObjectRow\n })\n }", "update() {\n\t\tlet title = this.refs.newTitle.value\n\t\tlet date = this.refs.newDate.value\n\t\tlet des = this.refs.newDescription.value\n\t\tlet link = this.refs.newLink.value\n\t\tlet id = this.props._id\n\n\t\tif(title == \"\" || date == \"\" || des == \"\" || link == \"\"){\n\t\t\talert(\"Fields can not be empty\")\n\t\t}else{\n\t\t\tlet data = '{\"Title\":\"' + title + '\",\"Description\":\"' + des + '\",\"Year\":\"' + date + '\",\"Link\":\"' + link + '\"}'\n\n\t\t\tthis.props.dispatch(updateProject(this.props._id, data))\n\t\t}\n\t}", "function findDuplicateDoc(moduleName, moduleDoc){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n\n //get the fields of the specific module\n service.getModuleByName(moduleName).then(function(aModule){\n //initialize array & object for querying\n var uniqueValues = [];\n var tempObj;\n\n //push the value of the document when a field is unique\n aModule.fields.forEach(function(field){\n if(field.unique){\n tempObj = {};\n tempObj[field.name] = moduleDoc[field.name];\n uniqueValues.push(tempObj);\n }\n });\n\n if(uniqueValues.length == 0){\n deferred.resolve();\n }\n else{\n db.bind(moduleName);\n\n //use $or for checking each field for uniqueness, not their combination\n db[moduleName].findOne({$or: uniqueValues}, function(err, duplicateDoc){\n if(err){\n deferred.reject(err);\n }\n //a duplicate exists, but needs further checking\n else if(duplicateDoc){\n //updating a module document\n if(moduleDoc._id){\n //different module documents with similar unique values\n if(moduleDoc._id != duplicateDoc._id){\n deferred.reject(exists);\n }\n //since it is the same document, it is not duplicate\n else{\n deferred.resolve();\n }\n }\n //adding new module documennt\n else{\n deferred.reject(exists);\n }\n }\n //does not exist - similar to notFound. but it is not rejected based on design\n else{\n deferred.resolve();\n }\n });\n }\n }).catch(function(err){\n deferred.reject(err);\n });\n\n return deferred.promise;\n}", "updateAppTempModuleInfo(jsonSaveObject) {\n this.tempModuleX = parseFloat(jsonSaveObject.x);\n this.tempModuleY = parseFloat(jsonSaveObject.y);\n this.tempModuleName = jsonSaveObject.name;\n this.tempModuleSourceCode = jsonSaveObject.code;\n this.tempPatchId = jsonSaveObject.patchId;\n this.tempParams = jsonSaveObject.params;\n }", "function updatePartnersFields() {\n data.partners.forEach(partner => {\n data.fields.forEach(field => {\n let id = GatherComponent.idByPartnerField(partner, field);\n partner.attributes[field.id] = elementById(id).value;\n });\n });\n}", "function UpdateAddableField(fieldType, fieldKey, fieldValue)\n{\n\t// fildKey is the key required to save the fieldType, ex. mobile: 01009091995, mobile is the key\n\tTi.API.info(\"UpdateAddableField: \" + fieldType + \", \" + fieldKey + \", \" + fieldValue);\n\t\n\t// TODO: Replace this with return statement\n\tif(contact == null) alert(\"Contact must be initialized ya beheema !\");\n\t\n\t// Add the new addable field to its array in contact\n\t// If contact[fieldType] is not empty, append to it, else create a new array\n\tvar fieldDictionary = contact[fieldType];\t// A workaround for iOS\n\ttry\n\t{\n\t\tfieldDictionary[fieldKey].push(fieldValue);\n\t}\n\tcatch(exp)\n\t{\n\t\tfieldDictionary[fieldKey] = [fieldValue];\n\t}\n\tcontact[fieldType] = fieldDictionary;\n\talert(contact[fieldType]);\n}", "function update() {\n var restikoId = localStorage.getItem(\"id\");\n getValueFromForm()\n base('RESTIKO').update([{\n \"id\": restikoId,\n \"fields\": {\n \"Date\": date,\n \"Ce que j'ai fait\": fait,\n \"Ce que j'ai appris\": appris,\n \"Ce que j'ai aimé\": aime,\n \"Ce que j'ai utilisé de nouveaux\": nouveau,\n \"Problématiques rencontrées\": problem,\n \"Quels sont les objectifs ?\": objectif,\n \"Qu'est-ce qui m'a manqué ?\": manque,\n \"Qu'est-ce que tu ferais à la place du formateur ?\": formateur,\n \"Personne (Initiales)\": {\n \"id\": \"usrVA8D2T1b8KxCEw\",\n \"email\": \"teaariki@gmail.com\",\n \"name\": \"FONG Tea\"\n },\n \"Objectif atteint ou pas\": succes,\n \"Field 13\": rating\n }\n }], function (err, records) {\n if (err) {\n console.error(err);\n return;\n }\n });\n setTimeout(function () {\n window.location = \"list.html\";\n }, 500);\n }", "async update({ params, request, response }) {}", "static updateArticle(idToUpdatePassedIn, articleDataToUpdatePassedIn) {\n\n /* NEW 20180623-1031\n In Edit/Update, ADD NEW PHOTO(s)...\n */\n\n\n console.log('SUPER-DUPER-OOFFAA ******** articleDataToUpdatePassedIn ', articleDataToUpdatePassedIn)\n /* UPDATE: I see Title and URL ... Now time to add the Photos Filenames Array. :o)\n {articleTitle_name: \"Trump’s WAYZO Gots to go 3345 Twice BAZZARRO We L…CIENT Fuel Efficiency Rollbacks Will Hurt Drivers\", articleUrl_name: \"https://www.nytimes.com/2018/05/11/opinion/trump-fuel-efficiency-rollbacks.html\"}\n\n\n ?\n Why only Title field?\n articleDataToUpdatePassedIn {articleTitle_name: \"Mueller EDIT Plans to Wrap Up Obstruction Inquiry Into Trump by Sept. 1, Giuliani Says\"}\n */\n\n\n /* Notes:\n 1. I tried this two ways:\n - UPDATE()\n - FINDBYIDANDUPDATE() << Preferred, for this use case\n\n Mongoose Model.update - this did work\n But, this is for having NO Document Returned.\n http://mongoosejs.com/docs/documents.html\n \"If we don't need the document returned in our application and merely want to update a property in the database directly, Model#update is right for us...\"\n\n So, I need another choice:\n http://mongoosejs.com/docs/api.html#findbyidandupdate_findByIdAndUpdate\n */\n // NEW. Let's (what the hell) update the URL, too. hey.\n /*\n Huh. Did na work.\n boo-hoo.\n What (the h.) is URL here, anyhoo?\n */\n console.log('******** articleDataToUpdatePassedIn.articleUrl_name ', articleDataToUpdatePassedIn.articleUrl_name)\n console.log('******** articleDataToUpdatePassedIn.articleTitle_name ', articleDataToUpdatePassedIn.articleTitle_name)\n\n console.log('******** articleDataToUpdatePassedIn.articlePhotos_name ', articleDataToUpdatePassedIn.articlePhotos_name)\n\n /* 20180628-0740\n Boys and girls, we are going to try to NIP this bad boy,\n right here in the B-U-D. Whoa.\n\n O.M.G. It Worked.\n Goodness Griefiness.\n wswhooohhhhwwhh (sound, breath, exhalation, all that)\n\nIN SUM - YAH, WE DID NEED TO DO ANOTHER JSON.stringify()\nOF THAT CRAZY SIMPLE ARRAY OF STRINGS\nBEFORE SENDING IT TO MONGOOSE / MONGO\nFOR WHATEVER THE HELL IT IS THEy DO\nIN TERMS OF STORING THIS AWAY.\nYEESH.\nAnd as a further comment: when you JSON.stringify()\nthis sort of thing, and then you debug either using\nconsole.log(), OR using debugging in Chrome DevTools,\nyou do ***NOT*** get to \"see\" what it looks like.\nYou always see:\n[ \"asdf\", \"qwer\" ]\nYou do NOT get to see (what actually lands in the database):\n[ '[\"asdf\", \"qwer\"] ' ]\nNOR (same thing):\n[ \"[\\\"asdf\\\", \\\"qwer\\\"]\" ]\n\nJESUS H. CHRIST.\n\n Relevant console explorations:\n In sum: yeah, parsing then stringifying then parsing again ...\n ... it WORKS. Lessee if it'll do that Magic for ME\n ============\n var p5 = \" [ \\\"asdf\\\", \\\"qwer\\\" ] \"\n undefined\n var p6 = JSON.parse(p5)\n undefined\n p6\n Array [ \"asdf\", \"qwer\" ]\n ...\n p6\n Array [ \"asdf\", \"qwer\" ]\n p13 = JSON.parse(p6)\n SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data[Learn More] debugger eval code:1:7\n p14 = JSON.stringify(p6) <<<<< THE MAGIC PART\n \"[\\\"asdf\\\",\\\"qwer\\\"]\"\n p14\n \"[\\\"asdf\\\",\\\"qwer\\\"]\"\n var p15 = JSON.parse(p14)\n undefined\n p15\n Array [ \"asdf\", \"qwer\" ]\n ============\n */\n\n var theLateGreatWhatTheHell = JSON.stringify(articleDataToUpdatePassedIn.articlePhotos_name); // << YES !!!\n console.log('******** theLateGreatWhatTheHell (JSON.stringify(articleDataToUpdatePassedIn.articlePhotos_name) ', theLateGreatWhatTheHell);\n/*\nNote that the \"console.log()\" nonsense does ***NOT*** show us what this thing\n***TRULY*** is. :o(\n* ******** theLateGreatWhatTheHell (JSON.stringify(articleDataToUpdatePassedIn.articlePhotos_name) [\"sometimes__1530187445867_27vid-trump-kennedy-1-thumbLarge.jpg\",\"sometimes__1530187445870_28midterm_xp-superJumbo.jpg\",\"sometimes__1530188021581_00republicans1-jumbo-v3.jpg\"]\n*\n*\n* WHAT IS IN THE (G.D.) DATABASE (which is correct and right and good):\n* \"articlePhotos\" : [ \"[\\\"sometimes__1530187445867_27vid-trump-kennedy-1-thumbLarge.jpg\\\",\\\"sometimes__1530187445870_28midterm_xp-superJumbo.jpg\\\",\\\"sometimes__1530188021581_00republicans1-jumbo-v3.jpg\\\"]\" ],\n */\n\n\n return articleModelHereInService.findByIdAndUpdate(\n {_id: idToUpdatePassedIn},\n { $set:\n {\n articleTitle: articleDataToUpdatePassedIn.articleTitle_name,\n articleUrl: articleDataToUpdatePassedIn.articleUrl_name,\n // articlePhotos: articleDataToUpdatePassedIn.articlePhotos_name, // << NO !!\n articlePhotos: theLateGreatWhatTheHell, // << YES!!!\n }\n },\n { new: true } // Gets you the NEW, just-edited doc (not the orig one)\n )\n .then(\n (whatIGot) => {\n console.log('articleService. Update. then() whatIGot: ', whatIGot)\n /* .update()\n Not the document. Returns a Mongo transaction report.\n {n: 1, nModified: 1, opTime: {…}, electionId: ObjectID, ok: 1}\n */\n\n /* .findByIdAndUpdate()\n model {$__: InternalCache, isNew: false, errors: undefined, _doc: {…}, $init: true}\n */\n\n /* Note / Question\n Here on the returned Model, I find a property '._doc' which does contain my document. Returning this does work.\n But:\n 1)What does that underscore naming convention mean?\n 2) Am I doing this the correct way, to get the data I need?\n 3) Does the returned Model expose some other way to get the document it is holding, than grabbing it off this '._doc' property?\n Feel like I'm missing something.\n But, this is working.\n */\n /* 2018-05-02 Web \"Office Hours\" with Mike Hilborn\n Looks like all is O.K. re: the above questioning, wondering:\n\n \"@William: Underscore notation signifies an internal property of Mongoose model, similar to \"_id\".\"\n \"@William: The \"_doc\" is a pointer to the document object and its properties, so, yeah, feel free to use it to access properties.\"\n\n */\n console.log('articleService. Update. then() whatIGot._doc: ', whatIGot._doc)\n return whatIGot._doc\n }\n )\n .catch((err) => console.log('Service. Update. Catch. err: ', err))\n }", "function determineAndApplyUpdate(fieldType, stringObjects, addOrDelete, userFriendAppId, bofffsSpecificData, bofffsData)\n{\n\tTi.API.info(\"determineUpdateType\");\n\t\n\t// TODO: Replace this with return statement\n\tif(contact == null) alert(\"Contact must be initialized ya beheema !\");\n\t\n\t// TODO: Handle if addOrDelete\n\tswitch(fieldType) {\n\t\t\n\t\tcase \"phone_number\":\n\t\tcase \"mails\":\n\t\tcase \"social_links\":\n\t\t{\n\t\t\t// Create the type and key strings\n\t\t\t// TODO: Should be replaced on the server with the approperiate key\n\t\t\tvar type, key;\n\t\t\tif(fieldType == \"phone_number\") {\n\t\t\t\ttype = \"phone\";\n\t\t\t\tkey = \"mobile\";\n\t\t\t}\n\t\t\telse if(fieldType == \"mails\") {\n\t\t\t\ttype = \"email\";\n\t\t\t\tkey = \"work\";\n\t\t\t}\n\t\t\telse {\n\t\t\t\ttype = \"url\";\n\t\t\t\tkey = \"home\";\n\t\t\t}\n\t\t\t\n\t\t\tif(addOrDelete == 'add') UpdateAddableField(type, key, stringObjects[fieldType]);\n\t\t\telse DeleteAddableField(type, stringObjects[fieldType]);\n\t\t\t\n\t\t\tbreak;\n\t\t}\n\t\t\n\t\tcase \"job_title\":\n\t\tcase \"birthday_date\":\n\t\tcase \"company\":\n\t\t// TODO: Adding nickname if needed\n\t\t// TODO: Note if needed\n\t\t{\n\t\t\tvar type;\n\t\t\tif(fieldType == \"job_title\") type = \"jobTitle\";\n\t\t\telse if(fieldType == \"birthday_date\") type = \"birthday\";\n\t\t\telse type = \"company\";\n\t\t\t\n\t\t\tUpdateNonAddableField(type, stringObjects[fieldType]);\n\t\t\t\n\t\t\tbreak;\n\t\t}\n\t\t\n\t\tcase \"residence\":\n\t\t\t// TODO: Unimplemented\n\t\t\tbreak;\n\t\t\n\t\tdefault:\n\t\t{\n\t\t\talert(\"ERROR: Field type is not recongnizable.\");\n\t\t\tbreak;\n\t\t}\n\t\t\n\t\t\n\t\t/* TODO: It could be done like the first code to remove these if and else statements\n\t\t * but it's better that these names are used to put the updates on the server and when that happens,\n\t\t * there will be no need for these if and else statements\n\t\t */\n\t}\n}", "async function updateProperty(e) {\n e.preventDefault()\n const inputEle = e.target.closest('div').querySelector('input')\n const inputType = inputEle.type\n const docId = e.target.closest('form').id\n if (inputType === 'text' || inputType === 'number') {\n const propertyName = inputEle.name\n const propertyValue = inputEle.value\n const bodyObj = {\n _id: docId,\n updateKey: propertyName,\n updateValue: propertyValue,\n position: inputEle.id\n }\n\n const fetchInit = {\n method: 'PUT',\n headers: {\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify(bodyObj)\n }\n try {\n const response = await fetch('http://localhost:5000/api/update/product_text', fetchInit)\n const resJSON = await response.json()\n console.log(resJSON)\n } catch(err) {\n console.log(`Text update Error! ${err}`)\n }\n\n } else if (inputType === 'file') {\n const formData = new FormData()\n\n formData.append('_id', docId)\n formData.append('image', inputEle.files[0])\n formData.append('position', inputEle.id)\n formData.append('name', inputEle.name)\n const fetchInit = {\n method: 'PUT',\n body: formData\n }\n\n const response = await fetch('http://localhost:5000/api/update/image', fetchInit)\n const resJSON = await response.json()\n console.log(resJSON)\n }\n }", "function updateData(info) {\r\n try {\r\n nlapiSubmitField('workorder', info.id, info.field, info.value);\r\n } catch (e) {\r\n nlapiLogExecution('ERROR', 'Error during main updateDate', e.toString());\r\n }\r\n}", "function update_field_to_server(controller, record_id, qualified_field, value) {\n // format the data to put\n field_data = qualified_field + \"=\" + value;\n \n $.ajax({\n type: \"PUT\",\n url: \"/\" + controller + \"/\" + record_id,\n data: field_data,\n dataType: \"script\"\n //success: alert(msg),\n //failure: alert(msg)\n });\n}", "function editLU(params, cb){\n //[{asdas: asdasd, asd:{asdas:asdasd},asda:[{asd:asd}]}]\n //verify that both framename and luname are supplied\n if (!params.frame.framename || !params.lu.luname) return cb(new Error('framename and luname must be supplied'));\n var lu =params.lu;\n\n //create semType list of objects of type semType (without ID)\n lu.semType = _.map(lu.semType, function(obj){ return {'@name': obj.trim()}});\n console.log(lu);\n var query = { //specify the lu to edit by fName and luName\n '@name': params.frame.framename,\n 'lexUnit.@name': lu.luname};\n var fields = {\n 'lexUnit.$.definition': lu.definition || '',\n 'lexUnit.$.status': lu.status || 'Initial',\n 'lexUnit.$.lexeme': lu.lexeme || '',\n 'lexUnit.$.semType': lu.semType || [],\n 'lexUnit.$.@lemma': lu.lemma || '',\n 'lexUnit.$.@incorporatedFE' : lu.incoFe || '', //default empty string\n 'lexUnit.$.@eDate' : new Date(),\n 'lexUnit.$.@eBy': params.other.username || 'unknown',\n 'lexUnit.$.translatedFrom' : lu.trans\n };\n\n if (lu.lunameNew){\n\tfields['lexUnit.$.@name'] = lu.lunameNew;\n\tfields['lexUnit.$.@POS'] = lu.lupos;\n }\n \n console.log(\"DEBUG: lu.trans in edit lu\", lu.trans);\n var update = {'$set': (fields)};\n var updateOptions={}; //set options if needed, see mongoose docs\n console.log(query);\n console.log(update);\n //console.log(\"EDITLU:\", JSON.stringify(query), JSON.stringify(update));\n Models.hebFrameModel.update(query, update, updateOptions, function(err, res){console.log(err);cb(err, res)});\n}//editLU", "function updatePlayerField(player, field, newValue) {\n\n\tconsole.log(player.id, field, newValue);\n\n\tio.sockets.emit('updatePlayerField', { player: player.id, field: field, newValue: newValue });\n}", "updateSpecialFieldsInStorage(specialFieldsObj, options = { fieldsWasSettedByUser: false }) {\n const syncDate = new Date().toISOString();\n const { host } = window.location;\n\n return this.extensionService.updateStorageValue(\n `${host}${this.EPIC_KEY_STORAGE_POSTFIX}`,\n JSON.stringify({\n specialFields: specialFieldsObj,\n syncDate,\n fieldsWasSettedByUser: options.fieldsWasSettedByUser,\n })\n );\n }", "function updateUserInJive(res, contactData, contactValues, person, callback) {\n\n var updatedOptions = {\n url: jiveLoginUrl + '/api/core/v3/people/' + person.id + '',\n method: 'PUT',\n headers: headers,\n body: {\n \"emails\": [{\n \"jive_label\" : \"Email\",\n \"value\":contactValues.Email\n }],\n \"jive\": {\n \"password\": \"carbonblack@123\",\n \"username\": contactValues.Email,\n \"profile\":[]\n },\n \"name\": {\n \"givenName\": contactValues.FirstName,\n \"familyName\": contactValues.LastName\n },\n \"addresses\":[],\n \"phoneNumbers\":[]\n }\n };\n\n console.log(contactValues);\n\n if(person.jive.profile !=undefined){\n updatedOptions.body.jive.profile = person.jive.profile;\n }\n if(person.addresses !=undefined){\n updatedOptions.body.addresses = person.addresses;\n }\n if(person.phoneNumbers !=undefined){\n updatedOptions.body.phoneNumbers = person.phoneNumbers;\n }\n\n contactData.mapping.forEach(function (result) {\n\n\n if (parseInt(result.mappingType) != 1) {\n\n\n if (result.jiveField == \"Title\") {\n\n if (person.jive.profile == \"undefined\") {\n updatedOptions.body.jive.profile = [];\n\n var title = {\n \"jive_label\": \"Title\",\n \"value\": contactValues[result.salesforceField],\n };\n updatedOptions.body.jive.profile.push(title);\n\n }\n\n else {\n\n var titleIndex = lodash.findIndex(updatedOptions.body.jive.profile, {'jive_label': 'Title'});\n if (titleIndex != -1) {\n updatedOptions.body.jive.profile[titleIndex].value = contactValues[result.salesforceField];\n }\n else {\n var title = {\n \"jive_label\": \"Title\",\n \"value\": contactValues[result.salesforceField]\n };\n updatedOptions.body.jive.profile.push(title);\n }\n\n }\n\n }\n\n\n if (result.jiveField == \"Department\") {\n\n if (person.jive.profile == \"undefined\") {\n updatedOptions.body.jive.profile = [];\n\n var title = {\n \"jive_label\": \"Department\",\n \"value\": contactValues[result.salesforceField],\n };\n updatedOptions.body.jive.profile.push(title);\n\n }\n\n else {\n\n var titleIndex = lodash.findIndex(updatedOptions.body.jive.profile, {'jive_label': 'Department'});\n if (titleIndex != -1) {\n updatedOptions.body.jive.profile[titleIndex].value = contactValues[result.salesforceField];\n }\n else {\n var title = {\n \"jive_label\": \"Department\",\n \"value\": contactValues[result.salesforceField]\n };\n updatedOptions.body.jive.profile.push(title);\n }\n\n }\n }\n\n if (result.jiveField == \"Availability\") {\n\n if (person.jive.profile == \"undefined\") {\n updatedOptions.body.jive.profile = [];\n\n var title = {\n \"jive_label\": \"Availability\",\n \"value\": contactValues[result.salesforceField],\n };\n updatedOptions.body.jive.profile.push(title);\n\n }\n\n else {\n\n var titleIndex = lodash.findIndex(updatedOptions.body.jive.profile, {'jive_label': 'Availability'});\n if (titleIndex != -1) {\n updatedOptions.body.jive.profile[titleIndex].value = contactValues[result.salesforceField];\n }\n else {\n var title = {\n \"jive_label\": \"Availability\",\n \"value\": contactValues[result.salesforceField]\n };\n updatedOptions.body.jive.profile.push(title);\n }\n\n }\n }\n\n if (result.jiveField == \"Hire Date\") {\n\n if (person.jive.profile == \"undefined\") {\n updatedOptions.body.jive.profile = [];\n\n var title = {\n \"jive_label\": \"Hire Date\",\n \"value\": contactValues[result.salesforceField],\n };\n updatedOptions.body.jive.profile.push(title);\n\n }\n\n else {\n\n var titleIndex = lodash.findIndex(updatedOptions.body.jive.profile, {'jive_label': 'Hire Date'});\n if (titleIndex != -1) {\n updatedOptions.body.jive.profile[titleIndex].value = contactValues[result.salesforceField];\n }\n else {\n var title = {\n \"jive_label\": \"Hire Date\",\n \"value\": contactValues[result.salesforceField]\n };\n updatedOptions.body.jive.profile.push(title);\n }\n\n }\n }\n\n if (result.jiveField == \"Biography\") {\n\n if (person.jive.profile == \"undefined\") {\n updatedOptions.body.jive.profile = [];\n\n var title = {\n \"jive_label\": \"Biography\",\n \"value\": contactValues[result.salesforceField],\n };\n updatedOptions.body.jive.profile.push(title);\n\n }\n\n else {\n\n var titleIndex = lodash.findIndex(updatedOptions.body.jive.profile, {'jive_label': 'Biography'});\n if (titleIndex != -1) {\n updatedOptions.body.jive.profile[titleIndex].value = contactValues[result.salesforceField];\n }\n else {\n var title = {\n \"jive_label\": \"Biography\",\n \"value\": contactValues[result.salesforceField]\n };\n updatedOptions.body.jive.profile.push(title);\n }\n\n }\n }\n\n if (result.jiveField == \"Company\") {\n\n if (person.jive.profile == \"undefined\") {\n updatedOptions.body.jive.profile = [];\n\n var title = {\n \"jive_label\": \"Company\",\n \"value\": contactValues[result.salesforceField],\n };\n updatedOptions.body.jive.profile.push(title);\n\n }\n\n else {\n\n var titleIndex = lodash.findIndex(updatedOptions.body.jive.profile, {'jive_label': 'Company'});\n if (titleIndex != -1) {\n updatedOptions.body.jive.profile[titleIndex].value = contactValues[result.salesforceField];\n }\n else {\n var title = {\n \"jive_label\": \"Company\",\n \"value\": contactValues[result.salesforceField]\n };\n updatedOptions.body.jive.profile.push(title);\n }\n\n }\n }\n\n if (result.jiveField == \"Twitter\") {\n\n if (person.jive.profile == \"undefined\") {\n updatedOptions.body.jive.profile = [];\n\n var title = {\n \"jive_label\": \"Twitter\",\n \"value\": contactValues[result.salesforceField],\n };\n updatedOptions.body.jive.profile.push(title);\n\n }\n\n else {\n\n var titleIndex = lodash.findIndex(updatedOptions.body.jive.profile, {'jive_label': 'Twitter'});\n if (titleIndex != -1) {\n updatedOptions.body.jive.profile[titleIndex].value = contactValues[result.salesforceField];\n }\n else {\n var title = {\n \"jive_label\": \"Twitter\",\n \"value\": contactValues[result.salesforceField]\n };\n updatedOptions.body.jive.profile.push(title);\n }\n\n }\n }\n\n if (result.jiveField == \"LinkedIn\") {\n\n if (person.jive.profile == \"undefined\") {\n updatedOptions.body.jive.profile = [];\n\n var title = {\n \"jive_label\": \"LinkedIn\",\n \"value\": contactValues[result.salesforceField],\n };\n updatedOptions.body.jive.profile.push(title);\n\n }\n\n else {\n\n var titleIndex = lodash.findIndex(updatedOptions.body.jive.profile, {'jive_label': 'LinkedIn'});\n if (titleIndex != -1) {\n updatedOptions.body.jive.profile[titleIndex].value = contactValues[result.salesforceField];\n }\n else {\n var title = {\n \"jive_label\": \"LinkedIn\",\n \"value\": contactValues[result.salesforceField]\n };\n updatedOptions.body.jive.profile.push(title);\n }\n\n }\n }\n\n if (result.jiveField == \"Facebook\") {\n\n if (person.jive.profile == \"undefined\") {\n updatedOptions.body.jive.profile = [];\n\n var title = {\n \"jive_label\": \"Facebook\",\n \"value\": contactValues[result.salesforceField],\n };\n updatedOptions.body.jive.profile.push(title);\n\n }\n\n else {\n\n var titleIndex = lodash.findIndex(updatedOptions.body.jive.profile, {'jive_label': 'Facebook'});\n if (titleIndex != -1) {\n updatedOptions.body.jive.profile[titleIndex].value = contactValues[result.salesforceField];\n }\n else {\n var title = {\n \"jive_label\": \"Facebook\",\n \"value\": contactValues[result.salesforceField]\n };\n updatedOptions.body.jive.profile.push(title);\n }\n\n }\n }\n\n if (result.jiveField == \"food\") {\n\n if (person.jive.profile == \"undefined\") {\n updatedOptions.body.jive.profile = [];\n\n var title = {\n \"jive_label\": \"food\",\n \"value\": contactValues[result.salesforceField],\n };\n updatedOptions.body.jive.profile.push(title);\n\n }\n\n else {\n\n var titleIndex = lodash.findIndex(updatedOptions.body.jive.profile, {'jive_label': 'food'});\n if (titleIndex != -1) {\n updatedOptions.body.jive.profile[titleIndex].value = contactValues[result.salesforceField];\n }\n else {\n var title = {\n \"jive_label\": \"food\",\n \"value\": contactValues[result.salesforceField]\n };\n updatedOptions.body.jive.profile.push(title);\n }\n\n }\n }\n\n if (result.jiveField == \"followerCount\") {\n updatedOptions.body[result.jiveField] = contactValues[result.salesforceField];\n }\n\n\n if (result.jiveField == \"followed\") {\n updatedOptions.body[result.jiveField] = contactValues[result.salesforceField];\n }\n\n\n if (result.jiveField == \"Address\") {\n\n if (contactValues[result.salesforceField] != null) {\n\n\n if (updatedOptions.body.addresses == \"undefined\") {\n\n var addresses = {\n \"jive_label\": \"Address\",\n \"type\": \"work\",\n \"value\": {\n \"country\": contactValues[result.salesforceField].country,\n \"locality\": contactValues[result.salesforceField].street,\n \"postalCode\": contactValues[result.salesforceField].postalCode,\n \"region\": contactValues[result.salesforceField].state,\n \"streetAddress\": contactValues[result.salesforceField].street,\n \"formatted\": contactValues[result.salesforceField].street\n }\n };\n updatedOptions.body.addresses.push(addresses);\n\n }\n else {\n\n var titleIndex = lodash.findIndex(updatedOptions.body.addresses, {'jive_label': 'Address'});\n if (titleIndex != -1) {\n updatedOptions.body.addresses[titleIndex].value = {\n \"country\": contactValues[result.salesforceField].country,\n \"locality\": contactValues[result.salesforceField].street,\n \"postalCode\": contactValues[result.salesforceField].postalCode,\n \"region\": contactValues[result.salesforceField].state,\n \"streetAddress\": contactValues[result.salesforceField].street,\n \"formatted\": contactValues[result.salesforceField].street\n };\n }\n else {\n var addresses = {\n \"jive_label\": \"Address\",\n \"type\": \"work\",\n \"value\": {\n \"country\": contactValues[result.salesforceField].country,\n \"locality\": contactValues[result.salesforceField].street,\n \"postalCode\": contactValues[result.salesforceField].postalCode,\n \"region\": contactValues[result.salesforceField].state,\n \"streetAddress\": contactValues[result.salesforceField].street,\n \"formatted\": contactValues[result.salesforceField].street\n }\n };\n updatedOptions.body.addresses.push(addresses);\n }\n\n }\n }\n }\n\n\n if (result.jiveField == \"Home Address\") {\n\n if (contactValues[result.salesforceField] != null) {\n\n\n if (updatedOptions.body.addresses == \"undefined\") {\n\n var addresses = {\n \"jive_label\": \"Home Address\",\n \"type\": \"home\",\n \"value\": {\n \"country\": contactValues[result.salesforceField].country,\n \"locality\": contactValues[result.salesforceField].street,\n \"postalCode\": contactValues[result.salesforceField].postalCode,\n \"region\": contactValues[result.salesforceField].state,\n \"streetAddress\": contactValues[result.salesforceField].street,\n \"formatted\": contactValues[result.salesforceField].street\n }\n };\n updatedOptions.body.addresses.push(addresses);\n\n }\n else {\n\n var titleIndex = lodash.findIndex(updatedOptions.body.addresses, {'jive_label': 'Home Address'});\n if (titleIndex != -1) {\n updatedOptions.body.addresses[titleIndex].value = {\n \"country\": contactValues[result.salesforceField].country,\n \"locality\": contactValues[result.salesforceField].street,\n \"postalCode\": contactValues[result.salesforceField].postalCode,\n \"region\": contactValues[result.salesforceField].state,\n \"streetAddress\": contactValues[result.salesforceField].street,\n \"formatted\": contactValues[result.salesforceField].street\n };\n }\n else {\n var addresses = {\n \"jive_label\": \"Home Address\",\n \"type\": \"home\",\n \"value\": {\n \"country\": contactValues[result.salesforceField].country,\n \"locality\": contactValues[result.salesforceField].street,\n \"postalCode\": contactValues[result.salesforceField].postalCode,\n \"region\": contactValues[result.salesforceField].state,\n \"streetAddress\": contactValues[result.salesforceField].street,\n \"formatted\": contactValues[result.salesforceField].street\n }\n };\n updatedOptions.body.addresses.push(addresses);\n }\n\n }\n }\n }\n\n\n if (result.jiveField == \"displayName\") {\n updatedOptions.body[result.jiveField] = contactValues[result.salesforceField];\n\n }\n\n\n if (result.jiveField == \"mentionName\") {\n updatedOptions.body[result.jiveField] = contactValues[result.salesforceField];\n }\n\n\n if (result.jiveField == \"followingCount\") {\n updatedOptions.body[result.jiveField] = contactValues[result.salesforceField];\n }\n\n\n if (result.jiveField == \"Phone Number\") {\n if (updatedOptions.body.phoneNumbers == \"undefined\") {\n var phoneNumbers = {\n \"jive_label\": \"Phone Number\",\n \"primary\": true,\n \"type\": \"work\",\n \"value\": contactValues[result.salesforceField],\n };\n\n updatedOptions.body.phoneNumbers.push(phoneNumbers);\n }\n else {\n var titleIndex = lodash.findIndex(updatedOptions.body.phoneNumbers, {'jive_label': 'Phone Number'});\n if (titleIndex != -1) {\n updatedOptions.body.phoneNumbers[titleIndex].value = contactValues[result.salesforceField];\n }\n else{\n var phoneNumbers = {\n \"jive_label\": \"Phone Number\",\n \"primary\": true,\n \"type\": \"work\",\n \"value\": contactValues[result.salesforceField]\n };\n updatedOptions.body.phoneNumbers.push(phoneNumbers);\n }\n\n }\n\n }\n\n if (result.jiveField == \"Mobile Phone Number\") {\n if (updatedOptions.body.phoneNumbers == \"undefined\") {\n var phoneNumbers = {\n \"jive_label\": \"Mobile Phone Number\",\n \"type\": \"mobile\",\n \"value\": contactValues[result.salesforceField],\n };\n\n updatedOptions.body.phoneNumbers.push(phoneNumbers);\n }\n else {\n var titleIndex = lodash.findIndex(updatedOptions.body.phoneNumbers, {'jive_label': 'Mobile Phone Number'});\n if (titleIndex != -1) {\n updatedOptions.body.phoneNumbers[titleIndex].value = contactValues[result.salesforceField];\n }\n else{\n var phoneNumbers = {\n \"jive_label\": \"Mobile Phone Number\",\n \"type\": \"mobile\",\n \"value\": contactValues[result.salesforceField]\n };\n updatedOptions.body.phoneNumbers.push(phoneNumbers);\n }\n\n }\n\n }\n\n if (result.jiveField == \"Home Phone Number\") {\n if (updatedOptions.body.phoneNumbers == \"undefined\") {\n var phoneNumbers = {\n \"jive_label\": \"Home Phone Number\",\n \"type\": \"home\",\n \"value\": contactValues[result.salesforceField],\n };\n\n updatedOptions.body.phoneNumbers.push(phoneNumbers);\n }\n else {\n var titleIndex = lodash.findIndex(updatedOptions.body.phoneNumbers, {'jive_label': 'Home Phone Number'});\n if (titleIndex != -1) {\n updatedOptions.body.phoneNumbers[titleIndex].value = contactValues[result.salesforceField];\n }\n else{\n var phoneNumbers = {\n \"jive_label\": \"Home Phone Number\",\n \"type\": \"home\",\n \"value\": contactValues[result.salesforceField]\n };\n updatedOptions.body.phoneNumbers.push(phoneNumbers);\n }\n\n }\n\n }\n\n\n if (result.jiveField == \"familyName\") {\n updatedOptions.body.name[result.jiveField] = contactValues[result.salesforceField];\n }\n\n\n if (result.jiveField == \"givenName\") {\n updatedOptions.body.name[result.jiveField] = contactValues[result.salesforceField];\n }\n\n\n if(result.jiveField == \"Email\"){\n console.log(\"dfdfsdf\");\n }\n\n\n if(result.jiveField == \"Location\"){\n updatedOptions.body[result.jiveField] = contactValues[result.salesforceField];\n }\n\n }\n });\n\n console.log(updatedOptions.body);\n updatedOptions.body = JSON.stringify(updatedOptions.body);\n request(updatedOptions, function (error, response, data) {\n if (!error && response.statusCode == 200) {\n // console.log(error);\n // console.log(data);\n data = JSON.parse(data);\n profileLogs.push({\n \"message\": \"User Updated in jive \",\n \"userId\": data.id,\n \"contactId\": contactValues.Email,\n \"status\": \"Success\",\n \"timestamp\": new Date()\n });\n callback(null);\n\n }\n else {\n data = JSON.parse(data);\n if (data.error.message) {\n profileLogs.push({\n \"message\": data.error.message,\n \"userId\": 0,\n \"contactId\": contactValues.Email,\n \"status\": \"Updation Failure\",\n \"timestamp\": new Date()\n });\n callback(null);\n }\n else {\n console.log(\"here\");\n // console.log(error);\n // console.log(response);\n data = JSON.stringify(data);\n console.log(\"data....\", data);\n profileLogs.push({\n \"message\": data,\n \"userId\": 0,\n \"contactId\": contactValues.Email,\n \"status\": \"Updation Failure\",\n \"timestamp\": new Date()\n });\n res.send(data);\n }\n }\n\n\n });\n}", "function updateItem(options) {\n\n var deferred = $q.defer();\n\n var defObject = {\n listName: false,\n data: false,\n id: false,\n fields: false\n };\n\n var settings = $.extend({}, defObject, options);\n\n if ((!settings.listName) && (!settings.data) && (!settings.id) && (!settings.fields)) {\n deferred.reject(settings);\n return deferred.promise;\n }\n\n var context = SP.ClientContext.get_current();\n\n var oList = context.get_web().get_lists().getByTitle(settings.listName);\n\n // query field by field name and value \n var oListItem = oList.getItemById(settings.id);\n\n\n settings.data = helperService.parse(settings.data, settings.fields.mappingToSP);\n delete settings.data.ID;\n\n //Bulk create list items\n $.each(settings.data, function (key, value) {\n // check if mutiple lookup\n if (Object.prototype.toString.call(value) === '[object Array]') {\n var lookups = [];\n $.each(value, function (i, lid) {\n var lookup = new SP.FieldLookupValue();\n lookup.set_lookupId(lid);\n lookups.push(lookup);\n });\n oListItem.set_item(key, lookups);\n } else {\n oListItem.set_item(key, value);\n }\n });\n\n oListItem.update();\n\n context.executeQueryAsync(success, fail);\n\n\n function success() {\n // load query details to json object\n var taskEntry = oListItem.get_fieldValues();\n deferred.resolve(helperService.parse(taskEntry, options.fields.mappingFromSP));\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 }", "renameFields() {\n for (var i = this.fields.length - 1; i >= 0; i--) {\n this.fields[i].attribute = this.key + '__' + this.fields[i].attribute;\n this.fields[i].validationKey = this.fields[i].attribute;\n\n if (this.fields[i].dependsOn) {\n Object.keys(this.fields[i].dependsOn).forEach(key => {\n this.fields[i].dependsOn[`${this.key}__${key}`] = this.fields[i].dependsOn[key];\n delete this.fields[i].dependsOn[key];\n });\n }\n }\n }", "editUser(UserDetails) { \n var headers = UserDetails; \n return new Promise((resolve, reject) => {\n User.update({'id': headers.id}, \n {$set:{\"name\": headers.name,\n \"password\" : headers.password,\n \"role\": headers.role,\n \"corpId\":headers.corpId,\n \"phone\": headers.phone }}, (err) => {\n if (err) reject (err);\n else resolve(`${headers.id}`);\n });\n })\n }", "fieldsInfo () {\n return [\n {\n text: this.$t('fields.id'),\n name: 'id',\n details: false,\n table: false,\n },\n\n {\n type: 'input',\n column: 'order_nr',\n text: 'order No.',\n name: 'order_nr',\n multiedit: false,\n required: true,\n disabled: true,\n create: false,\n },\n {\n type: 'input',\n column: 'name',\n text: 'person name',\n name: 'name',\n multiedit: false,\n required: false,\n edit: false,\n create: false,\n },\n\n {\n type: 'input',\n column: 'email',\n text: 'email',\n name: 'email',\n multiedit: false,\n required: false,\n edit: false,\n create: false,\n },\n\n {\n type: 'select',\n url: 'crm/people',\n list: {\n value: 'id',\n text: 'fullname',\n data: [],\n },\n column: 'user_id',\n text: this.$t('fields.person'),\n name: 'person',\n apiObject: {\n name: 'person.name',\n },\n table: false,\n },\n {\n type: 'input',\n column: 'package_points',\n text: 'package points',\n name: 'package_points',\n required: false,\n edit: false,\n create: false,\n },\n\n // package_points\n {\n type: 'select',\n url: 'crm/package',\n list: {\n value: 'id',\n text: 'full_name',\n data: [],\n },\n column: 'package_id',\n text: 'package name',\n name: 'package',\n apiObject: {\n name: 'package.package_name',\n },\n table: false,\n },\n {\n type: 'input',\n column: 'package_name',\n text: 'package name',\n name: 'package_name',\n multiedit: false,\n required: false,\n edit: false,\n create: false,\n },\n\n {\n type: 'input',\n column: 'package_price',\n text: 'package price',\n name: 'package_price',\n multiedit: false,\n required: false,\n edit: false,\n create: false,\n },\n\n {\n type: 'input',\n column: 'pur_date',\n text: 'purche date',\n name: 'pur_date',\n multiedit: false,\n required: false,\n edit: false,\n create: false,\n },\n ]\n }", "async update({ params, request, response }) {\n }", "static async updateDashboard(email, dashboardID, fields, data) {\n\t\tdata = data.map((item, i) => (i < fields.length && fields[i] === 'metadata' ? JSON.stringify(item) : item));\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tDatabase.sendQuery(`UPDATE Dashboard SET ${fieldUpdates(fields, data, 2)} WHERE ( email = $1 ) AND ( ID = $2) RETURNING *;`, [email, dashboardID, ...data])\n\t\t\t\t.then((result) => {\n\t\t\t\t\t// console.log(result);\n\t\t\t\t\tif (result.rows.length > 0) resolve(result.rows[0]);\n\t\t\t\t\telse reject(result);\n\t\t\t\t})\n\t\t\t\t.catch((result) => reject(result));\n\t\t});\n\t}", "static partIssueCreateUpdateFieldValues(pageClientAPI) {\n\n let dict = {};\n dict = libCom.getControlDictionaryFromPage(pageClientAPI);\n let binding = pageClientAPI.binding;\n\n let textCategory = libCom.getAppParam(pageClientAPI, 'PART', 'TextItemCategory');\n let textDescription = pageClientAPI.localizeText('text_item');\n\n dict.MaterialSim.setValue(libThis.getPartPlusDescription(pageClientAPI, binding.ItemCategory, textCategory, binding.TextTypeDesc, textDescription, binding.ComponentDesc, binding.MaterialNum));\n return libThis.getPlantPlusDescription(pageClientAPI, binding.Plant).then(result => {\n dict.PlantSim.setValue(result);\n }).catch(err => {\n /**Implementing our Logger class*/\n Logger.error(pageClientAPI.getGlobalDefinition('/SAPAssetManager/Globals/Logs/CategoryParts.global').getValue(), err);\n dict.PlantSim.setValue('');\n });\n }", "function fieldUpdates(fields, data, offset) {\n\toffset = offset || 0;\n\tlet index = -1;\n\tfields = fields.filter((field, i) => {\n\t\tif (field === 'email') {\n\t\t\tindex = i;\n\t\t\treturn false;\n\t\t} else return true;\n\t});\n\tif (index >= 0) data.splice(index, 1);\n\n\tlet output = '';\n\tfor (let i = 0; i < fields.length && i < data.length; i++) {\n\t\tconst d = i + offset + 1;\n\t\toutput = output + ' ' + fields[i] + ' = $' + d + (i < fields.length - 1 && i < data.length - 1 ? ', ' : '');\n\t}\n\treturn output;\n}", "async update ({ params, request, response }) {\n let { id } = params\n let material = await RawMaterial.find(id)\n //console.log(request.all())\n //request.only(['code', 'name', 'lot', 'quantity', 'unit', 'description', 'supplier', 'vat', 'purchaseOrderNo', 'unitCost', 'totalAmount', 'SKU', 'purchaseDate'])\n await material.merge(request.only(['code', 'name', 'lot', 'quantity', 'unit', 'description', 'supplier', 'vat', 'purchaseOrderNo', 'unitCost', 'totalAmount', 'SKU', 'purchaseDate']))\n return await material.save()\n \n }", "function pickReplace(module, fieldname, newVal, oldVal) {\n\tdocument.getElementById('status').style.display='inline';\n\tvar data = {\n\t\t'newValues' : encodeURIComponent(newVal),\n\t\t'oldValues' : encodeURIComponent(oldVal)\n\t};\n\tjQuery.ajax({\n\t\tmethod: 'POST',\n\t\turl: 'index.php?action=PickListAjax&module=PickList&mode=edit&file=PickListAction&fld_module='+encodeURIComponent(module)+'&fieldname='+encodeURIComponent(fieldname),\n\t\tdata: data\n\t}).done(function (response) {\n\t\tif (response == 'SUCCESS') {\n\t\t\tchangeModule();\n\t\t\tfnhide('actiondiv');\n\t\t} else {\n\t\t\talert(response);\n\t\t}\n\t\tdocument.getElementById('status').style.display='none';\n\t});\n}", "function setNextField()\n{\n if (authReq && authReq.type == 'update')\n {\n if (authReq.keys.length > 0)\n {\n var key = authReq.keys.pop();\n authReq.pending = key;\n\n if (key in setFieldMap)\n {\n sendString(setFieldMap[key], authReq.inputs[key].value);\n }\n else\n {\n console.log('setNextField: type \"'+authReq.key+'\" not supported');\n authReq.pending = null;\n setNextField(); // try the next field\n }\n } else {\n // no more input fields to set on mooltipass\n chrome.runtime.sendMessage(authReq.senderId, {type: 'updateComplete'});\n log('#messageLog', 'update finished \\n');\n endAuthRequest();\n }\n }\n else\n {\n log('#messageLog', 'setNextField: no authReq\\n');\n }\n}", "function findAndCreate(fieldProperty) {\n //if 'fieldProperty' is fieldCode then convert into object.\n if(typeof fieldProperty == 'string') {\n fieldProperty = {fieldCode:fieldProperty};\n };\n\n var field = fields[ fieldProperty.fieldCode ];\n if(field) {\n field.updateProperty(fieldProperty);\n } else {\n field = fields[ fieldProperty.fieldCode ] = new Field( fieldProperty );\n }\n\n if(field.triggerUpdate) {\n // console.log('TRIGGER UPATE..', field.fieldCode)\n field.update = validate;\n }\n\n return field;\n }", "function updateUserData(updateUserObject, next) {\r\n let firstName = (updateUserObject.ldapFirstName !== null && updateUserObject.ldapFirstName !== undefined) ? updateUserObject.ldapFirstName : '';\r\n let lastName = (updateUserObject.ldapLastName !== null && updateUserObject.ldapLastName !== undefined) ? updateUserObject.ldapLastName : '';\r\n let ldapEmail = (updateUserObject.ldapEmail !== null && updateUserObject.ldapEmail !== undefined) ? updateUserObject.ldapEmail : '';\r\n let externalId = (updateUserObject.externalId !== null && updateUserObject.externalId !== undefined) ? updateUserObject.externalId : '';\r\n sqlQuery = \"update users set first_name =$1, last_name=$2,email=$3, updated_dt = now() where external_id = $4\";\r\n return db.gammaDbPool.query(sqlQuery, [firstName, lastName, ldapEmail, externalId], next);\r\n }", "function update(module, endpoint, auth, data) {\n let req = makeRequest('PUT', module, endpoint, auth);\n req.data = data;\n return $.ajax(req);\n }", "function updateFieldName(field) {\n if (field == \"O3\") {\n fieldName = \"e2vo3_sens\"\n } else if (field == \"Light VOCs\") {\n fieldName = \"fig210_sens\"\n } else if (field == \"Heavy VOCs\") {\n fieldName = \"fig280_sens\"\n } else if (field == \"CO2 (PPM)\") {\n fieldName = \"CO2\"\n } else if (field == \"CO (PPM)\") {\n fieldName = \"CO\"\n } else if (field == \"O3 (PPB)\") {\n fieldName = \"e2vo3_sens\"\n } else if (field == \"Light VOCs (PPM)\") {\n fieldName = \"voc1_ppm\"\n } else if (field == \"Heavy VOCs (PPM)\") {\n fieldName = \"voc2_ppm\"\n } // Dhruv @07/19/21 - Updating field names so that getTimeSeriesGraph can find the PM ppm data\n\t else if (field == \"PM1.0 (PPM) \") {\n fieldName = \"PM1.0_ppm\"\n } else if (field == \"PM2.5 (PPM)\") {\n fieldName = \"PM2.5_ppm\"\n } else if (field == \"PM10 (PPM)\") {\n fieldName = \"PM10_ppm\"\n }\n\n else {\n fieldName = field.trim();\n }\n\n if (field == \"O3\") {\n axisfieldName = \"O3 Electronic Signal (Voltage Equivalent)\"\n } else if (field == \"Light VOCs\") {\n axisfieldName = \"Light VOCs Electronic Signal (Voltage Equivalent)\"\n } else if (field == \"Heavy VOCs\") {\n axisfieldName = \"Heavy VOCs Electronic Signal (Voltage Equivalent)\"\n } else if (field == \"Temperature\") {\n axisfieldName = \"Temperature (deg Celsius)\"\n } else if (field == \"Humidity\") {\n axisfieldName = \"Relative Humidity (%)\"\n } else if (field == \"CO2\") {\n axisfieldName = \"CO2 Electronic Signal (Voltage Equivalent)\"\n } else if (field == \"CO2 (PPM)\") {\n axisfieldName = \"CO2 (PPM)\"\n } else if (field == \"CO\") {\n axisfieldName = \"CO Electronic Signal (Voltage Equivalent)\"\n } else if (field == \"CO (PPM)\") {\n axisfieldName = \"CO (PPM)\"\n } else if (field == \"O3 (PPB)\") {\n axisfieldName = \"O3 (PPB)\"\n } else if (field == \"Light VOCs (PPM)\") {\n axisfieldName = \"Light VOCs (PPM)\"\n } else if (field == \"Heavy VOCs (PPM)\") {\n axisfieldName = \"Heavy VOCs (PPM)\"\n } // Dhruv @07/19/21 - Updating axis names so that units are visible for PPM\n else if (field == \"PM1.0 (PPM) \") {\n axisfieldName = \"PM1.0 (PPM ug/m^3)\"\n } else if (field == \"PM2.5 (PPM)\") {\n axisfieldName = \"PM2.5 (PPM ug/m^3)\"\n } else if (field == \"PM10 (PPM)\") {\n axisfieldName = \"PM10 (PPM ug/m^3)\"\n }\n else {\n axisfieldName = field.trim();\n }\n}" ]
[ "0.8456608", "0.81074345", "0.805101", "0.7392945", "0.7392381", "0.70211095", "0.68865806", "0.66497767", "0.66221124", "0.647745", "0.6348413", "0.6348413", "0.63277465", "0.6174028", "0.60932803", "0.60513693", "0.6039068", "0.60181665", "0.5856864", "0.57826996", "0.57653105", "0.57377654", "0.5716924", "0.5714146", "0.5623827", "0.5613265", "0.5594846", "0.5576073", "0.55671453", "0.5498458", "0.5484973", "0.53898764", "0.5374862", "0.5359376", "0.535202", "0.5350478", "0.5329829", "0.5316894", "0.5303291", "0.5301193", "0.5289825", "0.5277031", "0.5239152", "0.52279115", "0.52154297", "0.5179941", "0.51791584", "0.517655", "0.5168671", "0.5162004", "0.5159356", "0.5153453", "0.5149995", "0.5148667", "0.5146841", "0.51446193", "0.51303136", "0.5126928", "0.5106704", "0.51038694", "0.50967795", "0.50945157", "0.5092519", "0.50859064", "0.5063497", "0.50434697", "0.50401187", "0.5036264", "0.5031698", "0.5026611", "0.50247794", "0.50239027", "0.5011315", "0.5008987", "0.49973586", "0.49881193", "0.4987492", "0.4980998", "0.4965505", "0.49638772", "0.4960472", "0.49556985", "0.4953784", "0.4944842", "0.49437264", "0.49392757", "0.49389553", "0.4932044", "0.4930924", "0.49195713", "0.49168488", "0.4913847", "0.49106312", "0.49078742", "0.49017555", "0.4886853", "0.48840663", "0.48821282", "0.48790076", "0.48763737" ]
0.8240337
1
Function name: delete module field Author: Reccion, Jeremy Date Modified: 2018/04/24 Description: delete a field object from the specific module's fields array Parameter(s): moduleName: required. string type fieldID: required. string type Return: Promise
function deleteModuleField(moduleName, fieldID){ var deferred = Q.defer(); moduleName = moduleName.toLowerCase(); db.modules.update({name: moduleName}, {$pull: {fields: {id: mongo.helper.toObjectID(fieldID)}}}, function(err, writeResult){ if(err){ deferred.reject(err); } else{ if(writeResult.result.nModified == 0){ deferred.reject(notFound); } else{ deferred.resolve(); } } }); return deferred.promise; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function deleteModuleField(moduleName, fieldID){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n \n db.modules.update({name: moduleName}, {$pull: {fields: {id: mongo.helper.toObjectID(fieldID)}}}, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n deferred.resolve();\n }\n });\n\n return deferred.promise;\n}", "deleteField(field) {\n this.jsonStoreService.removeIn(this.getPathForChild(field));\n }", "function deleteModuleDoc(moduleName, id){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n\n db.bind(moduleName);\n\n db[moduleName].remove({_id: mongo.helper.toObjectID(id)}, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n deferred.resolve();\n }\n });\n\n return deferred.promise;\n}", "function deleteModule(id, moduleName){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n\n //drop the collection\n db.bind(moduleName);\n db[moduleName].drop();\n\n //remove document from 'modules' collection\n db.modules.remove({_id: mongo.helper.toObjectID(id)}, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n deferred.resolve();\n }\n });\n\n return deferred.promise;\n}", "function deleteFieldFromForm(formId, fieldId)\n\t\t{\n\t\t\tvar deferred = $q.defer();\n\t\t\t// DELETE the specified field from the specified form\n\t\t\t$http.delete(\"/api/assignment/form/\" + formId + \"/field/\" + fieldId)\n\t\t\t.success(function(response) \n\t\t\t{\n\t\t\t\tdeferred.resolve(response);\n\t\t\t});\n\n\t\t\treturn deferred.promise;\n\t\t}", "function deleteModuleDoc(moduleName, id){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n\n db.bind(moduleName);\n\n db[moduleName].remove({_id: mongo.helper.toObjectID(id)}, function(err, writeResult){\n if(err){\n deferred.reject(err);\n }\n else{\n //n is used to know if the document was removed\n if(writeResult.result.n == 0){\n deferred.reject(notFound);\n }\n else{\n deferred.resolve();\n }\n }\n });\n\n return deferred.promise;\n}", "function deleteModule(moduleName){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n\n //drop the collection\n db.bind(moduleName);\n db[moduleName].drop(function(err){\n if(err){\n if(err.codeName == 'NamespaceNotFound'){\n deferred.reject(notFound);\n }\n else{\n deferred.reject(err);\n }\n }\n else{\n //remove document from 'modules' collection\n db.modules.remove({name: moduleName}, function(err, writeResult){\n if(err){\n deferred.reject(err);\n }\n else{\n //n is used to know if the document was removed\n if(writeResult.result.n == 0){\n deferred.reject(notFound);\n }\n else{\n deferred.resolve();\n }\n }\n });\n }\n });\n\n return deferred.promise;\n}", "function updateModuleField(moduleName, fieldObject){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n\n console.log(fieldObject);\n\n service.getModuleByName(moduleName).then(function(aModule){ \n //use array.filter() to get the duplicate fields\n var duplicateFields = aModule.fields.filter(function(field){\n //lesson learned: use toString() in id\n return field.id.toString() == fieldObject.id.toString() || field.name == fieldObject.name;\n });\n \n if(duplicateFields.length == 0){\n deferred.reject(notFound);\n }\n //valid inputs\n else if(duplicateFields.length == 1){\n //this is to ensure that the field is inside the specific module (in case of improper input parameters)\n\n fieldObject.id = new ObjectID(fieldObject.id);\n\n if(duplicateFields[0].id.toString() == fieldObject.id.toString()){\n db.modules.update({name: moduleName, fields: {$elemMatch: {id: fieldObject.id}}}, {$set: {'fields.$': fieldObject}}, function(err, writeResult){\n if(err){\n deferred.reject(err);\n }\n else{\n console.log(writeResult.result);\n deferred.resolve();\n }\n });\n }\n //the only element has the same name but is different id, therefore, not inside the module document\n else{\n deferred.reject(notFound);\n }\n }\n else{\n deferred.reject(exists);\n }\n }).catch(function(err){\n deferred.reject(err);\n });\n\n return deferred.promise;\n}", "function addModuleField(moduleName, fieldObject){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n\n //create a new objectID to used as query for updates and delete\n fieldObject.id = new ObjectID();\n\n //the query searches for the module name that do not have the inputted field name\n //this is to avoid pushing same field names on the 'fields' array of the specified module\n //writeResult will determine if the update was successful or not (i.e. writeResult.result.nModified)\n db.modules.update({name: moduleName, fields: {$not: {$elemMatch: {name: fieldObject.name}}}}, {$push: {fields: fieldObject}}, function(err, writeResult){\n if(err){\n deferred.reject(err);\n }\n else{\n //console.log(writeResult.result);\n //check the status of the update, if it failed, it means that there is an existing field name\n if(writeResult.result.nModified == 0){\n deferred.reject(exists);\n }\n else{\n deferred.resolve();\n }\n }\n });\n\n return deferred.promise;\n}", "removeField(id) {\n this.fieldDescriptor.delete(id);\n this.errors.delete(id);\n }", "deleteField(object, field) {\n delete object[field];\n console.warn(`\"${field}\" is removed from input json since it's not in the schema`);\n }", "function updateModuleField(moduleName, fieldObject){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n\n fieldObject.id = new ObjectID(fieldObject.id);\n \n db.modules.update({name: moduleName, fields: {$elemMatch: {id: fieldObject.id}}}, {$set: {'fields.$': fieldObject}}, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n deferred.resolve();\n }\n });\n\n return deferred.promise;\n}", "function updateFieldArray(moduleName, fieldArray){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n\n //need to convert each 'id' property to an ObjectID\n for(var i = 0; i < fieldArray.length; i++){\n fieldArray[i].id = new ObjectID(fieldArray[i].id);\n }\n \n\n db.modules.update({name: moduleName}, {$set: {fields: fieldArray}}, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n deferred.resolve();\n }\n });\n\n return deferred.promise;\n}", "function addModuleField(moduleName, fieldObject){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n\n //create a new objectID to used as query for updates and delete\n fieldObject.id = new ObjectID();\n\n db.modules.update({name: moduleName}, {$push: {fields: fieldObject}}, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n deferred.resolve();\n }\n });\n\n return deferred.promise;\n}", "function updateFieldArray(moduleName, fieldArray){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n\n db.modules.update({name: moduleName}, {$set: {fields: fieldArray}}, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n deferred.resolve();\n }\n });\n\n return deferred.promise;\n}", "async deleteMetafield() {\n await axios({\n method: \"delete\",\n url: deleteMetafield(this.metaId),\n })\n .then((res) => console.log(res.data.metafields))\n .catch((err) => console.log(err));\n }", "function sc_deleteJsFieldBang(o, field) {\n delete o[field];\n}", "function pickDelete(module, fieldname, arr, replaceVal) {\n\tdocument.getElementById('status').style.display='inline';\n\tjQuery.ajax({\n\t\tmethod: 'POST',\n\t\turl: 'index.php?action=PickListAjax&module=PickList&mode=delete&file=PickListAction&fld_module='+encodeURIComponent(module)+'&fieldname='+encodeURIComponent(fieldname)+'&values='+JSON.stringify(arr)+'&replaceVal='+encodeURIComponent(replaceVal),\n\t}).done(function (response) {\n\t\tvar str = response;\n\t\tif (str == 'SUCCESS') {\n\t\t\tchangeModule();\n\t\t\tfnhide('actiondiv');\n\t\t} else {\n\t\t\talert(str);\n\t\t}\n\t\tdocument.getElementById('status').style.display='none';\n\t});\n}", "function deleteField(this_field,section_header) {\r\n\tif (section_header) {\r\n\t\tsimpleDialog(delSHMsg,delSHTitle,null,null,null,langCancel,\"deleteFieldDo('\"+this_field+\"',\"+section_header+\");\",langOD24);\r\n\t} else {\r\n\t\tsimpleDialog(delFieldMsg+' \"'+this_field+'\"'+langQuestionMark,delFieldTitle,null,null,null,langCancel,\"deleteFieldDo('\"+this_field+\"',\"+section_header+\");\",langOD24);\r\n\t}\r\n}", "removeModule() {\n this.props.firebase.database.ref('users')\n .child(this.props.firebase.auth.currentUser.uid)\n .child('appointments')\n .child('appointmentsArr')\n .once('value', snapshot => {\n snapshot.forEach(child => {\n console.log(child.val().title)\n if (child.val().title === this.props.module) {\n child.ref.remove();\n }\n })\n });\n this.props.firebase.database.ref('users')\n .child(this.props.firebase.auth.currentUser.uid)\n .child('appointments')\n .child('modsData')\n .child(this.props.module)\n .remove()\n }", "function deleteMod() {\n // eslint-disable-next-line no-restricted-globals\n if (\n confirm(\n 'Are you sure you want to delete this module? This cannot be undone.',\n )\n ) {\n db.collection('modules')\n .doc(module.value)\n .delete()\n .then(function () {\n history.push('/success');\n console.log('doc deleted successfully');\n return true;\n });\n } else {\n return false;\n }\n }", "deleteModule(moduleId, passphrase) {\n return this.httpService({\n method: 'DELETE',\n url: `${this.rootURL}microAnalytics?microAnalyticsId=${moduleId}`,\n headers: {Authorization: `basic ${passphrase}`}\n });\n }", "_delete (moduleName){\n delete this._dynamicParentsMap[moduleName];\n // SystemJs doesn't do this?\n delete this._system.loads[moduleName];\n // Do regular delete\n return this._systemDelete.apply(this._system, arguments);\n }", "function deleteFieldDo(this_field,section_header) {\r\n\t$.get(app_path_webroot+\"Design/delete_field.php\", { pid: pid, field_name: this_field, section_header: section_header, form_name: getParameterByName('page') },\r\n\t\tfunction(data) {\r\n\t\t\tvar chkFldInCalcBranching = true;\r\n\t\t\tif (data == \"1\") { // Successfully deleted\r\n\t\t\t\tif (section_header) {\r\n\t\t\t\t\thighlightTable('design-'+this_field+'-sh',1500);\r\n\t\t\t\t\tsetTimeout(function(){\r\n\t\t\t\t\t\t$('#'+this_field+'-sh-tr').remove();\r\n\t\t\t\t\t},1000);\r\n\t\t\t\t} else {\r\n\t\t\t\t\thighlightTable('design-'+this_field,1500);\r\n\t\t\t\t\tsetTimeout(function(){\r\n\t\t\t\t\t\t$('#'+this_field+'-tr').remove();\r\n\t\t\t\t\t},1000);\r\n\t\t\t\t}\r\n\t\t\t\tAddTableDrag();\r\n\t\t\t} else if (data == \"3\") { // Field is last on page and/or field has section header. Reload table.\r\n\t\t\t\treloadDesignTable(getParameterByName('page'));\r\n\t\t\t} else if (data == \"2\") { // All fields were deleted so redirect back to previous page\r\n\t\t\t\tsimpleDialog(langOD37,null,null,null,'window.location.href = app_path_webroot + \"Design/online_designer.php?pid=\" + pid;');\r\n\t\t\t} else if (data == \"4\") { // Table_pk was deleted, so inform user of this\r\n\t\t\t\thighlightTable('design-'+this_field,1500);\r\n\t\t\t\tsetTimeout(function(){\r\n\t\t\t\t\t$('#'+this_field+'-tr').remove();\r\n\t\t\t\t},1000);\r\n\t\t\t\tupdate_pk_msg(false,'field');\r\n\t\t\t} else if (data == \"5\") { // Field is last on page and has section header, which was then removed. Alert user of SH deletion and reload table.\r\n\t\t\t\tsimpleDialog(langOD39,null,null,null,\"reloadDesignTable(getParameterByName('page'))\");\r\n\t\t\t} else if (data == \"6\") { // Field is being used by randomization. So prevent deletion.\r\n\t\t\t\tsimpleDialog(langOD40);\r\n\t\t\t\tchkFldInCalcBranching = false;\r\n\t\t\t} else {\r\n\t\t\t\talert(woops);\r\n\t\t\t\tchkFldInCalcBranching = false;\r\n\t\t\t}\r\n\t\t\t// Send AJAX request to check if the deleted field was in any calc equations or branching logic\r\n\t\t\tif (chkFldInCalcBranching && !section_header) {\r\n\t\t\t\t$.post(app_path_webroot+\"Design/delete_field_check_calcbranch.php?pid=\"+pid, { field_name: this_field },function(data) {\r\n\t\t\t\t\tif (data != \"0\") {\r\n\t\t\t\t\t\tif (!$('#delFldChkCalcBranchPopup').length) $('body').append('<div id=\"delFldChkCalcBranchPopup\" style=\"display:none;\"></div>');\r\n\t\t\t\t\t\t$('#delFldChkCalcBranchPopup').html(data);\r\n\t\t\t\t\t\t$('#delFldChkCalcBranchPopup').dialog({ bgiframe: true, modal: true, width: 650, open: function(){fitDialog(this)}, \r\n\t\t\t\t\t\t\ttitle: langOD41,\r\n\t\t\t\t\t\t\tbuttons: {\r\n\t\t\t\t\t\t\t\tClose: function() { $(this).dialog('close'); }\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}", "function deleteFieldSpecs(entity) {\n try {\n return baseSvc.removeEntity(serviceUrl, entity);\n } catch (e) {\n throw e;\n }\n }", "function removeFields(p, ...fields) {\n if (!p.state.fields) {\n return\n } else {\n fields.forEach(f => {\n let index = p.state.fields.indexOf(f);\n if (index > -1) {\n p.state.fields.splice(index, 1);\n }\n });\n }\n}", "deleteRow(id) {\n this.fieldArray.splice(id, 1);\n }", "function removeFormField(id, fieldid) {\n var deferred = q.defer();\n\n FormModel.findById(id, function(err, form) {\n if(err) {\n deferred.reject(err);\n } else {\n // iterate over form fields\n for(var i = 0; i < form.fields.length; i ++) {\n if(form.fields[i].id == fieldid) {\n form.fields.splice(i, 1);\n form.save(function(err, form) {\n if(err) {\n deferred.reject(err);\n } else {\n deferred.resolve(form);\n }\n });\n }\n }\n }\n });\n\n return deferred.promise;\n }", "function deleteItem(options) {\n\n var deferred = $q.defer();\n\n var defObject = {\n listName: false,\n fields: false,\n id: false,\n };\n\n var settings = $.extend({}, defObject, options);\n\n if ((!settings.listName) && (!settings.id) && (!settings.fields)) {\n deferred.reject();\n return deferred.promise;\n }\n\n var context = SP.ClientContext.get_current();\n\n var oList = context.get_web().get_lists().getByTitle(settings.listName);\n\n\n // query field by field name and value \n var oListItem = oList.getItemById(settings.id);\n oListItem.deleteObject();\n\n\n\n context.executeQueryAsync(success, fail);\n\n function success() {\n // load query details to json object\n var taskEntry = oListItem.get_fieldValues();\n deferred.resolve(helperService.parse(taskEntry, options.fields.mappingFromSP));\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\n }", "function deleteSchemaField() {\n var sleep_schema_v4 = {\n className: \"Sleep\",\n fields: {\n polyphasic: {\n \"__op\" : \"Delete\"\n }\n }\n };\n XHR.PUT(SERVER_URL+'/schemas' + \"/\" + sleep_schema_v4.className, sleep_schema_v4)\n}", "function deleteReciprocalAssociation(field, recip_obj_id) {\n var type = jQuery('#entry_form input[name=_type]').val();\n jQuery.get(\n CMSScriptURI + '?__mode=unlink_reciprocal',\n {\n 'recip_field_basename': field,\n 'recip_entry_id': recip_obj_id,\n 'cur_entry_id': jQuery('input[name=id]').val(),\n 'recip_obj_type': type\n },\n function(data) {\n jQuery('#'+field+'_status').html(data.message).show(500);\n\n // The association was successfully deleted from the database,\n // so delete the visible data.\n if (data.status == 1) {\n jQuery('input#'+field).val('');\n jQuery('ul#custom-field-reciprocal-'+field).children().remove();\n setTimeout(function() {\n jQuery('#'+field+'_status').hide(1000)\n }, 7000);\n }\n },\n 'json'\n );\n}", "function delete_Project(response, request)\n{\n if(request.method== \"POST\")\n {\n var body = '';\n\n request.on('data', function (data) {\n body += data;\n });\n request.on('end', function ()\n {\n body = qs.parse(body);\n\n console.log(\"jarayyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyjajaaaaaaaaaaaaaaaaaaaaaaa \"+ body.aba);\n\n projectRemove.project_removal(body.aba, response)\n // projectEdit.projectEdit(body.project_Name, body.project_Department, body.project_StartDate, body.project_EndDate, response);\n\n });\n }\n\n}", "function removeField(formSchema = {}, fieldId) {\n let props = formSchema.properties;\n delete props[fieldId.replace('root_', '')];\n return {...formSchema, properties: props};\n}", "removeMaterialSchemaValue(fieldName, field) {\n this.fields[fieldName].attributes[field] = null;\n }", "function scanFields(fieldArray, fieldName) {\n fieldArray.forEach(function(field, key) {\n if(field.name === fieldName) {\n fieldArray = fieldArray.splice(key, 1);\n }\n });\n}", "function scanFields(fieldArray, fieldName) {\n fieldArray.forEach(function (field, key) {\n if (field.name === fieldName) {\n fieldArray = fieldArray.splice(key, 1);\n }\n });\n}", "function removeField(){\n this.parentElement.parentElement.removeChild(this.parentElement);\n fieldsCounter--;\n\n /* reversing disabled add field button if amount of fields is less than MAX*/\n if(!shouldDisableAddFieldButton()){\n let addFieldButton = document.getElementById('add-field-button');\n addFieldButton.disabled = false;\n }\n\n //if last field is removed then remove submit button\n if(fieldsCounter === 0){\n removeSubmitButton();\n }\n}", "function removeField(){\n\n if (fieldSet == 1){\n var removeBtn = document.getElementById('removeBtn');\n removeBtn.style.display = \"none\";\n var submitBtn = document.getElementById('submit');\n submitBtn.style.display = \"none\";\n }\n var newestDiv = document.getElementById(\"field_div_id_\"+(fieldSet-1));\n newestDiv.parentNode.removeChild(newestDiv);\n\n fieldSet--;\n}", "delModuleItem(state, idx) {\n const { imported } = state.info.basic\n // const tag = state.remains[imported[idx] - 1].tag\n // state.info[tag].forEach(v => (v.ref = false))\n imported.splice(idx, 1)\n }", "static async deleteProject(id){\n \n try{\n const response = await db.one(`DELETE FROM projects WHERE id =$1;`, [id]); \n return response;\n } catch (error){\n return error.message;\n }\n }", "deleteTest(geoTestId){\r\n\r\n console.log(\"inside delete entry in AtterbergDB.js\");\r\n\r\n return new Promise((resolve, reject)=>{ \r\n Determination_of_atterberg_limits.deleteOne({\"geoTestId\":geoTestId}).exec()\r\n .then(response => resolve(response))\r\n .catch(err => reject(err))\r\n }); \r\n }", "function removeField(field, parent = null){\r\n\t\tif(parent == null) parent = field.parentNode;\r\n\t\tparent.removeChild(field);\r\n\t\tif((box = getViaAttr(field.querySelector('.remove-field'),'data-check'))) uncheckBox(box);\r\n\t\tupdateIndex(parent);\r\n}", "spliceSlot(fieldIndex) {\n let splicedField = this.getElementByIndex(fieldIndex)\n this.getElementWrapper().removeChild(splicedField)\n }", "function datagrid_delete_row(table, field_id) {\n\tvar row = datagrid_get_selected_row(table);\n\tif (row) {\n\t\t// find the correct index of the row in the field\n\t\tvar row_index = datagrid_get_field_index(table, row);\n\n\t\t// update the field\n\t\tvar field = $('#' + field_id + '_gridvalue');\n\t\tvar field_data = $.evalJSON(field.val());\n\t\tfield_data.splice(row_index, 1);\n\t\tfield.val($.toJSON(field_data));\n\n\t\t// delete the row in the datagrid\n\t\ttable.fnDeleteRow(row, undefined, true);\n if (table.fnGetData().length==0){\n $('#' + field_id + '_editrow').addClass(\"disabled\");\n\t\t $('#' + field_id + '_deleterow').addClass(\"disabled\");\n }\n\t}\n\telse {\n\t\talert('You must select a row to delete.');\n\t}\n}", "clear(field) {\n if (field === undefined) {\n this.field = [];\n } else {\n this.fields[field] = undefined;\n }\n this.time = undefined;\n this.fieldsComputed = false;\n }", "deleteImageFromField(image) {\n\t\tconst list = getArrayFromField(this.imagesField);\n\t\t// filter the target image in array\n\t\tconst newList = list.filter((item) => item.name !== image.name);\n\t\tconsole.log('deleteImageFromField -- newList: ');\n\t\tconsole.log(newList);\n\t\tsaveArrayToField(this.imagesField, newList);\n\t}", "remove(fieldInternalName) {\n return spPost(this.clone(ViewFields, `removeviewfield('${fieldInternalName}')`));\n }", "clear(field, index) {\n let error = this.findErrorBy(index);\n\n if (field && error) {\n delete error[field];\n return;\n }\n\n this.errors = {};\n }", "function DeleteAddableField(fieldType, valueToBeDeleted)\n{\n\tTi.API.info(\"DeleteAddableField: \" + fieldType + \", \" + valueToBeDeleted);\n\talert(\"DeleteAddableField: \" + fieldType + \", \" + valueToBeDeleted);\n\talert(contact[fieldType]);\n\t\n\tvar fieldDictionary = contact[fieldType];\n\tvar fieldDictionaryAfterDeletion = {};\n\t\n\tvalueToBeDeleted = valueToBeDeleted.replace(\"http://\",\"\");\t// If it's a social link, remove the http://\n\t\n\t// Loop over the addable fields dictionary that contains arrays of data\n\tfor(var key in fieldDictionary)\n\t{\n\t\t// Loop over the arrays inside the original dictionary\n\t\tfor(var record in fieldDictionary[key])\n\t\t{\n\t\t\tfieldDictionary[key][record] = fieldDictionary[key][record].replace(\"http://\",\"\"); // If it's a social link, remove http://\n\t\t\t\n\t\t\t// If field is phone, make sure that the number contains no chatacters, only numbers \n\t\t\tif(fieldType == \"phone\") fieldDictionary[key][record] == removeAnyCharButNumber(fieldDictionary[key][record]);\n\t\t\t\n\t\t\t// If not equal to the valueToBeDeleted, then add it to the dictionary that will replace original one\n\t\t\tif(fieldDictionary[key][record] != valueToBeDeleted)\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tfieldDictionaryAfterDeletion[key].push(fieldDictionary[key][record]);\n\t\t\t\t}\n\t\t\t\tcatch(error)\n\t\t\t\t{\n\t\t\t\t\tfieldDictionaryAfterDeletion[key] = [fieldDictionary[key][record]];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tcontact[fieldType] = fieldDictionaryAfterDeletion;\n\talert(contact[fieldType]);\n}", "async delete(requisition, response){\n await Model.deleteOne({\"_id\": requisition.params.id}).then(resp =>{\n return response.status(200).json(resp);\n }).catch(error => {return response.status(500).json(error);});\n }", "function fieldUnset(doc, field) {\n // Requires(doc != undefined)\n // Requires(field != undefined)\n\n var segments = field.split('.');\n var value;\n\n for (var i = 0; i < segments.length; i++) {\n if (doc === undefined) break;\n\n var seg = segments[i];\n\n // if this is the last segment then we delete the field\n if (i == (segments.length - 1)) {\n value = doc[seg];\n delete doc[seg];\n } else {\n // Advance to the next segment\n doc = doc[seg];\n }\n }\n\n return value;\n }", "removeModule (path) {\n if (typeof path === 'string') path = [path]\n\n delete this.registeredModules[path.join('/')]\n\n if (_utils_shared_data__WEBPACK_IMPORTED_MODULE_1__[\"default\"].recordVuex) {\n this.addMutation(`Unregister module: ${path.join('/')}`, {\n path\n }, {\n unregisterModule: true\n })\n }\n }", "async delete(req, res) {\n const projeto = await Projeto.findByPk(req.body.id);\n /*const cadastrosAl = await CadastroAluno.findAll({\n where: {fk_projeto: projeto.id}\n })\n if(cadastrosAl.length > 0){\n cadastrosAl.forEach(cadAl=>{\n await CadastroAluno.destroy(cadAl);\n })\n }*/\n await projeto.destroy();\n if (!projeto) {\n return res.status(400).json({\n Error: ['Não foi possivel deletar o projeto']\n })\n }\n return res.status(200).json({\n Sucess: ['Projeto removido com sucesso']\n })\n }", "remove(entity) {\n delete this.byId[entity.id];\n this.fieldsToIndex.forEach(field => {\n const fieldIndex = this.fieldIndexes[field];\n const value = entity[field];\n this.fieldIndexes[field][value].delete(entity.id);\n });\n this._removeFromSpatialIndex(entity);\n }", "function action() {\n var logCategory = 'Module Item - Deleted';\n\n /* If we're running a standards check and not doing any changes... */\n if (course.info.checkStandard === true) {\n logCategory = 'Module Item - Deprecated';\n } else {\n moduleItem.techops.delete = true;\n }\n\n moduleItem.techops.log(logCategory, {\n 'Title': moduleItem.title,\n 'ID': moduleItem.id\n });\n callback(null, course, moduleItem);\n }", "remove(fieldInternalName) {\r\n return this.clone(ViewFields_1, `removeviewfield('${fieldInternalName}')`).postCore();\r\n }", "function deleteItem(){\r\n// todo\r\n var id = readNonEmptyString('please type the id of the item you wish to delete :');\r\n if (!isNaN(id)){\r\n var item = getItemById(id);\r\n item.parent.items.forEach(function(childItem,index,array){\r\n if (childItem.id == id){\r\n array.splice(index,1);\r\n }\r\n })\r\n }\r\n\r\n}", "function deleteField(data) {\n var employeeDetails = getStorage();\n employeeDetails.forEach(function (user, index) {\n if (user.employeeId == data) {\n employeeDetails.splice(index, 1);\n }\n });\n addStorage(employeeDetails);\n alert(\"Warning - All Data Will Erase !? \");\n}", "function deleteMatrix(current_field,grid_name) {\r\n\t// Remove \"-sh\" from field name (if has a section header)\t\r\n\tif (current_field.indexOf(\"-sh\") > -1) {\r\n\t\tcurrent_field = current_field.substr(0, current_field.length-3);\r\n\t}\r\n\tsimpleDialog(delMatrixMsg+' \"'+grid_name+'\"'+langQuestionMark+' '+delMatrixMsg2,delMatrixTitle,null,null,null,langCancel,\"deleteMatrixDo('\"+current_field+\"','\"+grid_name+\"');\",langDelete);\r\n}", "function deleteField(event){\n //console.log(event)\n //excluir um por vez, de baixo para cima, deixando pelo menos o último\n const span = event.currentTarget;\n const fieldsContainer = document.querySelectorAll('.new-upload');\n if(fieldsContainer.length <= 1){\n //limpa o valor do campo\n span.parentNode.children[0].value = \"\"\n return\n }\n //deletar campo\n span.parentNode.remove();\n\n\n}", "function deleteProject(req, res) {\n\n\tconst _id = new ObjectID(req.params.id);\n\n\tProject.deleteOne({_id: _id})\n\t\t.then(result =>{\n\t\t\tres.json({ message: \"Project successfully deleted!\", result });\n\t\t})\n\t\t.catch(err =>{\n\t\t\tconsole.log(err);\n\t\t});\n}", "function deletePageForWebsite(websiteId,pageId) {\n return websiteModel\n .findById(websiteId)\n .then(function (website) {\n var index= website.pages.indexOf(pageId);\n //console.log(index);\n website.pages.splice(index,1);\n return website.save();\n });\n}", "async function deleteTodoById(account_id){\n if(account_id){\n // const [result, ] = await pool.query(\"DELETE FROM todos WHERE id=?\",[account_id]); // return Promise [results, fields]\n return await Todo.destroy({\n attributes:attributes,\n where: { \n id: account_id\n }\n }) \n }\n return null;\n}", "function DeleteField() {\n myInfoWindow.close();\n myField.setMap(null);\n ShowDrawingTools(true);\n}", "function removeProd() {\n var id = document.getElementById(\"idProdDel\").value;\n requestDB = db.transaction([\"produtos\"], \"readwrite\")\n .objectStore(\"produtos\")\n .delete(Number(id));\n\n requestDB.onsuccess = function () {\n console.log(\"Removido \" + id);\n };\n requestDB.onerror = function () {\n console.log(\"Erro ao remover\");\n };\n}", "function removeField(divId) {\n var div = document.getElementById(divId);\n div.parentNode.removeChild(div);\n}", "deleteGrupo(idMaestro, idMateria, idTurno){\n console.log(idMaestro, idMateria, idTurno);\n }", "remove(peliculaId) {\r\n return callApi(`/peliculas/${peliculaId}`, {\r\n method: 'DELETE',\r\n });\r\n }", "setModuleName(field, module) {\n field.moduleName = field.moduleName || (module && module.__meta.name);\n if ((field.type === 'array') || (field.type === 'object')) {\n _.each(field.schema || [], function(subfield) {\n self.setModuleName(subfield, module);\n });\n }\n }", "removeSingleRow(formId) {\n this.getLocalStorageData();\n this.findIndex = this.formData.findIndex((obj) => obj.formId == formId);\n if (this.findIndex != -1) {\n this.formData.splice(this.findIndex, 1);\n }\n\n }", "function removeField(form, fieldName) {\n\n // Scan sections\n form.sections.forEach(function (section, key) {\n scanFields(section.fields, fieldName);\n });\n\n // Form fields\n scanFields(form.fields, fieldName);\n\n return form;\n\n}", "function delQ_field(){\n $(\"div\").remove(\".form-group.\" + question);\n question--;\n console.log(question);\n}", "function deleteTask(e){\n const taskID = document.getElementById('id').value;\n http\n .delete(`http://localhost:3000/Tasks/${taskID}`)\n .then(task=>{\n //clearing field\n ui.clearFiled();\n //showing message\n ui.showAlertMessage('Task deleted','alert alert-warning');\n //getting task\n getTasks();\n })\n}", "function deleteRecord() {\n connection.query(\"DELETE FROM products Where Id = 2\", function(err, res) {\n console.log(\"deleteRecord Returned res: \", res);\n // for (var i = 0; i < res.length; i++) {\n // console.log(res[i].id + \" | \" + res[i].flavor + \" | \" + res[i].price + \" | \" + res[i].quantity);\n // }\n console.log(\"-----------------------------------\");\n displayRecords();\n });\n}", "function removeField(form, fieldName) {\n\n // Scan sections\n form.sections.forEach(function(section, key) {\n scanFields(section.fields, fieldName);\n });\n\n // Form fields\n scanFields(form.fields, fieldName);\n\n return form;\n\n}", "function deleteMboElement(i_row){\n var id = SHEET_MAIN.getRange(i_row, 3).getValue();\n if (id > 0){\n checkJWT();\n var res = _deleteMboElement(keyJWT, urlHome, id);\n Logger.log(res);\n }\n SHEET_MAIN.deleteRow(i_row);\n}", "function deleted(numero){\n \n //console.log(numero);\n Eliminarcore(numero);\n cargarTablaRecibidos();\n cargarTablaPrincipal();\n \n}", "function deleteComponent(cid)\n{\nvar m=0;\n //delete the module from pm\n for(var k=0; k < pm.modules.length; k++)\n {\n if(pm.modules[k].id == cid)\n {\n m=k;\n break;\n }\n \n } \n\n delete pm.modules[m];\n //delete the wires from pm \n for(var k=0; k < pm.wires.length; k++)\n {\n if((pm.wires[k].src[0].moduleid == cid)||(pm.wires[k].tgt[0].moduleid == cid))\n {\n m=k;\n delete pm.wires[k];\n \n }\n \n }\n \n //delete the module from layout\n for(var k=0; k < pm.layout.length; k++)\n {\n if(pm.layout[k].id == cid)\n {\n m=k;\n break;\n \n }\n }\n \n delete pm.layout[m];\n return;\n\n}", "function deleteDevice (client, deviceId, registryName, cb) {\n const request = {\n name: `${registryName}/devices/${deviceId}`\n };\n\n client.projects.locations.registries.devices.delete(request, (err, data) => {\n if (err) {\n console.log('Could not delete device:', deviceId);\n console.log(err);\n cb(err);\n } else {\n console.log('Successfully deleted device:', deviceId);\n console.log(data);\n cb(null);\n }\n });\n}", "function deleteProject (req, res) {\n console.log('params.id', req.params.id)\n DESCRIPTION.destroy({\n where: {\n ProjectId: req.params.id\n }\n }).then(() => {\n IMAGEPATH.destroy({\n where: {\n ProjectId: req.params.id\n }\n }).then(() => {\n PROJECT.destroy({\n where: {\n id: req.params.id\n }\n }).then(() => {\n res.send(true)\n }).catch(err => {\n console.log(err)\n res.send(false)\n })\n }).catch(err => {\n console.log(err)\n res.send(false)\n })\n }).catch(err => {\n console.log(err)\n res.send(false)\n })\n}", "deleteProject({ commit, dispatch }, data) {\n commit(\"setProjectsLoadStatus\", 1);\n ProjectsAPI.deleteProject(data)\n .then(response => {\n if (response.data) {\n dispatch(\"loadProjects\");\n }\n })\n .catch(error => {\n commit(\"setProjectsLoadStatus\", 3);\n throw new Error(error);\n });\n }", "function _delete(SpecParam){\n var deferred = Q.defer();\n var id= SpecParam._id;\n\n db.specification.remove(\n {_id: mongo.helper.toObjectID(SpecParam._id)},\n function(err){\n \tif(err) deferred.reject(err);\n \t\n \tdeferred.resolve();\n });\n return deferred.promise;\n}", "function deleteDept(deleteRow) {\n // debugging\n // console.log(deleteRow);\n\n connection.query(\n \"DELETE FROM departments WHERE item_id= \" + deleteRow,\n function(err) {\n if (err) throw err;\n console.log(\"Your Item Was Deleted Successfully!!!\");\n userInput();\n }\n );\n}", "async function eliminarDocumento(id){\n const result = await Curso.deleteOne({_id: id});\n console.log('Documento eliminado', result); \n}", "function deleteDevice(\n client,\n deviceId,\n registryId,\n projectId,\n cloudRegion,\n cb\n) {\n // [START iot_delete_device]\n // Client retrieved in callback\n // getClient(serviceAccountJson, function(client) {...});\n // const cloudRegion = 'us-central1';\n // const projectId = 'adjective-noun-123';\n // const registryId = 'my-registry';\n const parentName = `projects/${projectId}/locations/${cloudRegion}`;\n const registryName = `${parentName}/registries/${registryId}`;\n const request = {\n name: `${registryName}/devices/${deviceId}`,\n };\n\n client.projects.locations.registries.devices.delete(request, (err, res) => {\n if (err) {\n console.log('Could not delete device:', deviceId);\n console.log(err);\n } else {\n console.log('Successfully deleted device:', deviceId);\n console.log(res.data);\n if (cb) {\n cb();\n }\n }\n });\n // [END iot_delete_device]\n}", "function deleteNRf(req, res) {\n\n nrfService.delete(req.body)\n .then(function () {\n res.sendStatus(200);\n })\n .catch(function (err) {\n res.status(400).send(err);\n });\n}", "buildDeleteFields(patchContext, origContext, schema){\n var deleteFields = [];\n // must remove nulls from the orig copy to sync with patchContext\n var origCopy = object.deepClone(origContext);\n origCopy = removeNulls(origCopy);\n var userGroups = JWT.getUserGroups();\n _.keys(origCopy).forEach((field, index) => {\n // if patchContext already has a value (such as admin edited\n // import_items fields), don't overwrite\n if(!isValueNull(patchContext[field])){\n return;\n }\n if(schema.properties[field]){\n var fieldSchema = object.getNestedProperty(schema, ['properties', field], true);\n if (!fieldSchema){\n return;\n }\n // skip calculated properties and exclude_from fields\n if (fieldSchema.calculatedProperty && fieldSchema.calculatedProperty === true){\n return;\n }\n if (fieldSchema.exclude_from && (_.contains(fieldSchema.exclude_from,'FFedit-create') || fieldSchema.exclude_from == 'FFedit-create')){\n return;\n }\n // if the user is admin, they already have these fields available;\n // only register as removed if admin did it intentionally\n if (fieldSchema.permission && fieldSchema.permission == \"import_items\"){\n if(_.contains(userGroups, 'admin')) deleteFields.push(field);\n return;\n }\n // check round two fields if the parameter roundTwo is set\n if(fieldSchema.ff_flag && fieldSchema.ff_flag == 'second round'){\n if(this.state.roundTwo) deleteFields.push(field);\n return;\n }\n // if we're here, the submission field was legitimately deleted\n if(!this.state.roundTwo) deleteFields.push(field);\n }\n });\n return deleteFields;\n }", "function updateModule(updateModule){\n var deferred = Q.defer();\n\n updateModule.name = updateModule.name.toLowerCase();\n\n //fields array should not be editable when using this function. therefore, delete it from input\n delete updateModule.fields;\n\n db.modules.find({$or: [\n {_id: mongo.helper.toObjectID(updateModule._id)},\n {name: updateModule.name}\n ]}).toArray(function(err, modules){\n if(err){\n deferred.reject(err);\n }\n else if(modules.length == 0){\n deferred.reject(notFound);\n }\n //vali inputs, no other document have the same name\n else if(modules.length == 1){\n var oldModule = modules[0];\n \n //rename if old & new names are different\n if(oldModule.name != updateModule.name){\n db.bind(oldModule.name);\n db[oldModule.name].rename(updateModule.name, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n update();\n }\n });\n }\n //go straight to update\n else{\n update();\n }\n }\n //another module document with the same name exists\n else{\n deferred.reject(exists);\n }\n }); \n\n //updates the document in the 'modules' collection\n function update(){\n\n //create another object and copy. then delete the '_id' property of the new copy\n var forUpdate = {};\n Object.assign(forUpdate, updateModule);\n delete forUpdate._id;\n \n db.modules.update({_id: mongo.helper.toObjectID(updateModule._id)}, {$set: forUpdate}, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n deferred.resolve();\n }\n });\n }\n\n return deferred.promise;\n}", "function _delete(req, res) {\n if (_adminCommonValidation(req, res, \"delete\")) {\n repository.deletePackageMetadata(req.params.name, req.user, function (err) {\n if (err) {\n var responseData = {\n errors: _toErrorMessageList(err),\n operation: \"delete\"\n };\n if (err.message === \"UNKNOWN_EXTENSION\") {\n res.status(404);\n _respond(req, res, \"adminFailed\", responseData);\n } else if (err.message === \"NOT_AUTHORIZED\") {\n _respondUnauthorized(req, res, \"adminFailed\", responseData);\n } else {\n res.status(400);\n _respond(req, res, \"adminFailed\", responseData);\n }\n } else {\n res.status(200);\n _respond(req, res, \"deleteSucceeded\", {\n name: req.params.name\n });\n }\n });\n }\n}", "async deleteProject({request, response, error}){\n try{\n var data = request.body;\n //to delete the project\n let qry = await Database.connection('oracledb').table('LIST_OF_PROJECTS').where('PROJECT_ID', data.projectid)\n .delete();\n console.log(qry);\n\n //to maintain the log of transactions\n var date = new Date();\n var data1 = {\n status:\"deleted\",\n email:\"Linda@xyz.com\"\n }\n let transactions = await Database.insert({ PROJECT_ID:data.projectid,\n TRANSACTION_DATE:date,\n ENTITIY_ACCESSED:data.entityname,\n TRANSACTION_STATUS:data1.status,\n TRANSACTION_PERFORMED_BY:data1.email\n }).into('PROJECT_TRANSACTIONS');\n console.log(transactions);\n \n return response.status(200).send({success:true, data:qry, msg:'Successfully delete the project', err:null});\n }\n catch(error){\n return response.status(400).send({success:false, data:null,msg:'Error while deleting projects', err:error});\n }\n // finally{\n // Database.close(['oracledb']);\n // }\n \n }", "deleteAccount (accountName) {\r\n let accountIndex = this.findAccountIndex(accountName);\r\n if (accountIndex !== -1) {\r\n this._accountList.splice(accountIndex, 1);\r\n } else {\r\n console.log('Account by the name' + accountName + ' not found');\r\n }\r\n }", "async function deleteBatchGroupMember (req, res) {\n const groupId = req.params.groupId;\n const identifier = req.params.identifier;\n\n let groupMemberArray = []\n let groupArray = req.body;\n\n if (!identifier) {\n throw new errors.BadRequestError('User Handle or Email or Child Group should be provided');\n }\n\n groupValidationService.validateWiproGroup(groupId);\n\n groupMemberArray = await deleteGroupMembers(groupId, identifier, groupArray);\n \n logger.debug(\"EXIT GroupShimController deleteBatchGroupMember\");\n res.send(groupMemberArray);\n }", "static deleteTask(taskId = 0){\n var table_Name = Task.tableName\n const sql = `delete from ${table_Name} WHERE id = ?`\n const params = [taskId]\n console.log(\"Task id \"+taskId)\n return this.repository.databaseLayer.executeSql(sql, params)\n }", "function uninstallModule(options, cli, next) {\n\n // Get the module name\n var moduleName = options[1];\n if (!moduleName) {\n next(new Error(\"You must specify a module name (@version is ignored).\"));\n return;\n }\n\n // Split module / version\n var moduleVersion = moduleName.split('@')[1] || \"\";\n var moduleName = moduleName.split('@')[0];\n\n // Locate the module\n var installedModule = calipso.modules[moduleName];\n var installed = installedModule ? true : false;\n\n // Assume that we want to re-install the dependencies via NPM\n if (installed) {\n\n if (installedModule.type === \"core\") {\n next(new Error(\"You should not delete core modules unless you really know what you are doing!\"));\n return;\n }\n\n // This can't be messed with, as it is populated based on pre-existing path type/name.\n var path = __dirname + \"/../modules/\" + installedModule.type + \"/\" + installedModule.name;\n\n confirm('This will remove the module completely from the site and cannot be undone, continue? '.red.bold, function (ok) {\n if (ok) {\n process.stdin.destroy();\n console.log(\"Removing \" + installedModule.name.green.bold + \", please wait ...\");\n exec('rm -rf ' + path, { timeout:5000, cwd:__dirname }, function (error, stdout, stderr) {\n\n var err = ((error ? error.message : '') || stderr);\n\n if (!err) {\n console.log(stdout + \"Module \" + installedModule.name.green.bold + \" uninstalled completely.\");\n next();\n } else {\n next(new Error(err));\n }\n });\n\n } else {\n next();\n }\n });\n\n } else {\n\n console.log(\"Module \" + moduleName.green.bold + \" is not installed.\");\n next();\n\n }\n\n}", "function bgDeleteGroup(groupId, collectGroups) {\r\n if(groupId) {\r\n var groups = collectGroups;\r\n \r\n BRW_dbTransaction(function(tx) {\r\n BRW_dbDelete(\r\n {//Param\r\n tx : tx,\r\n table : 'GROUPS',\r\n where : {\r\n key : 'id',\r\n val : groupId\r\n }\r\n },\r\n function(results){//Success\r\n \r\n } \r\n );\r\n });\r\n }\r\n}", "function User_Delete_Exercice_Liste_des_exercices_comptables0(Compo_Maitre)\n{\n var Table=\"exercice\";\n var CleMaitre = Compo_Maitre.getCleVal();\n var NomCleMaitre = DePrefixerChamp(Compo_Maitre.getCle());\n var Req=\"delete from \"+Table+\" where \"+NomCleMaitre+\" = \"+CleMaitre;\n\n if (pgsql_update(Req)==0)\n\talert(\"Echec lors de la supression\");\nreturn CleMaitre;\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 }", "async delete({request, response, params: {id}}) {\n\n const name = await nameService.findNameBy('id', id);\n\n if (name) {\n\n name.delete()\n\n return response.status(200).send({\n status: 200,\n message: \"name deleted\"\n })\n }\n else{\n return response.status(400).send({\n status: 400,\n message: \"invalid name id\"\n })\n }\n }", "deleteProblem(response, pathname, accountID) {\n //let problemName = Server.getSentID(pathname.substr(this.databaseActions[0].length)); //not sure why this is here...\n return this.database.deleteProblem(this, response, accountID, pathname.substr(this.databaseActions[0].length));\n }", "async function eliminarDocumento(id){\n const result = await Curso.findByIdAndDelete(id);\n console.log('Documento eliminado', result); \n}" ]
[ "0.8156747", "0.67469287", "0.66539174", "0.6590933", "0.65539515", "0.6496182", "0.6480931", "0.6474819", "0.6348002", "0.6331068", "0.62288254", "0.6219512", "0.6177473", "0.6077904", "0.6047087", "0.5973316", "0.59649444", "0.59559435", "0.59484595", "0.58134276", "0.58067805", "0.56874734", "0.56850034", "0.5600509", "0.5595539", "0.5585259", "0.557454", "0.55667555", "0.5552543", "0.5498065", "0.547809", "0.5456687", "0.54467803", "0.5429699", "0.54292315", "0.54243726", "0.5415296", "0.5399725", "0.53712183", "0.535851", "0.5301696", "0.5296294", "0.5245694", "0.52378666", "0.5234138", "0.5230389", "0.5227536", "0.52190447", "0.5218518", "0.52106583", "0.5195965", "0.5190445", "0.51804435", "0.51775336", "0.51464885", "0.51266587", "0.5118419", "0.51157886", "0.5109112", "0.50988305", "0.50957596", "0.50924677", "0.5070547", "0.5067524", "0.5055407", "0.5044654", "0.50360924", "0.503348", "0.5031144", "0.5027994", "0.5024254", "0.5023311", "0.5016065", "0.5015322", "0.50134104", "0.50121623", "0.50027823", "0.49990702", "0.49916", "0.49912018", "0.4987841", "0.49839792", "0.49812508", "0.4970589", "0.4967862", "0.49658933", "0.49649787", "0.49636465", "0.49608117", "0.49590367", "0.49572006", "0.492767", "0.49271843", "0.4924929", "0.49243915", "0.4923132", "0.49187005", "0.49144125", "0.4904236", "0.48942629" ]
0.80614734
1
Function name: get a specific module Author: Reccion, Jeremy Date Modified: 2018/04/20 Description: retrieves a specific module by its name Parameter(s): moduleName: string type Return: Promise
function getModuleByName(moduleName){ var deferred= Q.defer(); moduleName = moduleName.toLowerCase(); db.modules.findOne({name: moduleName}, function(err, aModule){ if(err){ deferred.reject(err); } else if(aModule){ deferred.resolve(aModule); } else{ deferred.reject(notFound); } }); return deferred.promise; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getModuleByName(moduleName){\n var deferred= Q.defer();\n moduleName = moduleName.toLowerCase();\n\n db.modules.findOne({name: moduleName}, function(err, aModule){\n if(err){\n deferred.reject(err);\n }\n else{\n deferred.resolve(aModule);\n }\n });\n\n return deferred.promise;\n}", "function getModule(name){\n\t\tfor (var i = 0; i < modules.length; i++) {\n\t\t\tif (modules[i].name === name){\n\t\t\t\treturn modules[i];\n\t\t\t}\n\t\t}\n\t}", "GetModule() {\n\n }", "function getPackageJSON(moduleName, cb) {\n console.time('getPackageJSON');\n var url = 'http://search.npmjs.org/api/' + moduleName;\n request(url, function (err, response, body) {\n if (!err && response.statusCode === 200) {\n console.timeEnd('getPackageJSON');\n cb(null, JSON.parse(body));\n } else {\n console.timeEnd('getPackageJSON');\n cb(err);\n }\n });\n}", "function requestModuleInformation(modId, cb) {\n $.get(\"/api/category/module\", {moduleId: modId}).done((data) => {\n if (data.error === \"NONE\") {\n cb(data.data);\n } else {\n alert(\"Invalid request to /api/category/module\");\n }\n });\n }", "async function func(uniqueModuleData) {\n try {\n console.log(\"uniqueModuleData\", uniqueModuleData)\n const foundModule = await prisma.module.findUnique({where: uniqueModuleData})\n console.log(\"foundModule\", foundModule)\n return foundModule\n } catch(e) {\n console.log(e)\n return\n }\n }", "getModules(){\n return this.#fetchAdvanced(this.#getModulesURL()).then((responseJSON) => {\n let moduleBOs = ModuleBO.fromJSON(responseJSON);\n // console.info(moduleBOs);\n return new Promise(function (resolve) {\n resolve(moduleBOs);\n })\n })\n\n }", "function getModuleById(moduleID) {\r\n fetch(`modules.json`)\r\n .then((res) => {\r\n return res.json();\r\n })\r\n .then((data) => {\r\n const moduleArr = data.filter((module) => {\r\n const regex = new RegExp(`^${moduleID}`, 'gi');\r\n\r\n return module.moduleCode.match(regex);\r\n });\r\n const module = moduleArr[0];\r\n\r\n addModuletoDOM(module);\r\n });\r\n}", "function require(name) {\n var mod = ModuleManager.get(name);\n if (!mod) {\n //Only firefox and synchronous, sorry\n var file = ModuleManager.file(name);\n var code = null,\n request = new XMLHttpRequest();\n request.open('GET', file, false); \n try {\n request.send(null);\n } catch (e) {\n throw new LoadError(file);\n }\n if(request.status != 200)\n throw new LoadError(file);\n //Tego el codigo, creo el modulo\n var code = '(function(){ ' + request.responseText + '});';\n mod = ModuleManager.create(name, file, code);\n }\n event.publish('module_loaded', [this, mod]);\n switch (arguments.length) {\n case 1:\n // Returns module\n var names = name.split('.');\n var last = names[names.length - 1];\n this[last] = mod;\n return mod;\n case 2:\n // If all contents were requested returns nothing\n if (arguments[1] == '*') {\n __extend__(false, this, mod);\n return;\n // second arguments is the symbol in the package\n } else {\n var n = arguments[1];\n this[n] = mod[n];\n return mod[n];\n }\n default:\n // every argyment but the first one are a symbol\n // returns nothing\n for (var i = 1, length = arguments.length; i < length; i++) {\n this[arguments[i]] = mod[arguments[i]];\n }\n return;\n }\n }", "function NSGetModule(compMgr, fileSpec) {\n return module;\n}", "function NSGetModule(compMgr, fileSpec) {\n return Module;\n}", "function getThisModule() {\n\tconst modules = MM.getModules();\n\tfor(let i = 0; i < modules.length; i++){\n\t\t//Log.log(modules[i].identifier);\n\t\tif(modules[i].name === \"MMM-PhotoSlideshow\"){\n\t\t\treturn modules[i];\n\t\t}\n\t}\n\treturn undefined;\n}", "static async getTasksByModule(module) {\n try {\n let res = await axios.get(`${url}/getByModule/${module}`);\n let data = res.data;\n if (data != 'No Tasks.') {\n return data;\n }\n }\n catch (err) {\n console.log(err);\n return [];\n }\n }", "async function getModules() {\n\n const pool = await db.dbConnection()\n\n const getQuery = `SELECT * FROM public.modules`;\n\n try {\n pool.query(getQuery, function (err, recordset) {\n\n if (err) {\n\n console.log('getModules', err)\n\n } else {\n\n // send records as a response\n return recordset.rows;\n }\n });\n }\n\n catch (error) {\n res.status(402).json('record insert failed with error: ' + parseError(error, getQuery))\n }\n}", "function getRevision (moduleName) {\n var cookie = cookies.get(COOKIE_NAME) || '',\n kvPairs = cookie ? cookie.split(COOKIE_PAIR_SEPARATOR) : [],\n modules = {};\n\n // Parse out modules.\n kvPairs.forEach(function (pair) {\n var parts = pair.split(COOKIE_REV_SEPARATOR),\n module = parts[0],\n revision = parts[1];\n\n modules[module] = revision;\n });\n\n if (moduleName) {\n return modules[moduleName];\n }\n\n return modules;\n}", "function queryModNames() {\n db.collection('modules')\n .get()\n .then((querySnapshot) => {\n querySnapshot.forEach((doc) => {\n let modNameObj = {};\n modNameObj.value = doc.id;\n modNameObj.label = doc.data().module.name;\n if (modNameObj.label !== 'Jumpshot Tutor') {\n allModules.push(modNameObj);\n }\n setModNamesIsLoading(false);\n });\n return allModules;\n });\n }", "async function fetchModule() {\n\t\t\t const module = await getUserModule(userId, instanceId);\n\t\t\t setModule(module);\n\n\t\t\t // Setting up audio message ref (if any audio message is present).\n\t\t\t if (module.audioMessageURL) {\n\t\t\t\t audioMessageRef.current = new Audio(module.audioMessageURL);\n\t\t\t }\n\n\t\t\t // Getting the module's author info\n\t\t\t const user = await getUserDocument(userId);\n\t\t\t setUser(user);\n\t\t}", "async function loadModule(moduleName, multiInject = false) {\n const modulesToLoad = [moduleName, ...modulesMetadata[moduleName].depsDeep]\n const loadedModules = await loadModules(modulesToLoad)\n return multiInject ? loadedModules[moduleName].instances : loadedModules[moduleName].instances[0]\n }", "static get moduleName() {\n return undefined;\n }", "function searchCache(moduleName, callback) {\n\t// Resolve the module identified by the specified name\n\tlet mod = require.resolve(moduleName);\n\n\t// Check if the module has been resolved and found within\n\t// the cache\n\tif (mod && ((mod = require.cache[mod]) !== undefined)) {\n\t\t// Recursively go over the results\n\t\t(function run(mod) {\n\t\t\t// Go over each of the module's children and\n\t\t\t// run over it\n\t\t\tmod.children.forEach(function (child) {\n\t\t\t\tif (child.id != mod.id) {\n\t\t\t\t\t// console.log(mod.id, child.id);\n\t\t\t\t\trun(child);\n\t\t\t\t}\n\t\t\t});\n\n\t\t\t// Call the specified callback providing the\n\t\t\t// found module\n\t\t\tcallback(mod);\n\t\t})(mod);\n\t}\n}", "function makeTheCall(userName){\n\n fetch(gitHubURL + userName +\"/repos\")\n .then(response => response.json())\n .then(responseJson => listOnlyName(responseJson)); \n}", "function getAllModuleDocs(moduleName){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n\n db.bind(moduleName);\n\n db[moduleName].find().toArray(function(err, moduleDocs){\n if(err){\n deferred.reject(err);\n }\n else{\n deferred.resolve(moduleDocs);\n }\n });\n\n return deferred.promise;\n}", "function getAllModuleDocs(moduleName){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n\n db.bind(moduleName);\n\n db[moduleName].find().toArray(function(err, moduleDocs){\n if(err){\n deferred.reject(err);\n }\n else{\n deferred.resolve(moduleDocs);\n }\n });\n\n return deferred.promise;\n}", "function getModuleLicense(moduleName, callback)\n {\n getModuleLicenses(moduleName, callback);\n }", "function loadModule(moduleName) {\n var module = modules[moduleName];\n\n if (module !== undefined) {\n return module;\n }\n\n // This uses a switch for static require analysis\n switch (moduleName) {\n case 'charset':\n module = __nccwpck_require__(99296);\n break;\n case 'encoding':\n module = __nccwpck_require__(25297);\n break;\n case 'language':\n module = __nccwpck_require__(19722);\n break;\n case 'mediaType':\n module = __nccwpck_require__(62563);\n break;\n default:\n throw new Error('Cannot find module \\'' + moduleName + '\\'');\n }\n\n // Store to prevent invoking require()\n modules[moduleName] = module;\n\n return module;\n}", "async function getInformation() {\n try {\n const ids = await getRecipies();\n console.log(ids);\n const jor = await getRecipe(ids[0]);\n console.log(jor);\n const nextJor = await getAuthorRecipe(jor.author);\n console.log(nextJor);\n return nextJor.name;\n } catch (error) {\n console.log(\"Алдаа : \" + error);\n }\n}", "static describe (module) {\n\t\tconst description = GetRequest.describe(module);\n\t\tdescription.access = 'User must be a member of the team that owns this repo';\n\t\treturn description;\n\t}", "function loadModule(moduleName) {\n var module = modules[moduleName];\n\n if (module !== undefined) {\n return module;\n }\n\n // This uses a switch for static require analysis\n switch (moduleName) {\n case 'charset':\n module = charset;\n break;\n case 'encoding':\n module = encoding;\n break;\n case 'language':\n module = language;\n break;\n case 'mediaType':\n module = mediaType;\n break;\n default:\n throw new Error('Cannot find module \\'' + moduleName + '\\'');\n }\n\n // Store to prevent invoking require()\n modules[moduleName] = module;\n\n return module;\n}", "getModuleList() {\n return this.http.get(this.url + '/cesco/getmodule', this.httpOptions);\n }", "function getCoreNodeModule(moduleName) {\n try {\n return require(`${vscode.env.appRoot}/node_modules.asar/${moduleName}`);\n } catch (err) {}\n\n try {\n return require(`${vscode.env.appRoot}/node_modules/${moduleName}`);\n } catch (err) {}\n\n return null;\n}", "function NSGetModule(aCompMgr, aFileSpec) \r\n{\r\n\treturn FoxMeterServiceModule;\r\n}", "function getModules() {\n\n queries.executeRequest('GET', 'permissions/modules')\n .then(function (result) {\n if (result.success) {\n $scope.modules = result.data;\n }\n });\n }", "function getRepoContributors(repoOwner, repoName, cb) {\n\n// if statement to check if user have the required arguments on node\n if(repoOwner && repoName) {\n\n var options = {\n url: \"https://api.github.com/repos/\" + repoOwner + \"/\" + repoName + \"/contributors\",\n headers: {\n 'User-Agent': 'request',\n Authorization: 'token ' + getKey.GITHUB_TOKEN\n }\n };\n request(options, function(err, res, body) {\n cb(err, body);\n });\n\n } else {\n console.log(\"Error: Please add your repoOwner and repoName to node.\");\n }\n\n}", "function loadModule(moduleName) {\n var module = modules[moduleName];\n\n if (module !== undefined) {\n return module;\n }\n\n // This uses a switch for static require analysis\n switch (moduleName) {\n case 'charset':\n module = __webpack_require__(621);\n break;\n case 'encoding':\n module = __webpack_require__(622);\n break;\n case 'language':\n module = __webpack_require__(623);\n break;\n case 'mediaType':\n module = __webpack_require__(624);\n break;\n default:\n throw new Error('Cannot find module \\'' + moduleName + '\\'');\n }\n\n // Store to prevent invoking require()\n modules[moduleName] = module;\n\n return module;\n}", "function openModuleDetails(modulename) {\n\n\tdisplay_module();\n\tconsole.log(\"loading \" +modulename);\n\tloadSelectedModule(modulename);\n\n}", "getModules(pkg: Package): Module[] {\n return this.modules.get(pkg) || []\n }", "function getModule(name) {\n var exports;\n var entry = defined[name];\n\n if (!entry) {\n exports = load(name);\n if (!exports)\n throw new Error(\"Unable to load dependency \" + name + \".\");\n }\n\n else {\n if (entry.declarative)\n ensureEvaluated(name, []);\n \n else if (!entry.evaluated)\n linkDynamicModule(entry);\n\n exports = entry.module.exports;\n }\n\n if ((!entry || entry.declarative) && exports && exports.__useDefault)\n return exports['default'];\n\n return exports;\n }", "function getModule(name) {\n var exports;\n var entry = defined[name];\n\n if (!entry) {\n exports = load(name);\n if (!exports)\n throw new Error(\"Unable to load dependency \" + name + \".\");\n }\n\n else {\n if (entry.declarative)\n ensureEvaluated(name, []);\n \n else if (!entry.evaluated)\n linkDynamicModule(entry);\n\n exports = entry.module.exports;\n }\n\n if ((!entry || entry.declarative) && exports && exports.__useDefault)\n return exports['default'];\n\n return exports;\n }", "function getModuleByID(id) {\n for (var i = 0, il = modules.length; i < il; i++) {\n if (modules[i].id == id) return modules[i];\n }\n }", "function loadModule(moduleName) {\n var module = modules[moduleName];\n\n if (module !== undefined) {\n return module;\n }\n\n // This uses a switch for static require analysis\n switch (moduleName) {\n case 'charset':\n module = __webpack_require__(519);\n break;\n case 'encoding':\n module = __webpack_require__(520);\n break;\n case 'language':\n module = __webpack_require__(521);\n break;\n case 'mediaType':\n module = __webpack_require__(522);\n break;\n default:\n throw new Error('Cannot find module \\'' + moduleName + '\\'');\n }\n\n // Store to prevent invoking require()\n modules[moduleName] = module;\n\n return module;\n}", "function loadModule(moduleName) {\n var module = modules[moduleName];\n\n if (module !== undefined) {\n return module;\n }\n\n // This uses a switch for static require analysis\n switch (moduleName) {\n case 'charset':\n module = __webpack_require__(429);\n break;\n case 'encoding':\n module = __webpack_require__(430);\n break;\n case 'language':\n module = __webpack_require__(431);\n break;\n case 'mediaType':\n module = __webpack_require__(432);\n break;\n default:\n throw new Error('Cannot find module \\'' + moduleName + '\\'');\n }\n\n // Store to prevent invoking require()\n modules[moduleName] = module;\n\n return module;\n}", "getByName(_actionName, _dccName) {\n return new Promise((resolve, reject) => {\n var _result = new actionResult_1.ActionResult(); // return object\n var _baseUri = this.getActionPathPerDcc(_dccName);\n if (_baseUri == \"NotFound\") // not found -> dcc name invalid\n {\n _result.error = `Dcc Not Found / name invalid as '${_dccName}'`;\n resolve(JSON.stringify(_result));\n return;\n }\n _baseUri += `/${_actionName}`;\n fs.readdir(_baseUri, (_err, _files) => {\n if (_err) {\n console.log('Unable to scan directory: ' + _err);\n _result.error = `actionName not found on : ${_err.path}`;\n resolve(JSON.stringify(_result)); // error treated as resolve\n return;\n }\n for (const _file of _files) {\n if (_file.includes(\"__init__\"))\n continue;\n if (_file.includes(\".pyc\"))\n continue;\n if (!_file.includes(\".json\"))\n continue;\n let _json = JSON.parse(fs.readFileSync(_baseUri + `/${_file}`));\n _result = _json;\n }\n resolve(JSON.stringify(_result)); // return jsonObject\n });\n });\n }", "loadModules(passphrase) {\n return this.httpService({\n method: 'GET',\n url: `${this.rootURL}microAnalytics`,\n headers: {Authorization: `basic ${passphrase}`}\n });\n }", "function getModuleFromMid(mid) {\n\t\tif (mid.indexOf(\"!\") >= 0) {\n\t\t\tthrow \"Method getModuleFromMid called with a plugin mid: \" + mid;\n\t\t}\n\n\t\tif (!cache[mid]) {\n\t\t\tvar path = utils.nameToFilepath(mid);\n\t\t\tcache[mid] = {\n\t\t\t\tmid: mid,\n\t\t\t\tfilepath: path,\n\t\t\t\tcontent: readFile(path)\n\t\t\t};\n\t\t}\n\t\treturn cache[mid];\n\t}", "async [FETCH_MODULES]({ commit }, successRoute) {\n // If user is logged in 'data' will contain an array of module data.\n // Otherwise 'data' will contain an error message.\n try {\n const { data } = await callApi(MODULES_URL);\n const { message } = data;\n\n if (message === 'NOT_AUTHORIZED') {\n router.push('/login');\n return;\n }\n\n const { entities } = normalize(data, moduleSchema);\n const { modules, reactions } = entities;\n\n commit(LOAD_MODULES, modules);\n commit(LOAD_REACTIONS, reactions);\n commit(FETCH_MODULES_SUCCESS);\n\n if (successRoute) {\n router.push(successRoute);\n }\n } catch (error) {\n console.log(error);\n }\n }", "async function getModuleInfoFromFirebase() {\n console.log(module.value);\n db.collection('modules')\n .doc(module.value)\n .get()\n .then((doc) => {\n setModuleVideos(doc.data());\n });\n }", "getModuleName() {\n return 'Search';\n }", "function loadModule(moduleName) {\n var module = modules[moduleName];\n\n if (module !== undefined) {\n return module;\n }\n\n // This uses a switch for static require analysis\n switch (moduleName) {\n case 'charset':\n module = __webpack_require__(263);\n break;\n case 'encoding':\n module = __webpack_require__(264);\n break;\n case 'language':\n module = __webpack_require__(265);\n break;\n case 'mediaType':\n module = __webpack_require__(266);\n break;\n default:\n throw new Error('Cannot find module \\'' + moduleName + '\\'');\n }\n\n // Store to prevent invoking require()\n modules[moduleName] = module;\n\n return module;\n}", "executeModules(date, hour, minutes, passphrase) {\n return this.httpService({\n method: 'GET',\n url: `${this.rootURL}result?date=${date}&hour=${hour}&minutes=${minutes}`,\n headers: {Authorization: `basic ${passphrase}`}\n });\n }", "function get_module_name(dir) {\n if (dir === void 0) { dir = \"./\"; }\n var base_dir = process.env.PWD !== undefined ? process.env.PWD : \"/\";\n fs.readdir(dir, function (err, files) {\n var modIdx = files.indexOf(\"go.mod\");\n if (modIdx != -1) {\n // found\n console.log(\"go.mod found:\", dir + \"go.mod\");\n parse_go_mod(dir + \"go.mod\").then(function (pkg) {\n return pkg;\n });\n }\n var next_dir = absolute_path(base_dir, dir + \"../\");\n if (next_dir == \"/\") {\n return \"\";\n }\n get_module_name(next_dir);\n });\n return \"\";\n}", "function loadModule(moduleName) {\n\t var module = modules[moduleName];\n\n\t if (module !== undefined) {\n\t return module;\n\t }\n\n\t // This uses a switch for static require analysis\n\t switch (moduleName) {\n\t case 'charset':\n\t module = __webpack_require__(97);\n\t break;\n\t case 'encoding':\n\t module = __webpack_require__(98);\n\t break;\n\t case 'language':\n\t module = __webpack_require__(99);\n\t break;\n\t case 'mediaType':\n\t module = __webpack_require__(100);\n\t break;\n\t default:\n\t throw new Error('Cannot find module \\'' + moduleName + '\\'');\n\t }\n\n\t // Store to prevent invoking require()\n\t modules[moduleName] = module;\n\n\t return module;\n\t}", "function getComponent(module, name) {\n //\n // If the module defines a default export, return that\n // e.g.\n //\n // ```\n // export default function Component() { ... }\n // ```\n //\n if (isDefaultExport(module)) {\n return module.default;\n } // If it is a CommonJS module which exports a function, return that\n // e.g.\n //\n // ```\n // function Component() { ... }\n // module.exports = Component;\n // ```\n //\n\n\n if (!module.__esModule && typeof module === 'function') {\n return module;\n } // If the module exports just one named export, return that\n // e.g.\n //\n // ```\n // export function Component() { ... }\n // ```\n //\n\n\n var namedExports = Object.keys(module);\n\n if (namedExports.length === 1) {\n return module[namedExports[0]];\n } // If the module exports a named export with the same name as the\n // understood Component identifier, return that\n // e.g.\n //\n // ```\n // // /component.js\n // export function someUtil() { ... }\n // export Component() { ... } // if identifier is Component, return this named export\n // ```\n //\n // Else return the module itself\n //\n\n\n return (name ? module[name] : undefined) || module;\n}", "function module_get_exports(mod){\n return module_walk_deps(mod, [], function(dep, ctx){\n ctx.push(module_exec(dep));\n });\n}", "function loadModule(moduleName) {\n var module = modules[moduleName];\n\n if (module !== undefined) {\n return module;\n }\n\n // This uses a switch for static require analysis\n switch (moduleName) {\n case 'charset':\n module = __webpack_require__(360);\n break;\n case 'encoding':\n module = __webpack_require__(361);\n break;\n case 'language':\n module = __webpack_require__(362);\n break;\n case 'mediaType':\n module = __webpack_require__(363);\n break;\n default:\n throw new Error('Cannot find module \\'' + moduleName + '\\'');\n }\n\n // Store to prevent invoking require()\n modules[moduleName] = module;\n\n return module;\n}", "function loadModuleForTile(tileName) {\n\n if (NS[tileName]) { // module containing the tile has already been loaded\n return Future.promise().fulfill();\n }\n\n var module = Modules.getModuleForTile(tileName);\n if (module !== null) {\n logging.debug(\"going to load module \" + module + \" for tile \" + tileName);\n return Modules.load(module);\n } else {\n logging.debug(\"cannot find module for tile \" + tileName);\n return Future.promise().fail(\"Can't find module for tile \" + tileName);\n }\n }", "async function find(){\n return \"strapi\"\n}", "getModuleName(modulePath) {\n if (typeof modulePath !== 'string') {\n return undefined;\n }\n const parts = modulePath.split(/\\\\|\\//);\n //get folder name\n const moduleName = parts.pop();\n if (!moduleName) {\n return undefined;\n }\n //get the next folder name\n const maybeNamespaceFolderName = parts.pop();\n if (maybeNamespaceFolderName === null || maybeNamespaceFolderName === void 0 ? void 0 : maybeNamespaceFolderName.startsWith('@')) {\n return maybeNamespaceFolderName + '/' + moduleName;\n }\n else {\n return moduleName;\n }\n }", "function searchCache(moduleName, callback) {\n // Resolve the module identified by the specified name\n let mod = require.resolve(moduleName);\n\n // Check if the module has been resolved and found within\n // the cache\n if (mod && ((mod = require.cache[mod]) !== undefined)) {\n // Recursively go over the results\n (function traverse(mod) {\n // Go over each of the module's children and\n // traverse them\n mod.children.forEach(function (child) {\n traverse(child);\n });\n\n // Call the specified callback providing the\n // found cached module\n callback(mod);\n }(mod));\n }\n}", "function getModule(name) {\n var exports;\n var entry = defined[name];\n\n if (!entry) {\n exports = load(name);\n if (!exports)\n throw new Error(\"Unable to load dependency \" + name + \".\");\n }\n\n else {\n if (entry.declarative)\n ensureEvaluated(name, []);\n\n else if (!entry.evaluated)\n linkDynamicModule(entry);\n\n exports = entry.module.exports;\n }\n\n if ((!entry || entry.declarative) && exports && exports.__useDefault)\n return exports['default'];\n\n return exports;\n }", "function getModule(name) {\n var exports;\n var entry = defined[name];\n\n if (!entry) {\n exports = load(name);\n if (!exports)\n throw new Error(\"Unable to load dependency \" + name + \".\");\n }\n\n else {\n if (entry.declarative)\n ensureEvaluated(name, []);\n\n else if (!entry.evaluated)\n linkDynamicModule(entry);\n\n exports = entry.module.exports;\n }\n\n if ((!entry || entry.declarative) && exports && exports.__useDefault)\n return exports['default'];\n\n return exports;\n }", "function getModule(name) {\n var exports;\n var entry = defined[name];\n\n if (!entry) {\n exports = load(name);\n if (!exports)\n throw new Error(\"Unable to load dependency \" + name + \".\");\n }\n\n else {\n if (entry.declarative)\n ensureEvaluated(name, []);\n\n else if (!entry.evaluated)\n linkDynamicModule(entry);\n\n exports = entry.module.exports;\n }\n\n if ((!entry || entry.declarative) && exports && exports.__useDefault)\n return exports['default'];\n\n return exports;\n }", "function getModule(name) {\n var exports;\n var entry = defined[name];\n\n if (!entry) {\n exports = load(name);\n if (!exports)\n throw new Error(\"Unable to load dependency \" + name + \".\");\n }\n\n else {\n if (entry.declarative)\n ensureEvaluated(name, []);\n\n else if (!entry.evaluated)\n linkDynamicModule(entry);\n\n exports = entry.module.exports;\n }\n\n if ((!entry || entry.declarative) && exports && exports.__useDefault)\n return exports['default'];\n\n return exports;\n }", "function getModule(name) {\n var exports;\n var entry = defined[name];\n\n if (!entry) {\n exports = load(name);\n if (!exports)\n throw new Error(\"Unable to load dependency \" + name + \".\");\n }\n\n else {\n if (entry.declarative)\n ensureEvaluated(name, []);\n\n else if (!entry.evaluated)\n linkDynamicModule(entry);\n\n exports = entry.module.exports;\n }\n\n if ((!entry || entry.declarative) && exports && exports.__useDefault)\n return exports['default'];\n\n return exports;\n }", "function getModule(name) {\n var exports;\n var entry = defined[name];\n\n if (!entry) {\n exports = load(name);\n if (!exports)\n throw new Error(\"Unable to load dependency \" + name + \".\");\n }\n\n else {\n if (entry.declarative)\n ensureEvaluated(name, []);\n\n else if (!entry.evaluated)\n linkDynamicModule(entry);\n\n exports = entry.module.exports;\n }\n\n if ((!entry || entry.declarative) && exports && exports.__useDefault)\n return exports['default'];\n\n return exports;\n }", "function getModule(name) {\n var exports;\n var entry = defined[name];\n\n if (!entry) {\n exports = load(name);\n if (!exports)\n throw new Error(\"Unable to load dependency \" + name + \".\");\n }\n\n else {\n if (entry.declarative)\n ensureEvaluated(name, []);\n\n else if (!entry.evaluated)\n linkDynamicModule(entry);\n\n exports = entry.module.exports;\n }\n\n if ((!entry || entry.declarative) && exports && exports.__useDefault)\n return exports['default'];\n\n return exports;\n }", "function getModule(name) {\n var exports;\n var entry = defined[name];\n\n if (!entry) {\n exports = load(name);\n if (!exports)\n throw new Error(\"Unable to load dependency \" + name + \".\");\n }\n\n else {\n if (entry.declarative)\n ensureEvaluated(name, []);\n\n else if (!entry.evaluated)\n linkDynamicModule(entry);\n\n exports = entry.module.exports;\n }\n\n if ((!entry || entry.declarative) && exports && exports.__useDefault)\n return exports['default'];\n\n return exports;\n }", "function getModule(name) {\n var exports;\n var entry = defined[name];\n\n if (!entry) {\n exports = load(name);\n if (!exports)\n throw new Error(\"Unable to load dependency \" + name + \".\");\n }\n\n else {\n if (entry.declarative)\n ensureEvaluated(name, []);\n\n else if (!entry.evaluated)\n linkDynamicModule(entry);\n\n exports = entry.module.exports;\n }\n\n if ((!entry || entry.declarative) && exports && exports.__useDefault)\n return exports['default'];\n\n return exports;\n }", "function getModule(name) {\n var exports;\n var entry = defined[name];\n\n if (!entry) {\n exports = load(name);\n if (!exports)\n throw new Error(\"Unable to load dependency \" + name + \".\");\n }\n\n else {\n if (entry.declarative)\n ensureEvaluated(name, []);\n\n else if (!entry.evaluated)\n linkDynamicModule(entry);\n\n exports = entry.module.exports;\n }\n\n if ((!entry || entry.declarative) && exports && exports.__useDefault)\n return exports['default'];\n\n return exports;\n }", "function getModule(name) {\n var exports;\n var entry = defined[name];\n\n if (!entry) {\n exports = load(name);\n if (!exports)\n throw new Error(\"Unable to load dependency \" + name + \".\");\n }\n\n else {\n if (entry.declarative)\n ensureEvaluated(name, []);\n\n else if (!entry.evaluated)\n linkDynamicModule(entry);\n\n exports = entry.module.exports;\n }\n\n if ((!entry || entry.declarative) && exports && exports.__useDefault)\n return exports['default'];\n\n return exports;\n }", "getModuleId(moduleType) {\n return undefined;\n }", "getModuleId(moduleType) {\n return undefined;\n }", "getModuleId(moduleType) {\n return undefined;\n }", "getModuleId(moduleType) {\n return undefined;\n }", "getModuleId(moduleType) {\n return undefined;\n }", "getModuleId(moduleType) {\n return undefined;\n }", "function loadModule( modulename ) {\n\tvar module = loadBuildIn( modulename );\n\tif( module == undefined ) {\n\t\tmodule = loadComponentModule( modulename );\n\t}\n\n\treturn module;\n}", "function NSGetModule(compMgr, fileSpec) {\n return XPCOMUtils.generateModule(components);\n}", "function loadModule(moduleName) {\n var module = modules[moduleName];\n\n if (module !== undefined) {\n return module;\n }\n\n // This uses a switch for static require analysis\n switch (moduleName) {\n case 'charset':\n module = __webpack_require__(317);\n break;\n case 'encoding':\n module = __webpack_require__(318);\n break;\n case 'language':\n module = __webpack_require__(319);\n break;\n case 'mediaType':\n module = __webpack_require__(320);\n break;\n default:\n throw new Error('Cannot find module \\'' + moduleName + '\\'');\n }\n\n // Store to prevent invoking require()\n modules[moduleName] = module;\n\n return module;\n}", "function getGadget(moduleName, offset) {\n return add2(window.ECore.moduleBaseAddresses[moduleName], offset);\n}", "function loadModule(moduleName) {\n var module = modules[moduleName];\n\n if (module !== undefined) {\n return module;\n } // This uses a switch for static require analysis\n\n\n switch (moduleName) {\n case 'charset':\n module = __webpack_require__(/*! ./lib/charset */ \"./node_modules/negotiator/lib/charset.js\");\n break;\n\n case 'encoding':\n module = __webpack_require__(/*! ./lib/encoding */ \"./node_modules/negotiator/lib/encoding.js\");\n break;\n\n case 'language':\n module = __webpack_require__(/*! ./lib/language */ \"./node_modules/negotiator/lib/language.js\");\n break;\n\n case 'mediaType':\n module = __webpack_require__(/*! ./lib/mediaType */ \"./node_modules/negotiator/lib/mediaType.js\");\n break;\n\n default:\n throw new Error('Cannot find module \\'' + moduleName + '\\'');\n } // Store to prevent invoking require()\n\n\n modules[moduleName] = module;\n return module;\n}", "function getUserInfo(name) {\n console.log();\n const url = `https://api.github.com/users/${name}/repos`;\n //fetch api GET calls github api\n fetch(url)\n .then( response => {\n //check for errors before returning response.json \n if (response.ok) {\n return response.json() ;\n }\n //send eror status text to .catch\n throw new Error(response.statusText) ;\n })\n //do something \n .then(responseJson => displayResults(responseJson))\n .catch( err => {$( '#js-error-message' ).text(`something went wrong: ${err.message}`);\n });\n}", "function getTutorialsOfModule(req, res) {\n\t// Get projectID from query parameters to fetch only project's tutorials\n\t// Create query to get tutorials by projectID\n\tconst tutorialModuleID = req.params.moduleID;\n\tconst query = Tutorial.find({tutorialModuleID});\n\n\t// Execute query and return all modules that have the same projectID\n\tquery.exec((err, tutorials) => {\n\t\tif (err) {\n\t\t\tres.status(400).json({message: `Following error was encountered: ${err}`});\n\t\t} else if (!tutorials) {\n\t\t\tres.status(404).send('No tutorials found.');\n\t\t} else {\n\t\t\tres.status(200).json(tutorials);\n\t\t}\n\t});\n}", "static describe (module) {\n\t\tconst description = GetRequest.describe(module);\n\t\tdescription.access = 'User must be a member of the company';\n\t\treturn description;\n\t}", "function getinformationUser(user) {\n return fetch(`https://api.github.com/users/${user}`)\n .then((data)=> data.json())\n .then(data => {\n console.log(data);\n return data\n } );\n}", "static getResolvedModule(sourceFile, moduleNameText) {\n // Compiler internal:\n // https://github.com/microsoft/TypeScript/blob/v3.2.2/src/compiler/utilities.ts#L218\n return ts.getResolvedModule(sourceFile, moduleNameText);\n }", "function executeModule(modName,modRoot) {\n\tvar name = modRoot ? resolveModuleName(modRoot,modName) : modName,\n\t\trequire = function(modRequire) {\n\t\t\treturn executeModule(modRequire,name);\n\t\t},\n\t\texports = {},\n\t\tmodule = modules[name];\n\tif(!module) {\n\t\tthrow new Error(\"Cannot find module named '\" + modName + \"' required by module '\" + modRoot + \"', resolved to \" + name);\n\t}\n\tif(module.exports) {\n\t\treturn module.exports;\n\t} else {\n\t\tmodule.exports = {};\n\t\tmodule.module(require,module.exports,module);\n\t\treturn module.exports;\n\t}\n}", "function loadModule(moduleName) {\n var module = modules[moduleName];\n\n if (module !== undefined) {\n return module;\n }\n\n // This uses a switch for static require analysis\n switch (moduleName) {\n case 'charset':\n module = __webpack_require__(/*! ./lib/charset */ \"./node_modules/negotiator/lib/charset.js\");\n break;\n case 'encoding':\n module = __webpack_require__(/*! ./lib/encoding */ \"./node_modules/negotiator/lib/encoding.js\");\n break;\n case 'language':\n module = __webpack_require__(/*! ./lib/language */ \"./node_modules/negotiator/lib/language.js\");\n break;\n case 'mediaType':\n module = __webpack_require__(/*! ./lib/mediaType */ \"./node_modules/negotiator/lib/mediaType.js\");\n break;\n default:\n throw new Error('Cannot find module \\'' + moduleName + '\\'');\n }\n\n // Store to prevent invoking require()\n modules[moduleName] = module;\n\n return module;\n}", "function loadModule(moduleName) {\n var module = modules[moduleName];\n\n if (module !== undefined) {\n return module;\n }\n\n // This uses a switch for static require analysis\n switch (moduleName) {\n case 'charset':\n module = __webpack_require__(/*! ./lib/charset */ \"./node_modules/negotiator/lib/charset.js\");\n break;\n case 'encoding':\n module = __webpack_require__(/*! ./lib/encoding */ \"./node_modules/negotiator/lib/encoding.js\");\n break;\n case 'language':\n module = __webpack_require__(/*! ./lib/language */ \"./node_modules/negotiator/lib/language.js\");\n break;\n case 'mediaType':\n module = __webpack_require__(/*! ./lib/mediaType */ \"./node_modules/negotiator/lib/mediaType.js\");\n break;\n default:\n throw new Error('Cannot find module \\'' + moduleName + '\\'');\n }\n\n // Store to prevent invoking require()\n modules[moduleName] = module;\n\n return module;\n}", "function loadModule(moduleName) {\n var module = modules[moduleName];\n\n if (module !== undefined) {\n return module;\n }\n\n // This uses a switch for static require analysis\n switch (moduleName) {\n case 'charset':\n module = __webpack_require__(/*! ./lib/charset */ \"./node_modules/negotiator/lib/charset.js\");\n break;\n case 'encoding':\n module = __webpack_require__(/*! ./lib/encoding */ \"./node_modules/negotiator/lib/encoding.js\");\n break;\n case 'language':\n module = __webpack_require__(/*! ./lib/language */ \"./node_modules/negotiator/lib/language.js\");\n break;\n case 'mediaType':\n module = __webpack_require__(/*! ./lib/mediaType */ \"./node_modules/negotiator/lib/mediaType.js\");\n break;\n default:\n throw new Error('Cannot find module \\'' + moduleName + '\\'');\n }\n\n // Store to prevent invoking require()\n modules[moduleName] = module;\n\n return module;\n}", "function loadModule(moduleName) {\n var module = modules[moduleName];\n\n if (module !== undefined) {\n return module;\n }\n\n // This uses a switch for static require analysis\n switch (moduleName) {\n case 'charset':\n module = __webpack_require__(/*! ./lib/charset */ \"./node_modules/negotiator/lib/charset.js\");\n break;\n case 'encoding':\n module = __webpack_require__(/*! ./lib/encoding */ \"./node_modules/negotiator/lib/encoding.js\");\n break;\n case 'language':\n module = __webpack_require__(/*! ./lib/language */ \"./node_modules/negotiator/lib/language.js\");\n break;\n case 'mediaType':\n module = __webpack_require__(/*! ./lib/mediaType */ \"./node_modules/negotiator/lib/mediaType.js\");\n break;\n default:\n throw new Error('Cannot find module \\'' + moduleName + '\\'');\n }\n\n // Store to prevent invoking require()\n modules[moduleName] = module;\n\n return module;\n}", "function fetch (moduleName, revisionHash, cb) {\n var currentRev = getRevision(moduleName) || '',\n method = currentRev ? 'apply' : 'add',\n callbackId = ++callbackCount,\n callbackName = CALLBACK_PREFIX + callbackId,\n path = ENDPOINT + '?',\n script = document.createElement('script'),\n callback;\n\n window[callbackName] = function (moduleName, revisionHash, moduleSrc) {\n dynoSrc[method](moduleName, revisionHash, moduleSrc, false);\n\n if (cb) {\n cb(getItem(LOCAL_STORAGE_PREFIX + moduleName), moduleSrc);\n }\n };\n\n path += 'id=' + moduleName +\n '&from=' + currentRev +\n '&to=' + revisionHash +\n '&fmt=js' +\n '&callback=' + callbackName;\n\n document.head.appendChild(script);\n script.src = path;\n\n return script;\n}", "function NSGetModule(comMgr, fileSpec)\n{\n return myAppHandlerModule;\n}", "function _loadQuestionModule(moduleName) {\n _soundEffect('laser', 'loop');\n\n return _buildModule(moduleName)\n .then(function() {\n _shouldStartLoading(false);\n window.location.href = window.location.origin + window.location.pathname + '#/slide-ready';\n _soundEffect('laser', 'stop');\n })\n .fail(function() {\n _shouldStartLoading(false);\n window.location.href = window.location.origin + window.location.pathname + '#slide-index';\n console.warn('Fail loading question module <' + moduleName + '> , please try another one');\n _buildModule(moduleName, 'local');\n _soundEffect('laser', 'stop');\n });\n }", "function _loadQuestionModule(moduleName) {\n _soundEffect('laser', 'loop');\n\n return _buildModule(moduleName)\n .then(function() {\n _shouldStartLoading(false);\n window.location.href = window.location.origin + window.location.pathname + '#/slide-ready';\n _soundEffect('laser', 'stop');\n })\n .fail(function() {\n _shouldStartLoading(false);\n window.location.href = window.location.origin + window.location.pathname + '#slide-index';\n console.warn('Fail loading question module <' + moduleName + '> , please try another one');\n _buildModule(moduleName, 'local');\n _soundEffect('laser', 'stop');\n });\n }", "function repoGetJson(req, res, template, block, next) {\n\n var Repo = calipso.db.model('Repo');\n var type = req.moduleParams.type || \"module\";\n var name = req.moduleParams.name || \"\";\n var version = req.moduleParams.version || \"master\";\n\n // TODO - Add pager\n Repo.find({type:type, name:name})\n .sort('name')\n .limit(10)\n .find(function(err,all) {\n var op = all.map(function(a) {\n return {name:a.name,\n description:a.description,\n versions:a.versions.map(function(b){\n return {version:b.version,url:b.url}\n })\n };\n });\n res.end(JSON.stringify(op),'UTF-8');\n });\n\n}", "function searchCache(moduleName, callback) {\n // Resolve the module identified by the specified name\n var mod = require.resolve(path.join(process.cwd(), moduleName));\n\n // Check if the module has been resolved and found within\n // the cache\n if (mod && ((mod = require.cache[mod]) !== undefined)) {\n // Recursively go over the results\n (function traverse(mod) {\n // Go over each of the module's children and\n // traverse them\n mod.children.forEach(function (child) {\n traverse(child);\n });\n\n // Call the specified callback providing the\n // found cached module\n callback(mod);\n }(mod));\n }\n}", "function findDuplicateDoc(moduleName, moduleDoc){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n\n //get the fields of the specific module\n service.getModuleByName(moduleName).then(function(aModule){\n //initialize array & object for querying\n var uniqueFields = [];\n var tempObj;\n\n //push the value of the document when a field is unique\n aModule.fields.forEach(function(field){\n if(field.unique){\n tempObj = {};\n tempObj[field.name] = moduleDoc[field.name];\n uniqueFields.push(tempObj);\n }\n });\n\n if(uniqueFields.length == 0){\n deferred.resolve();\n }\n else{\n //use $or for checking each field for uniqueness, not their combination\n db[moduleName].findOne({$or: uniqueFields}, function(err, duplicateDoc){\n if(err){\n deferred.reject(err);\n }\n //a duplicate exists, but needs further checking\n else if(duplicateDoc){\n //updating a module document\n if(moduleDoc._id){\n //different module documents with similar unique values\n if(moduleDoc._id != duplicateDoc._id){\n deferred.reject(exists);\n }\n //since it is the same document, it is not duplicate\n else{\n deferred.resolve();\n }\n }\n //adding new module documennt\n else{\n deferred.reject(exists);\n }\n }\n //does not exist\n else{\n deferred.resolve();\n }\n });\n }\n\n \n }).catch(function(err){\n deferred.reject(err);\n });\n\n return deferred.promise;\n}", "async function exploreModules(auth) {\n const mapping = readModuleMapping();\n const modulesInfo = await queryModulesAPI(auth);\n // Filter out modules that haven't been mapped in MODULES.txt\n const filteredModulesInfo = modulesInfo.filter(moduleInfo => {\n return Object.keys(mapping).includes(moduleInfo['name']);\n });\n // Map module codes according to user-defined module mappings\n const modules = filteredModulesInfo.map(moduleInfo => {\n return new Module(moduleInfo['id'], mapping[moduleInfo['name']], moduleInfo['courseName']);\n });\n\n // Recursively explore its children for folders\n const promises = modules.map(module => {\n return new Promise(async (resolve, reject) => {\n if (PRINT) console.log('Exploring ' + module.code + ': ' + module.name + ' ...');\n const folders = await exploreFolders(auth, module.id);\n module.populateFolders(folders);\n resolve();\n });\n });\n await Promise.all(promises);\n if (PRINT) console.log();\n\n return modules;\n}", "function getUser(username) {\n const queryUrl = \"https://api.github.com/users/\"+{username}+\"/repos?per_page=100\";\n\n axios.get(queryUrl).then(function(res) {\n const repo = res.data;\n console.log(repo)\n });\n }", "find_modules(flow){\n let modules = {}\n\n let nodes = flow.flow.nodes;\n\n for(var i = 0; i < nodes.length; i++){ \n modules[nodes[i].module_name] = this.modules[nodes[i].module_name]\n }\n \n let retArr = []\n for(var k in modules){\n modules[k].uuid = uuid.v4()\n retArr.push(modules[k])\n }\n return retArr\n }" ]
[ "0.7550319", "0.64568645", "0.6341758", "0.61982876", "0.6101905", "0.5989672", "0.59674895", "0.5937421", "0.5917052", "0.5729546", "0.56361324", "0.5632423", "0.5617168", "0.5553284", "0.55260795", "0.55196166", "0.5515729", "0.5500644", "0.54888695", "0.548056", "0.5458297", "0.5439356", "0.5439356", "0.54375446", "0.54367054", "0.54116267", "0.54109603", "0.5358582", "0.5352046", "0.5322723", "0.53006405", "0.5297673", "0.5291261", "0.5286952", "0.5280632", "0.5276186", "0.52707165", "0.52707165", "0.5268198", "0.5249323", "0.5246256", "0.5238236", "0.5231037", "0.5229486", "0.5223217", "0.52229375", "0.52221096", "0.5214037", "0.52108145", "0.5201339", "0.5200616", "0.5197396", "0.5193436", "0.51838887", "0.5179314", "0.5178504", "0.51709443", "0.51679343", "0.5167553", "0.5167553", "0.5167553", "0.5167553", "0.5167553", "0.5167553", "0.5167553", "0.5167553", "0.5167553", "0.5167553", "0.5167553", "0.5164598", "0.5164598", "0.5164598", "0.5164598", "0.5164598", "0.5164598", "0.515821", "0.51515776", "0.51451194", "0.5125466", "0.5124415", "0.51147044", "0.5114466", "0.51111376", "0.51105905", "0.51074904", "0.5103338", "0.51014805", "0.51014805", "0.51014805", "0.51014805", "0.5082859", "0.50823927", "0.5065189", "0.5065189", "0.5052253", "0.50507414", "0.50441307", "0.5042513", "0.5042225", "0.50403214" ]
0.7540487
1
Function name: add document Author: Reccion, Jeremy Date Modified: 2018/04/24 Description: add a document in a specific collection Parameter(s): moduleName: string type newDoc: object type. //fields must be the specific module's 'fields' in 'modules' collection Return: Promise
function addModuleDoc(moduleName, newDoc){ var deferred = Q.defer(); moduleName = moduleName.toLowerCase(); service.findDuplicateDoc(moduleName, newDoc).then(function(){ db.bind(moduleName); db[moduleName].insert(newDoc, function(err){ if(err){ deferred.reject(err); } else{ deferred.resolve(); } }); }).catch(function(err){ deferred.reject(err); }); return deferred.promise; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addModuleDoc(moduleName, newDoc){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n\n db.bind(moduleName);\n\n db[moduleName].insert(newDoc, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n deferred.resolve();\n }\n });\n\n return deferred.promise;\n}", "function addModule(newModule){\n //imitate angular promise. start by initializing this\n var deferred = Q.defer();\n\n newModule.name = newModule.name.toLowerCase();\n\n //check if there is an existing module\n db.modules.findOne({name: newModule.name}, function(err, aModule){\n if(err){\n deferred.reject(err);\n }\n //already exists\n else if(aModule){\n deferred.reject(exists);\n }\n else{\n //unique, so proceed\n //create table first before adding a new document to 'modules' collection (not necessary?)\n db.createCollection(newModule.name, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n //initialize fields property as empty array if there are none in the input\n if(newModule.fields == undefined){\n newModule.fields = [];\n }\n\n db.modules.insert(newModule, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n deferred.resolve();\n }\n });\n }\n });\n }\n \n });\n \n //return the promise along with either resolve or reject\n return deferred.promise;\n}", "function addModule(newModule){\n //imitate angular promise. start by initializing this\n var deferred = Q.defer();\n\n newModule.name = newModule.name.toLowerCase();\n\n //check if there is an existing module\n db.modules.findOne({name: newModule.name}, function(err, aModule){\n if(err){\n deferred.reject(err);\n }\n //already exists\n else if(aModule){\n deferred.reject(exists);\n }\n else{\n //unique, so proceed\n //create table first before adding a new document to 'modules' collection (not necessary?)\n db.createCollection(newModule.name, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n //initialize fields property as empty array if there are none in the input\n if(newModule.fields == undefined){\n newModule.fields = [];\n }\n\n db.modules.insert(newModule, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n deferred.resolve();\n }\n });\n }\n });\n }\n \n });\n \n //return the promise along with either resolve or reject\n return deferred.promise;\n}", "function addModuleField(moduleName, fieldObject){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n\n //create a new objectID to used as query for updates and delete\n fieldObject.id = new ObjectID();\n\n db.modules.update({name: moduleName}, {$push: {fields: fieldObject}}, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n deferred.resolve();\n }\n });\n\n return deferred.promise;\n}", "function updateModuleDoc(moduleName, updateDoc){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n\n db.bind(moduleName);\n\n //create another object and copy. then delete the '_id' property of the new copy\n var forUpdate = {};\n Object.assign(forUpdate, updateDoc);\n delete forUpdate._id;\n\n db[moduleName].update({_id: mongo.helper.toObjectID(updateDoc._id)}, {$set: forUpdate}, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n deferred.resolve();\n }\n });\n\n return deferred.promise;\n}", "function addModuleField(moduleName, fieldObject){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n\n //create a new objectID to used as query for updates and delete\n fieldObject.id = new ObjectID();\n\n //the query searches for the module name that do not have the inputted field name\n //this is to avoid pushing same field names on the 'fields' array of the specified module\n //writeResult will determine if the update was successful or not (i.e. writeResult.result.nModified)\n db.modules.update({name: moduleName, fields: {$not: {$elemMatch: {name: fieldObject.name}}}}, {$push: {fields: fieldObject}}, function(err, writeResult){\n if(err){\n deferred.reject(err);\n }\n else{\n //console.log(writeResult.result);\n //check the status of the update, if it failed, it means that there is an existing field name\n if(writeResult.result.nModified == 0){\n deferred.reject(exists);\n }\n else{\n deferred.resolve();\n }\n }\n });\n\n return deferred.promise;\n}", "function updateModuleDoc(moduleName, updateDoc){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n\n service.findDuplicateDoc(moduleName, updateDoc).then(function(){\n db.bind(moduleName);\n \n //convert '_id' to ObjectID\n updateDoc._id = new ObjectID(updateDoc._id);\n \n db[moduleName].update({_id: updateDoc._id}, {$set: updateDoc}, function(err, writeResult){\n if(err){\n deferred.reject(err);\n }\n else{\n if(writeResult.result.nModified == 0){\n deferred.reject(notFound);\n }\n else{\n deferred.resolve();\n }\n }\n });\n }).catch(function(err){\n deferred.reject(err);\n });\n\n return deferred.promise;\n}", "function findDuplicateDoc(moduleName, moduleDoc){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n\n //get the fields of the specific module\n service.getModuleByName(moduleName).then(function(aModule){\n //initialize array & object for querying\n var uniqueFields = [];\n var tempObj;\n\n //push the value of the document when a field is unique\n aModule.fields.forEach(function(field){\n if(field.unique){\n tempObj = {};\n tempObj[field.name] = moduleDoc[field.name];\n uniqueFields.push(tempObj);\n }\n });\n\n if(uniqueFields.length == 0){\n deferred.resolve();\n }\n else{\n //use $or for checking each field for uniqueness, not their combination\n db[moduleName].findOne({$or: uniqueFields}, function(err, duplicateDoc){\n if(err){\n deferred.reject(err);\n }\n //a duplicate exists, but needs further checking\n else if(duplicateDoc){\n //updating a module document\n if(moduleDoc._id){\n //different module documents with similar unique values\n if(moduleDoc._id != duplicateDoc._id){\n deferred.reject(exists);\n }\n //since it is the same document, it is not duplicate\n else{\n deferred.resolve();\n }\n }\n //adding new module documennt\n else{\n deferred.reject(exists);\n }\n }\n //does not exist\n else{\n deferred.resolve();\n }\n });\n }\n\n \n }).catch(function(err){\n deferred.reject(err);\n });\n\n return deferred.promise;\n}", "function findDuplicateDoc(moduleName, moduleDoc){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n\n //get the fields of the specific module\n service.getModuleByName(moduleName).then(function(aModule){\n //initialize array & object for querying\n var uniqueValues = [];\n var tempObj;\n\n //push the value of the document when a field is unique\n aModule.fields.forEach(function(field){\n if(field.unique){\n tempObj = {};\n tempObj[field.name] = moduleDoc[field.name];\n uniqueValues.push(tempObj);\n }\n });\n\n if(uniqueValues.length == 0){\n deferred.resolve();\n }\n else{\n db.bind(moduleName);\n\n //use $or for checking each field for uniqueness, not their combination\n db[moduleName].findOne({$or: uniqueValues}, function(err, duplicateDoc){\n if(err){\n deferred.reject(err);\n }\n //a duplicate exists, but needs further checking\n else if(duplicateDoc){\n //updating a module document\n if(moduleDoc._id){\n //different module documents with similar unique values\n if(moduleDoc._id != duplicateDoc._id){\n deferred.reject(exists);\n }\n //since it is the same document, it is not duplicate\n else{\n deferred.resolve();\n }\n }\n //adding new module documennt\n else{\n deferred.reject(exists);\n }\n }\n //does not exist - similar to notFound. but it is not rejected based on design\n else{\n deferred.resolve();\n }\n });\n }\n }).catch(function(err){\n deferred.reject(err);\n });\n\n return deferred.promise;\n}", "async addDocument(_, { input: { doc, owner } }, { generalInfo }) {\n const document = { doc }\n const { insertedId } = await generalInfo.insertOne(document)\n document._id = insertedId\n\n return document\n }", "function doc(moduleName) {\n exports.modules.push(moduleName);\n}", "async add(collection, document) {\n console.log(\"adding collection\")\n console.log(collection) \n try {\n const docRef = await this.api\n .collection(collection)\n .add(document);\n return docRef.id;\n }\n catch (error) {\n return 'Error adding document: ' + error;\n }\n }", "function createDocument(req, res, next) {\n const Token = _getToken(req, res)\n Token\n .then((token) => {\n const params = {\n method: 'set_entry',\n custom: false,\n rest_data: {\n session: token,\n modulo: 'Documents',\n data: [\n {\n name: 'document_name',\n value: req.params.filename,\n },\n {\n name: 'revision',\n value: 1,\n },\n ],\n },\n }\n\n _requestCRM(params)\n .then((result)=>{\n res.end(result.id)\n })\n .catch((e) => {\n logger.error('Controller::DefensaConsumidor::createDocument::_RequestCRM::Catch')\n next(APIError({ status: 500, devMessage: e.message, }))\n })\n })\n}", "_createDocument(req, res, next) {\n const { documentId, change } = req.body\n this.engine.createDocument(documentId, change, function(err, version) {\n if (err) return next(err)\n res.json(version)\n })\n }", "function addDocument(collectionName, newDoc) {\n var collection = data[collectionName];\n var nextId = Object.keys(collection).length;\n if (newDoc.hasOwnProperty('_id')) {\n throw new Error(`You cannot add a document that already has an _id. addDocument is for new documents that do not have an ID yet.`);\n }\n while (collection[nextId]) {\n nextId++;\n }\n newDoc._id = nextId;\n writeDocument(collectionName, newDoc);\n return newDoc;\n}", "function addDocument(collectionName, newDoc) {\n var collection = data[collectionName];\n var nextId = Object.keys(collection).length;\n if (newDoc.hasOwnProperty('_id')) {\n throw new Error(`You cannot add a document that already has an _id. addDocument is for new documents that do not have an ID yet.`);\n }\n while (collection[nextId]) {\n nextId++;\n }\n newDoc._id = nextId;\n writeDocument(collectionName, newDoc);\n return newDoc;\n}", "function addDocument(collectionName, newDoc) {\n var collection = data[collectionName];\n var nextId = Object.keys(collection).length;\n if (newDoc.hasOwnProperty('_id')) {\n throw new Error(`You cannot add a document that already has an _id. addDocument is for new documents that do not have an ID yet.`);\n }\n while (collection[nextId]) {\n nextId++;\n }\n newDoc._id = nextId;\n writeDocument(collectionName, newDoc);\n return newDoc;\n}", "static async addANewDocument (document) {\n if (typeof document !== 'object') {\n throw new Error('Bad Parameter');\n }\n\n // Retrieve instance of Mongo\n const db = await Mongo.instance().getDb();\n const isValid = await Document.isDocument(document);\n if (isValid.valid) {\n // Create a new document\n return db.collection(Document.COLLECTION).insertOne({\n ...document,\n createdAt: moment().toDate(),\n updatedAt: moment().toDate()\n });\n } else {\n log.debug('Warning - couldn\\'t insert document \\n', document);\n return null;\n }\n }", "async function sendData() {\n let ref = doc(db, \"Student\", usn.value); //collection for two parameter , doc for 3 parameter\n const docref = await setDoc( //addDoc for two parametr ,setDoc for 3 parameter\n ref, {\n Name: name.value,\n Age: age.value,\n USN: usn.value\n }\n )\n .then(() => {\n alert(\"added data into db\");\n })\n .catch((err) => {\n alert(err);\n })\n}", "function updateModule(updateModule){\n var deferred = Q.defer();\n\n updateModule.name = updateModule.name.toLowerCase();\n\n //fields array should not be editable when using this function. therefore, delete it from input\n delete updateModule.fields;\n\n db.modules.find({$or: [\n {_id: mongo.helper.toObjectID(updateModule._id)},\n {name: updateModule.name}\n ]}).toArray(function(err, modules){\n if(err){\n deferred.reject(err);\n }\n else if(modules.length == 0){\n deferred.reject(notFound);\n }\n //vali inputs, no other document have the same name\n else if(modules.length == 1){\n var oldModule = modules[0];\n \n //rename if old & new names are different\n if(oldModule.name != updateModule.name){\n db.bind(oldModule.name);\n db[oldModule.name].rename(updateModule.name, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n update();\n }\n });\n }\n //go straight to update\n else{\n update();\n }\n }\n //another module document with the same name exists\n else{\n deferred.reject(exists);\n }\n }); \n\n //updates the document in the 'modules' collection\n function update(){\n\n //create another object and copy. then delete the '_id' property of the new copy\n var forUpdate = {};\n Object.assign(forUpdate, updateModule);\n delete forUpdate._id;\n \n db.modules.update({_id: mongo.helper.toObjectID(updateModule._id)}, {$set: forUpdate}, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n deferred.resolve();\n }\n });\n }\n\n return deferred.promise;\n}", "function updateModule(updateModule){\n var deferred = Q.defer();\n\n updateModule.name = updateModule.name.toLowerCase();\n\n //fields array should not be editable when using this function. therefore, delete it from input\n delete updateModule.fields;\n\n //check if the name of the selected module has not changed\n db.modules.findOne({_id: mongo.helper.toObjectID(updateModule._id)}, function(err, aModule){\n if(err){\n deferred.reject(err);\n }\n else if(aModule){\n //if names are different, renaming the collection must be executed, then proceed to update\n if(aModule.name != updateModule.name){\n db.bind(aModule.name);\n db[aModule.name].rename(updateModule.name, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n update();\n }\n });\n }\n }\n else{\n update();\n }\n });\n\n //updates the document in the 'modules' collection\n function update(){\n\n //create another object and copy. then delete the '_id' property of the new copy\n var forUpdate = {};\n Object.assign(forUpdate, updateModule);\n delete forUpdate._id;\n \n db.modules.update({_id: mongo.helper.toObjectID(updateModule._id)}, {$set: forUpdate}, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n deferred.resolve();\n }\n });\n }\n\n return deferred.promise;\n}", "add(doc){const idx=this.size();if(isString(doc)){this._addString(doc,idx);}else {this._addObject(doc,idx);}}", "function addModuleToPipeline(moduleID, moduleName){\n\n var module_name = ''\n var documentation = ''\n var moduleSourceCode_settings = ''\n var moduleSourceCode_main = ''\n var moduleSourceCode_html = ''\n\n $.ajax({\n type: \"POST\",\n cache: false,\n url: \"/get_module_details\",\n data: 'p_module_key=' + moduleName,\n success: function (option) {\n //alert(\"@ success\");\n module_name = option.module_name\n documentation = option.documentation\n moduleSourceCode_settings = option.moduleSourceCode_settings\n moduleSourceCode_main = option.moduleSourceCode_main\n moduleSourceCode_html = option.moduleSourceCode_html\n user_role = option.user_role\n\n user_role_based_edit = ''\n if (user_role == 'image_researcher') {\n user_role_based_edit = '| <a style=\"font-size:12px;color:#000000;\" href=\"#\" class=\"btn_edit_code\"> Edit </a> | <a style=\"font-size:12px;color:#000000;\" href=\"#\" > Contact Author </a>';\n }\n\n //Parse the givn XML for tool definition\n var xmlDoc = $.parseXML( moduleSourceCode_html );\n var $xml_tool_definition = $(xmlDoc);\n\n //the tool configuration.\n //TODO: add the input port info.\n var tool_configs = $xml_tool_definition.find(\"toolConfigurations\");\n tool_configs = tool_configs.html();\n\n\n\n var tool_documentation = $xml_tool_definition.find(\"toolDocumentation\");\n tool_documentation = tool_documentation.html();\n\n\n var ioInformation = '';\n\n var $toolInput = $xml_tool_definition.find(\"toolInput\");\n\n $toolInput.each(function(){\n\n var label = $(this).find('label').text(),\n dataFormat = $(this).find('dataFormat').text(),\n referenceVariable = $(this).find('referenceVariable').text();\n\n ioInformation += '<input type=\"text\" style=\"display:none;\" class=\"setting_param module_input '+ referenceVariable + '\" ' + ' size=\"45\"/>';\n\n\n });\n\n\n var $toolOutput = $xml_tool_definition.find(\"toolOutput\");\n\n $toolOutput.each(function(){\n\n var label = $(this).find('label').text(),\n dataFormat = $(this).find('dataFormat').text(),\n referenceVariable = $(this).find('referenceVariable').text();\n\n //var thisPortOutput = 'module_id_' + moduleID + '_' + referenceVariable+'.' + dataFormat;\n //var thisPortOutputPath = referenceVariable + '=\"' + thisPortOutput + '\"';\n\n ioInformation += '<input type=\"text\" style=\"display:none;\" class=\"setting_param module_output '+ referenceVariable + '\" size=\"45\"/>';\n\n\n });\n\n\n\n\n\n\n\n//Parse the givn XML\n//var xmlDoc = $.parseXML( xml );\n\n//var $xml = $(xmlDoc);\n\n // Find Person Tag\n//var $person = $xml.find(\"toolConfigurations\");\n\n\n //append new module to the pipeline...\n $(\"#img_processing_screen\").append(\n '<div style=\"background-color:#EEE;width:100%;display:none;\" class=\"module\" id=\"module_id_'+ moduleID +'\">' +\n\n '<!-- Documentation -->' +\n '<div style=\"margin:10px;font-size:17px;color:#000000;\">' +\n ' ' + module_name + ' (Module ' + moduleID + ')'+ '<hr/>' +\n ' Documentation: <a style=\"font-size:12px;color:#000000;\" href=\"#\" class=\"documentation_show_hide\">(Show/Hide)</a>' +\n '<div class=\"documentation\" style=\"background-color:#DDDDDD;display:none;font-size:14px;\">' + tool_documentation + '</div>' +\n '</div>' +\n\n\n '<!-- Settings -->' +\n '<div style=\"margin:10px;font-size:17px;color:#000000;\">' +\n ' Settings: <a style=\"font-size:12px;color:#000000;\" href=\"#\" class=\"settings_show_hide\">(Show/Hide)</a>' +\n ' <div class=\"settings\" style=\"background-color:#DDDDDD;font-size:14px;\">' + tool_configs + '<br/>' + ioInformation +\n '<input type=\"hidden\" class=\"setting_param \" size=\"45\" id=\"module_id_'+ moduleID +'_output_destination\"/>'+\n '</div>' +\n '</div>' +\n\n\n '<div style=\"margin:10px;font-size:17px;color:#000000;\" class=\"setting_section\">' +\n ' <a style=\"display:none;font-size:12px;color:#000000;\" href=\"#\" class=\"code_show_hide\">(Show/Hide)</a>' + user_role_based_edit +\n\n ' <div class=\"edit_code\" style=\"background-color:#888888;font-size:14px;display:none;\">' +\n ' <textarea rows=7 cols=150 class=\"code_settings\">' + moduleSourceCode_settings + '</textarea>' +\n ' <p style=\"color:#000000;\">Main Implementation: </p>' +\n ' <textarea rows=10 cols=150>' + moduleSourceCode_main + '</textarea>' +\n '</div>' +\n\n ' <pre style=\"background-color:#333333;width:100%;display:none;\" class=\"pre_highlighted_code\">' + '<code class=\"python highlighted_code\" style=\"display:none;\">' + moduleSourceCode_settings +\n ' ' +\n moduleSourceCode_main + '</code></pre>' +\n\n ' </div>' +\n\n '</div>'\n\n\n );//end of append\n\n\n\n\n\n\n\n\n $(\"#module_id_\"+ moduleID + \"_output_destination\").val(\"output_destination = '/home/ubuntu/Webpage/app_collaborative_sci_workflow/workflow_outputs/test_workflow/Module_\" + moduleID + \"'\").trigger('change');\n\n\n\n\n\n\n\n\n\n\n\n var listOfInputPorts = [];\n var listOfOutputPorts = [];\n\n\n\n //input port definition\n var $toolInput = $xml_tool_definition.find(\"toolInput\");\n\n $toolInput.each(function(){\n\n var label = $(this).find('label').text(),\n dataFormat = $(this).find('dataFormat').text(),\n referenceVariable = $(this).find('referenceVariable').text();\n\n //$(\"#ProfileList\" ).append('<li>' +label+ ' - ' +dataFormat+ ' - ' + idn +'</li>');\n\n var aNewInputPort = makePort(dataFormat,referenceVariable,true);\n listOfInputPorts.push(aNewInputPort);\n\n\n\n var thisPortInput = 'module_id_' + moduleID + '_NO_INPUT_SOURCE_SELECTED_.' + dataFormat;\n thisPortInput = referenceVariable + '=\"' + WORKFLOW_OUTPUTS_PATH + THIS_WORKFLOW_NAME + '/' +thisPortInput + '\"';\n\n $(\"#module_id_\"+moduleID + ' .' + referenceVariable).val(thisPortInput).trigger('change');\n\n });\n\n\n\n\n\n //output port definition\n var $toolOutput = $xml_tool_definition.find(\"toolOutput\");\n\n $toolOutput.each(function(){\n\n var label = $(this).find('label').text(),\n dataFormat = $(this).find('dataFormat').text(),\n referenceVariable = $(this).find('referenceVariable').text();\n\n //$(\"#ProfileList\" ).append('<li>' +label+ ' - ' +dataFormat+ ' - ' + idn +'</li>');\n\n var aNewOutputPort = makePort(dataFormat,referenceVariable,false);\n listOfOutputPorts.push(aNewOutputPort);\n\n\n var thisPortOutput = 'module_id_' + moduleID + '_' + referenceVariable+'.' + dataFormat;\n thisPortOutput = referenceVariable + '=\"' + WORKFLOW_OUTPUTS_PATH + THIS_WORKFLOW_NAME + '/' +thisPortOutput + '\"';\n\n $(\"#module_id_\"+moduleID + ' .' + referenceVariable).val(thisPortOutput).trigger('change');\n\n });\n\n\n\n\n\n makeTemplate(moduleName,\"images/55x55.png\", \"white\",\n listOfInputPorts,\n listOfOutputPorts);\n\n\n\n\n\n\n //Update the DAG\n //var newWorkflowModule = workflow.add(\"Module_\"+moduleID, \"Module_0\", workflow.traverseDF);\n //newWorkflowModule.nodeName = moduleName;\n //redrawWorkflowStructure();\n\n\n //alert(\"Add\");\n myDiagram.startTransaction(\"add node\");\n // have the Model add the node data\n var newnode = {\"key\":\"module_id_\" + moduleID, \"type\":moduleName, \"name\":moduleName, \"module_id\": \"Module \"+moduleID};\n myDiagram.model.addNodeData(newnode);\n // locate the node initially where the parent node is\n // diagram.findNodeForData(newnode).location = node.location;\n // and then add a link data connecting the original node with the new one\n //var newlink = { from: node.data.key, to: newnode.key };\n //diagram.model.addLinkData(newlink);\n // finish the transaction -- will automatically perform a layout\n myDiagram.commitTransaction(\"add node\");\n\n\n\n\n\n\n if(isItMyFloor() == false)lockParamsSettings();\n\n /*$('pre code').each(function (i, block) {\n hljs.highlightBlock(block);\n });*/\n\n\n },\n error: function (xhr, status, error) {\n alert(xhr.responseText);\n }\n\n });//end of ajax\n\n\n}", "async function createCollection(req, res) {\n\t\n\tlet data = req.body\n\n\tif (!data.projectId || !data.name) return res.status(400).send({ message: 'ERROR: projectId and name are required' })\n\n\ttry {\n\t\tlet newCollection = {\n\t\t\tid: generate(alphabet, 10),\n\t\t\tprojectId: data.projectId,\n\t\t\tname: data.name,\n\t\t\tmodel: data.model || []\n\t\t}\n\n\t\tconsole.log(newCollection)\n\n\t\t// let project = await Project.findOne({id: data.projectId})\n\t\t// project.collections.push(newCollection)\n\t\t// await project.update()\n\t\tlet collection = await Collection.create(newCollection)\n\n\t\treturn res.status(200).json(collection)\n\t}\n\tcatch(error) {\n\t\treturn res.status(500).send({ error: error.message })\n\t}\n}", "function createProject(user, project_fields) {\n return db\n .collection(\"projects\")\n .add(project_fields).then((new_project) => {\n const {appID, adminKey } = algoliaConfig;\n const client = algoliasearch(appID, adminKey);\n const index = client.initIndex('projects')\n const {title, description, createdBy, owner} = project_fields\n const objectID = new_project.id;\n \n // add project to owner's list\n db\n .doc(`users/${user.uid}`)\n .collection('projects').doc(new_project.id)\n .set({\n favorited: false,\n pinned: true,\n });\n\n // attach owner to project\n db\n .doc(`projects/${new_project.id}`)\n .collection('admins').doc(user.uid)\n .set({\n date_added: project_fields.date_created,\n is_owner: true,\n });\n\n // add projects to algolia\n console.log('saving project...');\n console.log('index:')\n console.log(index.saveObject)\n index.saveObject({title,\n objectID,\n title,\n description,\n createdBy,\n owner,\n id:objectID\n }).then(({objectID}) => console.log);\n });\n \n}", "function escribir(){\n db\n .collection(\"users\")\n .add({\n first: \"Pepe\",\n last: \"Perez\",\n born: 1815\n })\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}", "function addModuleToPipeline(moduleID, moduleName){\n\n var module_name = ''\n var documentation = ''\n var moduleSourceCode_settings = ''\n var moduleSourceCode_main = ''\n var moduleSourceCode_html = ''\n\n $.ajax({\n type: \"POST\",\n cache: false,\n url: \"/get_module_details\",\n data: 'p_module_key=' + moduleName,\n success: function (option) {\n\n module_name = option.module_name\n documentation = option.documentation\n moduleSourceCode_settings = option.moduleSourceCode_settings\n moduleSourceCode_main = option.moduleSourceCode_main\n moduleSourceCode_html = option.moduleSourceCode_html\n user_role = option.user_role\n\n user_role_based_edit = ''\n if (user_role == 'image_researcher') {\n user_role_based_edit = '| <a style=\"font-size:12px;color:#000000;\" href=\"#\" class=\"btn_edit_code\"> Edit </a> | <a style=\"font-size:12px;color:#000000;\" href=\"#\" > Contact Author </a>';\n }\n\n\n\n\n //append new module to the pipeline...\n $(\"#img_processing_screen\").append(\n '<div style=\"background-color:#EEE;width:100%\" class=\"module\" id=\"module_id_'+ moduleID +'\">' +\n\n '<!-- Documentation -->' +\n '<div style=\"margin:10px;font-size:17px;color:#000000;\">' +\n ' ' + module_name + '<hr/>' +\n ' Documentation: <a style=\"font-size:12px;color:#000000;\" href=\"#\" class=\"documentation_show_hide\">(Show/Hide)</a>' +\n '<div class=\"documentation\" style=\"background-color:#888888;display:none;font-size:14px;\">' + documentation + '</div>' +\n '</div>' +\n\n\n '<!-- Settings -->' +\n '<div style=\"margin:10px;font-size:17px;color:#000000;\">' +\n ' Settings: <a style=\"font-size:12px;color:#000000;\" href=\"#\" class=\"settings_show_hide\">(Show/Hide)</a>' +\n ' <div class=\"settings\" style=\"background-color:#888888;display:none;font-size:14px;\">' + moduleSourceCode_html + '</div>' +\n '</div>' +\n\n\n '<div style=\"margin:10px;font-size:17px;color:#000000;\" class=\"setting_section\">' +\n ' Source Code: <a style=\"font-size:12px;color:#000000;\" href=\"#\" class=\"code_show_hide\">(Show/Hide)</a>' + user_role_based_edit +\n\n ' <div class=\"edit_code\" style=\"background-color:#888888;display:none;font-size:14px;\">' +\n ' <textarea rows=7 cols=180 class=\"code_settings\">' + moduleSourceCode_settings + '</textarea>' +\n ' <p style=\"color:#000000;\">Main Implementation: </p>' +\n ' <textarea rows=10 cols=180>' + moduleSourceCode_main + '</textarea>' +\n '</div>' +\n\n ' <pre style=\"background-color:#333333;width:100%;\" class=\"pre_highlighted_code\">' + '<code class=\"python highlighted_code\" style=\"display:none;\">' + moduleSourceCode_settings +\n ' ' +\n moduleSourceCode_main + '</code></pre>' +\n\n ' </div>' +\n\n '</div>'\n\n\n );//end of append\n\n if(isItMyFloor() == false)lockParamsSettings();\n\n $('pre code').each(function (i, block) {\n hljs.highlightBlock(block);\n });\n\n\n },\n error: function (xhr, status, error) {\n alert(xhr.responseText);\n }\n\n });//end of ajax\n\n\n}", "function updateModuleField(moduleName, fieldObject){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n\n console.log(fieldObject);\n\n service.getModuleByName(moduleName).then(function(aModule){ \n //use array.filter() to get the duplicate fields\n var duplicateFields = aModule.fields.filter(function(field){\n //lesson learned: use toString() in id\n return field.id.toString() == fieldObject.id.toString() || field.name == fieldObject.name;\n });\n \n if(duplicateFields.length == 0){\n deferred.reject(notFound);\n }\n //valid inputs\n else if(duplicateFields.length == 1){\n //this is to ensure that the field is inside the specific module (in case of improper input parameters)\n\n fieldObject.id = new ObjectID(fieldObject.id);\n\n if(duplicateFields[0].id.toString() == fieldObject.id.toString()){\n db.modules.update({name: moduleName, fields: {$elemMatch: {id: fieldObject.id}}}, {$set: {'fields.$': fieldObject}}, function(err, writeResult){\n if(err){\n deferred.reject(err);\n }\n else{\n console.log(writeResult.result);\n deferred.resolve();\n }\n });\n }\n //the only element has the same name but is different id, therefore, not inside the module document\n else{\n deferred.reject(notFound);\n }\n }\n else{\n deferred.reject(exists);\n }\n }).catch(function(err){\n deferred.reject(err);\n });\n\n return deferred.promise;\n}", "function addDocument(collection, document, callback){\n\tMongoClient.connect(url, function(err, db){\n\t\tif (err) throw err\n\t\t\n\t\tdb.collection(collection).insert(document, function(err, result) \t\t\t\t{\n \t\t\tconsole.log(result)\n \t \tassert.equal(err, null);\n \t \tassert.equal(1, result.result.n);\n \t \tassert.equal(1, result.ops.length);\n \t \tdb.close()\n \t \tcallback(result);\n \t\t})\n\t})\n}", "addDocument(_id, _docType, _payload) {\n client.index({\n index: this.indexName,\n type: _docType,\n id: _id,\n body: _payload\n }, function (err, resp) {\n if (err) {\n console.log(err);\n }\n else {\n console.log(\"added or updated\", resp);\n }\n })\n }", "function addToDb(collectionName, document, callback)\r\n{ \r\n const collection = db.collection(collectionName); \r\n collection.insertOne(document,\r\n function(err){\r\n if(err) { \r\n console.log(\"failed to add a document to \" + collection + \" collection\");\r\n return callback(err);\r\n } \r\n return callback(null, document);\r\n }); \r\n}", "function addnewdoc() {\n currentuseruid = auth.currentUser.uid\n var newdoc1 = {\n title: 'A new doc by abca',\n desc: 'A new doc blah blah by abca',\n creator: currentuseruid\n }\n // console.log(newdoc1)\n // get the current user\n db.collection('new1').doc('newdoc2').set(newdoc1).then(d => {\n console.log('new doc added')\n });\n db.collection('new1').doc('newdoc2').set({ newfield: 'yes' }, { merge: true }).then(d => {\n console.log('new data merged into an existing doc')\n });\n }", "function Add_Doc_WithAutoID() {\n // Collection is the table or collection of\n cloudDB\n .collection(\"Students\")\n .add({\n // This is creating a new entry in the DB\n NameOfStd: nameV,\n RollNo: Number(rollV),\n Section: secV,\n Gender: genV,\n })\n .then(function (docRef) {\n console.log(\"Document writeen with ID\", docRef.id);\n })\n .catch(function (error) {\n console.eroor(\"Error adding document\", error);\n });\n}", "function _createDocument(token, doc) {\n return new Promise((resolve, reject) => {\n const params = {\n method: 'set_entry',\n custom: false,\n rest_data: {\n session: token,\n modulo: 'Documents',\n data: [\n {\n name: 'document_name',\n value: doc,\n },\n {\n name: 'revision',\n value: 1,\n },\n ],\n },\n }\n _requestCRM(params)\n .then((result)=>{\n resolve(result.id)\n }).catch((error) => {\n logger.error('Controller::DefensaConsumidor::_createDocument')\n reject(error)\n })\n })\n}", "function addDocToLibraries (doc) {\n //AppController.sharedInstance().librariesController().addAssetLibraryAtURL(doc.fileURL())\n\tdoc.saveAndAddLibrary()\n}", "function addToCollection( newTitle, newArtist, newYearPublished, newTracks ){ \n// - Create a new object having the above properties\n let album = {\n title : newTitle,\n artist : newArtist,\n year : newYearPublished,\n tracks : newTracks\n } //end object literal\n// - Add the new object to the end of the `collection` array\nrecordCollection.push( album );\n// - Return the newly created object\nreturn console.log( 'New record added to the collection:', album );\n}", "function addRelatedDoc(uploadfilepath) {\n //Use filename for title of related doc\n var pathFilename = uploadfilepath.split(\"\\\\\");\n var filename = pathFilename[pathFilename.length - 1];\n\n //Save all change document properties in an object to send to post/put web service \n var properties = new Object();\n properties.Change_Record_Id = id;\n properties.DocTitle = $('#addLinkTitle').val();\n properties.DocType = $('#addLinkType').val();\n\n if (properties.DocType === \"Link\")\n properties.DocLocation = $('#addLinkValue').val();\n\n if (properties.DocType === \"File\")\n properties.DocLocation = uploadfilepath;\n\n properties.CreateDate = new Date($.now());\n\n $.ajax({\n url: 'api/data/PostChangeDocument',\n method: 'post',\n data: properties\n })\n .done(function (e) {\n getRelatedDocs();\n $('#errorInsert').hide();\n $('#errorUpdate').hide();\n $('#errorSelect').hide();\n $('#successInsert').hide();\n\n //Clear out fileupload entry\n var fileuploadclear = $('#fileUpload');\n fileuploadclear.replaceWith(fileuploadclear.clone(true));\n\n $('#success').html(\"Added related document successfully.\").fadeIn(1000);\n setTimeout\n (function () {\n $(\"#success\").fadeOut();\n }, 5000\n );\n })\n .fail(function (e) {\n $('#errorSelect').hide();\n $('#successInsert').hide();\n $('#successUpdate').hide();\n $('#errorInsert').hide();\n\n $('#error').html(\"Failed to Add Related Document.\").fadeIn(1000);\n setTimeout(function () {\n $(\"#error\").fadeOut();\n }, 5000);\n });\n}", "function createProject(user, project_fields) {\n return db\n .collection(\"projects\")\n .add(project_fields).then((new_project) => {\n const {appID, adminKey } = algoliaConfig;\n const client = algoliasearch(appID, adminKey);\n const index = client.initIndex('projects')\n const {title, description, createdBy, owner, status} = project_fields\n const objectID = new_project.id;\n \n // add project to owner's list\n db\n .doc(`users/${user.uid}`)\n .collection('projects').doc(new_project.id)\n .set({\n favorited: false,\n pinned: true,\n });\n\n // // attach owner to project\n // db\n // .doc(`projects/${new_project.id}`)\n // .collection('members').doc(user.uid)\n // .set({\n // date_added: project_fields.date_created,\n // });\n\n // add projects to algolia\n console.log('saving project...');\n console.log('index:')\n console.log(index.saveObject)\n index.saveObject({\n objectID,\n title,\n description,\n createdBy,\n owner,\n status,\n id:objectID\n }).then(({objectID}) => console.log);\n });\n \n}", "function updateModuleField(moduleName, fieldObject){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n\n fieldObject.id = new ObjectID(fieldObject.id);\n \n db.modules.update({name: moduleName, fields: {$elemMatch: {id: fieldObject.id}}}, {$set: {'fields.$': fieldObject}}, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n deferred.resolve();\n }\n });\n\n return deferred.promise;\n}", "function _uploadDocs() {\n $scope.deleteLogoFlag = true;\n $scope.submitDisable = true;\n serverRequestService.upload($scope.documentInput, ADD_EDIT_PROJECT_CTRL_API_OBJECT.uploadDocs, 'doc').then(function(res) {\n if (res) {\n $scope.submitDisable = false;\n $scope.documentArray.push(angular.copy(res));\n $scope.project.documentArray.push(angular.copy(res._id));\n }\n });\n }", "addDocument (doc) {\n if (this._isOptimized) {\n throw new Error('Cannot add a document to an already-optimized index.');\n }\n\n if (typeof doc.id === 'undefined') {\n throw new Error(1000, 'ID is a required property of documents.');\n };\n\n const fieldsToIndex = [];\n for (let [ fieldName, fieldData ] of Object.entries(doc)) {\n /* The document ID is not a field... */\n if ('id' === fieldName) {\n continue;\n }\n\n /* Make sure this field should be indexed... */\n if (!(Object.hasOwnProperty.call(this._fields, this._intern(fieldName, false)))) {\n console.error(`Document field (${fieldName}) is not indexable.`);\n continue;\n }\n\n fieldsToIndex.push(fieldName);\n }\n\n if (0 === fieldsToIndex.length) {\n console.log(`Not indexing empty document ${doc.id}`);\n return;\n }\n\n doc.id = this._intern(doc.id);\n\n for (let [ _, fieldName ] of Object.entries(fieldsToIndex)) {\n let tokens = this._tokenize(doc[`${fieldName}`], true);\n\n fieldName = this._intern(fieldName, false);\n\n if (!(Object.hasOwnProperty.call(this._fields[`${fieldName}`].documents, doc.id))) {\n this._fields[`${fieldName}`].documents[`${doc.id}`] = tokens.length;\n }\n\n for (let [ _, term ] of Object.entries(tokens)) {\n if (!(Object.hasOwnProperty.call(this._fields[`${fieldName}`].terms, term))) {\n this._fields[`${fieldName}`].terms[`${term}`] = {};\n }\n\n if (!(Object.hasOwnProperty.call(this._fields[`${fieldName}`].terms[`${term}`], doc.id))) {\n this._fields[`${fieldName}`].terms[`${term}`][`${doc.id}`] = 0;\n }\n ++this._fields[`${fieldName}`].terms[`${term}`][`${doc.id}`];\n }\n }\n }", "function addNewDocument(data) {\n db.collection(\"notes\")\n .add(data)\n .then(function (doc) {\n // console.log(doc);\n console.log(\"Note added successfully\");\n })\n .catch(function (error) {\n console.log(error);\n });\n}", "function updateFieldArray(moduleName, fieldArray){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n\n //need to convert each 'id' property to an ObjectID\n for(var i = 0; i < fieldArray.length; i++){\n fieldArray[i].id = new ObjectID(fieldArray[i].id);\n }\n \n\n db.modules.update({name: moduleName}, {$set: {fields: fieldArray}}, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n deferred.resolve();\n }\n });\n\n return deferred.promise;\n}", "function addNewRecipe(name,dif,ingridientsArray,photoLink,timeItTakes,howToMakeit){\n\n db.collection(\"Recepies\").add({\n recipeName: name,\n difficulty:dif,\n ingridients:ingridientsArray,\n recipePhoto:photoLink,\n time:timeItTakes,\n howToDo:howToMakeit\n })\n .then((docRef) => {\n console.log(\"Document written with ID: \", docRef.id);\n })\n .catch((error) => {\n console.error(\"Error adding document: \", error);\n });\n\n }", "add (docs = []) {\n Array.prototype.push.apply(this, (Array.isArray(docs) ? docs : [docs]).filter((doc) => {\n return doc.isDocument && !this.has(doc);\n }));\n\n return this;\n }", "function writeDocument (doc) {\n return wsk.actions.invoke({\n actionName: packageName + \"/create-document\",\n params: { \"doc\": doc },\n blocking: true,\n })\n .then(activation => {\n console.log(\"Created new document with ID \" + activation.response.result.id);\n return activation.response.result;\n })\n .catch(function (err) {\n console.log(\"Error creating document\");\n return err;\n });\n}", "function deleteModuleDoc(moduleName, id){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n\n db.bind(moduleName);\n\n db[moduleName].remove({_id: mongo.helper.toObjectID(id)}, function(err, writeResult){\n if(err){\n deferred.reject(err);\n }\n else{\n //n is used to know if the document was removed\n if(writeResult.result.n == 0){\n deferred.reject(notFound);\n }\n else{\n deferred.resolve();\n }\n }\n });\n\n return deferred.promise;\n}", "function deleteModuleDoc(moduleName, id){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n\n db.bind(moduleName);\n\n db[moduleName].remove({_id: mongo.helper.toObjectID(id)}, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n deferred.resolve();\n }\n });\n\n return deferred.promise;\n}", "function addUser(name, username, role){\n\n // Get a new write batch\n var batch = db.batch();\n\n var user = db.collection(\"users\").doc(email)\n batch.set(user, {\n name: name,\n username: username,\n role: role,\n public: db.doc('users/' + username),\n photourl: photoURL\n });\n\n var publicUser = db.collection(\"users-public\").doc(username)\n batch.set(publicUser, {\n username: username,\n photourl: photoURL\n }); \n\n var placeholder = db.collection(\"users\").doc(email).collection(\"projects\").doc(\"placeholder\")\n\n batch.set(placeholder, {\n note: \"Placeholder project document\"\n });\n\n var placeholder2 = db.collection(\"users\").doc(email).collection(\"courses\").doc(\"placeholder\")\n\n batch.set(placeholder2, {\n note: \"Placeholder courses document\"\n });\n\n batch.commit().then(function() {\n console.log(\"User successfully created!\");\n window.location.replace(\"/dashboard\")\n })\n .catch(function(error) {\n console.error(\"Error creating user: \", error);\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 updateFieldArray(moduleName, fieldArray){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n\n db.modules.update({name: moduleName}, {$set: {fields: fieldArray}}, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n deferred.resolve();\n }\n });\n\n return deferred.promise;\n}", "function addField(fieldIndex){\n if(!fieldIndex){\n return;\n }\n var fieldTypes = [\n //Single Line Text Field\n {\"label\": \"New Text Field\", \"type\": \"TEXT\", \"placeholder\": \"New Field\"},\n //Date Field\n {\"label\": \"New Date Field\", \"type\": \"DATE\"},\n //DropDownField\n {\"label\": \"New Dropdown\", \"type\": \"OPTIONS\", \"options\": [\n {\"label\": \"Option 1\", \"value\": \"OPTION_1\"},\n {\"label\": \"Option 2\", \"value\": \"OPTION_2\"},\n {\"label\": \"Option 3\", \"value\": \"OPTION_3\"}\n ]},\n //Checkboxes Field\n {\"label\": \"New Checkboxes\", \"type\": \"CHECKBOXES\", \"options\": [\n {\"label\": \"Option A\", \"value\": \"OPTION_A\"},\n {\"label\": \"Option B\", \"value\": \"OPTION_B\"},\n {\"label\": \"Option C\", \"value\": \"OPTION_C\"}\n ]},\n //Radio Buttons Field\n {\"label\": \"New Radio Buttons\", \"type\": \"RADIOS\", \"options\": [\n {\"label\": \"Option X\", \"value\": \"OPTION_X\"},\n {\"label\": \"Option Y\", \"value\": \"OPTION_Y\"},\n {\"label\": \"Option Z\", \"value\": \"OPTION_Z\"}\n ]},\n //Multi Line Text Field\n {\"label\": \"New Text Field\", \"type\": \"TEXTAREA\", \"placeholder\": \"New Field\"},\n //Email Text field\n {\"label\": \"New Email Field\", \"type\": \"EMAIL\", \"placeholder\": \"New Field\"},\n //Password field\n {\"label\": \"New Password Field\", \"type\": \"PASSWORD\", \"placeholder\": \"New Field\"}\n\n ];\n\n FieldService\n .createFieldForForm(vm.formId, fieldTypes[fieldIndex])\n .then(function (response) {\n vm.fields = response.data;\n },\n function (error) {\n console.log(error.statusText);\n });\n\n\n }", "submitInsertDocument(forumFields) {\n // Insert a new document\n this.props.collection.insert(forumFields, (err, res) => {\n if(err) // If there was an error\n {\n this.log(false, `Error inserting forum`, forumFields);\n this.handleSubmitError(err);\n\n this.setState({\n processingForm: false\n });\n }\n else\n {\n this.log(false, `Inserted forum`, forumFields);\n\n if(this.props.onSubmit) // If we have a onSubmit function from the props\n {\n this.props.onSubmit(res); // Run it - and pass the created docId to it\n }\n else // Otherwise\n {\n this.resetForm(); // Reset the forum to blank\n }\n }\n\n return res;\n });\n }", "add(doc) {\n const idx = this.size()\n\n if (isString(doc)) {\n this._addString(doc, idx)\n } else {\n this._addObject(doc, idx)\n }\n }", "addDocuments(collection, data, cb) {\n\t\tif (!Array.isArray(data)) return (cb('Data must be provived as an array.'));\n\t\tif (data.length == 0) return cb(null, []);\n\t\tif (!data) return (cb('Please provide a data (must be json object).'));\n\t\tif (data._id && !(data._id = this.toObjectId(data._id))) return (cb('Please provide a valid id.'));\n\t\tthis.mdb.collection(collection).insertMany(data, (err, insertedDoc) => {\n\t\t\tif (err) return (cb(err));\n\t\t\treturn (cb(null, insertedDoc));\n\t\t})\n\t}", "add(filename, content, shouldOverWrite = true) {\r\n const catalog = this.toUrl().indexOf(\"tenantappcatalog\") > 0 ? \"tenantappcatalog\" : \"sitecollectionappcatalog\";\r\n // you don't add to the availableapps collection\r\n const adder = new AppCatalog(extractWebUrl(this.toUrl()), `_api/web/${catalog}/add(overwrite=${shouldOverWrite},url='${filename}')`);\r\n return adder.postCore({\r\n body: content,\r\n }).then(r => {\r\n return {\r\n data: r,\r\n file: new File(odataUrlFrom(r)),\r\n };\r\n });\r\n }", "add(fields) {\r\n\t\t\tconst addField = (path, options) => {\r\n\t\t\t\tif (obsidian.Field === options || obsidian.Field === options.type) {\r\n\t\t\t\t\tthrow new Error(\"The field type must be a child class of obsidian.Field\");\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// Check if the options param is a Field\r\n\t\t\t\tif (obsidian.Field.isPrototypeOf(options)) {\r\n\t\t\t\t\toptions = {type: options};\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// Make sure the type field is a Field\r\n\t\t\t\tif (!obsidian.Field.isPrototypeOf(options.type)) {\r\n\t\t\t\t\tthrow new Error(\"The type parameter must be an instance of the Field class\");\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.schemaFields[path] = new options.type(this, path, options);\r\n\t\t\t}\r\n\r\n\t\t\tconst processFieldDefinition = (definition, prefix = \"\") => {\r\n\t\t\t\tObject.keys(definition).forEach((key) => {\r\n\t\t\t\t\tconst obj = definition[key];\r\n\r\n\t\t\t\t\tif (!obj) {\r\n\t\t\t\t\t\tthrow new Error(`Invalid value for schema path ${prefix+key} in ${this.listName}`);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (isPlainObject(obj) && !obj.type && Object.keys(obj).length) {\r\n\t\t\t\t\t\t// obj is a nested field\r\n\t\t\t\t\t\tprocessFieldDefinition(obj, prefix + key + \".\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\taddField(prefix + key, obj);\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\t// Recursivly process the field definitions\r\n\t\t\tprocessFieldDefinition(fields);\r\n\t\t}", "static async modifyDocument (id, document) {\n if (typeof document !== 'object') {\n throw new Error('Bad Parameter');\n }\n const db = await Mongo.instance().getDb();\n const isValid = await Document.isDocument(document);\n if (isValid.valid) {\n // Create a new document\n // Uploaded document with new informations.\n const res = await db.collection(Document.COLLECTION).updateOne(\n {\n _id: ObjectId(id)\n },\n {\n $set: {\n ...document,\n updatedAt: moment().toDate()\n }\n }\n );\n return res;\n } else {\n log.debug('Warning - couldn\\'t modify document \\n', document);\n return null;\n }\n }", "function Add_Doc_CustomID() {\n // Collection is the table or collection of\n cloudDB\n .collection(\"Students\")\n .doc(rollV)\n .set({\n // This is creating a new entry in the DB\n NameOfStd: nameV,\n RollNo: Number(rollV),\n Section: secV,\n Gender: genV,\n })\n .then(function () {\n console.log(\"Document writeen with ID\", rollV);\n })\n .catch(function (error) {\n console.eroor(\"Error adding document\", error);\n });\n}", "async addDocuments(documents) {\n const typesenseDocuments = this._documentsToTypesenseRecords(documents, await this.embeddings.embedDocuments(documents.map((doc) => doc.pageContent)));\n await this.import(typesenseDocuments, this.schemaName);\n }", "function postGroup(req, res) {\n cors.setHeader(res);\n let moduleId = req.swagger.params.body.value.module_id;\n\n // Only allow people in the module to create groups.\n // Administrators have can_view set for every module.\n rightsModule.getModuleRights(req)\n .then(rights => {\n var moduleRights;\n for (var x in rights.modules_rights) {\n if (rights.modules_rights[x].id === moduleId) {\n moduleRights = rights.modules_rights[x];\n }\n }\n console.log(moduleRights);\n if (!(moduleRights && moduleRights.can_view)) {\n res.status(401).json({});\n return;\n }\n });\n\n // Refuse groups without module id.\n if (typeof moduleId === 'undefined') {\n res.status(405).json({});\n return;\n }\n\n (async () => {\n const client = await db.connect();\n try {\n // Create a new group in the database for the given module.\n const result = await client.query(sqlStatements.addGroup, [moduleId]);\n // Add the module id to the result to conform to API specification.\n result.rows[0].module_id = moduleId;\n // Add the current user to the newly created group.\n await client.query(sqlStatements.addUserToGroup, [result.rows[0].id, req.user.id]);\n\n res.status(201).json(result.rows[0]);\n } finally {\n client.release();\n }\n })().catch(e => {\n console.log(e.stack);\n res.status(500).json({});\n });\n}", "function createDoc(resourceName, obj) {\n \tdelete obj._id; // Do not allow users to set ._id\n\n \tconst collection = getModel(resourceName);\n \tconst item = new collection(obj);\n\n \treturn item.save()\n \t.then(data => {\n\n \t\tconst resp = {\n \t\t\tdoc: data,\n \t\t\tmetadata: { modified: data.length}\n \t\t};\n\n \t\treturn resp;\n \t})\n \t.catch(err => {\n \t\tconsole.log(err);\n \t\tconsole.log(\"db.createDoc error\");\n \t});\n }", "function addDoc() {\n const docTable = document.getElementById('docTable');\n addRow(docTable);\n hideSelectedDoctypeOption();\n clearDoc();\n hideOrShowRightColumn();\n}", "addToApi() {\n // Invoke the factory function, passing along the form field values to\n const newJournalEntry = renderDom.buildEntry();\n // console.log(\"newJournalEntry\", newJournalEntry)\n API.postJournalEntry(newJournalEntry);\n }", "function guardarPedido2() {\n \n db.collection(\"DatosDeCompra\").add({\n ValorUnitario: Precio,\n Medida: medida,\n NombreProducto: NombreAmbientador.innerHTML,\n Aroma: aroma,\n Cantidad: CantidadAmbientador.value\n })\n\n .then(function (docRef) {\n console.log(\"Pedido hecho: \", docRef.id);\n \n })\n .catch(function (error) {\n console.error(\"Error: \", error);\n });\n\n}", "function upload_data(collection) {\n db.collection(collection).add({\n today_rating: today_rating,\n week_rating: week_rating,\n month_rating: month_rating,\n area_of_business: document.getElementById(\"survey_aob_dropdown\").value,\n date: `${Date()}`.substr(4,11)\n })\n .then(function(docRef) {\n console.log(\"Document written with ID: \", docRef.id);\n document.getElementById(\"survey_aob_dropdown\").value = \"Professional Services\";\n document.getElementById(\"aob_list\").value = \"All\";\n location.reload();\n })\n .catch(function(error) {\n console.error(\"Error adding document: \", error);\n });\n }", "function insert_doc(doc) {\n\tif (cloudant) {\n\t\tlogger.info(\"insert_doc() doc.id_str:\", doc.id_str);\n\t db.insert(doc, function (error, http_body, http_headers) {\n\t if(error) return logger.error(error);\n\t });\n // logger.debug(\"insert_doc() http_body:\", http_body);\n\t\t}\n}", "add(title, fieldType, properties) {\r\n const postBody = jsS(Object.assign(metadata(fieldType), {\r\n \"Title\": title,\r\n }, properties));\r\n return this.clone(Fields_1, null).postCore({ body: postBody }).then((data) => {\r\n return {\r\n data: data,\r\n field: this.getById(data.Id),\r\n };\r\n });\r\n }", "addDocument(url, dependencies) {\n const record = this._getRecordFor(url);\n for (const dependency of dependencies) {\n record.dependencies.add(dependency);\n const dependencyRecord = this._getRecordFor(dependency);\n dependencyRecord.dependants.add(url);\n }\n record.dependenciesDeferred.resolve(record.dependencies);\n }", "function handleAdd() {\n let newId = docs.length + 1;\n setDocs([\n ...docs,\n {\n id: newId,\n title: `Boleto ${newId}`,\n description: `Descrição do boleto ${newId}`\n }\n ]);\n }", "async addContent(name, contentText) {\n //TODO\n allWords = await this.words(contentText);\n docCount++;\n await db.collection(docContent_table).insertOne(\n {_id: docCount,docN: name, content: contentText}\n );\n for(let [word,offsets] of allWords){\n await db.collection(docs_table).updateOne(\n {_id: {word, name}},\n {\n $inc: {score: 1},\n $setOnInsert: {\n words: word,\n docs: name,\n offset: offsets\n }\n },\n {upsert: true}\n );\n }\n }", "async insertDoc(document) {\n let collection = await this.collection()\n\n await collection.insertOne(document)\n\n }", "function postDoc(username,fileName, fileType, doc){\n UserAccountService.postDoc(username, fileName, fileType, doc)\n .then(\n function(d) {\n vm.cancelModal();\n },\n function(errResponse){\n console.error('Error while updating doc');\n }\n );\n }", "_appendChild(collectionPath, data) {\n this.editorSession.transaction(tx => {\n const node = tx.create(data);\n documentHelpers.append(tx, collectionPath, node.id);\n });\n }", "function deleteModule(moduleName){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n\n //drop the collection\n db.bind(moduleName);\n db[moduleName].drop(function(err){\n if(err){\n if(err.codeName == 'NamespaceNotFound'){\n deferred.reject(notFound);\n }\n else{\n deferred.reject(err);\n }\n }\n else{\n //remove document from 'modules' collection\n db.modules.remove({name: moduleName}, function(err, writeResult){\n if(err){\n deferred.reject(err);\n }\n else{\n //n is used to know if the document was removed\n if(writeResult.result.n == 0){\n deferred.reject(notFound);\n }\n else{\n deferred.resolve();\n }\n }\n });\n }\n });\n\n return deferred.promise;\n}", "function guardarPedido3() {\n \n db.collection(\"DatosDeCompra\").add({\n ValorUnitario: Precio,\n Medida: medida,\n NombreProducto: NombreJabonManos.innerHTML,\n Aroma: aroma,\n Cantidad: CantidadJabonManos.value\n })\n\n .then(function (docRef) {\n console.log(\"Pedido hecho: \", docRef.id);\n \n })\n .catch(function (error) {\n console.error(\"Error: \", error);\n });\n\n}", "function addPro(project){\n return db.insert(project,\"*\").into(\"projects\");\n}", "function addModule() {\n $('<section>')\n .attr('id', 'rsw-discord')\n .addClass('rsw-custom-module rail-module')\n .append(\n $('<a>')\n .attr('href', ('https://discord.gg/s63bxtW'))\n .append(\n $('<img>')\n .attr('src', 'https://vignette.wikia.nocookie.net/vocaloid/images/2/2d/Discord-Logo-Color.png')\n ),\n $('<div>')\n .append(\n $('<p>')\n .append(\n 'Le Wiki VOCALOID a un serveur officiel de Discord ! Clique le bouton ci-dessous pour rejoindre et dialoguer avec les fans et des contributeurs en direct, ou clique ',\n $('<a>')\n .attr('href', mw.util.wikiGetlink('Wiki Vocaloid:Discord'))\n .text('ici'),\n ' pour lire les règles du tchat de ce serveur.'\n ),\n $('<a>')\n .attr('href', 'https://discord.gg/s63bxtW')\n .addClass('wds-button')\n .text('Recevoir une invitation')\n )\n )\n .insertBefore('#wikia-recent-activity');\n }", "function designDocAdd(ddoc_type, ddoc_name, ddoc_data, callback) {\n var ddoc_url = db._resolve('_design/' + ddoc_type), serialised;\n\n hoodie.request('GET', ddoc_url, {}, function (err, ddoc, res) {\n if (res.statusCode === 404) {\n // not found, so we use new object.\n ddoc = {\n language: 'javascript'\n };\n ddoc[ddoc_type] = {};\n } else if (err) {\n return callback(err);\n }\n\n // View functions need to be serialised/stringified.\n if (ddoc_type === 'views' || ddoc_type === 'fulltext') {\n serialised = _.reduce(ddoc_data, function (memo, v, k) {\n memo[k] = _.isFunction(v) ? v.toString() : v;\n return memo;\n }, {});\n } else {\n serialised = ddoc_data.toString();\n }\n\n // If view code has not changed we don't need to do anything else.\n // NOTE: Not sure if this is the best way to deal with this. This\n // saves work and avoids unnecessarily overwriting the\n // `_design/views` document when no actual changes have been made to\n // the view code (map/reduce).\n if (_.isEqual(serialised, ddoc[ddoc_type][ddoc_name])) {\n return callback(null, {\n ok: true,\n id: ddoc._id,\n rev: ddoc._rev\n });\n }\n ddoc[ddoc_type][ddoc_name] = serialised;\n hoodie.request('PUT', ddoc_url, {data: ddoc}, function cb(err, ddoc, res) {\n if (res && res.statusCode === 409) {\n return designDocAdd(ddoc_type, ddoc_name, ddoc_data, callback);\n }\n callback(err, ddoc, res);\n });\n });\n }", "function addToCollection(artist, title, yearPublished){\n// - Create a new object having the above properties\n let record = {artist , title , yearPublished}\n// - Add the new object to the end of the `collection` array\nconsole.log(artist, 'has been added to the collection');\ncollection.push(record);\n}", "function addOpportunitySource(req, res) {\n if (!validator.isValid(req.body.sourceName)) {\n res.json({\n code: Constant.ERROR_CODE,\n message: Constant.FIELD_REQUIRED\n });\n }\n else {\n source.findOne({sourceName: {$regex: new RegExp('^' + req.body.sourceName + '$', \"i\")}, moduleType: req.body.moduleType, deleted: false, companyId: req.body.companyId}, function(err, statusData) {\n if (err) {\n res.json({code: Constant.ERROR_CODE, message: err});\n }\n else {\n if (statusData) {\n res.json({\n code: Constant.ERROR_CODE,\n message: Constant.SOURCE_ALREADY_EXIST\n });\n }\n else {\n var sourceDataField = {\n sourceName: req.body.sourceName,\n companyId: req.body.companyId,\n userId: req.body.userId,\n moduleType: req.body.moduleType\n };\n source(sourceDataField).save(function(err, data) {\n if (err) {\n res.json({code: Constant.ERROR_CODE, message: err});\n } else {\n res.json({code: Constant.SUCCESS_CODE, data: data});\n }\n });\n }\n\n }\n });\n }\n\n\n}", "function AddNewPageToDoc(name,doc){\n var tempPage = MSPage.new();\n doc.addPage(tempPage);\n tempPage.setName(name);\n}", "function handleNewClick() {\n const newDoc = stubNewDocument()\n addUpdate(newDoc)\n appendToExtendedData([newDoc])\n }", "function addTemplate(templateName, fieldsArray,callback){\n\tcreateTemplate(templateName,fieldsArray, function(readyTemplate){\n\taddDocument('templates',readyTemplate,function(result){\n\tcallback(result)})})\n}", "function addDocument() {\n var $list = $(\".documentList\");\n var $item = $(\"#document-template\").clone(true).removeAttr(\"id\");\n $list.append($item);\n $item.show('slow');\n checkItems($list);\n updateDocument();\n\n}", "function guardarPedido5() {\n \n db.collection(\"DatosDeCompra\").add({\n ValorUnitario: PrecioJabonRey,\n Medida: medida,\n NombreProducto: NombreJabonRey.innerHTML,\n Aroma: aroma,\n Cantidad: CantidadJabonRey.value\n })\n\n .then(function (docRef) {\n console.log(\"Pedido hecho: \", docRef.id);\n \n })\n .catch(function (error) {\n console.error(\"Error: \", error);\n });\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 update(){\n\n //create another object and copy. then delete the '_id' property of the new copy\n var forUpdate = {};\n Object.assign(forUpdate, updateModule);\n delete forUpdate._id;\n \n db.modules.update({_id: mongo.helper.toObjectID(updateModule._id)}, {$set: forUpdate}, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n deferred.resolve();\n }\n });\n }", "function update(){\n\n //create another object and copy. then delete the '_id' property of the new copy\n var forUpdate = {};\n Object.assign(forUpdate, updateModule);\n delete forUpdate._id;\n \n db.modules.update({_id: mongo.helper.toObjectID(updateModule._id)}, {$set: forUpdate}, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n deferred.resolve();\n }\n });\n }", "function guardarPedido6() {\n \n db.collection(\"DatosDeCompra\").add({\n ValorUnitario: PrecioJabonLavadora,\n Medida: medida,\n NombreProducto: NombreJabonLavadora.innerHTML,\n Aroma: aroma,\n Cantidad: CantidadJabonLavadora.value\n })\n\n .then(function (docRef) {\n console.log(\"Pedido hecho: \", docRef.id);\n \n })\n .catch(function (error) {\n console.error(\"Error: \", error);\n });\n\n}", "async function addReview(db, freelancerId, newReview) {\n\n // to add a new \"for\" key with value as freelancer ID (tagging this new review to existing selected freelancer ID)\n newReview[\"for\"] = ObjectId(freelancerId)\n newReview[\"date\"] = new Date(); // the datetime default to NOW -- current date time\n newReview[\"reviewer\"][\"tag\"] = \"anonymous\";\n\n try {\n // let db = await MongoUtil.connect(mongoUrl, dbName);\n let result = await db.collection(collectionName).insertOne(newReview);\n return result\n } catch(e) {\n errorMsg = `\n Error encountered when inserting data into DB.\n Collection: ${collectionName}, Error: ${e}\n `\n console.error(errorMsg)\n throw new MongoUtil.DBError(errorMsg);\n }\n}", "function addBookToLibrary()\n{\n \n}", "async create(commit) {\n\n\t\tif (!this.changed) {\n\t\t\t// TODO should probably handle this better..\n\t\t\tconsole.warn(\"Update called but content hasn't changed\");\n\t\t}\n\n\t\tlet path = `${config.api}/directories/${this.path}/documents`\n\n\t\ttry {\n\t\t\tlet response = await fetch(path, {\n\t\t\t\tmethod: \"POST\",\n\t\t\t\theaders: store.state.auth.authHeader(),\n\t\t\t\tbody: JSON.stringify(commit.prepareJSON())\n\t\t\t});\n\n\t\t\treturn response;\n\t\t}\n\t\tcatch(err) {\n\t\t\tconsole.error(`There was a problem creating new document in ${this.path}, ${err}`);\n\t\t}\n\t}", "function updateDepModuleVersions () {\n return request.post({\n url: `http://${HOST}/api/DepModuleVersions/add`,\n followAllRedirects: true,\n headers: {\n \"Authorization\": TOKEN\n },\n body: {\n obj: obj\n },\n json: true // Automatically stringifies the body to JSON\n }, (err, res, body) => {\n licenseObj(body);\n check(err, res, body);\n });\n}", "async saveProject(data) {\n try{\n return await ( new Promise((resolve, reject) => { \n Project.create(data, \n function(dbErr, dbRes) {\n if (dbRes){\n delete dbRes._doc._id;\n delete dbRes._doc.__v;\n resolve(dbRes);\n } else{\n console.log(\"not found response: %s\", dbErr);\n reject(dbErr); \n } \n });\n }));\n } catch(e) {\n console.log(\"coud not create the project, error:\", e);\n }\n }", "async addTask({ commit }, { title, date }) {\n await db.collection('tasks').add({\n id: new Date().getTime(),\n title: title,\n date: date,\n done: false\n });\n\n await commit('getTasks');\n }", "async function add_identification_Number(institution_name,identification_number){\n var conn = await connect();\n\n await conn.collection('institution').updateOne(\n { institution_name },\n {\n $push: {\n \"identification_number\": identification_number,\n \n\n }\n }\n )\n}", "function guardarPedido4() {\n \n db.collection(\"DatosDeCompra\").add({\n ValorUnitario: PrecioJabonRopaColor,\n Medida: medida,\n NombreProducto: NombreJabonRopaColor.innerHTML,\n Aroma: aroma,\n Cantidad: CantidadJabonRopaColor.value\n })\n\n .then(function (docRef) {\n console.log(\"Pedido hecho: \", docRef.id);\n \n })\n .catch(function (error) {\n console.error(\"Error: \", error);\n });\n\n}", "function insert_Link_To_DB(\n db//: mongoDB obj <- optional == collection.s.db;\n ,collection//: mongoDB obj\n ,document_Obj//: dict\n //request,//: HTTP(S) obj <- ? optional ?\n //,response//: HTTP(S) obj\n //,json_Response_Obj//: dict <- ? optional ?\n //host, //protocol + // + host_name\n //source_Link,// str <- optional\n //,context_Message//: str <- optional\n ,is_Debug_Mode//: bool <- optional\n) {//: => thenable Promise => ((null | void | Unit) | error)\n \"use strict\";\n //const\n //var response_Helpers = require('./response_Helpers.js');\n var collection_Size = 0;\n //var short_Link; // = \"\";// = document_Obj.short_Link\n //var source_Link;\n //var json_Response_Obj = {};\n var message = \"? error message ?\";\n\n //*** positional arguments ***//\n //*** defaults ***//\n //document_Obj = document_Obj ? document_Obj : {};\n //json_Response_Obj = json_Response_Obj ? json_Response_Obj : {};\n /*\n if (context_Message) {\n } else {\n context_Message = \"request.on 'end' query.allow insertOne\";\n }\n */\n //if (is_Debug_Mode) {console.log('db:', db);}\n if (is_Debug_Mode) {console.log('db == null or undefined:', (db == null || db == undefined));}\n if (is_Debug_Mode) {console.log('typeof db:', typeof(db));}\n if (db) {} else {\n db = collection.s.db;\n //if (is_Debug_Mode) {console.log('collection.s.db:', db);}\n if (is_Debug_Mode) {console.log(\n 'db == null or undefined:', (db == null || db == undefined));}\n }\n //*** defaults end ***//\n\n // guard\n // currently fires before link was generated\n if (document_Obj.short_url) {\n var short_url = document_Obj.short_url;\n\n if (is_Debug_Mode) {console.log('short_url:', short_url, \"provided\");}\n\n } else {\n message = 'undefined / empty document_Obj.short_url';\n\n /* finally */\n if (db) {\n db.close();\n if (is_Debug_Mode) {console.log(\"Close db after link insert\");}\n }\n if (is_Debug_Mode) {console.log(message);}\n //new Error(message)\n return Promise.reject(new Error(message));\n }\n\n\n //return Promise\n // .resolve(() => {\n /// .resolve(\n return collection\n // collection\n // insertOne(doc, options, callback) => {Promise}\n .insertOne(\n document_Obj\n //JSON.stringify(document_Obj)\n )\n .then((result) => {//.result.n\n //console.log(JSON.stringify(document_Obj));\n if (is_Debug_Mode) {console.log('inserted document_Obj: %j', document_Obj);}\n if (is_Debug_Mode) {console.log(\"result.result.n:\", result.result.n);}\n //console.log('result.result: %j', result.result);\n\n /* finally */\n if (db) {\n db.close();\n if (is_Debug_Mode) {console.log(\"Close db after link insert(ion/ed)\");}\n }\n\n return Promise.resolve(result.result.ok);\n }\n )\n .catch((err) => {\n // \"E11000 duplicate key error index:\n // links.$original_url_text_short_url_text dup key: { : \\\"com\\\", : 0.625 }\n if (is_Debug_Mode) {console.log('(collection / cursor).insertOne() error:', err.stack);}\n /* finally */\n if (db) {\n db.close();\n if (is_Debug_Mode) {console.log(\"Close db after insertOne().catch()\");}\n }\n\n return Promise.reject(err);\n }\n );\n //}()\n //);\n\n //return //null;//side effect //void //Unit\n}", "static addNewFile(username, fullPath) {\n const entry = metaUtils.getFileMetadata(username, fullPath);\n Databases.fileMetaDataDb.update({path: entry.path}, entry, {upsert: true}, (err, doc) => {\n if (err) {\n console.log(\"could not insert : \" + err);\n }\n else {\n console.log('Inserted');\n }\n });\n }" ]
[ "0.79263556", "0.66809034", "0.66809034", "0.65259874", "0.6474247", "0.6462474", "0.6386402", "0.62038225", "0.6137509", "0.60923326", "0.60543627", "0.60535026", "0.60426795", "0.60029393", "0.5956532", "0.5956532", "0.5956532", "0.58633536", "0.5832858", "0.57799244", "0.57723767", "0.5765995", "0.56954175", "0.56861633", "0.566296", "0.5620292", "0.5595708", "0.5572104", "0.55378985", "0.55028796", "0.5502585", "0.54918104", "0.5481415", "0.54422754", "0.5392784", "0.538318", "0.5373799", "0.5359636", "0.53475994", "0.5344755", "0.53445876", "0.5331424", "0.53222513", "0.53033954", "0.5287168", "0.52721894", "0.5271081", "0.5264033", "0.5258407", "0.5258012", "0.52443314", "0.5230887", "0.5204798", "0.5203005", "0.52016425", "0.51966584", "0.5190214", "0.5180066", "0.5178163", "0.5176374", "0.51662827", "0.51581407", "0.51546097", "0.514791", "0.5146296", "0.5144377", "0.5142351", "0.5139015", "0.51355153", "0.5126772", "0.512452", "0.51152384", "0.510101", "0.5099667", "0.50943726", "0.5090775", "0.5090618", "0.50890267", "0.5088815", "0.50850606", "0.50796884", "0.5066853", "0.50654465", "0.50418615", "0.50415057", "0.50405633", "0.50319487", "0.50317794", "0.50317794", "0.50296944", "0.50225204", "0.50003964", "0.4995194", "0.49938777", "0.49937093", "0.49840352", "0.49825984", "0.49807814", "0.49797478", "0.49686474" ]
0.78352207
1
Function name: get documents of a module Author: Reccion, Jeremy Date Modified: 2018/04/04 Description: get all documents of a specific module Parameter(s): moduleName: string type Return: Promise
function getAllModuleDocs(moduleName){ var deferred = Q.defer(); moduleName = moduleName.toLowerCase(); db.bind(moduleName); db[moduleName].find().toArray(function(err, moduleDocs){ if(err){ deferred.reject(err); } else{ deferred.resolve(moduleDocs); } }); return deferred.promise; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function getDocument(req, res, next){\n\n document.findAll({ attributes: ['name'] })\n .then(document => {\n res.status(200).send(document)\n })\n .catch(err => {\n res.status(400).send(e);\n })\n}", "GetAllDocuments() {\n return this.Start().then(Cache.DB).then(db => new Promise((resolve, reject) => {\n db.all('SELECT id, rev, body FROM couchbasesync WHERE dbName = ?', this[sDbName], (err, rows) => {\n if (err) {\n return reject(err);\n }\n\n const docs = [];\n rows.forEach((row) => {\n let JSONData = {};\n try {\n JSONData = JSON.parse(row.body);\n } catch (e) {\n this.emit('error', `Failed to parse JSON object for document body: ${row.id}`);\n }\n\n docs.push({\n id: row.id,\n rev: row.rev,\n doc: JSONData,\n });\n });\n\n return resolve(docs);\n });\n }));\n }", "function getAllDocuments (req, res) {\n Documents.query().then(data => res.json(data));\n\n}", "_getDocument(req, res, next) {\n const documentId = req.params.id\n this.engine.getDocument(documentId, function(err, jsonDoc, version) {\n if (err) return next(err)\n res.json({\n data: jsonDoc,\n version: version\n })\n })\n }", "function getTutorialsOfModule(req, res) {\n\t// Get projectID from query parameters to fetch only project's tutorials\n\t// Create query to get tutorials by projectID\n\tconst tutorialModuleID = req.params.moduleID;\n\tconst query = Tutorial.find({tutorialModuleID});\n\n\t// Execute query and return all modules that have the same projectID\n\tquery.exec((err, tutorials) => {\n\t\tif (err) {\n\t\t\tres.status(400).json({message: `Following error was encountered: ${err}`});\n\t\t} else if (!tutorials) {\n\t\t\tres.status(404).send('No tutorials found.');\n\t\t} else {\n\t\t\tres.status(200).json(tutorials);\n\t\t}\n\t});\n}", "function _getDocumentByProjectId(req, res) {\n var findObj = {\n deleteFlag: false,\n projectID: req.id\n };\n Document.find(findObj, function(err, docs) {\n if (err) {\n resultObj.status = FAIL;\n resultObj.result = err;\n } else {\n resultObj.status = OK;\n resultObj.result = docs;\n }\n res.send(resultObj);\n });\n}", "function findDuplicateDoc(moduleName, moduleDoc){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n\n //get the fields of the specific module\n service.getModuleByName(moduleName).then(function(aModule){\n //initialize array & object for querying\n var uniqueFields = [];\n var tempObj;\n\n //push the value of the document when a field is unique\n aModule.fields.forEach(function(field){\n if(field.unique){\n tempObj = {};\n tempObj[field.name] = moduleDoc[field.name];\n uniqueFields.push(tempObj);\n }\n });\n\n if(uniqueFields.length == 0){\n deferred.resolve();\n }\n else{\n //use $or for checking each field for uniqueness, not their combination\n db[moduleName].findOne({$or: uniqueFields}, function(err, duplicateDoc){\n if(err){\n deferred.reject(err);\n }\n //a duplicate exists, but needs further checking\n else if(duplicateDoc){\n //updating a module document\n if(moduleDoc._id){\n //different module documents with similar unique values\n if(moduleDoc._id != duplicateDoc._id){\n deferred.reject(exists);\n }\n //since it is the same document, it is not duplicate\n else{\n deferred.resolve();\n }\n }\n //adding new module documennt\n else{\n deferred.reject(exists);\n }\n }\n //does not exist\n else{\n deferred.resolve();\n }\n });\n }\n\n \n }).catch(function(err){\n deferred.reject(err);\n });\n\n return deferred.promise;\n}", "function queryModNames() {\n db.collection('modules')\n .get()\n .then((querySnapshot) => {\n querySnapshot.forEach((doc) => {\n let modNameObj = {};\n modNameObj.value = doc.id;\n modNameObj.label = doc.data().module.name;\n if (modNameObj.label !== 'Jumpshot Tutor') {\n allModules.push(modNameObj);\n }\n setModNamesIsLoading(false);\n });\n return allModules;\n });\n }", "getDocuments(collectionName, query, projection) {\n return new Promise((resolve, reject) => {\n this.find(collectionName, query, projection).then(resolve).catch(reject);\n });\n }", "get(req, res) {\n const { id } = req.params;\n\n return Document.find({ _id: id })\n .then((documents) => res.json(documents))\n .catch((err) => res.send(err));\n }", "getListBookDoc(docname){\n\t\t// console.log(catename);\n\t\t$.ajax({\n\t\t\turl: '/api/bookdoc/' + docname,\n\t\t\ttype: 'GET',\n\t\t})\n\t\t.done((data) => {\n\t\t\tthis.actions.getListBookDocSuccess(data);\n\t\t})\n\t\t.fail((jqXhr) => {\n\t\t\tthis.actions.getListBookDocFail(jqXhr.responseJSON.message);\n\t\t});\n\t}", "function findDuplicateDoc(moduleName, moduleDoc){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n\n //get the fields of the specific module\n service.getModuleByName(moduleName).then(function(aModule){\n //initialize array & object for querying\n var uniqueValues = [];\n var tempObj;\n\n //push the value of the document when a field is unique\n aModule.fields.forEach(function(field){\n if(field.unique){\n tempObj = {};\n tempObj[field.name] = moduleDoc[field.name];\n uniqueValues.push(tempObj);\n }\n });\n\n if(uniqueValues.length == 0){\n deferred.resolve();\n }\n else{\n db.bind(moduleName);\n\n //use $or for checking each field for uniqueness, not their combination\n db[moduleName].findOne({$or: uniqueValues}, function(err, duplicateDoc){\n if(err){\n deferred.reject(err);\n }\n //a duplicate exists, but needs further checking\n else if(duplicateDoc){\n //updating a module document\n if(moduleDoc._id){\n //different module documents with similar unique values\n if(moduleDoc._id != duplicateDoc._id){\n deferred.reject(exists);\n }\n //since it is the same document, it is not duplicate\n else{\n deferred.resolve();\n }\n }\n //adding new module documennt\n else{\n deferred.reject(exists);\n }\n }\n //does not exist - similar to notFound. but it is not rejected based on design\n else{\n deferred.resolve();\n }\n });\n }\n }).catch(function(err){\n deferred.reject(err);\n });\n\n return deferred.promise;\n}", "async function getDocuments() {\n const snapshot = await collectionG1.get();\n\n if (snapshot.empty) {\n console.log(\"No documents found...\");\n return;\n } else {\n // List with data of documents\n var docsList = snapshot.docs.map((doc) => doc.data());\n // List with documents\n // var docsList = snapshot.docs.map((doc) => doc);\n return docsList;\n }\n}", "function getMovies() {\n MovieService.movies().then(res => {\nconsole.log(res.data.rows)\n let movies = res.data.rows;\n movies = movies.map((obj) => obj.doc);\n displayMovies(movies)\n })\n .catch((err) => {\n console.error(err);\n });\n\n}", "getDocumentByID(id, headers = null, params = null) {\n // Expose fields to promise\n let client = this.client;\n let selectDefault = this.selectDefault;\n\n id = StringHelpers.clean(id);\n\n // Initialize an empty document from type\n let documentType = this.documentType;\n\n return new Promise(\n // The resolver function is called with the ability to resolve or\n // reject the promise\n function(resolve, reject) {\n\n let defaultParams = {\n query: \n \"SELECT * FROM \" + documentType.prototype.entityTypeName + \" WHERE (ecm:uuid='\" + id + \"' AND \" + selectDefault + \")\"\n };\n\n let defaultHeaders = {};\n\n params = Object.assign(defaultParams, params);\n headers = Object.assign(defaultHeaders, headers);\n\n client.operation('Document.Query')\n .params(params)\n .execute(headers).then((response) => { \n if (response.entries.length > 0) {\n resolve(new documentType(response.entries[0]));\n } else {\n reject('No ' + documentType.prototype.entityTypeName +' found');\n }\n }).catch((error) => { throw error });\n });\n }", "async loadDocumentContent (documentPath) {\n const doc = await this.fetch(`/load_document?d=${documentPath}`) \n return this.parseDocument(doc);\n }", "function doc(moduleName) {\n exports.modules.push(moduleName);\n}", "function getParticularAppDoc(req, res) {\n var id = req.params.id\n dbconn.getAppointsForEachDoc(id, (err, result) => {\n if (err) {\n console.log(err)\n } else {\n if (result.length > 0) {\n console.log(result)\n res.send(result)\n } else {\n res.send(\"No Data Found\")\n }\n }\n })\n}", "async function getModules() {\n\n const pool = await db.dbConnection()\n\n const getQuery = `SELECT * FROM public.modules`;\n\n try {\n pool.query(getQuery, function (err, recordset) {\n\n if (err) {\n\n console.log('getModules', err)\n\n } else {\n\n // send records as a response\n return recordset.rows;\n }\n });\n }\n\n catch (error) {\n res.status(402).json('record insert failed with error: ' + parseError(error, getQuery))\n }\n}", "function search_documentation(query) {\n var doc_url = \"https://projectchrono.org\";\n var doc_search_url = \"/doxygen\";\n var page = \"0\";\n var number = \"40\";\n var callback = \"docshow\"\n var search_string = \"?q=\" + query +\"&n=\" + number + \"&p=\" + page + \"&cb=\" + callback;\n $.ajax({\n url: doc_url + doc_search_url + search_string,\n method: \"GET\",\n data: \"\",\n dataType:\"jsonp\",\n jsonpCallback: \"docshow\",\n success: function (response, status, xhr) {\n docshow(response);\n console.log(response);\n },\n error: function (xhr, status, error_code) {\n console.log(\"Error:\" + status + \": \" + error_code);\n }\n })\n }", "function getListItems() {\n var request = $http({\n method: \"get\",\n url: \"/api/documents\",\n params: {\n action: \"get\"\n }\n });\n\n return(request.then(handleSuccess, handleError));\n }", "function getDocument(court, caseNumber, docketSeq, docNumber) {\n const caseApi = new CourtApi.CaseApi();\n\n return new Promise((resolve, reject) => {\n caseApi.getDocketDocument(court, caseNumber, docketSeq, docNumber,\n handlers.promiseCallback(resolve, reject)\n );\n });\n}", "function getDocuments(page, callback) {\n var query = ALL_DOC_QUERY + '&limit=' + PER_PAGE + '&skip=' + (PER_PAGE * page);\n var url = buildQuery(query, DATABASE);\n Vue.http.get(url).then(function (res) {\n if (callback) callback(unpackAttribute(res.data.rows, 'doc'));\n }, function (res) {\n if (callback) callback(null, 'Could not fetch data from cloudant');\n });\n}", "getAll(req, res) {\n const { page, limit } = req.params;\n\n return Document.find({})\n .skip((page - 1) * limit)\n .limit(limit)\n .then((documents) => res.json(documents))\n .catch((err) => res.send(err));\n }", "getAllDocumentsByDate(req, res) {\n const { page, limit } = req.params;\n\n return Document.find({\n dateCreated: {\n $gt: moment().subtract(1, 'day'),\n $lt: moment().add(1, 'day'),\n },\n })\n .skip((page - 1) * limit)\n .limit(limit)\n .then((documents) => res.json(documents))\n .catch((err) => res.send(err));\n }", "function list() {\n return db.allDocs({\n /*This tells the server to get all docs that start with article*/\n startkey: 'article',\n endkey: 'article{}',\n inclusive_end: true,\n /*Include not just the key but all fields*/\n include_docs: true\n })\n .then(function(res) {\n console.log(res.rows);\n return res.rows.map(function(r) {\n return r.doc;\n });\n });\n }", "async function getIndex(req, res) {\n const key = req.headers['x-token']; // get token from header\n const userId = await redisClient.get(`auth_${key}`);\n\n let user = ''; // find and store user\n if (userId) user = await dbClient.client.collection('users').findOne({ _id: ObjectId(userId) });\n else res.status(401).json({ error: 'Unauthorized' });\n\n let docs = '';\n let documents = []; // to return\n\n // if parentId is passed as query string, filter by this id. Otherwise filter by userId\n if (req.query.parentId) {\n docs = await dbClient.client.collection('files').find({ parentId: req.query.parentId });\n } else docs = await dbClient.client.collection('files').find({ userId: ObjectId(user._id) });\n\n // if page is passed as query string, only get the 20 items of that page\n if (req.query.page) {\n const pagination = await dbClient.client.collection('files').aggregate([\n {\n $facet: {\n data: [{ $skip: (req.query.page * 2) }, { $limit: 2 }],\n },\n },\n ], docs);\n await pagination.forEach((data) => {\n documents = data.data;\n });\n } else await docs.forEach((d) => documents.push(d)); // without pagination\n\n if (documents) res.json(documents);\n else res.status(404).json({ error: 'Not Found' });\n}", "function getDocument(documentId) {\n\n return $http.get(\"component/getwithextradata\",{\n params: {\n documentId: documentId\n }\n });\n\n return request;\n }", "function fetchDocuments(_param, _callback){\n var data = {\n start : parseInt(_param.start,10) || 0,\n cat : _param.cat,\n num : parseInt(_param.num,10) || PAGESIZE\n };\n\n $.ajax({\n url: DOCUMENTS_URL + _param.cat + '/',\n data: data,\n success: function(_res){\n if(_callback){\n _callback(_res);\n }\n },\n error: function(){\n \n }\n });\n }", "function getAllModules(){\n var deferred = Q.defer();\n db.modules.find().toArray(function(err, modules){\n if(err){\n deferred.reject(err);\n }\n else{\n deferred.resolve(modules);\n }\n });\n\n return deferred.promise;\n}", "function getAllModules(){\n var deferred = Q.defer();\n db.modules.find().toArray(function(err, modules){\n if(err){\n deferred.reject(err);\n }\n else{\n deferred.resolve(modules);\n }\n });\n\n return deferred.promise;\n}", "getDocumentIds(collaboratorId) {\n let collaborator = this._collaborators[collaboratorId]\n if (!collaborator) {\n // console.log('CollabEngine.getDocumentIds', collaboratorId, 'not found');\n // console.log('CollabEngine._collaborators', this._collaborators);\n return []\n }\n return Object.keys(collaborator.documents)\n }", "function getProject(project_name){\n return new Promise((resolve,reject) => {\n projectModel.find({project_name:project_name},(err,docs) => {\n if (err){\n return reject(err)\n }\n else{\n resolve(docs)\n }\n })\n })\n}", "async getDocs(req) {\n const limit = 50\n let skip = 0\n const { getCollection, generateSearch } = this.imports\n const { page, postType, category } = req.params\n const collection = await getCollection()\n let search = {}\n\n if (page) {\n skip = (page - 1) * limit\n }\n\n if (postType) {\n search['cms.postType'] = postType\n }\n\n if (category) {\n search['properties.category'] = {\n $in: [category],\n }\n }\n\n search = generateSearch(search)\n const docs = await collection\n .find(search)\n .limit(limit)\n .skip(skip)\n .sort({ indexDate: 'desc' })\n .exec()\n return docs\n }", "static getDocument(pathOrUid = \"\", type, headers = {}, params = {}) {\n\n let properties = this.properties;\n\n return new Promise(\n function(resolve, reject) {\n properties.client\n .repository()\n .fetch(pathOrUid, headers)\n .then((doc) => {\n resolve(doc);\n }).catch((error) => {\n\n if (error.hasOwnProperty('response')) {\n error.response.json().then(\n (jsonError) => {\n if (jsonError.hasOwnProperty('status') && jsonError.status == '404') {\n jsonError.message = jsonError.message + ' (404 - Document Not Found)';\n }\n\n reject(StringHelpers.extractErrorMessage(jsonError));\n }\n );\n } else { \n return reject(error || 'Could not access server');\n }\n });\n });\n }", "function allProjects(){\n return new Promise((resolve,reject) => {\n projectModel.find((err,docs) => {\n if (err){\n return reject(err)\n }\n else{\n resolve(docs)\n }\n })\n })\n}", "async function getAllDocsAndFoldersFromCatalog() {\n\n var docsArray = [];\n var foldersArray = [];\n\n try {\n docsArray = await catalog.docs.toArray();\n foldersArray = await catalog.folders.toArray();\n } catch (error) {\n handleError(\"[CATALOG] Couldn't get all docs or folders from catalog\", error);\n return false;\n }\n\n return docsArray.concat(foldersArray);\n\n}", "function readRequests(findParams, callback, collectionName){\n var client = new MongoClient(url);\n client.connect((err)=>{\n assert.equal(null, err);\n //console.log(\"Connected successfully to server\");\n\n const db = client.db(dbName);\n const collection= db.collection(collectionName)\n\n collection.find(findParams).toArray(function(err, docs) {\n assert.equal(err, null);\n callback(docs)\n });\n client.close();\n })\n}", "function peiticionLibro(title){\n title = title.replace(/\\s/g,\"+\");\n //console.log(title);\n request.get(`http://openlibrary.org/search.json?q=/${title}/`,(err,response,body) =>{\n //console.log(err);\n //console.log(response.statusCode);\n const json = JSON.parse(body);\n console.log(json.docs[0].title);\n console.log('Authors');\n json.docs[0].author_name.forEach(element => console.log(element));\n\n });\n }", "function getDocLibraryList() {\n $scope.loading = true;\n DocLibraryService.getDocLibraryList().then(\n function (response) {\n $scope.loading = false;\n if (response.data.Error) {\n ToastrService.error(response.data.message)\n } else {\n vm.docsForMapping = response.data.documents;\n // vm.docsForMapping = $filter('filter')(vm.docsForMapping, { 'settings': settings.length });\n }\n },\n function (err) {\n ToastrService.error($rootScope.errorMsgs.MSG201);\n }\n )\n }", "function deleteModuleDoc(moduleName, id){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n\n db.bind(moduleName);\n\n db[moduleName].remove({_id: mongo.helper.toObjectID(id)}, function(err, writeResult){\n if(err){\n deferred.reject(err);\n }\n else{\n //n is used to know if the document was removed\n if(writeResult.result.n == 0){\n deferred.reject(notFound);\n }\n else{\n deferred.resolve();\n }\n }\n });\n\n return deferred.promise;\n}", "function getModuleByName(moduleName){\n var deferred= Q.defer();\n moduleName = moduleName.toLowerCase();\n\n db.modules.findOne({name: moduleName}, function(err, aModule){\n if(err){\n deferred.reject(err);\n }\n else if(aModule){\n deferred.resolve(aModule);\n }\n else{\n deferred.reject(notFound);\n }\n });\n\n return deferred.promise;\n}", "function getAllModules(req, res) {\n\t// Get projectID from query parameters to fetch only project's modules\n\t// Create query to get modules by projectID\n\tconst moduleProjectID = req.params.projectID;\n\tconst query = Module.find({moduleProjectID});\n\n\t// Execute query and return all modules that have the same projectID\n\tquery.exec((err, modules) => {\n\t\tif (err) {\n\t\t\tres.status(400).json({message: `Following error was encountered: ${err}`});\n\t\t} else if (!modules) {\n\t\t\tres.status(404).json({message: 'No modules found.'});\n\t\t} else {\n\t\t\tres.status(200).json(modules);\n\t\t}\n\t});\n}", "function getModuleByName(moduleName){\n var deferred= Q.defer();\n moduleName = moduleName.toLowerCase();\n\n db.modules.findOne({name: moduleName}, function(err, aModule){\n if(err){\n deferred.reject(err);\n }\n else{\n deferred.resolve(aModule);\n }\n });\n\n return deferred.promise;\n}", "function deleteModuleDoc(moduleName, id){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n\n db.bind(moduleName);\n\n db[moduleName].remove({_id: mongo.helper.toObjectID(id)}, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n deferred.resolve();\n }\n });\n\n return deferred.promise;\n}", "function listByUser(user) {\n return db.query('my_index2/by_user', {\n key: user,\n include_docs: true\n })\n .then(function(res) {\n /*Gets*/\n console.log(res.rows);\n return res.rows.map(function(r) {\n return r.doc;\n });\n });\n }", "getDocument(collectionName, query, projection) {\n return new Promise((resolve, reject) => {\n this.findOne(collectionName, query, projection)\n .then(resolve)\n .catch(reject);\n });\n }", "getLatestContentOfDocument(documentName, testerID) {\n var getLatestDoc1 = new Promise((resolve, reject) => {\n var storageLocation = config.personalStorageLocation + '/' + testerID + '/' + documentName + '-AutoSave' + '.md'\n fs.readFile(storageLocation,\n {\n encoding: 'utf8',\n flag: 'r'\n }, (err,data) => {\n if(!err) {\n resolve(data)\n } else {\n reject(err)\n }\n })\n })\n var getLatestDoc2= getLatestDoc1.catch((err) => {\n return new Promise((resolve, reject) => {\n var slateIncudesFolder = config.documentStorageLocation + '/' +\n documentName + '.md'\n fs.readFile(slateIncudesFolder,\n {\n encoding: 'utf8',\n flag: 'r'\n }, (err, data) => {\n if(!err) {\n resolve(data)\n } else {\n reject(err)\n }\n })\n })\n })\n\n return (getLatestDoc2) ? getLatestDoc2 : getLatestDoc1\n }", "function loadAllMdownDocs(doc, anchor){\n\n\t\tvar promises = [];\n\n\t\t$.each(arrDocNames, function(i, name){\n\t\t\tpromises.push(\n\t\t\t\tnew Promise(function (resolve, reject) {\n\t\t\t\t\t\t $.get(\"./markdown/\" + name + \".md\")\n\t\t\t\t\t\t\t .done(function (value) {resolve({value:value, name:name})})\n\t\t\t\t\t\t\t .fail(function () {reject(\"The document loading failed. Check the elements in the array arrDocNames[]\")});\n\t\t\t\t }\n\t\t\t));\n\t\t\t} //function\n\t\t); //each\n\n\t\tPromise.all(promises).then(function (array) {\n\t\t\tarrDocs = array.map(function (item) {\n\t\t\t\treturn {\n\t\t\t\t\tname: item.name,\n\t\t\t\t\ttitle: item.value.substring(item.value.indexOf(\"#\",0)+2,item.value.indexOf(\"\\n\",0)).trim(),\n\t\t\t\t\tcontent: item.value\n\t\t\t\t}\n\t\t\t});\n\t\t\tif(doc != null) loadMdDoc(doc, ['btnMenu','btnEditarDoc','btnToc','btnOpt'], anchor, null);\n\n // array to be used in the find functionality\n reformatedArrDocs = arrDocs.map(\n function(doc){\n var rDoc = {name:\"\",content:\"\",title:\"\"};\n rDoc.name = doc.name;\n rDoc.title = doc.title;\n // removes some markdown and HTML sintax\n rDoc.content = doc.content.replace(/!\\[(.*?)\\)|(#{1,} )|(\\*{2})|(\\_{2})|(\\|:-*)\\||(:-{2,})|(<div .*>)|(<\\/div>)|(<iframe .*>)|(<\\/iframe>)|(<button .*>)|(<\\/button>)/g,'');\n return rDoc;\n }\n );\n\n\t\t})\n} //function", "function updateModuleDoc(moduleName, updateDoc){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n\n service.findDuplicateDoc(moduleName, updateDoc).then(function(){\n db.bind(moduleName);\n \n //convert '_id' to ObjectID\n updateDoc._id = new ObjectID(updateDoc._id);\n \n db[moduleName].update({_id: updateDoc._id}, {$set: updateDoc}, function(err, writeResult){\n if(err){\n deferred.reject(err);\n }\n else{\n if(writeResult.result.nModified == 0){\n deferred.reject(notFound);\n }\n else{\n deferred.resolve();\n }\n }\n });\n }).catch(function(err){\n deferred.reject(err);\n });\n\n return deferred.promise;\n}", "parse() {\n const basePath = path.join(this.iotjs, 'docs/api');\n\n fs.readdir(basePath, (err, files) => {\n this.verboseLog(`Read '${basePath}' directory.`);\n\n if (err) {\n console.error(err.message);\n return false;\n }\n\n const promises = files.filter(file => !file.includes('reference')).map(file => {\n const name = file.slice(\n config.docname.pre.length,\n -config.docname.post.length\n ).toLowerCase().replace('file-system', 'fs');\n\n this.addModuleToOutput(name);\n\n return new Promise((resolve, reject) => {\n const filePath = path.join(basePath, file);\n\n fs.readFile(filePath, 'utf8', (error, data) => {\n this.verboseLog(`- Read '${filePath}' --> ${name} module`);\n\n if (error) {\n reject(error.message);\n } else {\n resolve({ name, data });\n }\n });\n });\n });\n\n Promise.all(promises).then((data) => {\n this.verboseLog('\\nParse each read file content to get their available functions list.');\n\n data.forEach((file) => {\n this.verboseLog(`- Parse ${file.name} module:`);\n\n let doc = false;\n let label = '';\n let detail = '';\n let insertText = '';\n let documentation = [];\n\n file.data.split('\\n').forEach(line => {\n // Prototype line match.\n if (!config.regex.new.test(line) && config.regex.proto.test(line)) {\n // Found a new prototype before an example, save the last known prototype if necessary.\n if (doc) {\n this.addFunctionToModule(file.name, {\n label: label,\n kind: 2,\n detail: detail,\n documentation: documentation.join('\\n'),\n insertText: insertText,\n });\n }\n\n const functionName = line.substring(4).replace(config.regex.args, '').split('.').pop();\n const functionDetail = line.substring(4);\n\n label = functionName;\n detail = functionDetail;\n insertText = functionName;\n documentation = [];\n doc = true;\n\n this.verboseLog(` = ${functionDetail}`);\n\n return;\n }\n\n // Documentation line match.\n if (!config.regex.event.test(line) &&\n !config.regex.exDef.test(line) &&\n !config.regex.exLess.test(line) &&\n !config.regex.proto.test(line) && doc) {\n documentation.push(line);\n } else {\n // Store the function documentation.\n if (doc) {\n this.addFunctionToModule(file.name, {\n label: label,\n kind: 2,\n detail: detail,\n documentation: documentation.join('\\n'),\n insertText: insertText,\n });\n }\n\n documentation = [];\n doc = false;\n }\n });\n });\n\n this.verboseLog('Modules are parsed.\\n');\n\n this.writeOutputToDestonation();\n }).catch((error) => {\n console.error(error);\n });\n });\n }", "async function getDoc() {\n doc = {\n titleNodeList : await document.querySelectorAll(elements.titleSelector),\n imageNodeList : await document.querySelectorAll(elements.imageSelector),\n descNodeList : await document.querySelectorAll(elements.descSelector),\n authorNodeList : await document.querySelectorAll(elements.authorSelector),\n ratingNodeList : await document.querySelectorAll(elements.ratingSelector),\n reviewNodeList : await document.querySelectorAll(elements.reviewSelector),\n basePriceNodeList : await document.querySelectorAll(elements.basePriceSelector),\n discPriceNodeList : await document.querySelectorAll(elements.discPriceSelector),\n durationNodeList : await document.querySelectorAll(elements.durationSelector),\n lectureNodeList : await document.querySelectorAll(elements.lectureSelector),\n levelNodeList : await document.querySelectorAll(elements.levelSelector), \n urlNodeList : await document.querySelectorAll(elements.urlSelector),\n }\n console.log('udah semua');\n return doc;\n }", "function addModuleDoc(moduleName, newDoc){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n\n db.bind(moduleName);\n\n db[moduleName].insert(newDoc, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n deferred.resolve();\n }\n });\n\n return deferred.promise;\n}", "function getTutorialsOfProject(req, res) {\n\t// Get projectID from query parameters to fetch only project's tutorials\n\t// Create query to get tutorials by projectID\n\tconst tutorialProjectID = req.params.projectID;\n\tconst query = Tutorial.find({tutorialProjectID}).populate('tutorialModuleID');\n\n\t// Execute query and return all modules that have the same projectID\n\tquery.exec((err, tutorials) => {\n\t\tif (err) {\n\t\t\tres.status(400).json({message: `Following error was encountered: ${err}`});\n\t\t} else if (!tutorials) {\n\t\t\tres.status(404).send('No tutorials found.');\n\t\t} else {\n\t\t\tres.status(200).json(tutorials);\n\t\t}\n\t});\n}", "function get_docs(name, server_name)\n{\n if (name != 'leer') {\n var w = window.open();\n w.location = server_name + '/docs/' + name;\n }\n}", "function deleteModule(moduleName){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n\n //drop the collection\n db.bind(moduleName);\n db[moduleName].drop(function(err){\n if(err){\n if(err.codeName == 'NamespaceNotFound'){\n deferred.reject(notFound);\n }\n else{\n deferred.reject(err);\n }\n }\n else{\n //remove document from 'modules' collection\n db.modules.remove({name: moduleName}, function(err, writeResult){\n if(err){\n deferred.reject(err);\n }\n else{\n //n is used to know if the document was removed\n if(writeResult.result.n == 0){\n deferred.reject(notFound);\n }\n else{\n deferred.resolve();\n }\n }\n });\n }\n });\n\n return deferred.promise;\n}", "async function getContacts(){\n const contacts = await loadContacts('[DB_NAME]','[COLLECTION]','[MONGO_CONNECTION_STRING]'); //CONNECT TO MONGO\n const res = await contacts.find().toArray(); //GET THE CONTACTS\n return res\n}", "async function getCourses() {\n\n const pageNumber = 2;\n const pageSize = 10;\n\n const courses = await Course\n .find({ author: 'Vivek', isPublished: true })\n // .find()\n // .or([ {author: 'Vivek'}, {isPublished: false} ])\n // .and([])\n\n // // starts with Vivek\n // .find({ author: /^Vivek/ })\n // // ends with Malhan\n // .find({ author: /Malhan$/i }) // i for case-insensitive\n // // contains Vivek\n // .find({ author: /.*Vivek.*/ })\n\n // pagination - to get the documents in the given page\n .skip((pageNumber - 1) * pageSize)\n .limit(pageSize)\n\n .sort({ name: 1 })\n .select({ name: 1, tags: 1, author: 1, isPublished: 1 })\n // .estimatedDocumentCount();\n console.log(courses);\n}", "getModuleList() {\n return this.http.get(this.url + '/cesco/getmodule', this.httpOptions);\n }", "function addModuleDoc(moduleName, newDoc){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n\n service.findDuplicateDoc(moduleName, newDoc).then(function(){\n db.bind(moduleName);\n\n db[moduleName].insert(newDoc, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n deferred.resolve();\n }\n });\n }).catch(function(err){\n deferred.reject(err);\n });\n\n return deferred.promise;\n}", "getPublications() {\n return this.perform('get', '/publications');\n }", "function getGallery() {\n return new Promise(function(resolve, reject) {\n gallery.find({}).sort({'date':-1}).limit(50).exec(function(err, doc) {\n if (err) {\n reject(err);\n } else {\n resolve(doc);\n }\n });\n });\n}", "_getSheetsInfo() {\n return new Promise((resolve, reject) => {\n this.doc.getInfo((err, info) => {\n if (!err) {\n console.log('Loaded doc: ' + info.title + ' by ' + info.author.email);\n resolve(info);\n }\n else {\n reject(err);\n }\n });\n })\n }", "loadDocument(urn) {\n return new Promise((resolve, reject) => {\n const paramUrn = !urn.startsWith('urn:') ? 'urn:' + urn : urn;\n\n window.Autodesk.Viewing.Document.load(\n paramUrn,\n doc => {\n resolve(doc);\n },\n error => {\n reject(error);\n }\n );\n });\n }", "getAllDocumentsByRoleUser(req, res) {\n const { page, limit } = req.params;\n\n return Document.find({})\n .populate('ownerId')\n .skip((page - 1) * limit)\n .limit(limit)\n .sort([['dateCreated', 'descending']])\n .then((documents) => {\n const filtered = documents.filter((obj) => obj.ownerId.role === 'User');\n\n return res.json(filtered);\n })\n .catch((err) => res.send(err));\n }", "function getRecommendations(fn){\r\n\tMongoClient.connect(uri, function(err, db) {\r\n\t\r\n\t\tif(err) throw err;\r\n\t\t\r\n\t\t//gets all available recommendations\r\n\t\tvar collection = db.collection('recommendation');\r\n\t\tcollection.find().toArray(function(err, results) {\r\n\t\t\t//sends recommendations to user\r\n\t\t\tfn(results);\r\n\t\t\tdb.close();\r\n\t\t});\r\n\t\t\r\n\t});\r\n}", "getModules(){\n return this.#fetchAdvanced(this.#getModulesURL()).then((responseJSON) => {\n let moduleBOs = ModuleBO.fromJSON(responseJSON);\n // console.info(moduleBOs);\n return new Promise(function (resolve) {\n resolve(moduleBOs);\n })\n })\n\n }", "function processGetAllDocumentsByKey(result, params){\n\tlabel.text = result;\n\n\tvar db = ss.getDatabase(con, dbFilePath2);\n\tdb.runXAgent(xpage, parameters, processRunXAgent, null);\n\n}", "function getOrdersForDriver (driverid) {\n return new Promise((resolve, reject)=> {\ndb = getDb()\ndb.collection(\"orders\").find({driverId: driverid}).toArray(function(err, docs) {\n if (err) { \n reject (err)\n }\n console.log(\"Found the record:\");\n console.log(docs)\n resolve(docs)\n })\n})\n}", "function getDocumentsFromDB(queryOptions, model, res) {\n model.find(queryOptions.where)\n .limit(queryOptions.limit)\n .sort(queryOptions.sort)\n .select(queryOptions.select)\n .skip(queryOptions.skip)\n .exec(function(err, docs) {\n if (err) {\n return res.status(500).json({ message: 'Error: Unable to retrieve results from database.', \n data: [] }); \n }\n else {\n var dataObj = docs;\n var msg = 'Returning a list of documents.'\n if (queryOptions.count) {\n dataObj = docs.length;\n msg = 'Returning a count of documents'\n }\n return res.status(200).json({ message: msg,\n data: dataObj,\n opts: queryOptions }); //TODO\n }\n });\n}", "function find_Recent_Docs(\n MongoClient//: MongoClient obj <- explicit\n ,mongoLab_URI//: str\n ,connection//: MongoClient.connect obj <- optional\n ,db//: MongoClient.connect.then() obj <- optional\n ,collection//: db.collection obj <- optional\n ,collection_Name//: str\n ,limit//: int\n ,is_Debug_Mode//: bool <- optional\n) {//: => Promise | thenable (list of (dict | obj) | undefined | error)\n \"use strict\";\n\n var result;\n var documents;//: list of obj\n var query = {};//: query obj\n var results = [];\n\n // most parameters are from super / parent scope\n function actual_Result(\n db//: MongoClient.connect.then() obj\n ,collection//: db.collection obj <- optional\n ,collection_Name//: str\n ,query//: obj\n ) {//: => Promise | thenable ((dict | obj) | undefined | error)\n if (collection) {\n if (is_Debug_Mode) {console.log(\"using passed collection parameter\");}\n } else {\n collection = db\n .collection(collection_Name);\n }\n\n return collection\n .find(\n query\n )\n .project({\"_id\": false, \"original_url\": true, \"short_url\": 1})\n .toArray()\n .then((docs) => {\n if (is_Debug_Mode) {console.log(\"documents found:\", docs.length);}\n if (is_Debug_Mode) {console.log(docs);}\n if (is_Debug_Mode) {\n // Logging property names and values using Array.forEach\n Object\n //.getOwnPropertyNames(obj)\n .keys(docs)\n .forEach((val, idx, array) => {\n //!(is_Debug_Mode) ||\n console.log(\n val, '->', docs[val]);\n });\n }\n //*** find original_Link in docs ***//\n //var filtered = arr.filter(func);\n results = docs.filter((doc) => {return doc.original_url == original_Link;});\n if (results.length > 0) {\n result = {\"document\": results[0], \"is_New\": false};//, \"db\": db};\n } else {\n //*** find Arrays / lists difference ***//\n documents = [];\n documents.push({\"original_url\": original_Link, \"short_url\": short_Links[0]});\n documents.push({\"original_url\": original_Link, \"short_url\": short_Links[1]});\n documents.push({\"original_url\": original_Link, \"short_url\": short_Links[2]});\n documents.push({\"original_url\": original_Link, \"short_url\": short_Links[3]});\n\n results = comparator.lists_Difference(\n documents//: list (of obj)\n ,docs//: list (of obj)\n ,is_Debug_Mode\n );\n result = results.hasOwnProperty(0) ? results[0] : result;\n result = {\"document\": result, \"is_New\": true};//, \"db\": db};\n }\n if (is_Debug_Mode) {console.log(\"result\", result);}\n result.db = db;\n //db.close();\n\n return Promise.resolve(\n result\n );\n }\n )\n .catch((err) => {\n if (is_Debug_Mode) {console.log(\"cursor.then():\", err.stack);}\n return Promise.reject(err);\n }\n );\n }\n //!(env.DEBUG_MODE.value) || console.log(\"mongoLab_URI is:\", mongoLab_URI);\n if (is_Debug_Mode) {console.log(\"short_Link_Size:\", short_Link_Size);}\n\n // prepossessing\n short_Links.push(link_Gen.get_Short_Link(short_Link_Size));//, null, env.DEBUG_MODE.value));\n short_Links.push(link_Gen.get_Short_Link(short_Link_Size));\n short_Links.push(link_Gen.get_Short_Link(short_Link_Size));\n short_Links.push(link_Gen.get_Short_Link(short_Link_Size + 1));\n\n // one \"original_url\"\n // many \"short_url\"\n query = {\n $or: [\n {\n \"original_url\": original_Link\n }\n ,{\n \"short_url\": {\n $in: [\n short_Links[0]\n ,short_Links[1]\n ,short_Links[2]\n ,short_Links[3]\n ]\n }\n }\n ]\n };\n if (is_Debug_Mode) {console.log(\"query: %j\", query);}\n if (is_Debug_Mode) {console.log(\"typeof(db):\", typeof(db));}\n if (is_Debug_Mode) {console.log(\"db instanceof Promise:\", (db instanceof Promise));}\n if (is_Debug_Mode) {console.log(\"typeof(collection)\", typeof(collection));}\n if (is_Debug_Mode) {console.log(\"collection instanceof Promise:\", (collection instanceof Promise));}\n\n if (db) {\n //if (db && collection) {\n if (is_Debug_Mode) {console.log(\"using passed db parameter\");}\n\n return actual_Result(\n db//: MongoClient.connect.then() obj\n ,collection//: db.collection obj <- optional\n ,collection_Name//: str\n ,query//: obj\n );\n } else {\n if (connection) {} else {\n connection = MongoClient.connect(mongoLab_URI);//, function(err, db) {\n }\n //return Promise.resolve(connection\n return connection\n .then((db) => {\n // the new Collection instance if not in strict mode\n //var collection = db.collection(collection_Name);\n //var cursor = collection\n\n // non-interrupted chain of returns needed\n // to obtain / gain Promise | thenable\n // as return value\n //return collection\n return actual_Result(\n db//: MongoClient.connect.then() obj\n ,collection//: db.collection obj <- optional\n ,collection_Name//: str\n ,query//: obj\n );\n }\n )\n .catch((err) => {\n if (is_Debug_Mode) {console.log(\"connection.then():\", err.stack);}\n return Promise.reject(err);\n }\n //)\n );\n }\n}", "getDocumentFiles(id) {\n return this.promisify(cb => super.getDocumentFiles(id, cb))\n }", "getAllDocumentsByRoleAdministrator(req, res) {\n const { page, limit } = req.params;\n\n return Document.find({})\n .populate('ownerId')\n .skip((page - 1) * limit)\n .limit(limit)\n .sort([['dateCreated', 'descending']])\n .then((documents) => {\n const filtered = documents.filter(\n (obj) => obj.ownerId.role === 'Administrator',\n );\n\n return res.json(filtered);\n })\n .catch((err) => res.send(err));\n }", "function DocumentoByCheque(NoCheque) {\n var deferred = $q.defer();\n var doc = NoCheque != undefined? NoCheque : 0;\n\n $http.get('/desembolsojson/?nocheque={NoCheque}&format=json'.replace('{NoCheque}', doc))\n .success(function (data) {\n deferred.resolve(data);\n });\n\n return deferred.promise;\n }", "static async getTasksByModule(module) {\n try {\n let res = await axios.get(`${url}/getByModule/${module}`);\n let data = res.data;\n if (data != 'No Tasks.') {\n return data;\n }\n }\n catch (err) {\n console.log(err);\n return [];\n }\n }", "function getFiles() {\n const courseName = /*cleanupCourseName(*/ //set course name\n document.getElementsByClassName(\"breadcrumb-item\")[2].textContent.trim() || //try to get course name\n document.getElementsByTagName(\"h1\")[0].innerText || //if no course name, get probably university name\n document.querySelector(\"header#page-header .header-title\").textContent.trim() ||\n \"\";\n /*document.getElementsByClassName(\"breadcrumb-item\")[2].firstElementChild.title ||*/\n // The session key should normally be accessible through window.M.cfg.sesskey,\n // but getting the window object is hard.\n // Instead, we can grab the session key from the logout button.\n // Note that var is used here as this script can be executed multiple times.\n const sesskey = new URL(\n document.querySelector(\"a[href*='login/logout.php']\").href\n ).searchParams.get(\"sesskey\");\n\n const tableBody = document.querySelector(\n \"div[role='main'] > table.generaltable.mod_index > tbody\"\n );\n const SUPPORTED_FILES = new Set([\"File\", \"Folder\", \"URL\", \"Page\", \"קובץ\"]);\n\n const allFiles = tableBody === null\n ? getFilesUnderSections(sesskey, SUPPORTED_FILES)\n : getFilesUnderResources(sesskey, tableBody, SUPPORTED_FILES);\n allFiles.forEach(file => (file.course = courseName));\n chrome.runtime.sendMessage({\n message: \"All Files\",\n files: allFiles\n },\n function (response) {\n console.log(response);\n });\n return allFiles;\n }", "async function getDocuments() {\n setLoadingScreen(true)\n try {\n const response = await axios.get('/api/note')\n\n if (response.status === 200) {\n setLoadingScreen(false)\n formatList(response.data)\n } else {\n setLoadingScreen(false)\n setError({ isError: true, message: 'Something went wrong. Try again later'})\n }\n } catch (err) {\n console.log(err)\n setLoadingScreen(false)\n setError({ isError: true, message: err.response.data.message })\n }\n }", "function getTodos() {\n todoDb.find({}, (error, todos) => {\n if(error) console.log(error);\n window.webContents.send('getTodos', todos);\n })\n}", "function GoogleDocsInSpecificFolder(docName, FolderFullPath)\n{\n if(FolderFullPath == \"//\")\n {\n // Read files in Root, getFilesByName return the FileIterator\n var RootDocs = DriveApp.getRootFolder().getFilesByName(docName);\n return RootDocs;\n }\n else\n {\n // getFolder return the FolderIterator\n var TargetFolders = getFolder(FolderFullPath); \n while (TargetFolders.hasNext())\n {\n var folder = TargetFolders.next();\n var docFiles = folder.getFilesByName(docName);\n return docFiles;\n }\n } \n}", "get(repoId, docId) {\n const rows = this.preparedGet.all(repoId, docId);\n return rowsToCursor(rows);\n }", "fetch() {\n return new Promise((resolve, reject) => {\n this.doc.fetch((err) => {\n if (err) {\n reject(err);\n }\n else {\n resolve(this.doc);\n }\n });\n });\n }", "function requestModuleListData() {\n cr.sendWithPromise('requestModuleList').then(returnModuleList);\n}", "async function getDoc (zoneSlug, versionNo, permalink) {\n if (!zoneSlug || !versionNo || !permalink) {\n throw new Error(\n `Cannot fetch doc. \"zoneSlug\", \"versionNo\" and \"permalink\" are required.`\n )\n }\n\n const { data } = await axios(`${BASE_URL}/${zoneSlug}/versions/${versionNo}/${permalink}.json`)\n return data\n}", "function getAllOrders () {\n return new Promise((resolve, reject)=> {\n db = getDb()\n db.collection(\"orders\").find({}).toArray(function(err, docs) {\n if (err) { \n reject (err)\n }\n console.log(\"Found the following records\");\n console.log(docs)\n resolve(docs)\n })\n })\n}", "function updateModuleDoc(moduleName, updateDoc){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n\n db.bind(moduleName);\n\n //create another object and copy. then delete the '_id' property of the new copy\n var forUpdate = {};\n Object.assign(forUpdate, updateDoc);\n delete forUpdate._id;\n\n db[moduleName].update({_id: mongo.helper.toObjectID(updateDoc._id)}, {$set: forUpdate}, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n deferred.resolve();\n }\n });\n\n return deferred.promise;\n}", "function getMascDocu(pObjeto){\n\n}", "async function getModuleInfoFromFirebase() {\n console.log(module.value);\n db.collection('modules')\n .doc(module.value)\n .get()\n .then((doc) => {\n setModuleVideos(doc.data());\n });\n }", "function fetchMarkupDoc(){\n\t\t\tvar request = $http({\n\t\t\t\tmethod: \"post\",\n\t\t\t\turl: \"/data/get-markup-document\"\n\t\t\t});\n\n\t\t\treturn(request.then(function(response){\n\t\t\t\treturn response.data;\n\t\t\t}, handleError));\n\t\t}", "function getAllItemsREST(callback) {\n\tvar PATH = \"/items/_all_docs?include_docs=true\";\n\tvar options = {\n\t\thostname : CLOUDANT_REST_URL,\n\t\tport : '80',\n\t\tpath : PATH,\n\t\tmethod : 'GET',\n\t\theaders : {\n\t\t\t 'Authorization': 'Basic MmJlMjg0NTctY2JhNy00NDlhLWE4NzAtYjFjYWE0NWQ5MzUwLWJsdWVtaXg6MjRjNzI5NWFkOWM5OWQ5NmQ4Y2JmYmEzZGVlYzdmODU1ZGU2NTA0ODY2ZTcyYzc2YWZjMjQ0Y2FiZTJjNzk3Mg=='\n\t\t},\n\t\trejectUnauthorized : false,\n\t\tagent : false,\n\t};\n\tvar req = http.request(options, function(res) {\n\t\tvar resultString = '';\n\t\tres.on('data', function(chunk) {\n\t\t\tconsole.log('get response: ' + chunk);\n\t\t\tresultString += chunk;\n\t\t});\n\t\tres.on('error', function(c) {\n\t\t\tconsole.log('get error: ' + c);\n\t\t});\n\t\tres.on('end', function() {\n\t\t\tconsole.log('get status ' + res.statusCode);\n\t\t\tif (res.statusCode === 200) {\n\t\t\t\tcallback(JSON.parse(resultString));\n\t\t\t} else {\n\t\t\t\tcallback(); // error case\n\t\t\t}\n\t\t});\n\t});\n\treq.end();\n}", "function findObj() {\n var search = db.collection('search');\n search.find({\n }, {\n \"_id\" : 1,\n \"link\" : 1,\n \"id\" : 1,\n \"title\" : 1\n }).limit(pagNum).toArray(function(err, results) {\n if (err) throw err;\n console.log(\"Returned #\" + results.length + \" documents\");\n res.send({results});\n });\n } // end: find documents in mongodb", "function getDocs(src, diffs, state) {\n diffs = clone(diffs); // we do not need to modify this\n\n var resultDocs = [];\n\n function getAllDocs() {\n\n var bulkGetOpts = createBulkGetOpts(diffs);\n\n if (!bulkGetOpts.docs.length) { // optimization: skip empty requests\n return;\n }\n\n return src.bulkGet(bulkGetOpts).then(function (bulkGetResponse) {\n /* istanbul ignore if */\n if (state.cancelled) {\n throw new Error('cancelled');\n }\n bulkGetResponse.results.forEach(function (bulkGetInfo) {\n bulkGetInfo.docs.forEach(function (doc) {\n if (doc.ok) {\n resultDocs.push(doc.ok);\n }\n });\n });\n });\n }\n\n function hasAttachments(doc) {\n return doc._attachments && Object.keys(doc._attachments).length > 0;\n }\n\n function fetchRevisionOneDocs(ids) {\n // Optimization: fetch gen-1 docs and attachments in\n // a single request using _all_docs\n return src.allDocs({\n keys: ids,\n include_docs: true\n }).then(function (res) {\n if (state.cancelled) {\n throw new Error('cancelled');\n }\n res.rows.forEach(function (row) {\n if (row.deleted || !row.doc || !isGenOne$1(row.value.rev) ||\n hasAttachments(row.doc)) {\n // if any of these conditions apply, we need to fetch using get()\n return;\n }\n\n // the doc we got back from allDocs() is sufficient\n resultDocs.push(row.doc);\n delete diffs[row.id];\n });\n });\n }\n\n function getRevisionOneDocs() {\n // filter out the generation 1 docs and get them\n // leaving the non-generation one docs to be got otherwise\n var ids = Object.keys(diffs).filter(function (id) {\n var missing = diffs[id].missing;\n return missing.length === 1 && isGenOne$1(missing[0]);\n });\n if (ids.length > 0) {\n return fetchRevisionOneDocs(ids);\n }\n }\n\n function returnDocs() {\n return resultDocs;\n }\n\n return PouchPromise.resolve()\n .then(getRevisionOneDocs)\n .then(getAllDocs)\n .then(returnDocs);\n}", "function getDocument() {\n return DocumentApp.getActiveDocument().getBody().getText();\n}", "function fetchListAndDocuments(page, per_page) {\n return fetchList(page, per_page)\n .then((collection) => {\n return Promise.all(collection.map((item) => fetchDocument(item)));\n });\n}", "async function getBooks() {\r\n\ttry{\r\n\t\t// lean() transforms mongoose object to json object\r\n\t\tconst data = await newBoek.find().lean();\r\n\t\treturn data;\r\n\t} catch (error) {\r\n\t\tconsole.log('getBooks failed ' + error);\r\n\t}\r\n}", "function getIndexedDoc(task) {\n const path = `${task.indexedPath}?_source_includes=attachments&_source_excludes=*data,*content`;\n \n return getElastic(path)\n .then((result) => {\n if (!result.found || !result._source) {\n return null;\n }\n return result._source;\n });\n}", "function getDescribeObjects(accessibleModules, moduleName, callback) {\n\t\tvtinst.describeObject(moduleName, handleError(function (result) {\n\t\t\tvar parent = referencify(result);\n\t\t\tvar fields = parent['fields'];\n\t\t\tvar referenceFields = filter(function (e) {\n\t\t\t\treturn e['type']['name'] == 'reference';\n\t\t\t},\n\t\t\t\t\tfields);\n\t\t\tvar referenceFieldModules =\n\t\t\t\t\tmap(\n\t\t\t\t\t\t\tfunction (e) {\n\t\t\t\t\t\t\t\treturn e['type']['refersTo'];\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\treferenceFields\n\t\t\t\t\t\t\t);\n\t\t\tfunction union(a, b) {\n\t\t\t\tvar newfields = filter(function (e) {\n\t\t\t\t\treturn !contains(a, e);\n\t\t\t\t}, b);\n\t\t\t\treturn a.concat(newfields);\n\t\t\t}\n\t\t\tvar relatedModules = reduceR(union, referenceFieldModules, [parent['name']]);\n\n\t\t\t// Remove modules that is no longer accessible\n\t\t\trelatedModules = diff(accessibleModules, relatedModules);\n\n\t\t\tfunction executer(parameters) {\n\t\t\t\tvar failures = filter(function (e) {\n\t\t\t\t\treturn e[0] == false;\n\t\t\t\t}, parameters);\n\t\t\t\tif (failures.length != 0) {\n\t\t\t\t\tvar firstFailure = failures[0];\n\t\t\t\t\tcallback(false, firstFailure[1]);\n\t\t\t\t} else {\n\t\t\t\t\tvar moduleDescriptions = map(function (e) {\n\t\t\t\t\t\treturn referencify(e[1]);\n\t\t\t\t\t},\n\t\t\t\t\t\t\tparameters);\n\t\t\t\t\tvar modules = dict(map(function (e) {\n\t\t\t\t\t\treturn [e['name'], e];\n\t\t\t\t\t},\n\t\t\t\t\t\t\tmoduleDescriptions));\n\t\t\t\t\tcallback(true, modules);\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar p = parallelExecuter(executer, relatedModules.length);\n\t\t\t$.each(relatedModules, function (i, v) {\n\t\t\t\tp(function (callback) {\n\t\t\t\t\tvtinst.describeObject(v, callback);\n\t\t\t\t});\n\t\t\t});\n\t\t}));\n\t}", "function getDrivers () {\nreturn new Promise((resolve, reject)=> {\ndb = getDb()\ndb.collection(\"drivers\").find({}).toArray(function(err, drivers) {\n if (err) { \n reject (err)\n }\nconsole.log(\"Found the following drivers\");\nconsole.log(drivers)\n\nresolve(drivers);\n});\n})\n}", "listOneDoc(req, res) {\n const user = req.decoded;\n\n Document.findOne({ where: { id: req.params.id } })\n .then((document) => {\n if (!document) {\n res.status(404).send({ message: 'Document not found!' });\n } else if (document.access === 'public' || document.userId === user.id) {\n res.status(200).send(document);\n } else {\n res.send({ message: 'You do not have the permissions to view that document' });\n }\n });\n }", "static async findList(req, res) {\n \n \n try{\n\n const { name } = req.query\n \n // get student list\n const students = await studentService.findList({keyword:name})\n \n // create response\n const response = {\n success: true,\n data: {\n total: students.count,\n students:students.rows\n }\n }\n res.send(response)\n } catch (e) {\n res.send(e)\n }\n }" ]
[ "0.6185267", "0.5993622", "0.59846175", "0.59552914", "0.57914364", "0.5780547", "0.57780313", "0.57778186", "0.5751649", "0.57448214", "0.5715541", "0.5707072", "0.5701094", "0.5696588", "0.56830984", "0.56245357", "0.56133175", "0.55978113", "0.55827266", "0.5580734", "0.55675834", "0.5550082", "0.5536222", "0.55329823", "0.55166954", "0.5499953", "0.5486899", "0.54621136", "0.54202133", "0.53830093", "0.53830093", "0.53787744", "0.53502446", "0.53461033", "0.53416485", "0.53130853", "0.5302086", "0.5286442", "0.5275529", "0.5269664", "0.5266998", "0.5255823", "0.52546185", "0.52493554", "0.5249298", "0.5241976", "0.5238081", "0.52309716", "0.52143687", "0.52128136", "0.5208717", "0.51956546", "0.51928395", "0.5178053", "0.5169261", "0.51586115", "0.51541835", "0.5142383", "0.5134688", "0.51295656", "0.51294893", "0.51251733", "0.5117839", "0.5105447", "0.5103468", "0.5088635", "0.5084713", "0.5050461", "0.5047026", "0.50360745", "0.50353605", "0.50303906", "0.5029191", "0.50271624", "0.5020776", "0.5019453", "0.5015241", "0.5015192", "0.5005044", "0.4996756", "0.49906415", "0.49871516", "0.49826232", "0.49694675", "0.49654046", "0.49637425", "0.49561238", "0.49527812", "0.49506533", "0.4941177", "0.49408793", "0.49396047", "0.49356598", "0.4932329", "0.49322072", "0.49309024", "0.49302295", "0.49302015", "0.4914996" ]
0.8136698
1
Function name: update a module document Author: Reccion, Jeremy Date Modified: 2018/04/04 Description: update a document of a specific module Parameter(s): moduleName: string type updateDoc: object type. includes: _id: required. string type //fields must be the specific module's 'fields' in 'modules' collection Return: Promise
function updateModuleDoc(moduleName, updateDoc){ var deferred = Q.defer(); moduleName = moduleName.toLowerCase(); service.findDuplicateDoc(moduleName, updateDoc).then(function(){ db.bind(moduleName); //convert '_id' to ObjectID updateDoc._id = new ObjectID(updateDoc._id); db[moduleName].update({_id: updateDoc._id}, {$set: updateDoc}, function(err, writeResult){ if(err){ deferred.reject(err); } else{ if(writeResult.result.nModified == 0){ deferred.reject(notFound); } else{ deferred.resolve(); } } }); }).catch(function(err){ deferred.reject(err); }); return deferred.promise; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateModuleDoc(moduleName, updateDoc){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n\n db.bind(moduleName);\n\n //create another object and copy. then delete the '_id' property of the new copy\n var forUpdate = {};\n Object.assign(forUpdate, updateDoc);\n delete forUpdate._id;\n\n db[moduleName].update({_id: mongo.helper.toObjectID(updateDoc._id)}, {$set: forUpdate}, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n deferred.resolve();\n }\n });\n\n return deferred.promise;\n}", "function updateModule(updateModule){\n var deferred = Q.defer();\n\n updateModule.name = updateModule.name.toLowerCase();\n\n //fields array should not be editable when using this function. therefore, delete it from input\n delete updateModule.fields;\n\n db.modules.find({$or: [\n {_id: mongo.helper.toObjectID(updateModule._id)},\n {name: updateModule.name}\n ]}).toArray(function(err, modules){\n if(err){\n deferred.reject(err);\n }\n else if(modules.length == 0){\n deferred.reject(notFound);\n }\n //vali inputs, no other document have the same name\n else if(modules.length == 1){\n var oldModule = modules[0];\n \n //rename if old & new names are different\n if(oldModule.name != updateModule.name){\n db.bind(oldModule.name);\n db[oldModule.name].rename(updateModule.name, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n update();\n }\n });\n }\n //go straight to update\n else{\n update();\n }\n }\n //another module document with the same name exists\n else{\n deferred.reject(exists);\n }\n }); \n\n //updates the document in the 'modules' collection\n function update(){\n\n //create another object and copy. then delete the '_id' property of the new copy\n var forUpdate = {};\n Object.assign(forUpdate, updateModule);\n delete forUpdate._id;\n \n db.modules.update({_id: mongo.helper.toObjectID(updateModule._id)}, {$set: forUpdate}, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n deferred.resolve();\n }\n });\n }\n\n return deferred.promise;\n}", "function updateModule(updateModule){\n var deferred = Q.defer();\n\n updateModule.name = updateModule.name.toLowerCase();\n\n //fields array should not be editable when using this function. therefore, delete it from input\n delete updateModule.fields;\n\n //check if the name of the selected module has not changed\n db.modules.findOne({_id: mongo.helper.toObjectID(updateModule._id)}, function(err, aModule){\n if(err){\n deferred.reject(err);\n }\n else if(aModule){\n //if names are different, renaming the collection must be executed, then proceed to update\n if(aModule.name != updateModule.name){\n db.bind(aModule.name);\n db[aModule.name].rename(updateModule.name, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n update();\n }\n });\n }\n }\n else{\n update();\n }\n });\n\n //updates the document in the 'modules' collection\n function update(){\n\n //create another object and copy. then delete the '_id' property of the new copy\n var forUpdate = {};\n Object.assign(forUpdate, updateModule);\n delete forUpdate._id;\n \n db.modules.update({_id: mongo.helper.toObjectID(updateModule._id)}, {$set: forUpdate}, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n deferred.resolve();\n }\n });\n }\n\n return deferred.promise;\n}", "function updateModuleField(moduleName, fieldObject){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n\n fieldObject.id = new ObjectID(fieldObject.id);\n \n db.modules.update({name: moduleName, fields: {$elemMatch: {id: fieldObject.id}}}, {$set: {'fields.$': fieldObject}}, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n deferred.resolve();\n }\n });\n\n return deferred.promise;\n}", "function updateModuleField(moduleName, fieldObject){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n\n console.log(fieldObject);\n\n service.getModuleByName(moduleName).then(function(aModule){ \n //use array.filter() to get the duplicate fields\n var duplicateFields = aModule.fields.filter(function(field){\n //lesson learned: use toString() in id\n return field.id.toString() == fieldObject.id.toString() || field.name == fieldObject.name;\n });\n \n if(duplicateFields.length == 0){\n deferred.reject(notFound);\n }\n //valid inputs\n else if(duplicateFields.length == 1){\n //this is to ensure that the field is inside the specific module (in case of improper input parameters)\n\n fieldObject.id = new ObjectID(fieldObject.id);\n\n if(duplicateFields[0].id.toString() == fieldObject.id.toString()){\n db.modules.update({name: moduleName, fields: {$elemMatch: {id: fieldObject.id}}}, {$set: {'fields.$': fieldObject}}, function(err, writeResult){\n if(err){\n deferred.reject(err);\n }\n else{\n console.log(writeResult.result);\n deferred.resolve();\n }\n });\n }\n //the only element has the same name but is different id, therefore, not inside the module document\n else{\n deferred.reject(notFound);\n }\n }\n else{\n deferred.reject(exists);\n }\n }).catch(function(err){\n deferred.reject(err);\n });\n\n return deferred.promise;\n}", "function update(){\n\n //create another object and copy. then delete the '_id' property of the new copy\n var forUpdate = {};\n Object.assign(forUpdate, updateModule);\n delete forUpdate._id;\n \n db.modules.update({_id: mongo.helper.toObjectID(updateModule._id)}, {$set: forUpdate}, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n deferred.resolve();\n }\n });\n }", "function update(){\n\n //create another object and copy. then delete the '_id' property of the new copy\n var forUpdate = {};\n Object.assign(forUpdate, updateModule);\n delete forUpdate._id;\n \n db.modules.update({_id: mongo.helper.toObjectID(updateModule._id)}, {$set: forUpdate}, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n deferred.resolve();\n }\n });\n }", "function updateFieldArray(moduleName, fieldArray){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n\n //need to convert each 'id' property to an ObjectID\n for(var i = 0; i < fieldArray.length; i++){\n fieldArray[i].id = new ObjectID(fieldArray[i].id);\n }\n \n\n db.modules.update({name: moduleName}, {$set: {fields: fieldArray}}, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n deferred.resolve();\n }\n });\n\n return deferred.promise;\n}", "function updateFieldArray(moduleName, fieldArray){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n\n db.modules.update({name: moduleName}, {$set: {fields: fieldArray}}, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n deferred.resolve();\n }\n });\n\n return deferred.promise;\n}", "function findDuplicateDoc(moduleName, moduleDoc){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n\n //get the fields of the specific module\n service.getModuleByName(moduleName).then(function(aModule){\n //initialize array & object for querying\n var uniqueFields = [];\n var tempObj;\n\n //push the value of the document when a field is unique\n aModule.fields.forEach(function(field){\n if(field.unique){\n tempObj = {};\n tempObj[field.name] = moduleDoc[field.name];\n uniqueFields.push(tempObj);\n }\n });\n\n if(uniqueFields.length == 0){\n deferred.resolve();\n }\n else{\n //use $or for checking each field for uniqueness, not their combination\n db[moduleName].findOne({$or: uniqueFields}, function(err, duplicateDoc){\n if(err){\n deferred.reject(err);\n }\n //a duplicate exists, but needs further checking\n else if(duplicateDoc){\n //updating a module document\n if(moduleDoc._id){\n //different module documents with similar unique values\n if(moduleDoc._id != duplicateDoc._id){\n deferred.reject(exists);\n }\n //since it is the same document, it is not duplicate\n else{\n deferred.resolve();\n }\n }\n //adding new module documennt\n else{\n deferred.reject(exists);\n }\n }\n //does not exist\n else{\n deferred.resolve();\n }\n });\n }\n\n \n }).catch(function(err){\n deferred.reject(err);\n });\n\n return deferred.promise;\n}", "function addModuleDoc(moduleName, newDoc){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n\n db.bind(moduleName);\n\n db[moduleName].insert(newDoc, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n deferred.resolve();\n }\n });\n\n return deferred.promise;\n}", "function addModuleDoc(moduleName, newDoc){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n\n service.findDuplicateDoc(moduleName, newDoc).then(function(){\n db.bind(moduleName);\n\n db[moduleName].insert(newDoc, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n deferred.resolve();\n }\n });\n }).catch(function(err){\n deferred.reject(err);\n });\n\n return deferred.promise;\n}", "function findDuplicateDoc(moduleName, moduleDoc){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n\n //get the fields of the specific module\n service.getModuleByName(moduleName).then(function(aModule){\n //initialize array & object for querying\n var uniqueValues = [];\n var tempObj;\n\n //push the value of the document when a field is unique\n aModule.fields.forEach(function(field){\n if(field.unique){\n tempObj = {};\n tempObj[field.name] = moduleDoc[field.name];\n uniqueValues.push(tempObj);\n }\n });\n\n if(uniqueValues.length == 0){\n deferred.resolve();\n }\n else{\n db.bind(moduleName);\n\n //use $or for checking each field for uniqueness, not their combination\n db[moduleName].findOne({$or: uniqueValues}, function(err, duplicateDoc){\n if(err){\n deferred.reject(err);\n }\n //a duplicate exists, but needs further checking\n else if(duplicateDoc){\n //updating a module document\n if(moduleDoc._id){\n //different module documents with similar unique values\n if(moduleDoc._id != duplicateDoc._id){\n deferred.reject(exists);\n }\n //since it is the same document, it is not duplicate\n else{\n deferred.resolve();\n }\n }\n //adding new module documennt\n else{\n deferred.reject(exists);\n }\n }\n //does not exist - similar to notFound. but it is not rejected based on design\n else{\n deferred.resolve();\n }\n });\n }\n }).catch(function(err){\n deferred.reject(err);\n });\n\n return deferred.promise;\n}", "function addModuleField(moduleName, fieldObject){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n\n //create a new objectID to used as query for updates and delete\n fieldObject.id = new ObjectID();\n\n //the query searches for the module name that do not have the inputted field name\n //this is to avoid pushing same field names on the 'fields' array of the specified module\n //writeResult will determine if the update was successful or not (i.e. writeResult.result.nModified)\n db.modules.update({name: moduleName, fields: {$not: {$elemMatch: {name: fieldObject.name}}}}, {$push: {fields: fieldObject}}, function(err, writeResult){\n if(err){\n deferred.reject(err);\n }\n else{\n //console.log(writeResult.result);\n //check the status of the update, if it failed, it means that there is an existing field name\n if(writeResult.result.nModified == 0){\n deferred.reject(exists);\n }\n else{\n deferred.resolve();\n }\n }\n });\n\n return deferred.promise;\n}", "function addModuleField(moduleName, fieldObject){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n\n //create a new objectID to used as query for updates and delete\n fieldObject.id = new ObjectID();\n\n db.modules.update({name: moduleName}, {$push: {fields: fieldObject}}, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n deferred.resolve();\n }\n });\n\n return deferred.promise;\n}", "function changeModName() {\n //console.log('Modname' + modName);\n db.collection('modules')\n .doc(module.value)\n .update({\n 'module.name': modName,\n })\n .then(function () {\n console.log('modName updated successfully');\n history.push('/success');\n });\n }", "function changeDoc(req, res) {\n var id = req.swagger.params.id.value;\n var data = JSON.parse(req.swagger.params.docname.value);\n var userId = req.decoded.user_id;\n var clientId = req.decoded.client_id;\n var name = data.docname;\n var autor = data.autor;\n var filename = data.filename\n var query = '';\n //console.log(name); \n if (data.docname) {\n query = `Update sadrzaj set \n name = '` + name + `', \n modified_by = ` + userId + `,\n modified_ts = NOW()\n\n where id =` + id + ` `;\n }\n if (data.autor) {\n query = `Update ri.dokumentacija set \n autor = '` + autor + `'\n where id =` + id + ` `;\n }\n if(data.filename)\n {\n query = `Update ri.dokumentacija set \n link = '` + filename + `' \n where id =` + id + ` `;\n }\n console.log(query);\n \n var client = new pg.Client(conString);\n client.connect(function(err) {\n if (err) {\n return console.error('could not connect to postgres', err);\n } else { \n client.query(query, function(err, result) {\n if (err) {\n return console.error('error running query', err);\n } else {\n\n res.json(\"Changed\");\n }\n })\n }\n })\n\n \n}", "function deleteModuleDoc(moduleName, id){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n\n db.bind(moduleName);\n\n db[moduleName].remove({_id: mongo.helper.toObjectID(id)}, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n deferred.resolve();\n }\n });\n\n return deferred.promise;\n}", "function deleteModuleDoc(moduleName, id){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n\n db.bind(moduleName);\n\n db[moduleName].remove({_id: mongo.helper.toObjectID(id)}, function(err, writeResult){\n if(err){\n deferred.reject(err);\n }\n else{\n //n is used to know if the document was removed\n if(writeResult.result.n == 0){\n deferred.reject(notFound);\n }\n else{\n deferred.resolve();\n }\n }\n });\n\n return deferred.promise;\n}", "function orgUpdateField(org_id, fieldName, fieldValue ) {\n\n // var member = globalMembers.find(function (member) { return member.id === member_id; }); //get the member object\n \n var ckanParameters = { id: org_id };\n ckanParameters[fieldName] = fieldValue;\n\n\n\n\n debugger;\n var client = new CKAN.Client(ckanServer, myAPIkey);\n\n client.action('organization_patch', ckanParameters,\n function (err, result) {\n if (err != null) { //some error - try figure out what\n mylog(mylogdiv, \"orgUpdateField ERROR: \" + JSON.stringify(err));\n console.log(\"orgUpdateField ERROR: \" + JSON.stringify(err));\n //return false;\n return 0;\n } else // we have managed to update. We are getting the full info for the org as the result\n {\n console.log(\"orgUpdateField RETURN: \" + JSON.stringify(result.result));\n //return true;\n return 1;\n // update the globalMembers array\n // update the screen\n\n }\n\n });\n\n\n}", "function deleteModuleField(moduleName, fieldID){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n \n db.modules.update({name: moduleName}, {$pull: {fields: {id: mongo.helper.toObjectID(fieldID)}}}, function(err, writeResult){\n if(err){\n deferred.reject(err);\n }\n else{\n if(writeResult.result.nModified == 0){\n deferred.reject(notFound);\n }\n else{\n deferred.resolve();\n }\n }\n });\n\n return deferred.promise;\n}", "function updateDocument(params) {\n var deferred = $q.defer();\n\n $http({\n method: 'POST',\n url: $rootScope.serverEndpoint + 'jsonServices/updateDocument',\n data: {\n 'tokenAuthentication': params.tokenAuthentication,\n 'documentID': params.documentID,\n 'fields': params.fields,\n 'resource': (params.resource) ? params.resource : undefined\n }\n })\n \n .then(function(response) {\n if(response.data.codRet == WS_SUC_COD_RET) {\n deferred.resolve(response.data);\n } else if (response.data.codRet == WS_EXP_COD_RET) {\n deferred.reject(response.data.msg);\n } else {\n deferred.reject(response.data.msg);\n }\n })\n .catch(function(errorResponse) {\n deferred.reject(errorResponse);\n });\n\n return deferred.promise;\n }", "update(req, res) {\n // update only allowed for authorised user of their own documents or admin\n const isPermittedUser =\n req.decoded.role === 'Administrator' || req.decoded._id === req.params.id;\n\n if (!isPermittedUser) {\n return res.json(403, {\n message: 'Forbidden to update this document.',\n });\n }\n\n return Document.findOneAndUpdate(\n { _id: req.params.id },\n {\n title: req.body.title,\n content: req.body.content,\n },\n )\n .then((document) =>\n res.status(200).json({\n document,\n success: true,\n message: 'Successfully updated Document!',\n }),\n )\n .catch((err) => res.status(500).send(err));\n }", "function deleteModuleField(moduleName, fieldID){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n \n db.modules.update({name: moduleName}, {$pull: {fields: {id: mongo.helper.toObjectID(fieldID)}}}, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n deferred.resolve();\n }\n });\n\n return deferred.promise;\n}", "async function updateResourceHandler(request, response) {\n const { _id } = request.variablePath;\n console.log(_id);\n const { parsedBody, db } = response;\n console.log(parsedBody);\n \n // get the db isntance\n const collection = db.collection(__collectionName);\n\n // now that we have the parsed body, we set the update parameter in mongodb\n // filter parameter\n\n const query = {\n _id: ObjectID.createFromHexString(_id),\n }\n // udpate paramter\n const update = {\n $set: parsedBody,\n };\n // options parameter\n const options = {\n returnOriginal: false,\n };\n try {\n const resultCommand = await collection.findOneAndUpdate(\n query,\n update,\n options,\n );\n // get the updated document\n const { value: updatedDocument } = resultCommand;\n console.log(resultCommand);\n response.jsonify(envelop.dataEnvelop(updatedDocument));\n \n } catch (error) {\n console.log(error);\n if (error instanceof MongoError) {\n if (error.code === 11000) {\n // that means this duplicate error message\n response.badRequestError(envelop.duplicateValueError(parsedBody));\n } else {\n response.badRequestError(envelop.unknownError());\n }\n } else {\n response.badRequestError(envelop.unknownError());\n }\n }\n }", "update(req, res) {\n if (!req.body.title || req.body.title === ''\n || !req.body.content || req.body.content === '') {\n res.send({ message: 'Both fields are required' });\n } else {\n Document.findOne({ where: { id: req.params.id } })\n .then((document) => {\n if (!document) {\n res.status(404).send({ message: 'Document could not be found!' });\n } else if (document.userId !== req.decoded.id) {\n res.status(401).send({ message: 'You can only update documents you own!' });\n } else {\n document.updateAttributes({\n title: req.body.title || document.title,\n content: req.body.content || document.content,\n }).then(() => {\n res.status(200).send({ message: 'Your document was successfully updated!' });\n });\n }\n });\n }\n }", "function updateOpportunitySource(req, res) {\n if (!validator.isValid(req.body.sourceName)) {\n res.json({\n code: Constant.ERROR_CODE,\n message: Constant.FIELD_REQUIRED\n });\n }\n else {\n source.findOne({sourceName: {$regex: new RegExp('^' + req.body.sourceName + '$', \"i\")}, moduleType: req.body.moduleType, deleted: false, companyId: req.body.companyId}, function(err, statusData) {\n if (err) {\n res.json({code: Constant.ERROR_CODE, message: err});\n }\n else {\n if (statusData) {\n res.json({\n code: Constant.ERROR_CODE,\n message: Constant.CONTACT_STATUS_EXIST\n });\n }\n else {\n var sourceDataField = {\n sourceName: req.body.sourceName,\n companyId: req.body.companyId,\n userId: req.body.userId\n\n };\n source.findByIdAndUpdate(req.body.sourceId, sourceDataField, function(err, data) {\n if (err) {\n res.json({code: Constant.ERROR_CODE, message: err});\n } else {\n res.json({code: Constant.SUCCESS_CODE, data: data});\n }\n });\n }\n\n }\n });\n }\n\n\n}", "static async modifyDocument (id, document) {\n if (typeof document !== 'object') {\n throw new Error('Bad Parameter');\n }\n const db = await Mongo.instance().getDb();\n const isValid = await Document.isDocument(document);\n if (isValid.valid) {\n // Create a new document\n // Uploaded document with new informations.\n const res = await db.collection(Document.COLLECTION).updateOne(\n {\n _id: ObjectId(id)\n },\n {\n $set: {\n ...document,\n updatedAt: moment().toDate()\n }\n }\n );\n return res;\n } else {\n log.debug('Warning - couldn\\'t modify document \\n', document);\n return null;\n }\n }", "update(req,res,next){\n console.log(\"Update...\")\n //we check the req for an id\n if(!req.query.hasOwnProperty(\"id\")){\n return res.status(400).send(\"Missing ID Parameter.\");\n }\n let id = req.query.id;\n\n Contact.findByIdAndUpdate(id,req.body).exec()\n .then(doc=>{\n res.status(200).json(doc);\n })\n .catch(err=>{\n res.status(500).send(\"There was an error.\")\n })\n }", "async update({ request, response, auth }) {\n try {\n let body = request.only(fillable)\n const id = request.params.id\n const data = await StudyProgram.find(id)\n if (!data || data.length === 0) {\n return response.status(400).send(ResponseParser.apiNotFound())\n }\n const isUniversityExists = await CheckExist(\n body.university_id,\n \"University\"\n )\n if (!isUniversityExists) {\n return response\n .status(422)\n .send(ResponseParser.apiValidationFailed(\"University not fund\"))\n }\n\n const isStudyNameExists = await CheckExist(\n body.study_name_id,\n \"StudyName\"\n )\n if (!isStudyNameExists) {\n return response\n .status(422)\n .send(ResponseParser.apiValidationFailed(\"StudyName not fund\"))\n }\n await data.merge(body)\n await data.save()\n await RedisHelper.delete(\"StudyProgram_*\")\n await RedisHelper.delete(\"StudyYear_*\")\n await RedisHelper.delete(\"MarketingTarget_*\")\n await data.loadMany([\"university\", \"studyName\", \"years\"])\n const jsonData = data.toJSON()\n const activity = `Update StudyProgram \"${jsonData.studyName.name}\" in \"${\n jsonData.university.name\n }\" university`\n await ActivityTraits.saveActivity(request, auth, activity)\n let parsed = ResponseParser.apiUpdated(data.toJSON())\n return response.status(200).send(parsed)\n } catch (e) {\n ErrorLog(request, e)\n return response.status(500).send(ResponseParser.unknownError())\n }\n }", "async update({ params, request, response }) {}", "function deleteModule(id, moduleName){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n\n //drop the collection\n db.bind(moduleName);\n db[moduleName].drop();\n\n //remove document from 'modules' collection\n db.modules.remove({_id: mongo.helper.toObjectID(id)}, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n deferred.resolve();\n }\n });\n\n return deferred.promise;\n}", "async function update(req, res) {}", "function updateDepModuleVersions () {\n return request.post({\n url: `http://${HOST}/api/DepModuleVersions/add`,\n followAllRedirects: true,\n headers: {\n \"Authorization\": TOKEN\n },\n body: {\n obj: obj\n },\n json: true // Automatically stringifies the body to JSON\n }, (err, res, body) => {\n licenseObj(body);\n check(err, res, body);\n });\n}", "function deleteModule(moduleName){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n\n //drop the collection\n db.bind(moduleName);\n db[moduleName].drop(function(err){\n if(err){\n if(err.codeName == 'NamespaceNotFound'){\n deferred.reject(notFound);\n }\n else{\n deferred.reject(err);\n }\n }\n else{\n //remove document from 'modules' collection\n db.modules.remove({name: moduleName}, function(err, writeResult){\n if(err){\n deferred.reject(err);\n }\n else{\n //n is used to know if the document was removed\n if(writeResult.result.n == 0){\n deferred.reject(notFound);\n }\n else{\n deferred.resolve();\n }\n }\n });\n }\n });\n\n return deferred.promise;\n}", "function updateIndustry(req, res) {\n if (!validator.isValid(req.body.industryName)) {\n res.json({\n code: Constant.ERROR_CODE,\n message: Constant.FIELD_REQUIRED\n });\n }\n else {\n industry.findOne({industryName: {$regex: new RegExp('^' + req.body.industryName + '$', \"i\")}, moduleType: req.body.moduleType, companyId: req.body.companyId, deleted: false}, function(err, industryData) {\n if (err) {\n res.json({code: Constant.ERROR_CODE, message: err});\n }\n else {\n if (industryData) {\n res.json({\n code: Constant.ERROR_CODE,\n message: Constant.CONTACT_INDUSTRY_EXIST\n });\n }\n else {\n var industryDataField = {\n industryName: req.body.industryName,\n companyId: req.body.companyId,\n userId: req.body.contactId,\n moduleType: req.body.moduleType\n };\n industry.findByIdAndUpdate(req.body.industryId, industryDataField, function(err, data) {\n if (err) {\n res.json({code: Constant.ERROR_CODE, message: err});\n } else {\n res.json({code: Constant.SUCCESS_CODE, data: data});\n }\n });\n }\n\n }\n });\n }\n\n}", "static updateArticle(idToUpdatePassedIn, articleDataToUpdatePassedIn) {\n\n /* NEW 20180623-1031\n In Edit/Update, ADD NEW PHOTO(s)...\n */\n\n\n console.log('SUPER-DUPER-OOFFAA ******** articleDataToUpdatePassedIn ', articleDataToUpdatePassedIn)\n /* UPDATE: I see Title and URL ... Now time to add the Photos Filenames Array. :o)\n {articleTitle_name: \"Trump’s WAYZO Gots to go 3345 Twice BAZZARRO We L…CIENT Fuel Efficiency Rollbacks Will Hurt Drivers\", articleUrl_name: \"https://www.nytimes.com/2018/05/11/opinion/trump-fuel-efficiency-rollbacks.html\"}\n\n\n ?\n Why only Title field?\n articleDataToUpdatePassedIn {articleTitle_name: \"Mueller EDIT Plans to Wrap Up Obstruction Inquiry Into Trump by Sept. 1, Giuliani Says\"}\n */\n\n\n /* Notes:\n 1. I tried this two ways:\n - UPDATE()\n - FINDBYIDANDUPDATE() << Preferred, for this use case\n\n Mongoose Model.update - this did work\n But, this is for having NO Document Returned.\n http://mongoosejs.com/docs/documents.html\n \"If we don't need the document returned in our application and merely want to update a property in the database directly, Model#update is right for us...\"\n\n So, I need another choice:\n http://mongoosejs.com/docs/api.html#findbyidandupdate_findByIdAndUpdate\n */\n // NEW. Let's (what the hell) update the URL, too. hey.\n /*\n Huh. Did na work.\n boo-hoo.\n What (the h.) is URL here, anyhoo?\n */\n console.log('******** articleDataToUpdatePassedIn.articleUrl_name ', articleDataToUpdatePassedIn.articleUrl_name)\n console.log('******** articleDataToUpdatePassedIn.articleTitle_name ', articleDataToUpdatePassedIn.articleTitle_name)\n\n console.log('******** articleDataToUpdatePassedIn.articlePhotos_name ', articleDataToUpdatePassedIn.articlePhotos_name)\n\n /* 20180628-0740\n Boys and girls, we are going to try to NIP this bad boy,\n right here in the B-U-D. Whoa.\n\n O.M.G. It Worked.\n Goodness Griefiness.\n wswhooohhhhwwhh (sound, breath, exhalation, all that)\n\nIN SUM - YAH, WE DID NEED TO DO ANOTHER JSON.stringify()\nOF THAT CRAZY SIMPLE ARRAY OF STRINGS\nBEFORE SENDING IT TO MONGOOSE / MONGO\nFOR WHATEVER THE HELL IT IS THEy DO\nIN TERMS OF STORING THIS AWAY.\nYEESH.\nAnd as a further comment: when you JSON.stringify()\nthis sort of thing, and then you debug either using\nconsole.log(), OR using debugging in Chrome DevTools,\nyou do ***NOT*** get to \"see\" what it looks like.\nYou always see:\n[ \"asdf\", \"qwer\" ]\nYou do NOT get to see (what actually lands in the database):\n[ '[\"asdf\", \"qwer\"] ' ]\nNOR (same thing):\n[ \"[\\\"asdf\\\", \\\"qwer\\\"]\" ]\n\nJESUS H. CHRIST.\n\n Relevant console explorations:\n In sum: yeah, parsing then stringifying then parsing again ...\n ... it WORKS. Lessee if it'll do that Magic for ME\n ============\n var p5 = \" [ \\\"asdf\\\", \\\"qwer\\\" ] \"\n undefined\n var p6 = JSON.parse(p5)\n undefined\n p6\n Array [ \"asdf\", \"qwer\" ]\n ...\n p6\n Array [ \"asdf\", \"qwer\" ]\n p13 = JSON.parse(p6)\n SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data[Learn More] debugger eval code:1:7\n p14 = JSON.stringify(p6) <<<<< THE MAGIC PART\n \"[\\\"asdf\\\",\\\"qwer\\\"]\"\n p14\n \"[\\\"asdf\\\",\\\"qwer\\\"]\"\n var p15 = JSON.parse(p14)\n undefined\n p15\n Array [ \"asdf\", \"qwer\" ]\n ============\n */\n\n var theLateGreatWhatTheHell = JSON.stringify(articleDataToUpdatePassedIn.articlePhotos_name); // << YES !!!\n console.log('******** theLateGreatWhatTheHell (JSON.stringify(articleDataToUpdatePassedIn.articlePhotos_name) ', theLateGreatWhatTheHell);\n/*\nNote that the \"console.log()\" nonsense does ***NOT*** show us what this thing\n***TRULY*** is. :o(\n* ******** theLateGreatWhatTheHell (JSON.stringify(articleDataToUpdatePassedIn.articlePhotos_name) [\"sometimes__1530187445867_27vid-trump-kennedy-1-thumbLarge.jpg\",\"sometimes__1530187445870_28midterm_xp-superJumbo.jpg\",\"sometimes__1530188021581_00republicans1-jumbo-v3.jpg\"]\n*\n*\n* WHAT IS IN THE (G.D.) DATABASE (which is correct and right and good):\n* \"articlePhotos\" : [ \"[\\\"sometimes__1530187445867_27vid-trump-kennedy-1-thumbLarge.jpg\\\",\\\"sometimes__1530187445870_28midterm_xp-superJumbo.jpg\\\",\\\"sometimes__1530188021581_00republicans1-jumbo-v3.jpg\\\"]\" ],\n */\n\n\n return articleModelHereInService.findByIdAndUpdate(\n {_id: idToUpdatePassedIn},\n { $set:\n {\n articleTitle: articleDataToUpdatePassedIn.articleTitle_name,\n articleUrl: articleDataToUpdatePassedIn.articleUrl_name,\n // articlePhotos: articleDataToUpdatePassedIn.articlePhotos_name, // << NO !!\n articlePhotos: theLateGreatWhatTheHell, // << YES!!!\n }\n },\n { new: true } // Gets you the NEW, just-edited doc (not the orig one)\n )\n .then(\n (whatIGot) => {\n console.log('articleService. Update. then() whatIGot: ', whatIGot)\n /* .update()\n Not the document. Returns a Mongo transaction report.\n {n: 1, nModified: 1, opTime: {…}, electionId: ObjectID, ok: 1}\n */\n\n /* .findByIdAndUpdate()\n model {$__: InternalCache, isNew: false, errors: undefined, _doc: {…}, $init: true}\n */\n\n /* Note / Question\n Here on the returned Model, I find a property '._doc' which does contain my document. Returning this does work.\n But:\n 1)What does that underscore naming convention mean?\n 2) Am I doing this the correct way, to get the data I need?\n 3) Does the returned Model expose some other way to get the document it is holding, than grabbing it off this '._doc' property?\n Feel like I'm missing something.\n But, this is working.\n */\n /* 2018-05-02 Web \"Office Hours\" with Mike Hilborn\n Looks like all is O.K. re: the above questioning, wondering:\n\n \"@William: Underscore notation signifies an internal property of Mongoose model, similar to \"_id\".\"\n \"@William: The \"_doc\" is a pointer to the document object and its properties, so, yeah, feel free to use it to access properties.\"\n\n */\n console.log('articleService. Update. then() whatIGot._doc: ', whatIGot._doc)\n return whatIGot._doc\n }\n )\n .catch((err) => console.log('Service. Update. Catch. err: ', err))\n }", "update(request, response) {\n console.log('request stuff', request.params, request.body);\n Resttask.findByIdAndUpdate(request.params._id, request.body, { new: true })\n .then(task => response.json(task))\n .catch(error => response.json(error));\n }", "async putDessert(req,res){\r\n const {id} = req.params;\r\n const {name,ingredients,price,offer,portion,img} = req.body;\r\n const update = {};\r\n if(name) update.name = name;\r\n if(ingredients) update.ingredients = ingredients;\r\n if(price) update.price = price;\r\n if(offer) update.offer = offer;\r\n if(portion) update.portion = portion;\r\n if(img) update.img = img;\r\n\r\n const updateDessert = await Dessert.updateOne(\r\n {\"_id\": id}\r\n , update );\r\n if(updateDessert.n){//n == numero de documentos modificados\r\n return res.status(200).json({ok: true})\r\n }else{\r\n return res.status(404).json({error: \"Dessert not found\"});\r\n } \r\n }", "function updateStage(req, res) {\n if (!validator.isValid(req.body.stageName)) {\n res.json({\n code: Constant.ERROR_CODE,\n message: Constant.FIELD_REQUIRED\n });\n }\n else {\n stage.findOne({stageName: {$regex: new RegExp('^' + req.body.stageName + '$', \"i\")}, moduleType: req.body.moduleType, companyId: req.body.companyId, deleted: false}, function(err, stageData) {\n if (err) {\n res.json({code: Constant.ERROR_CODE, message: err});\n }\n else {\n if (stageData) {\n res.json({\n code: Constant.ERROR_CODE,\n message: Constant.CONTACT_STAGE_EXIST\n });\n }\n else {\n var stageField = {\n stageName: req.body.stageName,\n companyId: req.body.companyId,\n moduleType: req.body.moduleType\n };\n stage.findByIdAndUpdate(req.body.stageId, stageField, function(err, data) {\n if (err) {\n res.json({code: Constant.ERROR_CODE, message: err});\n } else {\n res.json({code: Constant.SUCCESS_CODE, data: data});\n }\n });\n }\n\n }\n });\n }\n\n}", "async update({ params, request, response }) {\n }", "updateById(id, updateObj) {\n return this.findById(id)\n .then((doc) => {\n if (doc) {\n return doc.update(updateObj).exec();\n }\n else {\n return Promise.reject(\"document not found\");\n }\n });\n }", "static async update(req, res) {\n \n try {\n const { id } = req.params\n const { changeName } = req.body\n\n const updateStudent = await studentService.updateById(id,{\n name:changeName\n })\n\n // create response\n const response = {\n success: true,\n data: {\n student: updateStudent\n }\n }\n res.send(response)\n } catch(e) {\n res.send(e)\n }\n }", "function addModule(newModule){\n //imitate angular promise. start by initializing this\n var deferred = Q.defer();\n\n newModule.name = newModule.name.toLowerCase();\n\n //check if there is an existing module\n db.modules.findOne({name: newModule.name}, function(err, aModule){\n if(err){\n deferred.reject(err);\n }\n //already exists\n else if(aModule){\n deferred.reject(exists);\n }\n else{\n //unique, so proceed\n //create table first before adding a new document to 'modules' collection (not necessary?)\n db.createCollection(newModule.name, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n //initialize fields property as empty array if there are none in the input\n if(newModule.fields == undefined){\n newModule.fields = [];\n }\n\n db.modules.insert(newModule, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n deferred.resolve();\n }\n });\n }\n });\n }\n \n });\n \n //return the promise along with either resolve or reject\n return deferred.promise;\n}", "function addModule(newModule){\n //imitate angular promise. start by initializing this\n var deferred = Q.defer();\n\n newModule.name = newModule.name.toLowerCase();\n\n //check if there is an existing module\n db.modules.findOne({name: newModule.name}, function(err, aModule){\n if(err){\n deferred.reject(err);\n }\n //already exists\n else if(aModule){\n deferred.reject(exists);\n }\n else{\n //unique, so proceed\n //create table first before adding a new document to 'modules' collection (not necessary?)\n db.createCollection(newModule.name, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n //initialize fields property as empty array if there are none in the input\n if(newModule.fields == undefined){\n newModule.fields = [];\n }\n\n db.modules.insert(newModule, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n deferred.resolve();\n }\n });\n }\n });\n }\n \n });\n \n //return the promise along with either resolve or reject\n return deferred.promise;\n}", "function update(req , res){\n\tvar model = getModel(req.params.model);\n\tif (!req.params.id){\n\t\treturn res.status(400).send({request:\"update\" , status:-1 , err:new Error(\"Missing id in update request\")});\n\t}\n\t// Params to be updated\n\tvar pars = _.keys(req.body);\n\t\n\t model.findById(req.params.id, function (err, found) {\n\t \tif (!found)\n\t \t\treturn res.status(400).send({request:\"update\" , status:-1 , err:new Error(\"Unknown documents \"+req.params.id)});\n\t\tpars.forEach(function(p , i){\n \t\t\tfound[p] = req.body[p];\n \t\t});\n\t\tfound.save(function (err) {\n\t\t\tif (!err) {\n\t\t\t\t// MAPS\n\t\t\t\t// Should we update something in maps?\n\t\t\t\tcheckDocumentInMap(found , req.params.model , found.lang, function(err , ret){\n\t\t\t\t\tif (err){\n\t\t\t\t\t\tlogToConsole(err);\n\t\t\t\t\t\treturn res.status(500).send({request:\"update\" , status:-1, err:err}); \n\t\t\t\t\t}else{\n\t\t\t\t\t\tif (ret.__changed__){\n\t\t\t\t\t\t\tret.save(function (err , ret) {\n\t\t\t\t\t\t\t\tif (!err) {\n\t\t\t\t\t\t\t\t\t// @FIXME: potrei avere piu elementi nell'array \n\t\t\t\t\t\t\t\t\treturn res.send({request:\"update\" , status:1 , _id:ret._id , map_id : ret._maps_to_[0]});\n\t\t\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t\t\t}else {\n\t\t\t\t\t\t\t\t\tlogToConsole(err);\n\t\t\t\t\t\t\t\t\treturn res.status(500).send({request:\"update\" , status:-1, err:err}); \n\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\treturn res.send({request:\"update\" , status:1});\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t} else {\n\t\t\t\treturn res.status(500).send({request:\"update\" , status:-1, err:err}); \n\t\t\t}\n\t\t});\n\t });\n}", "static update({ id, name, phone, email, sex }) {\r\n return new Promise(async resolve => {\r\n try {\r\n \r\n if( !ObjectID.isValid( id )){\r\n return resolve({ error : true , message : 'params_invalid' });\r\n }\r\n let listUser = await USER_COLL.findByIdAndUpdate( id, {\r\n name, phone, email, sex\r\n }\r\n ,{\r\n new: true\r\n });\r\n \r\n if(!listUser){\r\n return resolve({error: true, message:'cannot_update_list'});\r\n }\r\n return resolve({error: false, message:'update_data_success', data: listUser});\r\n\r\n\r\n } catch (error) {\r\n return resolve({ error: true, message: error.message });\r\n }\r\n })\r\n}", "async update({ params, request, response }) {\n }", "async updateAllModuleSemantics() {\n await this.db.transaction('rw', this.db.files, this.db.classes, this.db.modules, this.db.functions, () => {\n this.db.files.where(\"type\").equals(\"file\").each((file) => {\n this.addModuleSemantics(file)\n })\n })\n }", "function update(model){ \n var updateProperty={\n \"mod\" : \"guard\",\n \"operation\" : \"update\",\n \"data\" : {\t\n \"key\" : guardKey,\n \"schema\": \"Lead\",\n \"id\" : model.documentToUpdateId,\n \"data\" : {\n \"tags\" : model.data.tags \n }\n } \n }; \n \n var updateRequestParams = {\n url : commonAccessUrl,\n method : 'POST',\n headers : headers,\n body : JSON.stringify(updateProperty)\n }\n request(updateRequestParams, function (error, response, body){\n \n if(body){\n try{\n if(!body.error){\n body=JSON.parse(body);\n }\n else{\n model.info=body.error\n model.emit(globalCallBackRouter,model)\n }\n }\n catch(err){\n model.info=err\n model.emit(globalCallBackRouter,model)\n }\n model.leadData=model.data;\n model.beneficiaryIndex=0\n saveReportDetailsLocally(model);\n \n }\n else if(response){\n model.info=response;\n model.emit(globalCallBackRouter,model)\n }\n else if(error){\n model.info=error;\n model.emit(globalCallBackRouter,model)\n }\n else{\n model.info=\"Error while updating lead details : Thyrocare API \\n\"+body;\n model.emit(globalCallBackRouter,model)\n }\n \n }) \n\n}", "async function example() {\n let course = await User.update(\n { id: _id },\n { $set: { \"subdoc.name\": \"sharath\" } },\n { new: true }\n );\n}", "function update(req, res) {\n if (req.body._id) {\n delete req.body._id;\n }\n PlanSection.findByIdAsync({ _plan_id: req.params.plan_id, _id: req.params.id }).then(handleEntityNotFound(res)).then(saveUpdates(req.body)).then(responseWithResult(res))['catch'](handleError(res));\n}", "update({ sponsor, body, body:{name, description} }, res) {\n\n saveImg(body.logo, sponsor.logo)\n .then( logo =>\n sponsor.update({name, description, logo})\n )\n .then( s => {\n SponsorLink.bulkCreate(body.links, {fields:['name','url'], returning: true})\n .then( links => s.setSponsorLinks(links) )\n SponsorMedia.bulkCreate(body.mediaObjs, {fields:['url'], returning: true})\n .then( media => s.setSponsorMedia(media) )\n\n return s;\n })\n .then((s)=>{res.json(s)});\n }", "async update(ctx){\n try{\n const results = await ctx.db.Company.update({\n name: ctx.request.body.name,\n city: ctx.request.body.city,\n address: ctx.request.body.address\n }, {\n where: {\n id: ctx.params.id\n }\n });\n results == 0 ? ctx.throw(500,'invalid id provide') : ctx.body = `company is updated with id ${ctx.params.id}`;\n }\n catch (err) {\n ctx.throw(500, err)\n }\n }", "static async updateContact(ContactId, obj, userId) {\n const contactFields = {};\n if (obj.name) contactFields.name = obj.name;\n if (obj.email) contactFields.email = obj.email;\n if (obj.phone) contactFields.phone = obj.phone;\n if (obj.type) contactFields.type = obj.type;\n console.log(contactFields);\n const contact = await Contact.findById({ _id: ContactId });\n\n if (!contact) {\n throw new Error(\"Contact not found\");\n }\n\n // Make sure user owns contact\n if (contact.user.toString() !== userId) {\n return new Error(\"Unauthorized access\");\n }\n\n const updatedContact = await Contact.findByIdAndUpdate(\n ContactId,\n { $set: contactFields },\n { new: true }\n );\n return updatedContact;\n }", "submitUpdateDocument(forumFields) {\n if(Object.keys(forumFields).length === 0) // If there is nothing to submit quit now\n {\n this.setState({\n processingForm: false\n });\n this.log(false, `Attempting to update \\`${this.props.doc._id}\\` with a blank forum`);\n return;\n }\n\n // Update the document with $forumFields\n this.props.collection.update(this.props.doc._id, {$set: forumFields}, (err, res) => {\n if(err) // If there was an error\n {\n this.log(false, `Error updating \\`${this.props.doc._id}\\``, forumFields);\n this.handleSubmitError(err);\n }\n else\n {\n this.log(false, `Updated \\`${this.props.doc._id}\\``, forumFields);\n if(this.props.onSubmit) // If we have a onSubmit function from the props\n {\n this.props.onSubmit(res); // Run it - and pass the created docId to it\n }\n }\n\n // Finished processing so allow submitting again\n this.setState({\n processingForm: false\n });\n\n return res;\n });\n }", "function updateDocument(docId, words) {\n return Promise.resolve()\n .then(() => {\n return this.wordIndex_removeDocument(docId);\n }).then(() => {\n return this.wordIndex_addDocument(docId, words);\n });\n}", "updateProduct(id, updatedProduct) {\n if (!id || !updatedProduct || id == undefined || updatedProduct == undefined)\n {\n return Promise.reject(\"Please valid input for your product.\\n\");\n }\n\n return products().then((productsCollection) => {\n let updatedProdcutData = {};\n\n\n if (updatedProduct.title) {\n updatedProdcutData.title = updatedProduct.title;\n }\n\n if (updatedProduct.user) {\n updatedProdcutData.user = updatedProduct.user;\n }\n\n\n if (updatedProduct.description) {\n updatedProdcutData.description = updatedProduct.description;\n }\n\n if (updatedProduct.price) {\n updatedProdcutData.price = updatedProduct.price;\n }\n\n if (updatedProduct.condition) {\n updatedProdcutData.condition = updatedProduct.condition;\n }\n\n if (updatedProduct.purchasedYear) {\n updatedProdcutData.purchasedYear = updatedProduct.purchasedYear;\n }\n\n if (updatedProduct.image) {\n updatedProdcutData.productImage = updatedProduct.image;\n }\n\n if (updatedProduct.status) {\n updatedProdcutData.status = updatedProduct.status;\n }\n\n let updateCommand = {\n $set: updatedProdcutData\n };\n return productsCollection.updateOne({ _id: id }, updateCommand).then(() => {\n return this.getProductByID(id);\n }).catch((err)=>{\n console.log(\"Error while updating product:\", err);\n });\n });\n }", "async function updateCourseById(id, course) {\n course = extractValidFields(course, CourseSchema);\n/*\n const courseValues = {\n subject: course.subject,\n number: course.number,\n title: course.title,\n term: course.term,\n instructorId: course.instructorId\n };\n*/\n console.log(course);\n\n const db = getDBReference();\n const collection = db.collection('courses');\n if (!ObjectId.isValid(id)) {\n return null;\n } else {\n const result = await collection.updateOne(\n { _id: new ObjectId(id) },\n { $set: course }\n );\n return result.matchedCount > 0;\n }\n}", "async update (req, res, id) {\n throw new Error('update: Implementation Missing!')\n }", "async updateDocument(ctx, documentId, newValue) {\n const exists = await this.documentExists(ctx, documentId);\n if (!exists) {\n throw new Error(`The document ${documentId} does not exist`);\n }\n const asset = { value: newValue };\n const buffer = Buffer.from(JSON.stringify(asset));\n await ctx.stub.putState(documentId, buffer);\n }", "async function updateStudent (req,res,next){\n\tconsole.log(\"Updating student\");\n\tif(req.query.idStudent){\t\n\t\t// Start promise for student\n\t\tconsole.log(\"registing update student promise\")\n\t\tvar P_update_student = new Promise((resolve,reject)=>{\n\t\t\tlet Params_student=_.pick(req.body,['Student_name','Student_num','Birth_date','ID_num','ID_expire_date',\n\t\t\t\t\t\t\t'Tax_num','Drive_license_num','Obs','T_ID_type_idT_ID_type']);\n\t\t\tif (_.size(Params_student)>0){\n\t\t\t\tdbHandlers.Qgen_student.Qupdate_byIdStudent(req.query.idStudent, Params_student, function(err,results){\n\t\t\t\t\tif(err){\n\t\t\t\t\t\t// internal error\n\t\t\t\t\t\tconsole.log(err);\n\t\t\t\t\t\treturn res.status(500).json({message:\"Database error patching candidate\"});\n\t\t\t\t\t\treject(false);\n\t\t\t\t\t}else{\n\t\t\t\t\t\t// console.log(\"resolved update student\")\n\t\t\t\t\t\tresolve(true);\t\n\t\t\t\t\t};\n\t\t\t\t});\n\t\t\t}else{\n\t\t\t\tresolve(true);\t\n\t\t\t};\n\t\t});\n\t};\n\tif(req.query.idStudent_license){\n\t\tconsole.log(\"registing update student license promise\")\n\t\tvar P_update_student_license = new Promise((resolve,reject)=>{\n\t\t\tvar Params_student_license =_.pick(req.body,['Student_license',\n\t\t\t\t\t\t\t\t'Expiration_date','School_idSchool','Type_category_idType_category']);\n\t\t\tif(_.size(Params_student_license)>0){\n\t\t\t\t\n\t\t\t\tctl_student_license.updateStudent_license(req.query.idStudent_license,Params_student_license, function(err,results2){\n\t\t\t\t\tif (err){\n\t\t\t\t\t\tconsole.log(err);\n\t\t\t\t\t\treturn res.status(500).send({message:\"Database error patching candidate\"});\n\t\t\t\t\t\treject(false);\n\t\t\t\t\t}else{\n\t\t\t\t\t\tconsole.log(\"resolved update student license\")\n\t\t\t\t\t\tresolve(true);\n\t\t\t\t\t};\n\t\t\t\t});\n\t\t\t}else{\n\t\t\t\tresolve(true);\t\n\t\t\t};\n\t\t});\n\t};\n\n\tvar update_student= await P_update_student.then();\n\tvar update_student_license= await P_update_student_license.then();\n\n\tif (update_student && update_student_license){\n\t\treturn res.status(200).send({message:\"Candidate patched\"});\n\t}else{\n\t\treturn res.status(500).send({message:\"Database error patching candidate\"});\t\n\t}\n\n}", "function update(module, endpoint, auth, data){\n\n let requestObj = makeRequest('PUT', module, endpoint, auth);\n requestObj.data = data; // MOJE DA E : JSON.stringify(data);\n \n return $.ajax(requestObj);\n }", "updateProject(blockId) {\n //console.log('Update Project!' + blockId + '>');\n let that = this;\n\n fetch('https://api.webwizards.me/v1/projects?id=' + this.state.projectId, {\n method: 'PATCH',\n headers: {\n 'Accept': 'application/json',\n 'Content-Type': 'application/json',\n 'Authorization': localStorage.getItem('Authorization')\n },\n body: JSON.stringify({\n 'content': [blockId]\n })\n })\n .then(function (response) {\n that.setup_getProjectData();\n })\n .catch(err => {\n console.log('ERROR: ', err);\n });\n }", "setModuleName(field, module) {\n field.moduleName = field.moduleName || (module && module.__meta.name);\n if ((field.type === 'array') || (field.type === 'object')) {\n _.each(field.schema || [], function(subfield) {\n self.setModuleName(subfield, module);\n });\n }\n }", "async update ({ params, request, response }) {\n }", "async update ({ params, request, response }) {\n }", "async update ({ params, request, response }) {\n }", "async update ({ params, request, response }) {\n }", "async update ({ params, request, response }) {\n }", "async update ({ params, request, response }) {\n }", "async update ({ params, request, response }) {\n }", "function updateById(resourceName, id, update) {\n\n \tconst collection = getModel(resourceName);\n \tdelete update._id; // Do not allow users to update ._id of a document\n\n \tconst mongoUpdate = { $set: update };\n \tconst query = { _id: id }\n\n \treturn collection.findOneAndUpdate(query, mongoUpdate, { new: true })\n \t.then(data => {\n\n \t\tconst resp = {\n \t\t\tmetadata: {\n \t\t\t\tfound: 1,\n \t\t\t\treturned: 1,\n \t\t\t\tmodified: 1\n \t\t\t},\n \t\t\tdoc: data,\n \t\t};\n\n \t\treturn resp;\n \t})\n \t.catch(err => {\n \t\tconsole.log(err);\n \t\tconsole.log(\"db.updateById error\");\n \t});\n }", "static async updateReview(reviewId, userId, text, date){\n\n try{\n const updateResponse = await reviews.updateOne (\n // First set is where we want to update\n {user_id: user, _id: ObjectId(reviewId)},\n // Second set is what we want to update\n {$set: {text: text, date:date}} \n\n\n )\n return updateResponse\n\n }catch(e){\n console.log(\n `Unable to post review ${e}`\n )\n return{error: e}\n }\n\n }", "function testUpdate( Lib, args ) {\n\n return makeTest(Lib, args, ( couch, nock, deferred ) => {\n\n nock.put('/test/1')\n .reply(201, { id: 1, rev: 2 });\n\n couch.update({ _id: 1, _rev: 1 })\n .then(deferred.resolve.bind(deferred));\n });\n }", "function updateAssignment(req, res) {\n Assignment.findByIdAndUpdate(req.body._id, req.body, { new: true }, (err, assignment) => {\n if (err) {\n console.log(err);\n res.send(err)\n } else {\n res.json({ message: 'updated' })\n }\n\n // console.log('updated ', assignment)\n });\n\n}", "async editDoc(doc, target) {\n let collection = await this.collection()\n\n let id = ObjectId(target)\n\n await collection.updateOne({_id: id}, {$set: doc})\n\n }", "async function updateCourse2(id) {\n const result = await Course.update({_id:id}, {\n $set: { // it update in the database\n author: \"Mosh\",\n isPublished: false\n }\n });\n // findByIdAndUpdate\n console.log(result);\n}", "update(req, res) {\n //console.log('update req===>', req.body);\n let queryVars = req.body;\n Region.update(req.body, {\n where: {\n id: queryVars.id\n }\n })\n .then(function (updatedRecords) {\n res.status(200).json(updatedRecords);\n })\n .catch(function (error){\n res.status(500).json(error);\n });\n }", "update(req, res) {\n return OrderDetails.find({\n where: {\n OrderId: req.params.orderid,\n ItemId: req.body.itemid\n }\n })\n .then(item => {\n if (!item) {\n return res.status(404).send({\n message: \"Item Not Found\"\n });\n }\n\n return (\n item\n .update(req.body, { fields: Object.keys(req.body) })\n // .update({ quantity: 11 })\n .then(updatedOrderDetail =>\n res.status(200).send(updatedOrderDetail)\n )\n .catch(error => res.status(400).send(error))\n );\n })\n .catch(error => res.status(400).send(error));\n }", "static update(request, response) {\r\n\r\n itemsModel.getById(request.body.id)\r\n .then( data => {\r\n if (data.length > 0) {\r\n\r\n //recupera do body os campos que serao atualizados na tabela\r\n const conditions = [\r\n {\r\n field: 'id',\r\n value: request.body.id\r\n },\r\n {\r\n field: 'title',\r\n value: request.body.title\r\n },\r\n {\r\n field: 'descr',\r\n value: request.body.descr\r\n },\r\n {\r\n field: 'photo',\r\n value: request.body.photo\r\n },\r\n {\r\n field: 'category',\r\n value: request.body.category\r\n },\r\n ];\r\n\r\n //chama rotina para atualizacao dos dados\r\n itemsModel.update(conditions) \r\n response.sendStatus(200);\r\n console.log('Item has been updated. ID: ', request.body.id); \r\n } else {\r\n response.sendStatus(404);\r\n console.log('Item not found. ID: ', request.body.id);\r\n }\r\n })\r\n .catch(err => {\r\n response.sendStatus(500);\r\n console.log('Error updating Item by ID: ', request.body.id, err);\r\n });\r\n \r\n }", "function inviteUpdate(project,email,username){\r\n var s=/*LibraryjsUtil.*/dbParse({verb:\"get\",project:project,className:\"invite\",query:{email:email}}).results[0]//;Logger.log(s),var x\r\n , t=/*LibraryjsUtil.*/dbParse({verb:\"put\",project:project,className:\"invite\",obid:s.objectId,ob:{username:username}})\r\n ;return t}//function test(){Logger.log(inviteUpdate(\"dealDigger\",\"cooldude89@suremail.info\",\"cooldude89\"))}//Sample call: var t=LibraryjsUtil.inviteUpdate(pname,ob.email,ob.username);", "function updateDoc(doc, db){\n\tdb.update({ _refObjectUUID: doc._refObjectUUID }, doc, {}, function(err, count){\n\t\t//console.log('Update: ', count);\n\t});\n}", "function update(req, res) {\n // find one project by id, update it based on request body,\n // and send it back as JSON\n\n db.Project.findById(req.params.id, function(err, foundProject) {\n if (err) { console.log('projectsController.update error', err); }\n foundProject.artistName = req.body.artistName;\n foundProject.name = req.body.name;\n foundProject.releaseDate = req.body.releaseDate;\n foundProject.save(function(err, savedProject) {\n if (err) { console.log('saving altered project failed'); }\n res.json(savedProject);\n });\n });\n}", "function update(module, endpoint, auth, data) {\n let req = makeRequest('PUT', module, endpoint, auth);\n req.data = data;\n return $.ajax(req);\n }", "async function update(req, res, next) {\n try {\n const {\n name, createdDate, money, note,\n } = req.body;\n\n // eslint-disable-next-line prefer-destructuring\n const importStock = req.importStock;\n importStock.name = name;\n importStock.createdDate = createdDate;\n importStock.money = money;\n importStock.note = note;\n\n return importStock\n .save()\n .then(async (result) => {\n res.json(result);\n })\n .catch((err) => {\n next(err);\n });\n } catch (e) {\n next(e);\n }\n}", "updateOne(query, updateObj) {\n return this.findById(query)\n .then((doc) => {\n if (doc) {\n return doc.update(updateObj).exec();\n }\n else {\n return Promise.reject(\"document not found\");\n }\n });\n }", "updateRecord(accessToken, updateData, id) {\n\n updateData.uid = id;\n\n var updateObject = this.dbObject(updateData);\n updateObject = updateObject.setHeader('access_token', accessToken);\n return this.makePromise(updateObject.save());\n }", "function updateTask(doc, res, updateParams) {\n if (updateParams.name) {\n doc.name = updateParams.name\n }\n if (updateParams.description) {\n doc.description = updateParams.description;\n }\n if (updateParams.deadline) {\n doc.deadline = updateParams.deadline;\n }\n if (typeof updateParams.completed !== 'undefined') {\n doc.completed = updateParams.completed;\n }\n if (updateParams.assignedUser || typeof updateParams.assignedUser !== 'undefined') {\n doc.assignedUser = updateParams.assignedUser;\n }\n if (updateParams.assignedUserName) {\n doc.assignedUserName = updateParams.assignedUserName;\n }\n \n saveAndRespond(doc, 'Task was updated.', res);\n}", "static async apiUpdateInfluencer(req, res, next) {\n try {\n const influencerId = req.body.influencer_id\n const text = req.body.text\n const date = new Date()\n // get user id bc making sure user who created influencer is updating influencer\n const influencerResponse = await InfluencersDAO.updateInfluencer(\n influencerId,\n req.body.user_id,\n text,\n date,\n )\n\n var{error} = influencerResponse\n if (error) {\n res.status(400).json({error})\n }\n // if mod count = 0 -> not updated and throw error\n if (influencerResponse.modifiedCount === 0) {\n throw new Error(\n \"unable to influencer - user may not be original poster\",\n )\n }\n res.json({ status: \"success\"})\n } catch (e) {\n res.status(500).json({error:e.message})\n }\n }", "update(task) {\n return db\n .collection('tasks')\n .doc(task.id)\n .update({\n // id: task.id,\n ...task,\n })\n .then(() => {\n console.log('Document updated'); // Document updated\n this.load();\n })\n .catch((error) => {\n console.error('Error updating doc', error);\n });\n }", "async function updateProductDetails(req, res){\n try{\n const db = req.app.get('db');\n const user_id = req.user.user_id;\n const product_id = req.body.product_id;\n const name = req.body.name;\n const mrp = req.body.mrp;\n const description = req.body.description;\n let obj = {\n \"user_id\": user_id,\n \"product_id\": product_id,\n };\n if(!!name){\n obj.name = name;\n }\n if(!!mrp){\n obj.mrp = mrp;\n }\n if(!!description){\n obj.description = description;\n }\n if(obj.hasOwnProperty(\"name\") || obj.hasOwnProperty(\"mrp\") || obj.hasOwnProperty(\"description\")){\n const is_updated = await ProductData.updateProductDetails(db, obj);\n if(is_updated.affectedRows){\n responseData = Utility.getResponseData(true, 'Updated Product successfully', 200);\n res.status(responseData.meta.code).json(responseData);\n }\n } else {\n responseData = Utility.getResponseData(true, 'Nothing to update', 200);\n res.status(responseData.meta.code).json(responseData);\n }\n } catch (e) {\n responseData = Utility.getResponseData(false, 'Failed, Please try again', 404);\n res.status(responseData.meta.code).json(responseData);\n }\n}", "update(req, res) {\n console.log('update req===>', req.body);\n queryVars = req.body;\n Image.update(req.body, {\n where: {\n id: queryVars.id\n }\n })\n .then(function (updatedRecords) {\n res.status(200).json(updatedRecords);\n })\n .catch(function (error){\n res.status(500).json(error);\n });\n }", "async function updateCourse(id) \n{\n \n // Creating an async await class to get the course by the id \n const course = await COURSE\n .findById(id); \n \n console.log(id); \n\n // if the course is empty, return a \"null\" value \n if ( !course ) return; \n\n // Changing the values \n // course.isPublished = true; \n // course.author = 'Changed Author'; \n\n course.set({\n isPublished: true, \n name: \"Python Course\", \n author: 'Mbonu Chinedu', \n price: 100.23\n }); \n\n // Saving the new changed values \n const resultOfSavedModifedCourse = await course.save();\n console.log(resultOfSavedModifedCourse); \n\n}", "function _Update(objRequest, objResponse) {\n nlapiLogExecution('AUDIT','UPDATE Courses', '=====START=====');\n var stCustId = objRequest['CustomerId'];\n var httpBody = objRequest;\n nlapiLogExecution('AUDIT', 'Update Course', 'Update function in Departments executed.');\n\n var objDataResponse = {\n Response: 'F',\n Message: 'Default Value',\n ReturnId: ''\n };\n\n var loadedICourseRecord = nlapiLoadRecord('customrecord_rc_course', httpBody.Id);\n\n try {\n loadedICourseRecord.setFieldValue('custrecord_rc_course_title', httpBody.Title),\n loadedICourseRecord.setFieldValue('custrecord_rc_course_number', httpBody.Number),\n loadedICourseRecord.setFieldValue('custrecord_rc_course_credit_level', httpBody.CreditLevel.Id),\n loadedICourseRecord.setFieldValue('custrecord_rc_course_credit_hours', httpBody.CreditHours),\n loadedICourseRecord.setFieldValue('custrecord_rc_course_syllabi_name', httpBody.SyllabiName),\n loadedICourseRecord.setFieldValue('custrecord_rc_course_institution', httpBody.ModeOfInstruction),\n loadedICourseRecord.setFieldValue('custrecord_rc_course_reg_course', httpBody.RegisteredCourseId)\n objDataResponse.ReturnId = nlapiSubmitRecord(loadedICourseRecord, true)\n }\n catch (ex) {\n nlapiLogExecution('ERROR', 'Something broke trying to set fields' + ex.message)\n }\n\n if(objDataResponse.ReturnId){\n objDataResponse.Response = 'T';\n objDataResponse.Message = 'Yo it seems as though we have been successful with dis otha endevour' + JSON.stringify(loadedICourseRecord)\n }\n\n // Ask john.\n //1.)How to deal with \"missing\" values. What values must be supplied at any given stage\n // Mode up is required(looking at ns)\n\n // its either a list OR a record A list has id and value when writing i only provide an ID, don't pass anything but the id\n // think of it as an Enumerator, a number that means something else.\n //2.)How to deal with list objects\n\n nlapiLogExecution('AUDIT','UPDATE Courses', '======END======');\n return JSON.stringify(objDataResponse)\n}", "async update(request, response) {\n\n const result = Developer.findByIdAndUpdate(\n request.params.id,\n request.body,\n {new: true},\n // Callback function\n (error, dev) => {\n if (error) return response.status(500).send(error);\n // message of update\n var message = dev ? \n `Dev ${Developer.name}'s info updated.`\n : `Developer not found.`;\n\n // Return a message & dev`s info IF IT WAS UPDATE CORRECTLY\n return response.send({message, dev});\n }\n );\n \n }", "updateOne(Model, query, updateModelFunction, body) {\n return new Promise((resolve, reject) => {\n if (typeof updateModelFunction !== \"function\") {\n return reject(errors.generateError(\"InternalServerError\", \"Expected argument function for update in updateOne method in crudService.\"));\n }\n Model.findOne(query, function (error, doc) {\n if (error) {\n return reject(errors.generateError(\"InternalServerError\", error));\n }\n if (doc === null) {\n return reject(errors.generateError(\"NotFoundError\", \"Not found element for update\"));\n }\n updateModelFunction(body, doc)\n .then(result => {\n doc.save(function(saveErrors) {\n if (saveErrors) {\n return reject(errors.generateError(\"InternalServerError\", saveErrors))\n }\n return resolve({status: 200});\n })\n })\n .catch(error => {\n return reject(errors.onCatchHandler(error));\n });\n })\n })\n }", "async function partialUpdateItem(collectionId, itemId, updateFields) {\n const client = await _client()\n\n // Handle inserting required default properties to `updateFields`\n const requiredProperties = {\n updated: new Date().toISOString()\n }\n\n if (updateFields.properties) {\n // If there are properties incoming, merge and overwrite our required ones.\n Object.assign(updateFields.properties, requiredProperties)\n } else {\n updateFields.properties = requiredProperties\n }\n\n const response = await client.update({\n index: collectionId,\n id: itemId,\n _source: true,\n body: {\n doc: updateFields\n }\n })\n\n return response\n}", "updateField(recordId: number, key: string, value: string|number) {\n // Retrieving the record that is requested to go over the field update \n let record = this.crudStore.getData().get(recordId);\n\n // Asserting record retrieved successfully\n if (record) {\n // Updating field of record\n record[key] = value;\n\n // Updating record\n this.updateRecord(recordId, record)\n }\n else {\n throw \"CRUDActions.updateField: record wasn't retrieved successfully\"\n }\n }", "async update(req,res){\n try{\n let params = req.allParams();\n let attributes = {};\n\n if(params.name){\n attributes.name = params.name;\n }\n if(params.city){\n attributes.city = params.city;\n }\n if(params.phone){\n attributes.phone = params.phone;\n }\n\n const results = await Company.update({id: req.params.id}, attributes);\n return res.ok(results);\n }\n catch(err){\n return res.serverError(err);\n }\n }" ]
[ "0.8221811", "0.7874364", "0.77189493", "0.738352", "0.72332454", "0.68794364", "0.68794364", "0.68435234", "0.6736119", "0.63068366", "0.6303614", "0.62880695", "0.62741476", "0.6246192", "0.61462486", "0.61180973", "0.60007644", "0.59134805", "0.59115833", "0.58952177", "0.5873493", "0.58626056", "0.5856888", "0.5749113", "0.5707836", "0.5691329", "0.55863655", "0.5579424", "0.54561806", "0.5444204", "0.54432285", "0.54015774", "0.5382092", "0.5371103", "0.53627443", "0.5354698", "0.5351026", "0.534065", "0.5339669", "0.5333157", "0.5329819", "0.5329604", "0.5324084", "0.5317954", "0.5317954", "0.53144073", "0.53125215", "0.52822953", "0.5259317", "0.52287406", "0.52215767", "0.5219999", "0.5214588", "0.52135", "0.5196341", "0.51907593", "0.5183752", "0.51827395", "0.5173471", "0.51650214", "0.51629674", "0.5158482", "0.5152044", "0.5148076", "0.51464486", "0.5146343", "0.5146343", "0.5146343", "0.5146343", "0.5146343", "0.5146343", "0.5146343", "0.51366186", "0.51307476", "0.5124098", "0.51174796", "0.51162016", "0.5095974", "0.508964", "0.50846845", "0.50836563", "0.5082408", "0.5078221", "0.50740457", "0.50710154", "0.5063759", "0.5062667", "0.5062331", "0.50616455", "0.5059659", "0.5058565", "0.50547683", "0.50534624", "0.5050646", "0.5050605", "0.50494903", "0.5048212", "0.50470436", "0.50446784", "0.5043808" ]
0.80793613
1
Function name: delete a module document Author: Reccion, Jeremy Date Modified: 2018/04/04 Description: delete a document of a specific module Parameter(s): moduleName: string type id: string type. //id of the specific document Return: Promise
function deleteModuleDoc(moduleName, id){ var deferred = Q.defer(); moduleName = moduleName.toLowerCase(); db.bind(moduleName); db[moduleName].remove({_id: mongo.helper.toObjectID(id)}, function(err, writeResult){ if(err){ deferred.reject(err); } else{ //n is used to know if the document was removed if(writeResult.result.n == 0){ deferred.reject(notFound); } else{ deferred.resolve(); } } }); return deferred.promise; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function deleteModuleDoc(moduleName, id){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n\n db.bind(moduleName);\n\n db[moduleName].remove({_id: mongo.helper.toObjectID(id)}, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n deferred.resolve();\n }\n });\n\n return deferred.promise;\n}", "function deleteModule(moduleName){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n\n //drop the collection\n db.bind(moduleName);\n db[moduleName].drop(function(err){\n if(err){\n if(err.codeName == 'NamespaceNotFound'){\n deferred.reject(notFound);\n }\n else{\n deferred.reject(err);\n }\n }\n else{\n //remove document from 'modules' collection\n db.modules.remove({name: moduleName}, function(err, writeResult){\n if(err){\n deferred.reject(err);\n }\n else{\n //n is used to know if the document was removed\n if(writeResult.result.n == 0){\n deferred.reject(notFound);\n }\n else{\n deferred.resolve();\n }\n }\n });\n }\n });\n\n return deferred.promise;\n}", "function deleteModule(id, moduleName){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n\n //drop the collection\n db.bind(moduleName);\n db[moduleName].drop();\n\n //remove document from 'modules' collection\n db.modules.remove({_id: mongo.helper.toObjectID(id)}, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n deferred.resolve();\n }\n });\n\n return deferred.promise;\n}", "function deleteMod() {\n // eslint-disable-next-line no-restricted-globals\n if (\n confirm(\n 'Are you sure you want to delete this module? This cannot be undone.',\n )\n ) {\n db.collection('modules')\n .doc(module.value)\n .delete()\n .then(function () {\n history.push('/success');\n console.log('doc deleted successfully');\n return true;\n });\n } else {\n return false;\n }\n }", "_deleteDocument(req, res, next) {\n let documentId = req.params.id\n this.engine.deleteDocument(documentId, function(err, result) {\n if (err) return next(err)\n res.json(result)\n })\n }", "function deleteModuleField(moduleName, fieldID){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n \n db.modules.update({name: moduleName}, {$pull: {fields: {id: mongo.helper.toObjectID(fieldID)}}}, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n deferred.resolve();\n }\n });\n\n return deferred.promise;\n}", "function deleteModuleField(moduleName, fieldID){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n \n db.modules.update({name: moduleName}, {$pull: {fields: {id: mongo.helper.toObjectID(fieldID)}}}, function(err, writeResult){\n if(err){\n deferred.reject(err);\n }\n else{\n if(writeResult.result.nModified == 0){\n deferred.reject(notFound);\n }\n else{\n deferred.resolve();\n }\n }\n });\n\n return deferred.promise;\n}", "deleteModule(moduleId, passphrase) {\n return this.httpService({\n method: 'DELETE',\n url: `${this.rootURL}microAnalytics?microAnalyticsId=${moduleId}`,\n headers: {Authorization: `basic ${passphrase}`}\n });\n }", "async deleteProduct(req, res, next) {\n console.log(\"inside delete function\");\n let document;\n try {\n document = await ProductDB.findOneAndDelete({ _id: req.params.id });\n // console.log(document.image);\n fs.unlink(document.image, (error) => {\n if (error) {\n return next(error);\n }\n });\n } catch (error) {\n return next(error);\n }\n res.json({ document });\n }", "_delete (moduleName){\n delete this._dynamicParentsMap[moduleName];\n // SystemJs doesn't do this?\n delete this._system.loads[moduleName];\n // Do regular delete\n return this._systemDelete.apply(this._system, arguments);\n }", "static deleteDocument(pathOrUid = \"\", type, headers = {}, params = {}) {\n\n let properties = this.properties;\n\n return new Promise(\n function(resolve, reject) {\n properties.client\n .repository()\n .delete(pathOrUid, headers)\n .then((res) => {\n resolve(res);\n }).catch((error) => {\n\n if (error.hasOwnProperty('response')) {\n error.response.json().then(\n (jsonError) => {\n reject(StringHelpers.extractErrorMessage(jsonError));\n }\n );\n } else { \n return reject(error || 'Could not access server');\n }\n });\n });\n }", "async deleteDocument(ctx, documentId) {\n const exists = await this.documentExists(ctx, documentId);\n if (!exists) {\n throw new Error(`The document ${documentId} does not exist`);\n }\n await ctx.stub.deleteState(documentId);\n }", "removeDocument(_docId, event) {\n event.preventDefault();\n const { contractInst, account } = this.props;\n //condition for docid \n if (_docId) {\n contractInst.methods.removeNotarizedDocument(_docId).send({ from: account })\n .then(res => {\n //show toast message\n toast.success(\"Your document has been removed successfully !\");\n //update document list\n this.props.updateList(event);\n }).catch(err => {\n console.error(\"---Error while removing document---\".err);\n });\n }\n }", "delete(req, res) {\n // delete only allowed for authorised user of their own documents or admin\n const isPermittedUser =\n req.decoded.role === 'Administrator' || req.decoded._id === req.params.id;\n\n if (!isPermittedUser) {\n return res.json(403, {\n message: 'Forbidden to delete this document.',\n });\n }\n\n return Document.findOneAndRemove({ _id: req.params.id })\n .then((document) => res.status(200).json({ message: document }))\n .catch((err) => res.status(500).json({ message: err }));\n }", "deleteOne(req, res) {\n const user = req.decoded;\n Document.findById(req.params.id)\n .then((document) => {\n if (!document || document.length < 1) {\n res.status(404).send({ message: 'Document not found!' });\n } else if (user.title === 'admin' || document.userId === user.id) {\n Document.destroy({\n where: { id: req.params.id },\n cascade: true,\n restartIdentity: true,\n });\n res.send({ message: 'Document deleted!' });\n } else {\n res.status(401).send({ message: 'Cannot delete this document without owner\\'s permission!' });\n }\n });\n }", "async function eliminarDocumento(id){\n const result = await Curso.findByIdAndDelete(id);\n console.log('Documento eliminado', result); \n}", "async deleteDoc(target) {\n let collection = await this.collection()\n let id = ObjectId(target)\n\n await collection.deleteOne({_id: id})\n\n }", "async function eliminarDocumento(id){\n const result = await Curso.deleteOne({_id: id});\n console.log('Documento eliminado', result); \n}", "function deleteWithID(res, req){\n factoryStore.remove(req.params.id, function(err, factory){\n if (err){\n res.writeHeader(500, {'Content-Type':'text/html'});\n res.write(\"Error deleting file. Ensure that file with that ID exists.\");\n console.log(err);\n }\n res.writeHeader(200, {'Content-Type':'text/html'});\n res.write(\"Deleted\");\n res.end();\n });\n}", "supprimerParId(id) {\n console.log(id + \" <=id \");\n mongoose.model('Article').deleteOne({\"_id\" : id}).then((result)=>{\n console.log('ok deleted');\n }).catch((err)=>{\n console.log(err);\n });\n }", "static async deleteReview(reviewId, userId){\n\n try{\n const deleteResponse = await reviews.deleteeOne (\n // Information needed to delete a docd\n {\n _id: ObjectId(reviewId),\n user: userId,\n }\n \n\n )\n return deleteResponse\n\n }catch(e){\n console.log(\n `Unable to post review ${e}`\n )\n return{error: e}\n }\n\n}", "supprimerParId(id) {\n mongoose.model('Publicite').findByIdAndDelete({_id : id}, cb).then((result)=>{\n console.log(\"suppression effectuée\");\n }).catch((error)=>{\n console.log(\"erreur suppression\");\n });\n }", "async function deleteBookByID(req, res) {\n const book = await table().deleteOne({\n _id: mongoDB.ObjectId(req.params.id),\n });\n res.send(\"Record deleted\");\n}", "async delete(requisition, response){\n await Model.deleteOne({\"_id\": requisition.params.id}).then(resp =>{\n return response.status(200).json(resp);\n }).catch(error => {return response.status(500).json(error);});\n }", "function deleteCard(Id) { \n if (AdminGroup.has(globaluser.uid)) { \n db.collection(\".messages\").doc(Id).delete().then(() => {\n console.log(\"Document successfully deleted!\"); \n}).catch((error) => {\n console.error(\"Error removing document: \", error);\n});\n} \n}", "deleteRecord() {\n var docId = this.props.orderId\n db.collection(\"orders\").doc(docId).delete()\n .then(function() {\n console.log(\"Successfully deleted document id \" + docId)\n })\n .catch(function(error) {\n console.error(\"Error writing document: \" + error);\n });\n }", "async delete(id) {\n let collection = await this.collection();\n await collection.deleteOne({_id: ObjectId(id)});\n this.dbClient.close();\n return console.log('Item successfully deleted')\n }", "function _delete(req, res) {\n if (_adminCommonValidation(req, res, \"delete\")) {\n repository.deletePackageMetadata(req.params.name, req.user, function (err) {\n if (err) {\n var responseData = {\n errors: _toErrorMessageList(err),\n operation: \"delete\"\n };\n if (err.message === \"UNKNOWN_EXTENSION\") {\n res.status(404);\n _respond(req, res, \"adminFailed\", responseData);\n } else if (err.message === \"NOT_AUTHORIZED\") {\n _respondUnauthorized(req, res, \"adminFailed\", responseData);\n } else {\n res.status(400);\n _respond(req, res, \"adminFailed\", responseData);\n }\n } else {\n res.status(200);\n _respond(req, res, \"deleteSucceeded\", {\n name: req.params.name\n });\n }\n });\n }\n}", "function deleteComment(id) {\n return CommentModel.findOneAndRemove({_id : id}, function(err, docs) {\n if (err) {\n console.log(err);\n }\n });\n}", "async delete({request, response, params: {id}}) {\n\n const name = await nameService.findNameBy('id', id);\n\n if (name) {\n\n name.delete()\n\n return response.status(200).send({\n status: 200,\n message: \"name deleted\"\n })\n }\n else{\n return response.status(400).send({\n status: 400,\n message: \"invalid name id\"\n })\n }\n }", "function deleteProject (req, res) {\n console.log('params.id', req.params.id)\n DESCRIPTION.destroy({\n where: {\n ProjectId: req.params.id\n }\n }).then(() => {\n IMAGEPATH.destroy({\n where: {\n ProjectId: req.params.id\n }\n }).then(() => {\n PROJECT.destroy({\n where: {\n id: req.params.id\n }\n }).then(() => {\n res.send(true)\n }).catch(err => {\n console.log(err)\n res.send(false)\n })\n }).catch(err => {\n console.log(err)\n res.send(false)\n })\n }).catch(err => {\n console.log(err)\n res.send(false)\n })\n}", "function deleteProject(req, res) {\n\n\tconst _id = new ObjectID(req.params.id);\n\n\tProject.deleteOne({_id: _id})\n\t\t.then(result =>{\n\t\t\tres.json({ message: \"Project successfully deleted!\", result });\n\t\t})\n\t\t.catch(err =>{\n\t\t\tconsole.log(err);\n\t\t});\n}", "delete(req, res) {\n this._bookDao\n .delete(req.params.id)\n .then(() => res.status(200).end())\n .catch(console.error);\n }", "removeById(id) {\n return this.findById(id)\n .then((doc) => {\n if (!doc) {\n return Promise.reject(\"document not found\");\n }\n else {\n return doc.remove();\n }\n });\n }", "deleteGoal(id) {\n this.db.remove({ _id: id }, {}, function (err, docsRem) {\n if (err) {\n console.log(\"Error deleting document.\");\n } else {\n console.log(docsRem, \"Document(s) removed from database.\");\n }\n });\n }", "deleteFile(name) {\n let auth = this.auth;\n const drive = google.drive({ version: 'v3', auth });\n this.db.collection(\"filesCollection\").findOne({\"name\": name}).then(file => {\n console.log(`Deleting file ${name} with id ${file.fileId} and keyId ${file.keyId}`);\n drive.files.delete({\n 'fileId': file.fileId\n }).then(fileDeleteRes => {\n drive.files.delete({\n 'fileId': file.keyId\n }).then(keyDeleteRes => {\n this.db.collection(\"filesCollection\").deleteOne({\"name\": name}).then(res => console.log(\"File in the database deleted\"));\n });\n });\n });\n }", "static async deleteProject(id){\n \n try{\n const response = await db.one(`DELETE FROM projects WHERE id =$1;`, [id]); \n return response;\n } catch (error){\n return error.message;\n }\n }", "delete(fileId, callback){\n throw new Error('delete is not implemented');\n }", "async function deleteCourse(id){\n const result = await Course.deleteOne({_id: id});\n // Course.findByIdAndRemove(id);\n console.log(result);\n}", "delete(fileID) {\n return this.ready.then(db => {\n const transaction = db.transaction([STORE_NAME], 'readwrite');\n const request = transaction.objectStore(STORE_NAME).delete(this.key(fileID));\n return waitForRequest(request);\n });\n }", "function deleteData(req, res) {\n var p = config.getDB().then(function(db){\n db.collection(\"chartinsert\").remove({_id:ObjectID(req.params.id)},function(err,data){\n if(err) res.status(500).json({success:false,message:'something went wrong.'})\n else{\n // console.log(data)\n res.status(200).json({success:true, message:'deleted successfully'})\n }\n })\n })\n}", "function updateModuleDoc(moduleName, updateDoc){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n\n service.findDuplicateDoc(moduleName, updateDoc).then(function(){\n db.bind(moduleName);\n \n //convert '_id' to ObjectID\n updateDoc._id = new ObjectID(updateDoc._id);\n \n db[moduleName].update({_id: updateDoc._id}, {$set: updateDoc}, function(err, writeResult){\n if(err){\n deferred.reject(err);\n }\n else{\n if(writeResult.result.nModified == 0){\n deferred.reject(notFound);\n }\n else{\n deferred.resolve();\n }\n }\n });\n }).catch(function(err){\n deferred.reject(err);\n });\n\n return deferred.promise;\n}", "function updateModuleDoc(moduleName, updateDoc){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n\n db.bind(moduleName);\n\n //create another object and copy. then delete the '_id' property of the new copy\n var forUpdate = {};\n Object.assign(forUpdate, updateDoc);\n delete forUpdate._id;\n\n db[moduleName].update({_id: mongo.helper.toObjectID(updateDoc._id)}, {$set: forUpdate}, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n deferred.resolve();\n }\n });\n\n return deferred.promise;\n}", "function deleteDocument1(event) {\n event.preventDefault();\n console.log(\"hello2\");\n let id = document.getElementById(\"deleteId\").value;\n axios\n .delete(`/products/${id}`)\n .then(function (response) {\n console.log(response.data);\n })\n .catch(function (error) {\n console.log(`${id} product was deleted`);\n });\n\n console.log(id);\n }", "async function deleteCourse(id) {\n return await Course.deleteOne({\"_id\":id});\n}", "static deldoc(req,res){\n return especialidad_doctor\n .findByPk(req.params.id)\n .then(data => {\n if(!data) {\n return res.status(400).send({\n success:false,\n msg: 'No funciona ',\n });\n }\n return data\n .destroy()\n .then(() => res.status(200).json({\n success:true,\n msg: 'Elimanado Correctamente'\n }))\n .catch(error => res.status(400).send(error));\n })\n .catch(error => res.status(400).send(error))\n }", "async function deleteArticle(id){\n return Article.deleteOne({_id: id}).exec()\n}", "async function eliminarUser(req, res) {\n\n try {\n\n console.log(req.params['id']); \n const usr = await db.collection('users').doc(req.params['id']+\"\").delete();\n let user = await User.findByIdAndRemove(req.params['id'] );\n\n \n res.status(200).send({ user: user });\n } catch (error) {\n res.status(500).send({ error: error });\n }\n\n}", "static deleteTemplate(req, res) {\n let type = req.params.type;\n let id = req.params.id;\n\n ConnectionHelper.getTemplateProvider(req.project, req.environment)\n .then((connection) => {\n if(!connection) { return Promise.reject(new Error('No template provider found')); }\n \n return connection.deleteTemplateById(type, id);\n })\n .then(() => {\n res.status(200).send('OK');\n })\n .catch((e) => {\n res.status(404).send(ApiController.printError(e, false));\n }); \n }", "function _delete(SpecParam){\n var deferred = Q.defer();\n var id= SpecParam._id;\n\n db.specification.remove(\n {_id: mongo.helper.toObjectID(SpecParam._id)},\n function(err){\n \tif(err) deferred.reject(err);\n \t\n \tdeferred.resolve();\n });\n return deferred.promise;\n}", "deleteById(id) {\n let sqlRequest = \"DELETE FROM repo WHERE id=$id\";\n let sqlParams = {$id: id};\n return this.common.run(sqlRequest, sqlParams);\n }", "async function removeCourse(id) {\n //return await Course.deleteOne({_id:id});\n\n //delete 1st one\n //Course.deleteOne({isPublish : false});\n //delete many\n //Course.deleteMany(id);\n const deletedCourse = await Course.findByIdAndRemove(id);\n return deletedCourse;\n //if specify delete id is not in db, it will return null, otherwise return the document b4 deleted.\n}", "async deleteTodo(todo){\n\n // delete the todo from the database\n const result = await _mongoDb.collection(\"todos\").deleteOne({_id: ObjectId(todo.id)});\n\n // return result\n return result;\n\n }", "del(source = true) {\n return new Promise((resolve, reject) => {\n this.doc.del({ source }, (err) => {\n if (err) {\n reject(err);\n }\n else {\n this.sdb.deleteDoc(this);\n resolve();\n }\n });\n });\n }", "function deleteBook (req, res) {\n let id = req.params.id \n bookModel.findById(id, (err, book) => {\n if (err) {\n res.status(500).send({message: `Error when deleting the book: ${err}`})\n }\n book.remove(err => {\n if(err) res.status(404).send({message: `Book does not exist`})\n res.status(200).send({ message: \"The book has been deleted\" })\n }) \n })\n}", "async delete(req,res){\n const {_id} = req.params;\n try{\n await Simulador.findByIdAndDelete(_id);\n return res.json({deletado:true})\n }\n catch(e){\n return res.status(404).send(`${e} Item nao encontrado`);\n }\n }", "static deleteById(req, res) {\n\t\t//delete referensi di user dulu\n\t\tUser.findByIdAndUpdate(req.headers.userId, {\n\t\t\t$pull: { userTodos: { $in: ObjectId(req.params.todoId) } }\n\t\t})\n\t\t\t.exec()\n\t\t\t.then(deleteResponse => {\n\t\t\t\tres.json(deleteResponse);\n\t\t\t\t///return Todo.findByIdAndRemove(ObjectId(req.params.todoId));\n\t\t\t})\n\t\t\t.then(response => {\n\t\t\t\tres.status(200).json({\n\t\t\t\t\tmessage: \"Todo Deleted\"\n\t\t\t\t});\n\t\t\t})\n\t\t\t.catch(err => {\n\t\t\t\tres.status(400).json({\n\t\t\t\t\tmessage: err.message,\n\t\t\t\t\tdata: err\n\t\t\t\t});\n\t\t\t});\n\t}", "delete(req, res) {\n Item.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 }", "async DeleteSingleDoctorService(req,res) {\n\n }", "function deleteCourse(code){\n var user = firebase.auth().currentUser;\n var userEmail = user.uid;\n var db = firebase.firestore().collection(\"temp\").doc(\"tempdoc\").collection(\"temp-\"+userEmail);\n\n db.doc(code).delete().then(function() {\n updateCoursePlanner();\n console.log(\"Document successfully deleted!\");\n }).catch(function(error) {\n console.error(\"Error removing document: \", error);\n });\n }", "static Delete(req, res) {\n let id = req.params.id\n new mssql.ConnectionPool(config.config).connect().then((pool) => {\n return pool.request().query(`EXEC sp_delete_attachment ${id}`)\n }).then((fields) => {\n mssql.close();\n res.json(\"DELETED SUCCESSFULLY\");\n }).catch(err => {\n mssql.close();\n res.json(err);\n })\n }", "deleteById(req, res) {\n this.Model\n .destroy({where: {id: req.params.id}})\n .then(item => {\n let responseCode = 0;\n\n if (item === 0) {\n responseCode = -2;\n }\n\n return Response.create(res, responseCode, []);\n })\n .catch(err => {\n return Response.create(res, -1, err);\n });\n }", "function removeById(resourceName, id) {\n\n \tconst collection = getModel(resourceName);\n\n \treturn collection.findOneAndRemove({_id: id})\n \t.then(data => {\n\n \t\tconst resp = {\n \t\t\tdoc: data,\n \t\t\tmetadata: {\n \t\t\t\tmodified: data.length\n \t\t\t}\n \t\t};\n\n \t\treturn resp;\n \t})\n \t.catch(err => {\n \t\tconsole.log(err);\n \t\tconsole.log(\"db.removeById error\");\n \t});\n }", "function deletePage(req, res) {\n var pageId = req.params[\"pageId\"];\n pageModel.deletePage(pageId)\n .then(function(status) {\n res.sendStatus(200);\n });\n}", "removeThought({ params }, res) {\n Thought.findOneAndDelete({ _id: params.id })\n .then(deletedThought => {\n if (!deletedThought) {\n return res.status(404).json({ message: 'No thought with this id!' })\n }\n res.json({ message: 'Thought removed!' })\n })\n .catch(err => {\n console.log(err)\n res.sendStatus(400)\n })\n }", "async delete(req, res) {\n const projeto = await Projeto.findByPk(req.body.id);\n /*const cadastrosAl = await CadastroAluno.findAll({\n where: {fk_projeto: projeto.id}\n })\n if(cadastrosAl.length > 0){\n cadastrosAl.forEach(cadAl=>{\n await CadastroAluno.destroy(cadAl);\n })\n }*/\n await projeto.destroy();\n if (!projeto) {\n return res.status(400).json({\n Error: ['Não foi possivel deletar o projeto']\n })\n }\n return res.status(200).json({\n Sucess: ['Projeto removido com sucesso']\n })\n }", "function deletePageForWebsite(websiteId,pageId) {\n return websiteModel\n .findById(websiteId)\n .then(function (website) {\n var index= website.pages.indexOf(pageId);\n //console.log(index);\n website.pages.splice(index,1);\n return website.save();\n });\n}", "delete(req, res) {\n Assembly.findByIdAndDelete(req.params.id)\n .then(deletedAssembly => res.json(deletedAssembly))\n .catch(err => res.status(400).json(err));\n }", "deleteThought({ params }, res) {\n Thought.findOneAndDelete({ _id: params.id })\n .then(dbThoughtData => {\n if (!dbThoughtData) {\n res.status(404).json({ message: 'No thought found with this id!' });\n return;\n }\n res.json(dbThoughtData);\n })\n .catch(err => { res.status(400).json(err) });\n }", "delete(req, res) {\n studentDAO.deleteStudent(db, req.params.studentID)\n .then(() => {\n res.sendStatus(204)\n })\n .catch(err => {\n console.error(err)\n res.sendStatus(404)\n })\n }", "function deleteItem(deleteItemtodo){\r\n var iteMId = deleteItemtodo.parentNode.id;\r\n db.collection(\"todo\").doc(iteMId).delete().then(function() {\r\n console.log(\"Document successfully deleted!\");\r\n }).catch(function(error) {\r\n console.error(\"Error removing document: \", error);\r\n });\r\n}", "static delete(req, res) {\n const { id } = req.params\n\n Article.destroy({\n where: { id },\n })\n .then((deletedData) => {\n if (!deletedData) throw { status: 404, message: 'Article not found!' }\n\n res.status(200).json({ message: 'Successfully delete article!' })\n })\n .catch((err) => {\n if (err.status) {\n res.status(err.status).json({ message: err.message })\n } else {\n res\n .status(500)\n .json({ message: err.message || 'internal error server' })\n }\n })\n }", "delete(req, res) {\n RegistroEstudo.destroy({\n where: {\n id: req.params.id\n }\n })\n .then(function (deletedRecords) {\n res.status(200).json(deletedRecords);\n })\n .catch(function (error) {\n res.status(500).json(error);\n });\n }", "function _delete(id) {\n return dispatch => {\n dispatch(request(id));\n\n projectService.delete(id)\n .then(\n project => {\n // wenn Projekt erfolgreich gelöscht, dann auch alle Dokumente löschen\n projectDocService.deleteAllByProjectId(id);\n\n // erfolgreich gelöschtes Projekt aus Projects-Array entfernen --> success(id)\n dispatch(success(id));\n dispatch(alertActionsProjectMgmt.clearAndOverlayChange('Clear'));\n },\n error => dispatch(failure(error.toString()))\n );\n };\n\n function request(id) { return { type: projectConstants.DELETE_PROJECT_REQUEST, id } }\n function success(id) { return { type: projectConstants.DELETE_PROJECT_SUCCESS, id } }\n function failure(error) { return { type: projectConstants.DELETE_PROJECT_FAILURE, error } }\n}", "async deleteById(id) {\r\n const item = await this.findById(id);\r\n const result = await item.destroy();\r\n if (result === false) {\r\n throw new Exception('can not delete resource', 1002);\r\n }\r\n return result;\r\n }", "function deleteCart(productId){\n db.collection(\"cart\").doc(productId).delete().then(function() {\n alert('Pedido eliminado del carrito')\n leerCarrito();\n }).catch(function(error) {\n alert('Hubo un error al eliminar el pedido del carrito:', error)\n });\n\n}", "function deleteNode(req, res, next) {\n req.query.idNode = parseInt(req.query.idNode);\n if(!req.query.idNode && req.query.idNode !== 0) {\n return next(new Error('no directory or file specified!'));\n }\n Nodes.deleteNode(req.query.idNode, function(err) {\n err ? next(err) : res.sendStatus(200); \n });\n}", "deletefacture(req, res) {\n try {\n const id = req.params.id;\n Facture.destroy({\n where: { id: id },\n }).then((num) => {\n if (num == 1)\n return res.status(200).send(\"facture was deleted succesfully\");\n return res\n .status(404)\n .send(\n `Cannot deleted facture with id=${id}. Maybe facture was not found !`\n );\n });\n } catch (error) {\n res.status(500).send(error);\n }\n }", "async deleteTask(_id){\n console.log(\"we in the taskDao\" +_id);\n let deletedTask = Task.findOneAndDelete({\"_id\":_id})\n console.log(\"THIS GOT DELETED: \"+deletedTask);\n return deletedTask;\n }", "deleteComment(req, res) {\n const { user } = req;\n const { commentId } = req.params;\n db.Comment.findOne({ where: { id: commentId, UserId: user.id } })\n .then((comment) => {\n if (comment) {\n comment.deleteThread()\n .then(() => res.send(200));\n }\n res.send(403);\n })\n .catch(err => errorHandler(req, res, err));\n }", "async function deleteFile(userIdIn, fileIdIn) {\n var db = await MongoClient.connect(process.env.PROD_MONGODB);\n await db.collection('files').deleteOne(\n {_id: new ObjectID(fileIdIn)}\n );\n await db.close();\n}", "async function deleteProductById(req, res, id) {\n try {\n const product = await ProductModel.findDataById(id)\n\n if(!product) {\n res.writeHead(404, { 'Content-Type': 'application/json' })\n res.end(JSON.stringify({ message: 'Product Not Found' }))\n } else {\n await ProductModel.removeById(id)\n res.writeHead(200, { 'Content-Type': 'application/json' })\n res.end(JSON.stringify({ message: `Product having ${id} is removed` }))\n }\n } catch (error) {\n console.log(error)\n }\n}", "function deleteProduct(req, res) {\n let productId = req.params.productId\n\n Product.findById(productId, (err, product) => {\n\n if (err) res.status(500).send({ message: 'Error al borrar el Producto' })\n\n product.remove(err => {\n if (err) res.status(500).send({ message: 'Error al borrar el Producto' })\n\n res.status(200).send({ message: 'Producto borrado' })\n })\n\n })\n}", "deleteThought({params}, res) {\n thoughts.findOneAndDelete({_id: params.id})\n .then(dbThoughtData => {\n if (!dbThoughtData) {\n res.status(404).json({message: 'No Thoughts found with this ID!'});\n return;\n }\n res.json(dbThoughtData);\n })\n .catch(err => res.status(400).json(err));\n}", "function deleteChosenDocument() {\n\tvar aid = getURLParameter(\"AID\");\n\ttogglePopup('document_del', false);\n\tdocument.getElementById(\"dokumentloeschenbutton\").disabled = \"disabled\";\n\tconnect(\"/hiwi/Clerk/js/deleteOfferDocument\", \"uid=\" + selectedDocument\n\t\t\t+ \"&aid=\" + aid, handleDocumentChangeResponse);\n\tselectedDocument = null;\n\ttogglePopup(\"document_delete\", false);\n}", "deleteById(req, res) {\n Activity.findByIdAndRemove(req.params.id).then(result => {\n res.json(result);\n })\n .catch(err => {\n res.json(err);\n });\n }", "async function removeCourse(id) {\n // const result = await Course.deleteOne({ _id: id });\n // const result = await Course.deleteMany({ _id: id });\n const course = await Course.findByIdAndRemove(id);\n // console.log(result);\n console.log(course);\n}", "delete(params)\n {\n let opts = this.buildCallOpts({method:'DELETE'});\n return this.doRequest({method: 'DELETE'}, params._id, params);\n }", "delete(req, res) {\n console.log('Delete Request is=====>');\n console.log(req.query);\n queryVars = req.query;\n Image.destroy({\n where: {\n id: queryVars.id\n }\n })\n .then(function (deletedRecords) {\n //if successfull, delete image from the file system tourcosts\n\n res.status(200).json(deletedRecords);\n })\n .catch(function (error){\n res.status(500).json(error);\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 function deleteTodoById(account_id){\n if(account_id){\n // const [result, ] = await pool.query(\"DELETE FROM todos WHERE id=?\",[account_id]); // return Promise [results, fields]\n return await Todo.destroy({\n attributes:attributes,\n where: { \n id: account_id\n }\n }) \n }\n return null;\n}", "async function deleteItem(req, res){\n const item=await Item.findById(req.params._id)\n if (!item){\n throw new Error(\"item notfound\")\n } else {\n const deletedItem=await item.remove()\n res.json(`${deletedItem.name} removed successfully`)\n }\n \n}", "async function removeReviewForFreelancer(db, freelancerId) {\n try {\n // let db = await MongoUtil.connect(mongoUrl, dbName);\n let result = await db.collection(collectionName).deleteMany({\n 'for': ObjectId(freelancerId)\n });\n return result\n } catch(e) {\n errorMsg = `\n Error encountered when removing data from DB.\n Collection: ${collectionName}, Freelancer Id: ${freelancerId}, Error: ${e}\n `\n console.error(errorMsg)\n throw new MongoUtil.DBError(errorMsg);\n }\n}", "async function deleteResource(req, res) {\n let id = req.params.id;\n\n await Resource.destroy({ where: { id: id } })\n .then(async data => {\n if (data == 1) {\n saveBitacora('Resource', id, 'delete resource', 'delete', req.user.id);\n res.status(200).json({\n ok: true,\n message: 'Recurso eliminado con éxito',\n data\n });\n } else {\n res.status(200).json({\n ok: false,\n message: `No existe un recurso con id = ${id}.`\n });\n }\n })\n .catch(err => {\n rres.status(500).json({\n ok: false,\n message: `No se pudo eliminar el recurso con id = ${id}.`,\n error: err.parent.detail\n });\n });\n}", "function deleteReminder(user, reminderDocID) {\r\n return new Promise((resolve, reject) => {\r\n\r\n const MongoClient = require(\"mongodb\").MongoClient;\r\n const url = mongoURL;\r\n\r\n MongoClient.connect(url, function(err, db) {\r\n if (err) reject(false);\r\n\r\n const dbo = db.db(dbName);\r\n\r\n dbo.collection(user).findOne(\r\n {\r\n _id: reminderDocID\r\n },\r\n function(err, result) {\r\n if (err) reject(false);\r\n if (result) {\r\n // Reminder with reminderNumber found - remove this document\r\n const documentToDeleteID = {_id: reminderDocID};\r\n dbo.collection(user).deleteOne(documentToDeleteID, function(err, obj) {\r\n if (err) {\r\n console.log(\"Failed to delete this reminder\");\r\n db.close();\r\n resolve(false);\r\n }\r\n if (obj) {\r\n console.log(\"Reminder successfully deleted!\");\r\n db.close();\r\n resolve(true);\r\n }\r\n });\r\n\r\n } else {\r\n // No document with reminderNumber found\r\n console.log(\"Reminder not found\");\r\n db.close();\r\n resolve(false);\r\n }\r\n });\r\n });\r\n });\r\n}", "function deleteInvoice(req, res, next) {\n\n var id = req.swagger.params.id.value;\n var status = req.swagger.params.status.value;\n InvoiceService.deleteInvoice(id, status)\n .then(function (response) {\n res.json(response);\n })\n .catch(function (response) {\n var statusCode = response.statusCode;\n var msg = response.message;\n res.status(statusCode).send({ message: msg });\n }); \n }", "function _delete(_id) {\n var deferred = Q.defer();\n \n db.assets.remove(\n { _id:mongo.helper.toObjectID(_id) },\n function (err) {\n if (err) deferred.reject(err);\n \n deferred.resolve();\n });\n \n return deferred.promise;\n}", "function deleteAssignment(req, res) {\n let assignmentId = req.params.id;\n Assignment.findByIdAndRemove(assignmentId, (err, assignment) => {\n if (err) {\n console.log(err + \" err\");\n res.send(err);\n } else {\n res.json({ message: `deleted` });\n }\n })\n}", "delete({ note }, res) {\n console.log(\n `${dateFormat(null, \"isoUtcDateTime\")} - REQUEST delete [${note.id}]`\n );\n\n db.collection(\"notes\").deleteOne({ id: note.id }, (err, result) => {\n if (err) {\n return console.log(err);\n }\n res.sendStatus(204);\n\n db\n .collection(\"notes\")\n .find()\n .toArray(function(err, results) {\n broadcast(results);\n });\n });\n }", "function deletep(req){\r\n \r\n return new Promise(function(resolve,reject){\r\n ProductCart.remove({_id: req.params.id}, function(err){\r\n if( err ){ console.log('Error: ', err); reject(); }\r\n \r\n console.log(\"Product deleted!\");\r\n resolve();\r\n });\r\n });\r\n}" ]
[ "0.8478919", "0.8008632", "0.79626316", "0.7090099", "0.69446784", "0.6760206", "0.6703368", "0.6679069", "0.6499352", "0.648364", "0.6419483", "0.6418587", "0.63801485", "0.63159657", "0.6239152", "0.6212612", "0.6169452", "0.61594284", "0.61558723", "0.61168295", "0.61043197", "0.60533875", "0.60423076", "0.6038414", "0.6034389", "0.6033768", "0.5992024", "0.5987659", "0.5983495", "0.59788865", "0.597354", "0.5971797", "0.5971417", "0.59664804", "0.5959825", "0.5947824", "0.59311354", "0.5928788", "0.59278506", "0.5912139", "0.59088045", "0.5897116", "0.58965784", "0.58962566", "0.5883702", "0.5871367", "0.585185", "0.5833238", "0.5828813", "0.58287334", "0.5811388", "0.58009386", "0.57998997", "0.5797721", "0.5792605", "0.57904106", "0.5790185", "0.5787833", "0.5785811", "0.57835484", "0.57780737", "0.5774023", "0.5769118", "0.5766586", "0.5759401", "0.5748772", "0.5748511", "0.57476485", "0.57466036", "0.5741969", "0.5734936", "0.5729178", "0.5727479", "0.572088", "0.5715773", "0.5709153", "0.57084537", "0.5706626", "0.5703678", "0.57016516", "0.56984985", "0.5691043", "0.5688971", "0.5681081", "0.5680776", "0.5665819", "0.56643265", "0.5662778", "0.56574637", "0.5655009", "0.56493247", "0.56441504", "0.56389767", "0.5636176", "0.56304777", "0.56303495", "0.56285423", "0.5626315", "0.562006", "0.5617257" ]
0.8466946
1
Function name: find duplicate values Author: Reccion, Jeremy Date Modified: 2018/04/12 Description: check for duplicate values according to one or more unique fields Parameter(s): moduleName: required. string type moduleDoc: required. object type. includes: _id: optional. string type //if this exists, the document is being updated Return: Promise
function findDuplicateDoc(moduleName, moduleDoc){ var deferred = Q.defer(); moduleName = moduleName.toLowerCase(); //get the fields of the specific module service.getModuleByName(moduleName).then(function(aModule){ //initialize array & object for querying var uniqueValues = []; var tempObj; //push the value of the document when a field is unique aModule.fields.forEach(function(field){ if(field.unique){ tempObj = {}; tempObj[field.name] = moduleDoc[field.name]; uniqueValues.push(tempObj); } }); if(uniqueValues.length == 0){ deferred.resolve(); } else{ db.bind(moduleName); //use $or for checking each field for uniqueness, not their combination db[moduleName].findOne({$or: uniqueValues}, function(err, duplicateDoc){ if(err){ deferred.reject(err); } //a duplicate exists, but needs further checking else if(duplicateDoc){ //updating a module document if(moduleDoc._id){ //different module documents with similar unique values if(moduleDoc._id != duplicateDoc._id){ deferred.reject(exists); } //since it is the same document, it is not duplicate else{ deferred.resolve(); } } //adding new module documennt else{ deferred.reject(exists); } } //does not exist - similar to notFound. but it is not rejected based on design else{ deferred.resolve(); } }); } }).catch(function(err){ deferred.reject(err); }); return deferred.promise; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function findDuplicateDoc(moduleName, moduleDoc){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n\n //get the fields of the specific module\n service.getModuleByName(moduleName).then(function(aModule){\n //initialize array & object for querying\n var uniqueFields = [];\n var tempObj;\n\n //push the value of the document when a field is unique\n aModule.fields.forEach(function(field){\n if(field.unique){\n tempObj = {};\n tempObj[field.name] = moduleDoc[field.name];\n uniqueFields.push(tempObj);\n }\n });\n\n if(uniqueFields.length == 0){\n deferred.resolve();\n }\n else{\n //use $or for checking each field for uniqueness, not their combination\n db[moduleName].findOne({$or: uniqueFields}, function(err, duplicateDoc){\n if(err){\n deferred.reject(err);\n }\n //a duplicate exists, but needs further checking\n else if(duplicateDoc){\n //updating a module document\n if(moduleDoc._id){\n //different module documents with similar unique values\n if(moduleDoc._id != duplicateDoc._id){\n deferred.reject(exists);\n }\n //since it is the same document, it is not duplicate\n else{\n deferred.resolve();\n }\n }\n //adding new module documennt\n else{\n deferred.reject(exists);\n }\n }\n //does not exist\n else{\n deferred.resolve();\n }\n });\n }\n\n \n }).catch(function(err){\n deferred.reject(err);\n });\n\n return deferred.promise;\n}", "function updateModuleField(moduleName, fieldObject){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n\n console.log(fieldObject);\n\n service.getModuleByName(moduleName).then(function(aModule){ \n //use array.filter() to get the duplicate fields\n var duplicateFields = aModule.fields.filter(function(field){\n //lesson learned: use toString() in id\n return field.id.toString() == fieldObject.id.toString() || field.name == fieldObject.name;\n });\n \n if(duplicateFields.length == 0){\n deferred.reject(notFound);\n }\n //valid inputs\n else if(duplicateFields.length == 1){\n //this is to ensure that the field is inside the specific module (in case of improper input parameters)\n\n fieldObject.id = new ObjectID(fieldObject.id);\n\n if(duplicateFields[0].id.toString() == fieldObject.id.toString()){\n db.modules.update({name: moduleName, fields: {$elemMatch: {id: fieldObject.id}}}, {$set: {'fields.$': fieldObject}}, function(err, writeResult){\n if(err){\n deferred.reject(err);\n }\n else{\n console.log(writeResult.result);\n deferred.resolve();\n }\n });\n }\n //the only element has the same name but is different id, therefore, not inside the module document\n else{\n deferred.reject(notFound);\n }\n }\n else{\n deferred.reject(exists);\n }\n }).catch(function(err){\n deferred.reject(err);\n });\n\n return deferred.promise;\n}", "checkDuplicates(error) {\n if (error.name === \"MongoError\" && error.code === 11000) {\n // check if the error from Mongodb is duplication error\n // eslint-disable-next-line no-useless-escape\n const regex = /index\\:\\ (?:.*\\.)?\\$?(?:([_a-z0-9]*)(?:_\\d*)|([_a-z0-9]*))\\s*dup key/i;\n const match = error.message.match(regex);\n const fieldName = match[1] || match[2];\n return new APIError({\n message: `${fieldName} already exists`,\n status: httpStatus.CONFLICT,\n isPublic: true,\n stack: error.stack,\n });\n }\n return error;\n }", "function processDuplicates() {\r\n\tnlapiLogExecution('AUDIT','FLO Start','processDuplicates');\r\n\t\r\n\tvar context = nlapiGetContext();\r\n\tvar s = nlapiLoadSearch('customrecord_flo_customization', 'customsearch_flo_duplicate_cust_script');\r\n\tvar res = s.runSearch();\r\n\tvar set=res.getResults(0,1000);\r\n\tvar cols=res.getColumns();\r\n\tnlapiLogExecution('DEBUG','Records',set.length);\r\n\t/*\r\n\tName name\r\n\tScriptId \tcustrecord_flo_cust_id\r\n\tInternal Id\t \tcustrecord_flo_int_id\r\n\tFormula \tformulanumeric\r\n\tfor (var i=0;i<cols.length;i++){\r\n\t\tnlapiLogExecution('DEBUG','Column',cols[i].getName());\r\n\t}\r\n\t*/\r\n\tif (set!= null && set.length > 0) {\r\n\t\tfor (var i=0; i < set.length && set[i] != null; i++) {\r\n\t\t\t\r\n\t\t\t//USAGE CHECK / RESCHEDULE\r\n\t\t\tif (context.getRemainingUsage() < MAX_USAGE || new Date().getTime() - START_TIME > MAX_TIME) {\r\n\t\t\t\tvar status = nlapiScheduleScript(context.getScriptId(), context.getDeploymentId());\r\n\t\t\t\tnlapiLogExecution('AUDIT','Rescheduled Due to Usage','processDuplicates');\r\n\t\t\t\tif ( status == 'QUEUED' )\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tvar name=set[i].getValue(cols[0]);\r\n\t\t\tvar scriptId=set[i].getValue(cols[1]);\r\n\t\t\tif (scriptId == '- None -')\r\n\t\t\t\tscriptId = '';\r\n\t\t\tvar intId=set[i].getValue(cols[2]);\r\n\t\t\t\r\n\t\t\tif (name == '' || scriptId == '' || intId == '')\r\n\t\t\t\tcontinue;\r\n\t\t\t\r\n\t\t\t// search duplicate\r\n\t\t\tvar filters = [];\r\n\t\t\tfilters[0] = new nlobjSearchFilter('name', null, 'is', name );\r\n\t\t\tfilters[1] = new nlobjSearchFilter('custrecord_flo_cust_id', null, 'is', scriptId );\r\n\t\t\tfilters[2] = new nlobjSearchFilter('custrecord_flo_int_id', null, 'equalto', intId );\r\n\t\t\tfilters[3] = new nlobjSearchFilter('isinactive', null, 'is', 'F' );\r\n\r\n\t\t\tvar dupRes=nlapiSearchRecord('customrecord_flo_customization',null,filters);\r\n\t\t\tif (dupRes == null || dupRes.length < 2) {\r\n\t\t\t\tnlapiLogExecution('ERROR','Couldnt Find Duplicate',name+','+scriptId+','+intId);\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\tvar dupId=dupRes[0].getId();\r\n\t\t\tvar id=dupRes[1].getId();\r\n\t\t\t\r\n\t\t\tif (parseInt(id) > parseInt(dupId)) {\r\n\t\t\t\t//swap variables\r\n\t\t\t\tvar temp=dupId;\r\n\t\t\t\tdupId=id;\r\n\t\t\t\tid=temp;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tnlapiLogExecution('DEBUG','id, dupId', id + ',' + dupId);\r\n\t\t\t\r\n\t\t\t//FLO Change Log\r\n\t\t\t//custrecord_flo_customization_record\r\n\t\t\tfilters = [];\r\n\t\t\tfilters[0] = new nlobjSearchFilter('custrecord_flo_customization_record', null, 'anyof', dupId );\r\n\t\t\tfilters[1] = new nlobjSearchFilter('isinactive', null, 'is', 'F' );\r\n\t\t\tvar clRes=nlapiSearchRecord('customrecord_flo_change_log',null,filters);\r\n\t\t\t\r\n\t\t\tif (clRes != null && clRes.length > 0) {\r\n\t\t\t\tfor (var ii = 0; ii < clRes.length && clRes[ii] != null; ii++) {\r\n\t\t\t\t\tvar clId=clRes[ii].getId();\r\n\t\t\t\t\tvar clRec = nlapiLoadRecord('customrecord_flo_change_log',clId);\r\n\t\t\t\t\tif (clRec == null)\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\tclRec.setFieldValue('custrecord_flo_customization_record',id);\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\tnlapiSubmitRecord(clRec,false,true);\r\n\t\t\t\t\t\tnlapiLogExecution('AUDIT','Updated FLO Change Log',clId);\r\n\t\t\t\t\t} catch(e) {\r\n\t\t\t\t\t\tnlapiLogExecution('DEBUG','Error Submit',e);\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\r\n\t\t\t} else {\r\n\t\t\t\tnlapiLogExecution('DEBUG','No Change Log',dupId);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//FLO Change Request customrecord_flo_change_request\r\n\t\t\t// custrecord_flo_cust_change\tmultiselect\r\n\t\t\t// custrecord_flo_customization_to_cleanup\tmultiselect\r\n\t\t\t// custrecord_flo_approve_customization\t\tmultiselect\r\n\t\t\tvar crFilterExpr=[[['custrecord_flo_cust_change','anyof',dupId]\r\n\t\t\t,'or',['custrecord_flo_customization_to_cleanup','anyof',dupId]\r\n\t\t\t,'or',['custrecord_flo_approve_customization','anyof',dupId]]\r\n\t\t\t,'and',['isinactive','is','F']];\r\n\t\t\t\r\n\t\t\tupdateRecord('FLO Change Request','customrecord_flo_change_request',null,['custrecord_flo_cust_change','custrecord_flo_customization_to_cleanup','custrecord_flo_approve_customization'],crFilterExpr,id,dupId);\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t//FLO Test Record customrecord_flo_test_report\r\n\t\t\t//custrecord_flo_customization_tested\r\n\t\t\t//custrecord_flo_data_input_fields\tmultiselect\r\n\t\t\t//custrecord_flo_data_input_form\tmultiselect\r\n\t\t\tvar trFilterExpr=[[['custrecord_flo_customization_tested','anyof',dupId]\r\n\t\t\t,'or',['custrecord_flo_data_input_fields','anyof',dupId]\r\n\t\t\t,'or',['custrecord_flo_data_input_form','anyof',dupId]]\r\n\t\t\t,'and',['isinactive','is','F']];\r\n\t\t\t\r\n\t\t\tupdateRecord('FLO Test Record','customrecord_flo_test_report',['custrecord_flo_customization_tested']\r\n\t\t\t\t,['custrecord_flo_data_input_fields','custrecord_flo_data_input_form'],trFilterExpr,id,dupId);\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t//FLO Process Issue customrecord_process_issue\r\n\t\t\t//custrecord_flo_issue_cust \tmultiselect\r\n\t\t\t//custrecord_flo_source_control\r\n\t\t\tvar piFilterExpr=[[['custrecord_flo_issue_cust','anyof',dupId]\r\n\t\t\t,'or',['custrecord_flo_source_control','anyof',dupId]]\r\n\t\t\t,'and',['isinactive','is','F']];\r\n\t\t\t\r\n\t\t\tupdateRecord('FLO Process Issue','customrecord_process_issue',['custrecord_flo_source_control']\r\n\t\t\t\t,['custrecord_flo_issue_cust'],piFilterExpr,id,dupId);\r\n\t\t\t\t\r\n\t\t\t//Set Duplicate to Inactive\r\n\t\t\t\r\n\t\t\tvar dupRec = nlapiLoadRecord('customrecord_flo_customization',dupId);\r\n\t\t\tif (dupRec != null) {\r\n\t\t\t\tdupRec.setFieldValue('isinactive','T');\r\n\t\t\t\ttry {\r\n\t\t\t\t\tnlapiSubmitRecord(dupRec,false,true);\r\n\t\t\t\t\tnlapiLogExecution('AUDIT','Duplicate Processed',dupId + ':' + name + ',' + scriptId + ',' + intId);\r\n\t\t\t\t} catch (e) {\r\n\t\t\t\t\tnlapiLogExecution('AUDIT','Error set to inactive',dupId + ':' + name + ',' + scriptId + ',' + intId);\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\r\n\t\tif (set.length == 1000) {\r\n\t\t\tvar status = nlapiScheduleScript(context.getScriptId(), context.getDeploymentId());\r\n\t\t\tnlapiLogExecution('AUDIT','Rescheduled','processDuplicates');\r\n\t\t\tif ( status == 'QUEUED' )\r\n\t\t\t\treturn; \r\n\t\t\t//reschedule\r\n\t\t}\r\n\t\r\n\t} else {\r\n\t\tnlapiLogExecution('DEBUG','No Duplicates Found');\r\n\t}\r\n\r\n\tnlapiLogExecution('AUDIT','FLO End','processDuplicates');\r\n}", "function updateModuleDoc(moduleName, updateDoc){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n\n service.findDuplicateDoc(moduleName, updateDoc).then(function(){\n db.bind(moduleName);\n \n //convert '_id' to ObjectID\n updateDoc._id = new ObjectID(updateDoc._id);\n \n db[moduleName].update({_id: updateDoc._id}, {$set: updateDoc}, function(err, writeResult){\n if(err){\n deferred.reject(err);\n }\n else{\n if(writeResult.result.nModified == 0){\n deferred.reject(notFound);\n }\n else{\n deferred.resolve();\n }\n }\n });\n }).catch(function(err){\n deferred.reject(err);\n });\n\n return deferred.promise;\n}", "function getDups() {\n return new Promise((resolve, reject) => {\n Event.aggregate([\n { $group: {\n // Group by fields to match on (a,b)\n _id: { title: \"$title\", timeValue: \"$timeValue\" },\n\n // Count number of matching docs for the group\n count: { $sum: 1 },\n\n // Save the _id for matching docs\n docs: { $push: \"$_id\" }\n }},\n\n // Limit results to duplicates (more than 1 match)\n { $match: {\n count: { $gt : 1 }\n }}\n ], function (err, result) {\n if (err) {\n console.log(err);\n reject(err)\n }\n resolve(result)\n });\n });\n}", "function checkForDuplicates(user, reminderContent, reminderTime) {\r\n const MongoClient = require(\"mongodb\").MongoClient;\r\n const url = mongoURL;\r\n\r\n MongoClient.connect(url, function(err, db) {\r\n if (err) throw err;\r\n const dbo = db.db(dbName);\r\n dbo.collection(user).findOne(\r\n {\r\n reminderContent: reminderContent,\r\n reminderTime: reminderTime\r\n },\r\n function(err, result) {\r\n if (err) throw err;\r\n if (result) {\r\n console.log(\"Such reminder already exists\");\r\n db.close();\r\n return true;\r\n } else {\r\n console.log(\"No duplicates found\");\r\n db.close();\r\n return false;\r\n }\r\n });\r\n });\r\n}", "function check_for_dups(){\n var ss = SpreadsheetApp.openById(BERTHA_ID)\n var backend_sh = SpreadsheetApp.openById(BACKEND_ID)\n\n var tracking_db = backend_sh.getSheetByName(\"Tracking Number DB\")\n var main_sheet = ss.getSheetByName(\"1 - Main Page\")\n var main_sheet_data = main_sheet.getDataRange().getValues()\n var db_data = tracking_db.getDataRange().getValues()\n \n var indexes = get_main_indexes()\n \n var index_facility = indexes.indexFacilityName\n var index_action = indexes.indexPend\n var index_shipped = indexes.indexShippedEmail\n var indexRowID = indexes.indexRowID\n var index_notes = indexes.indexActualIssues\n var indexColemanTracking = indexes.indexColemanTracking\n \n for(var i = 0; i < main_sheet_data.length; i++){\n if(main_sheet_data[i][index_shipped].toString().length == 0){ //if reused, then this would never fill\n var tracking_nums = main_sheet_data[i][indexColemanTracking].toString().split(\",\") //get all tracking nums\n if(tracking_nums.length > 0){\n for(var j = 0; j < db_data.length; j++){\n if(db_data[j][0].toString() == main_sheet_data[i].toString().trim()){ //find the row\n for(var n = 0; n < tracking_nums.length; n++){\n if(db_data[j][1].toString().split(\";\").indexOf(\"971424215\" + tracking_nums[n]) > -1){\n //then it's a duplicate\n debugEmail(\"DUPLICATE TRACKING NUMBER\", \"Found one:\\n\\n\" + tracking_nums[n] + \"\\n\\nRow ID: \" + main_sheet_data[i][indexRowID])\n }\n }\n\n }\n }\n }\n }\n }\n}", "function checkDupe(data,x){\n\n if(idArray.includes(data[x][0])){\n return false;\n } else { return true; }\n\n}", "async function func(uniqueModuleData) {\n try {\n console.log(\"uniqueModuleData\", uniqueModuleData)\n const foundModule = await prisma.module.findUnique({where: uniqueModuleData})\n console.log(\"foundModule\", foundModule)\n return foundModule\n } catch(e) {\n console.log(e)\n return\n }\n }", "function findDuplicate() {\n\n var modelsArray = [$scope.data.first, $scope.data.second, $scope.data.third, $scope.data.fourth];\n var filteringModelsArray = _.uniq(modelsArray);\n\n return filteringModelsArray.length === modelsArray.length;\n }", "_removeDuplicates(data, options) {\n let uniqueValue = [];\n let uniqueData = [];\n let objects = JP.query(data, options.object);\n\n objects.forEach((object, index) => {\n let value = JP.query(object, options.value)[0];\n if (uniqueValue.indexOf(value) === -1){\n uniqueValue.push(value);\n uniqueData.push(data[index]);\n }\n });\n\n return uniqueData;\n }", "async function modifyValidation(data, unique = true){\n var valid = UserUpdateSchema(data);\n if (!valid)\n return UserUpdateSchema.errors;\n\n if(unique === false)\n return true;\n\n data._id = ObjectId(data._id);\n var docs = await db.get().collection('users').findOne({_id: { $ne: data._id}, username:data.username});\n if(docs){\n return ([{'message':'Username is already existss'}]);\n }\n return true;\n}", "isUnique(emailOrmobile) {\n return new Promise((resolve, reject) => {\n let sql = sqlObj.otp.isExist;\n let sqlQuery = format(sql, emailOrmobile);\n\n db.doRead(sqlQuery).then(result => {\n resolve(result);\n })\n .catch(err => {\n reject(new Error(err));\n })\n })\n }", "unique(field) {\n const set = new Set();\n return (commit) => {\n const include = !set.has(commit[field]);\n set.add(commit[field]);\n return include;\n };\n }", "function sameNameOrNumber(req,res,next){\n //checking if same name\n User.find({name:req.body.name},function(err,sameName){\n if (err) console.log(err);\n else {\n if(sameName.length==0)\n {//if no user with same name exists, checking for user with same number\n User.find({number:req.body.number},function(err,sameNum){\n if (err) console.log(err);\n else {\n if(sameNum.length==0)//if user with same number also does not exist\n next();\n else\n res.send(\"User with same number exists.Create another user\");\n }\n })\n }\n else\n res.send(\"User with same name exists.Create another user\");\n }\n })\n}", "function checkDuplication(data, tele, sheet_id, mid, mname, admin_time) {\n\tvar doc = new GoogleSpreadsheet('1rFX49ARfLmBBqxwj-S3H_Mt6regZmUeheNfiPisIu_w');\n\tvar sheet;\n\tasync.series([\n\t\tfunction setAuth(step) {\n\t\t\t// see notes below for authentication instructions!\n\t\t\tvar creds = require('../2i studio-fd2ce7d288b9.json');\n\t\t\tdoc.useServiceAccountAuth(creds, step);\n\t\t},\n\t\tfunction getInfoAndWorksheets(step) {\n\t\t\tdoc.getInfo(function (err, info) {\n\t\t\t\tif (info !== undefined) {\n\t\t\t\t\tsheet = info.worksheets[0];\n\t\t\t\t}\n\t\t\t\tstep();\n\t\t\t});\n\t\t},\n\t\tfunction workingWithRows(step) {\n\t\t\t// google provides some query options\n\t\t\tif (sheet !== undefined) {\n\t\t\t\tsheet.getRows({\n\t\t\t\t\toffset: 1\n\t\t\t\t\t// orderby: 'col2'\n\t\t\t\t}, function (err, rows) {\n\t\t\t\t\tif (rows !== undefined && rows !== null) {\n\t\t\t\t\t\tif (rows.length > 0) {\n\t\t\t\t\t\t\tlet checkPhone = checkPhoneNumber(data.sốđiệnthoại);\n\t\t\t\t\t\t\tif (rows.contains(checkPhone) === true) {\n\t\t\t\t\t\t\t\tsaveDupData(data);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t// insertOldStudent(data);\n\t\t\t\t\t\t\t\tinsertStudent(data, tele, sheet_id, mid, mname, admin_time);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tstep();\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t], function (err) {\n\t\tif (err) {\n\t\t\tconsole.log('Error: ' + err);\n\t\t}\n\t});\n}", "function CheckDuplicate(a)\n{\n if(a.firstName.includes(\"Rani\"))\n ++n;\nreturn n;\n}", "function checkDuplicateData(DATAJSONFILE, params) {\r\n const key = params['query'].toLowerCase();\r\n return getUserInfoByKey(DATAJSONFILE, key, params['value']) ? {[key] : 'true'} : {[key] : 'false'};\r\n\r\n}", "function checkingDuplicateRow(rowNum){\n\tvar error=\"true\";\n\tvar currentWO_MajorHead=$(\"#combobox\"+rowNum).val().split(\"$\")[0];\n\tvar currentWO_MinorHead=$(\"#comboboxsubProd\"+rowNum).val().split(\"$\")[0];\n\tvar currentWO_Desc=$(\"#comboboxsubSubProd\"+rowNum).val().split(\"$\")[0];\n\tvar currentUOM=$(\"#UOMId\"+rowNum).val().split(\"$\")[0];\n\n\t$(\".workorderrowcls\").each(function(){\n\t\tvar currentId=$(this).attr(\"id\").split(\"workorderrow\")[1];\n\t\tif(currentId!=rowNum){\n\t\t\tvar WO_MajorHead=$(\"#combobox\"+currentId).val().split(\"$\")[0];\n\t\t\tvar WO_MinorHead=$(\"#comboboxsubProd\"+currentId).val().split(\"$\")[0];\n\t\t\tvar WO_Desc=$(\"#comboboxsubSubProd\"+currentId).val().split(\"$\")[0];\n\t\t\tvar UOM=$(\"#UOMId\"+currentId).val().split(\"$\")[0];\n\t\t\n\t\t\tif(currentWO_MajorHead==WO_MajorHead && WO_MinorHead==currentWO_MinorHead && currentWO_Desc==WO_Desc && currentUOM==UOM){\n\t\t\t\talert(\"UOM already exist, Please choose different UOM.\");\n\t\t\t\treturn error=\"false\";\n\t\t\t}\n\t\t}\n\t});\n\n\treturn error;\n\t\n}", "function isDuplicate(user, data) {\n const v = user.find(itm => JSON.stringify(itm) === JSON.stringify(data))\n\n const exist = v? true : false;\n\n return exist;\n}", "function getDuplicates (slug) {\n if (!slug) {\n return Promise.resolve(false);\n }\n\n return api.space.getEntries({\n 'query': slug\n }).then(res => {\n\n let items = res.items.filter(item => {\n\n // If its not the current page, if the current region matches and if the item has a navigationName field\n if(item.sys.id != api.entry.getSys().id && (item.fields.region && currentRegion.getValue() == item.fields.region['sv-SE']) && (item.fields.navigationName && item.fields.navigationName['sv-SE'] == slug)){\n return item;\n }\n })\n\n return { hasDuplicates: items.length > 0, dupliactes: items };\n });\n }", "function checkIndivDupe() {\n var firstInstance = true;\n var dupeCount = 0;\n \n var validUserRows = validUserSheet.getLastRow() + 1;\n for (var row = 1; row < validUserRows; row++) {\n if (validUserSheet.getRange(row, 6).getValue() == userEmail) {\n if (firstInstance) {\n isIndivDupe = true;\n //get original batch ID\n origBatchId = validUserSheet.getRange(row, 2).getValue();\n origUID = validUserSheet.getRange(row, 3).getValue();\n origUserFirst = validUserSheet.getRange(row, 4).getValue();\n origUserLast = validUserSheet.getRange(row, 5).getValue();\n origUserEmail = validUserSheet.getRange(row, 6).getValue();\n origUserOrg = validUserSheet.getRange(row, 7).getValue();\n firstInstance = false;\n }\n //increment duplicate count\n dupeCount++;\n }\n }\n \n Logger.log('This a duplicate 1: ' + isIndivDupe);\n Logger.log('The original Batch ID is: ' + origBatchId);\n \n if (isIndivDupe) {\n //get info about original submission using original batch ID\n \n var logSheetRows = logSheet.getLastRow() + 1;\n for (var logRow = 1; logRow < logSheetRows; logRow++) {\n if (logSheet.getRange(logRow, 3).getValue() == origBatchId) {\n origRespFirst = logSheet.getRange(logRow, 4).getValue();\n origRespLast = logSheet.getRange(logRow, 5).getValue();\n origRespName = origRespFirst + ' ' + origRespLast;\n origRespEmail = logSheet.getRange(logRow, 6).getValue();\n origTime = logSheet.getRange(logRow, 1).getValue();\n origTime = Utilities.formatDate(origTime, ss.getSpreadsheetTimeZone(), \"M/d/yy 'at' h:mm a\");\n }\n }\n \n }\n \n }", "async function checkIfRefereeExistWithSameName(ref_first_name,ref_last_name){\n // check if match exist in matches db.\n let checkIfExist = await DButils.execQuery(`SELECT TOP 1 1 FROM dbo.Referees \n WHERE (first_name = '${ref_first_name}') AND (last_name = '${ref_last_name}')`);\n let match_id_array = [];\n checkIfExist.map((element) => match_id_array.push(element)); //extracting the match id into array for checking if exist\n if(match_id_array.length==0){\n return false;\n }\n return true;\n }", "function updateModule(updateModule){\n var deferred = Q.defer();\n\n updateModule.name = updateModule.name.toLowerCase();\n\n //fields array should not be editable when using this function. therefore, delete it from input\n delete updateModule.fields;\n\n db.modules.find({$or: [\n {_id: mongo.helper.toObjectID(updateModule._id)},\n {name: updateModule.name}\n ]}).toArray(function(err, modules){\n if(err){\n deferred.reject(err);\n }\n else if(modules.length == 0){\n deferred.reject(notFound);\n }\n //vali inputs, no other document have the same name\n else if(modules.length == 1){\n var oldModule = modules[0];\n \n //rename if old & new names are different\n if(oldModule.name != updateModule.name){\n db.bind(oldModule.name);\n db[oldModule.name].rename(updateModule.name, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n update();\n }\n });\n }\n //go straight to update\n else{\n update();\n }\n }\n //another module document with the same name exists\n else{\n deferred.reject(exists);\n }\n }); \n\n //updates the document in the 'modules' collection\n function update(){\n\n //create another object and copy. then delete the '_id' property of the new copy\n var forUpdate = {};\n Object.assign(forUpdate, updateModule);\n delete forUpdate._id;\n \n db.modules.update({_id: mongo.helper.toObjectID(updateModule._id)}, {$set: forUpdate}, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n deferred.resolve();\n }\n });\n }\n\n return deferred.promise;\n}", "checkForDuplicates(state, indexDictionary) {\n const data = state.dictionaries[indexDictionary].content;\n\n data.forEach((value) => {\n state.dictionaries[indexDictionary].content = data.map((pair, index) => {\n // Make sure the object is not itself\n if (data.indexOf(pair) !== data.indexOf(value)) {\n if (pair.domain === value.domain && pair.range === value.range) {\n if (\n data[index].validity.status\n && data[index].validity.reason === ''\n ) {\n // Change validity of the pair to false and assign the reason why\n data[index].validity.status = false;\n data[index].validity.reason = reasonNotValid.duplicate;\n }\n }\n }\n return pair;\n });\n });\n }", "isDocumentExisted(documentName) {\n var checkExistedProcess = this.dbConnect.then((connection) => {\n return new Promise ((resolve, reject) => {\n connection.query('SELECT id FROM ' + dbDocumentInfo + ' WHERE documentName = ?', documentName, (err, results, fields) => {\n if (!err) {\n var docName = results\n var quantity = docName.length\n if(quantity === 1) {\n //connection.release()\n resolve(true)\n } else if (quantity === 0){\n // console.log('Inside dbDoc : ' + docName[0].id)\n //connection.release()\n resolve(false)\n } else {\n //connection.release()\n reject({err: {msg: 'There are two of them in Database - System ERR'}})\n }\n } else {\n reject(err)\n }\n })\n })\n }).catch((err) =>{\n return Promise.reject(err)\n })\n return checkExistedProcess\n }", "function addModuleField(moduleName, fieldObject){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n\n //create a new objectID to used as query for updates and delete\n fieldObject.id = new ObjectID();\n\n //the query searches for the module name that do not have the inputted field name\n //this is to avoid pushing same field names on the 'fields' array of the specified module\n //writeResult will determine if the update was successful or not (i.e. writeResult.result.nModified)\n db.modules.update({name: moduleName, fields: {$not: {$elemMatch: {name: fieldObject.name}}}}, {$push: {fields: fieldObject}}, function(err, writeResult){\n if(err){\n deferred.reject(err);\n }\n else{\n //console.log(writeResult.result);\n //check the status of the update, if it failed, it means that there is an existing field name\n if(writeResult.result.nModified == 0){\n deferred.reject(exists);\n }\n else{\n deferred.resolve();\n }\n }\n });\n\n return deferred.promise;\n}", "checkExists(userId,contactId) {\r\n return this.findOne({\r\n $or :[\r\n {\r\n $and : [\r\n {\"userId\" :userId},\r\n {\"contactId\" : contactId}\r\n ]},\r\n {\r\n $and : [\r\n {\"userId\" :contactId},\r\n {\"contactId\" : userId}\r\n ]}\r\n ]\r\n }).exec();\r\n }", "function areThereDuplicates2() {\n let collection = {}\n for(let val in arguments){\n collection[arguments[val]] = (collection[arguments[val]] || 0) + 1\n }\n for(let key in collection){\n if(collection[key] > 1) return true\n }\n return false;\n }", "function check_duplicate(students, student) {\r\n\r\n for (let i = 0; i < students.length; i++) {\r\n if (Store.check_equal(student, students[i])) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n\r\n}", "function isDuplicateEntry(wslId) {\r\n\t//alert(\"wslField = \" + wslField);\r\n\tvar wslIdList = getMainView().forms[0].elements[wslField];\r\n\t//alert(\"wslIdList = \" + wslIdList);\r\n\tvar duplicate = false;\r\n\t//alert(\"!wslIdList = \" + (!wslIdList));\r\n\tif(!wslIdList) return false;\r\n\t\r\n\t//alert(\"wslIdList.length = \" + wslIdList.length);\r\n\tif(wslIdList.length) {\r\n\t\t// there are more than one entry\r\n\t\tfor(var z=0; z<wslIdList.length; z++) {\r\n\t\t\t//alert(\"wslIdList[z].value = \" + wslIdList[z].value.toLowerCase() + \", wslId = \" + wslId.toLowerCase() + \", compare = \" + (wslIdList[z].value.toLowerCase() == wslId.toLowerCase()));\r\n\t\t\tif(wslIdList[z].value.toLowerCase() == wslId.toLowerCase()) {\r\n\t\t\t\tduplicate = true;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t} else {\r\n\t\t//alert(\"wslIdList.value = \" + wslIdList.value.toLowerCase() + \", wslId = \" + wslId.toLowerCase() + \", compare = \" + (wslIdList.value.toLowerCase() == wslId.toLowerCase()));\r\n\t\tif(wslIdList.value.toLowerCase() == wslId.toLowerCase())\r\n\t\t\tduplicate = true;\r\n\t}\r\n\t\r\n\treturn duplicate;\r\n}", "static async updateOne(data) {\n try {\n let criteria = {\n _id: data._id\n };\n\n let modifiedFields = {\n courier: data.courier,\n projectIds: data.projectIds,\n referenceNo: data.referenceNo,\n receivedBy: data.receivedBy,\n deliveredBy: data.deliveredBy,\n shipmentStatus: data.shipmentStatus,\n nosOfSamples: data.nosOfSamples\n };\n const projectSamples = data.projectSamples;\n // remove key\n let result = await DatabaseService.updateByCriteria(\n collectionName,\n criteria,\n modifiedFields\n );\n // for project Samples which have status 'SAMPLE_ADDED' // LEAVE it\n let deleteIds = [];\n let insertProjectSamples = [];\n for (let row of projectSamples) {\n if (row.status !== \"SAMPLE ADDED\") {\n if (row._id) {\n deleteIds.push(row._id);\n }\n // insert such //take status back to 0\n row.status = \"SAMPLE ADDITION PENDING\";\n insertProjectSamples.push(row);\n }\n }\n console.log(\"deleteIds\");\n\n console.log(deleteIds);\n console.log(\"insertProjectSamples\");\n\n console.log(insertProjectSamples);\n\n if (deleteIds.length > 0) {\n let r = await ShipmentHandler.deleteProjectSamples(deleteIds);\n console.log(\"result\");\n console.log(r);\n }\n // insert ProjectSamples\n if (insertProjectSamples.length > 0) {\n await ShipmentHandler.saveProjectSamples(\n insertProjectSamples,\n data._id\n );\n }\n return result;\n } catch (err) {\n throw err;\n }\n }", "async checkReportExists(db, reportDate) {\n const reportRef = db.collection('results').doc(this.id).collection(\"raporty\").doc(reportDate);\n const report = await reportRef.get();\n \n return new Promise((resolve) => {\n resolve(report.exists)\n });\n //return await db.collection('results').doc(userId).collection(\"raporty\").doc(reportDate).get();\n }", "function addModuleDoc(moduleName, newDoc){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n\n service.findDuplicateDoc(moduleName, newDoc).then(function(){\n db.bind(moduleName);\n\n db[moduleName].insert(newDoc, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n deferred.resolve();\n }\n });\n }).catch(function(err){\n deferred.reject(err);\n });\n\n return deferred.promise;\n}", "function checkExistentIdInArray(req, res, next) {\r\n // try {\r\n // const { id } = projects.find(x => x.id == req.body.id).id;\r\n // } catch {\r\n // return next();\r\n // }\r\n const project = projects.find(x => x.id === req.body.id);\r\n if (project) {\r\n return res\r\n .status(400)\r\n .json({ error: \"Project already existent, unable to proceed!\" });\r\n }\r\n return next();\r\n}", "addStudent(newStudent) {\n let foundDuplicates = studentsFullList.filter(student => {\n return student.name.includes(newStudent.name) == true || student.email.includes(newStudent.email) == true\n });\n if (foundDuplicates.length > 0) {\n console.log(`Student already added`);\n } else {\n studentsFullList.push(newStudent);\n }\n return {\n newStudent,\n studentsFullList\n }\n }", "function checkFieldUniqueInSameMatrix(ob) {\r\n\tvar countDupl = 0;\r\n\t$('#addMatrixPopup input.field_name_matrix').each(function(){\r\n\t\tif (ob.val() == $(this).val()) countDupl++;\r\n\t});\r\n\treturn (countDupl <= 1);\r\n}", "async function insertValidation(data, unique = true){\n var post_data = Object.assign({}, data);;\n var valid = UserInsertSchema(data);\n if (!valid){\n console.log(UserInsertSchema.errors);\n return AjvResponseHandler.formatError(UserInsertSchema.errors, userSchemas.getInsertSchema());\n }\n \n if(unique === false)\n return true;\n\n var docs = await db.get().collection('users').findOne({username:data.username});\n if(docs){\n return ([{'message':'Username is already exists'}])\n }\n return true;\n}", "function findDuplicate(arr) {\n \n \n}", "function areThereDuplicates() {\n let collection = {}\n for(let val in arguments){\n collection[arguments[val]] = (collection[arguments[val]] || 0) + 1\n }\n for(let key in collection){\n if(collection[key] > 1) return true\n }\n return false;\n}", "async function update(filteredRows){\n\n if(filteredRows.length === 0) return failure()\n\n collection.findOneAndUpdate({_id: filteredRows[0].id},par.put, {new: true} ,function(error, doc){\n if (error) return resolve( {error:error} )\n return resolve( doc)\n })\n }", "checkDupe() {\n let occurrences = this.props.occurrences;\n let habit = this.state.currentHabit;\n let time = JSON.parse(JSON.stringify(this.state.habitTime));\n let quantity = this.state.quantity;\n let found = false;\n\n occurrences.forEach(item => {\n if (item.timestamp.slice(0, 10) === time.slice(0, 10)) {\n found = true;\n }\n });\n\n if (found) {\n alert('Please make any updates to existing logs by updating your table');\n } else {\n this.props.logHabit(habit, time, quantity);\n }\n }", "function unique(modelName, field, caseSensitive) {\n return function(value, respond) {\n if(value && value.length) {\n let query = mongoose.model(modelName).where(field, new RegExp('^'+value+'$', caseSensitive ? 'i' : undefined));\n if(!this.isNew)\n query = query.where('_id').ne(this._id);\n query.count(function(err, n) {\n respond(n<1);\n });\n }\n else\n respond(false);\n };\n}", "findDuplicatesWithObj(){\n var curNode = this.head;\n var dup = {};\n while(curNode !== null){\n // console.log('--------===',dup[curNode.val],'======',)\n if(!dup[curNode.val]) {\n dup[curNode.val] = 1;\n } else {\n dup[curNode.val]++;\n }\n curNode = curNode.next;\n }\n for(let i in dup){\n // console.log('-----', dup[i]);\n if(dup[i]>1) return false;\n }\n return true;\n }", "function areThereDuplicates() {\n // console.log(arguments)\n let counter = {};\n for (let i=0; i< arguments.length; i++){\n // counter[arguments[i]] = ++counter[arguments[i]] || 1;\n if (counter[arguments[i]]) return true;\n counter[arguments[i]] = 1;\n // console.log(counter)\n\n }\n return false;\n}", "function findByUniqueFields(name, fields = []) {\n const methods = {}\n\n fields.forEach(field => {\n methods[`${name}By${cap(field)}`] = (_, { [field]: value }) =>\n Models[name].find({\n where: { [field]: value }\n })\n })\n\n return methods\n}", "function searchDuplicate(service, next) {\n const query2ServDiffNmSmBP = {\n name: { $ne: service.name },\n basePath: service.basePath\n };\n\n const dupCheckQuery = {\n name: service.name,\n basePath: service.basePath\n };\n\n Service.findOne(query2ServDiffNmSmBP, function (err, diffNmSameBP) {\n if (err) {\n handleError(err, res, 500);\n return;\n }\n else if (diffNmSameBP)\n next({ twoServDiffNmSmBP: true });\n else {\n Service.findOne(dupCheckQuery, function (err, duplicate) {\n if (err) {\n handleError(err, res, 500);\n return;\n }\n next(duplicate);\n });\n }\n });\n}", "function addFieldParc(res){\r\nvar collParc = dBase.collection('golfGPS');\r\n\r\n collParc.distinct(\"Parcours_id\", function(err, doc){\r\n\t\t//debugger;\r\n\t\taddGolfGPS(doc);\r\n });\r\nres.end();\r\n\t\r\n}", "function findUniqueKey(){\n let key\n\n //check unique key\n let next = true\n while(next){\n key = uniqid()\n Users.findOne({\n where:{\n referralKey: key\n }\n })\n .then((user)=>{\n if(!user){\n next = false\n }\n })\n }\n return key\n}", "function checkDateDuplicate(callback)\n\t\t{\n\t\tfunction check_dupl(doc)\n\t\t\t{\n\t\t\ttry\n\t\t\t\t{\n\t\t\t\tvar d = {};\n\t\t\t\tdoc['dates'].filter(function(el){d[el]=1;return false});\n\t\t\t\tvar ks = Object.keys(d);\t\t\n\t\t\t\t}\n\t\t\tcatch(err){console.log(doc);return false};\n\t\t\t\n\t\t\treturn ks.length!=doc['dates'].length?ks:false;\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\t\t\t\t\t\t\t\t\t\t\t\t\n\n\t\tvar cursor = db.collection('adverts_short').find({});\n\t\tcursor.count(function(err,cursor_size)\n\t\t\t{\n\t\t\tif (err!==null){callback(err);return false};\n\t\t\tvar num = 0;\n\t\t\tvar changed = 0;\n\t\t\tvar part = parseInt(cursor_size/10);\n\t\t\tcursor.each(function(err,doc)\n\t\t\t\t{\n\t\t\t\tif (num%part==0){console.log(num)};\n\t\t\t\tif (err!=null){callback(err);flag=false;return false;}\n\t\t\t\tif (doc!==null)\n\t\t\t\t\t{\n\t\t\t\t\tvar tmp = check_dupl(doc);\n\t\t\t\t\tif (tmp!=false)\n\t\t\t\t\t\t{\n\t\t\t\t\t\tdb.collection('adverts_short').updateOne({'_id':doc['_id']},{'$set':{'dates':tmp}},function(err,res)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (err!==null){console.log('Error update dates for '+doc['_id']);return false;}\n\t\t\t\t\t\t\tchanged = changed+1;\n\t\t\t\t\t\t\tnum = num+1;\n\t\t\t\t\t\t\tif (num===cursor_size)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tcallback(null,changed);\n\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\tnum = num+1;\n\t\t\t\t\t\tif (num==cursor_size)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcallback(null,changed);\n\t\t\t\t\t\t\treturn false;\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\t\t}\n\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\tnum = num+1;\n\t\t\t\t\tif (num==cursor_size||cursor_size==0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\tcallback(null,changed);\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})\n\n\t\t\t})\n\n\n\t\t}", "function isUnique(key, value) {\n var deferred = $q.defer();\n\n // Make sure we got all elements\n getAllElements().then(function() {\n\n // Look for duplicates\n for(var i = 0; i < elements.dataElements.length; i++)\n if(elements.dataElements[i][key] == value)\n return deferred.resolve({key: key, value: value, unique: false}); // Dulpicate found\n\n return deferred.resolve({key: key, value: value, unique: true}); // Duplicate not found\n });\n\n return deferred.promise;\n }", "function checkDup(db,userId,callback){\n\t db.collection(\"userAccount\").findOne({\"userId\" : userId}, function(err,doc){\n\t\t assert.equal(err,null);\n\t\tif(!doc){\n\t\t\tcallback(true);\n\t\t}\n\t\telse{\n\t\t\tcallback(false);\n\t\t}\n\t});\n}", "function areThereDuplicates() {\n const obj1 = {};\n for (let i = 0; i<arguments.length; i++) {\n let arg = arguments[i]\n obj1[arg] = (obj1[arg] || 0) + 1;\n if (obj1[arg] > 1) return true;\n }\n return false;\n}", "function checkDups(oneN){\n return oneN.id == root[i].id;\n }", "function checkUniqueValue(value, key) {\n var filter = {};\n filter[key] = value;\n return new Promise((resolve, reject) => {\n UserModel.findOne(filter).lean().exec((err, result) => {\n if (result) {\n reject({\n status: 400,\n message: \"Username or Email already exists!\"\n });\n } else resolve()\n });\n });\n}", "isEmployeeNumberUnique(company, emp_no){\n let flag = true;\n let allEmployees = companydata.getAllEmployee(company);\n allEmployees.forEach(employee => {\n if (emp_no == employee.emp_no) {\n flag = false;\n }\n });\n return flag;\n }", "isUserExistenceAndUnique(username) {\n var connectionDB = this.connectDB()\n var checkExistenceAndUniqueProcess = connectionDB.then((connection) => {\n return new Promise((resolve, reject) => {\n connection.query('SELECT id FROM ' + dbTesterInfo +\n ' WHERE testerID = ?', username, (err, results, fields) => {\n\n if (!err) {\n if(results.length === 1) {\n connection.release()\n resolve()\n } else if (results.length === 0){\n connection.release()\n reject({err: {msg: 'This username does not exist!'}})\n } else {\n connection.release()\n reject({err: {msg: 'This username is duplicated!Please remove!'}})\n }\n } else {\n connection.release()\n reject({err: {msg: 'Lost database connection!'}})\n }\n })\n })\n }).catch((err) => {\n return Promise.reject(err)\n })\n return checkExistenceAndUniqueProcess\n }", "function fn_validate_duplicate(iID,tableName,fieldName,strURL,iActiveID)\n{\n\n var objFormData =\n {\n tableName: tableName,\n fieldName: fieldName,\n KEY_ID : iID,\n\t\tiActiveID : iActiveID,\n };\n var objMyPost = AJAX_Post(strURL, objFormData);\n\n if (objMyPost.DATA.DBStatus === 'ERR') {\n return true;\n }\n\n}", "function areThereDuplicates() {\n let collection = {}\n for(let val in arguments){\n collection[arguments[val]] = (collection[arguments[val]] || 0) + 1\n }\n for(let key in collection){\n if(collection[key] > 1) return true\n }\n return false;\n}", "function areThereDuplicates() {\n let collection = {}\n for(let val in arguments){\n collection[arguments[val]] = (collection[arguments[val]] || 0) + 1\n }\n for(let key in collection){\n if(collection[key] > 1) return true\n }\n return false;\n}", "function areThereDuplicates() {\n let collection = {}\n for(let val in arguments){\n collection[arguments[val]] = (collection[arguments[val]] || 0) + 1\n }\n for(let key in collection){\n if(collection[key] > 1) return true\n }\n return false;\n}", "function areThereDuplicates() {\n let collection = {}\n for(let val in arguments){\n collection[arguments[val]] = (collection[arguments[val]] || 0) + 1\n }\n for(let key in collection){\n if(collection[key] > 1) return true\n }\n return false;\n}", "function areThereDuplicates() {\n let collection = {}\n for(let val in arguments){\n collection[arguments[val]] = (collection[arguments[val]] || 0) + 1\n }\n for(let key in collection){\n if(collection[key] > 1) return true\n }\n return false;\n}", "function areThereDuplicates() {\n let collection = {}\n for(let val in arguments){\n collection[arguments[val]] = (collection[arguments[val]] || 0) + 1\n }\n for(let key in collection){\n if(collection[key] > 1) return true\n }\n return false;\n}", "function findDup(array) {\n let seenArray = [];\n\n for (let num in array) {\n if (!seenArray.includes(array[num])) {\n seenArray.push(array[num]);\n } else {\n return array[num];\n }\n }\n return 'No duplicate';\n}", "function areThereDuplicates() {\n let collection = {};\n for (let val in arguments) {\n collection[arguments[val]] = (collection[arguments[val]] || 0) + 1;\n }\n for (let key in collection) {\n if (collection[key] > 1) return true;\n }\n return false;\n}", "function duplicateValueInContactList(value, keyName){\n\t\tvar hasDuplicate = 0;\n\t\tfor(var i=0;i<$scope.contactList.length;i++){\n\t\t\tif(!hasDuplicate && $scope.contactList[i][keyName]===value && editIndex!==i){\n\t\t\t\thasDuplicate = 1;\n\t\t\t}\n\t\t}\n\t\treturn hasDuplicate;\n\t}", "static async getOne(id) {\n let criteria = Object.create(SOFT_DELETE_FIND_QUERY);\n criteria._id = id;\n let filesProjection = {\n _id: 1,\n originalname: 1,\n createdOn: 1\n };\n let filesCriteria = {\n foreignRef: id,\n moduleCode: \"SHIPMENT\"\n };\n\n let query = [\n {\n $match: {\n shipmentId: id\n }\n },\n {\n $lookup: {\n from: \"project\",\n localField: \"project._id\",\n foreignField: \"_id\",\n as: \"project\"\n }\n },\n {\n $unwind: \"$project\"\n }\n ];\n console.debug(\"neeraj\");\n try {\n let shipmentObj = {};\n // let result = await DatabaseService.getOneFind(collectionName, criteria,\n // projection)\n const db = mongodb.getDB();\n let result = await db\n .db()\n .collection(collectionName)\n .aggregate([\n {\n $match: criteria\n },\n {\n $lookup: {\n from: \"user\",\n localField: \"receivedById\",\n foreignField: \"_id\",\n as: \"receivedBy\"\n }\n },\n { $unwind: \"$receivedBy\" }\n ])\n .toArray();\n\n console.debug(result);\n\n let fileResult = await DatabaseService.findByCriteria(\n Collection.DOCUMENT_UPLOAD,\n filesCriteria,\n filesProjection\n );\n let projectSamples = await DatabaseService.getAggregatedData(\n Collection.PROJECT_SAMPLES,\n query\n );\n if (result !== undefined) {\n shipmentObj = result[0];\n shipmentObj.documents = fileResult;\n shipmentObj.projectSamples = projectSamples;\n }\n return shipmentObj;\n } catch (err) {\n throw err;\n }\n }", "function determineIfDuplicate(projectName) {\n let isDuplicate;\n for(let i = 0; i < store.getState().projects.length; i++) {\n if(projectName === store.getState().projects[i].projectName) {\n isDuplicate = true;\n return isDuplicate;\n } \n }\n return isDuplicate = false;\n}", "async function isEmailOrIdNumberAlreadyExist(user){\n // validation\n if(user.idNumber == null || user.idNumber == \"\"){\n console.log(\"Id number is required\");\n throw new ServerError (ErrorType.IS_REQUIRED_FIELD); \n } \n\n if(user.email == null || user.email == \"\" ){\n console.log(\"email is required\");\n throw new ServerError (ErrorType.IS_REQUIRED_FIELD); \n } \n\n if(user.password == null || user.password == \"\"){\n console.log(\"password is required\");\n throw new ServerError (ErrorType.IS_REQUIRED_FIELD); \n } \n \n if(await usersDao.isEmailOrIdNumberAlreadyExist(user)){\n console.log(\"user email or id number already exist\");\n throw new ServerError (ErrorType.USER_ALREADY_EXIST); \n }\n console.log(\"all registartion fields are valid\")\n return false;\n}", "function checkDuplicateUserName(arr,name){\n for (var i = 0;i<arr.length;i++){\n if(arr.length == 0){\n alert(\"no data\");\n return ;\n }\n if(arr[i].userName===name){\n alert(name + \"Duplicate user, user exist found\");\n return false;\n }\n }\n}", "function CheckDuplicates(FirstName,LastName)\n{\n searchedContact = contactsArray.filter(p => p.firstName == FirstName && p.lastName == LastName)[0];\n var index = contactsArray.indexOf(searchedContact);\n if(index=-1)\n return true;\n}", "function uniqueValues(value) {\n if (arr1.includes(value) && arr2.includes(value)) {\n console.log(\"dupe\") \n } else {\n return value;\n }\n }", "function fn_validate_duplicate_two(iVal1,iVal2,field1,field2,tableName,strURL,iActiveID)\n{\n\n var objFormData =\n {\n tableName: tableName,\n field1: field1,\n field2: field2,\n value1: iVal1,\n value2: iVal2,\n\t\t\n\n };\n var objMyPost = AJAX_Post(strURL, objFormData);\n\n if (objMyPost.DATA.DBStatus === 'ERR') {\n return true;\n }\n\n}", "getDupeFiles(){\n }", "isDepartmentUnique(department) {\n let flag = true;\n console.log(department);\n let allDepartments = companydata.getAllDepartment(department.company);\n allDepartments.forEach(e => {\n if (department.dept_no == e.dept_no) {\n flag = false;\n }\n });\n return flag;\n }", "function autoIncrement(schema, options) {\n\n var fieldName = options.field || '_id';\n \n // add the field to model.\n schema.add({\n [fieldName]:{\n type: Number,\n }\n });\n\n schema.index({ [fieldName]: 1 },{\n partialFilterExpression: {\n [fieldName]:{\n $type: 'number',\n $exists: true\n }\n },\n unique: true\n });\n\n schema.pre('save', function (next) {\n\n console.log('pre.save');\n\n var doc = this;\n\n ready().then(()=>{\n\n if (doc.db && doc.isNew && typeof doc[fieldName] === 'undefined') {\n getNextSeqObservable(doc.db.db, doc.collection.name)\n .retryWhen(err => {\n console.log(err);\n return err;\n })\n .subscribe(seq => {\n console.log('seq = %d',seq);\n doc[fieldName] = seq;\n next();\n });\n } else {\n //heal sets doc.__allowChange to true in order to bypass this check.\n console.log(doc.modifiedPaths());\n if(!doc.__allowChange){\n console.log('not allowed to change');\n if(doc.isModified(fieldName)){\n console.log('invalidating field');\n doc.invalidate(fieldName,'You may not modify the auto-increment field `'+fieldName+'` ');\n // doc.$ignore(fieldName);\n }\n }else{\n delete doc.__allowChange;\n }\n next();\n }\n\n });\n });\n\n schema.statics.heal = function(){\n console.log('schema.statics.heal');\n return new Promise((resolve,reject)=>{\n\n ready().then(()=>{\n console.log('ready()');\n\n // this = the mongoose model\n this.find({\n $or: [\n { [fieldName] : { $exists: false } },\n { [fieldName] : null }\n ]\n }).exec().then((docs)=>{\n console.log(docs);\n var numSaved = docs.length;\n syncEach(docs,(doc,cb)=>{\n doc.__allowChange = true;//so the pre check wont fail because its not new and its changed.\n getNextSeqObservable(doc.db.db,doc.collection.name)\n .retryWhen(err => {\n console.log(err)\n return err;\n })\n .subscribe(seq => {\n console.log('got seq %d',seq)\n doc[fieldName] = seq;\n doc.save(function(err){\n console.log(err)\n cb();\n });\n });\n },()=>{\n resolve(numSaved);\n });\n }).catch((err)=>reject(err));\n\n });\n });\n };\n\n}", "function getData() {\r\n var registrationNumber = $(\"#reg\").val();\r\n var temp = [];\r\n\r\n db.collection(\"users\")\r\n .get()\r\n .then((doc) => {\r\n doc.forEach((d) => {\r\n let currentData = d.data().Registration_Number;\r\n temp.push(currentData);\r\n });\r\n\r\n if (temp.includes(registrationNumber)) {\r\n $(\"#reg\").css(\"border\", \"1px solid red\");\r\n $(\"#regcheck\").html(\"**Registration number already exist\");\r\n $(\"#regcheck\").show();\r\n\t\t $(\".loader\").fadeOut();\r\n userregError = true;\r\n } else {\r\n $(\"#reg\").css(\"border\", \"1px solid lightgrey\");\r\n $(\"#regcheck\").hide();\r\n userregError = false;\r\n storeDataInFirebase();\r\n }\r\n });\r\n checkForEnable();\r\n }", "extractDocumentExistenceInfo(arr) {\n return this.chooseDocumentsDuplicate(arr.map(item => item.existenceInfo));\n }", "findOneAndUpdate(query={}, data) {\n // get the collection and find the matching records using sift\n const collection = this.getCollection();\n const record = sift(query, collection)[0];\n // update the records with the new data, then validate\n Object.assign(record, data);\n return this.validate(record)\n .then(() => {\n // once updated data is validated, persist to localStorage and return the updated records\n this.setCollection(collection);\n return record;\n });\n }", "async _upsertDoc(props) {\n const id = props.form.getValue('id');\n\n let exists = false;\n\n if (id) {\n try {\n await this._getDoc({ id });\n exists = true;\n } catch (err) {\n if (err.message === 'GraphQL error: record not found') {\n // Do nothing as record doesn't exist\n } else {\n throw err;\n }\n }\n }\n\n if (exists) {\n return this.updateDoc({ ...props, id });\n } else {\n return this.createDoc(props);\n }\n }", "function updateModuleDoc(moduleName, updateDoc){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n\n db.bind(moduleName);\n\n //create another object and copy. then delete the '_id' property of the new copy\n var forUpdate = {};\n Object.assign(forUpdate, updateDoc);\n delete forUpdate._id;\n\n db[moduleName].update({_id: mongo.helper.toObjectID(updateDoc._id)}, {$set: forUpdate}, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n deferred.resolve();\n }\n });\n\n return deferred.promise;\n}", "function upload_excel(filename) {\n xlsxFile(filename).then((rows) => {\n\n rows.splice(0, 1); // for remove headers in excel file\n\n // inserting into mysql\n con.query(\"insert into products(PRDT_NAME, PRDT_TYPE, PRDT_PRICE) VALUES ? on duplicate key update PRDT_NAME=VALUES(PRDT_NAME), PRDT_TYPE=VALUES(PRDT_TYPE), PRDT_PRICE=VALUES(PRDT_PRICE)\", [rows], function (error, results, fields) {\n if (error) return false;\n return true\n\n });\n })\n\n}", "function updateModuleField(moduleName, fieldObject){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n\n fieldObject.id = new ObjectID(fieldObject.id);\n \n db.modules.update({name: moduleName, fields: {$elemMatch: {id: fieldObject.id}}}, {$set: {'fields.$': fieldObject}}, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n deferred.resolve();\n }\n });\n\n return deferred.promise;\n}", "checkForDuplicates() {\n const alreadyChecked = [];\n for(let list of [this.state.listA, this.state.listB]) {\n for(let row of list) {\n row.isDuplicate = false;\n const duplicate = alreadyChecked.find(otherRow => otherRow.snomed.code === row.snomed.code);\n if (!row.snomed.code || duplicate) {\n row.isDuplicate = true;\n if (duplicate) duplicate.isDuplicate = true;\n } \n alreadyChecked.push(row);\n }\n }\n }", "async function hasDuplicate(mandatarisUri) {\n const result = await querySudo(`\n PREFIX owl: <http://www.w3.org/2002/07/owl#>\n\n SELECT ?duplicatedMandataris\n WHERE {\n GRAPH ?g {\n ${sparqlEscapeUri(mandatarisUri)} owl:sameAs ?duplicatedMandataris .\n }\n FILTER (?g NOT IN (${sparqlEscapeUri(GRAVEYARD_GRAPH)}))\n }\n `);\n\n if (result.results.bindings.length) {\n return result.results.bindings[0]['duplicatedMandataris'].value;\n } else {\n return false;\n }\n}", "function checkForDuplicates(elements, value) {\r\n var length = Object.keys(elements).length;\r\n for(var i=0;i<length;i++) {\r\n if(elements[i].name === value) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n}", "function determineIfDuplicate(projectName) {\n let isDuplicate;\n for (let i = 0; i < store.getState().projects.length; i++) {\n if (projectName === store.getState().projects[i].projectName) {\n isDuplicate = true;\n return isDuplicate;\n }\n }\n return isDuplicate = false;\n}", "function areThereDuplicates() {\n let freqCounter = {};\n for(let i = 0; i < arguments.length; i++){\n if(freqCounter[arguments[i]]){\n return true;\n } else {\n freqCounter[arguments[i]] = true;\n }\n }\n return false;\n}", "function populateCollection(collection, data, exampleKeys) {\n var metadata = {}\n return Promise.each(Object.keys(data), function(key) {\n console.log('~~~', data[key])\n var example = {}\n exampleKeys.forEach(function(k){\n example[k] = data[key][k];\n })\n example._type = data[key]._type;\n return Promise.resolve(collection.byExample(example)).call('all').then(function(matches) {\n if (matches.length === 0) {\n return collection.save(data[key]).then(function(res) {\n return metadata[key] = res;\n })\n }\n// If a single match is found, update it; apply extra handling for person matches\n if (matches.length === 1) {\n var update = data[key];\n if (example._type === 'person') update = handleUpdatePersonMatches(example, matches[0]);\n// console.log('node already exists. Updating', example,' with', update);\n return collection.update(matches[0]._id, update).then(function(res) {\n return metadata[key] = res;\n });\n }\n// Do not attempt to update when multiple matching nodes are found, except make an attempt for persons (disabled at the moment);\n if (matches.length > 1) {\n/*\n if (example._type === 'person') {\n var update = handleMultiplePersonMatches(example, matches);\n if (update) {\n console.log('multiple matches found for example. updating: ', example, 'with', update, matches)\n return collection.update(update._id, update);\n }\n }\n*/\n console.log('multiple matches found for example. Creating a unique node: ', example, matches)\n return collection.save(data[key]).then(function(res) {\n return metadata[key] = res\n })\n }\n })\n }).catch(function(err) { console.log(err)\n }).then(function(result) {\n return metadata\n })\n}", "function oidExist(oid){\n return itemOp.findOne({oid: oid})\n .then(\n function(data){\n if(!data){\n return new Promise(function(resolve, reject) { resolve(oid) ;} );\n } else {\n oid = uuid();\n oidExist(oid);\n }\n })\n .catch(\n function(err){\n return new Promise(function(resolve, reject) { reject('Error in Mongo: ' + err) ;} );\n });\n}", "function item_already_exists(my_object) \n{\n RMPApplication.debug (\"begin function item_already_exists\");\n c_debug(debug.exists, \"=> item_already_exists: my_object = \", my_object);\n var my_pattern = {};\n for (key in my_object) {\n my_pattern[key] = ( my_object[key] !== \"\" ) ? my_object[key] : \"\";\n }\n var options = {};\n options.asynchronous = false;\n res = false;\n eval(collectionid).listCallback(my_pattern, options, exists_ok, exists_ko);\n RMPApplication.debug (\"end function item_already_exists\");\n return res;\n}", "function findProdDuplicado(idProdNvo) {\n lDuplicado=false;\n $(\".prodForAjuste\").each(\n function(index, value) {\n let idProd=parseFloat($(this).val());\n //console.log(idProd, idProdNvo);\n if(idProd==idProdNvo){\n //console.log(\"son iguales\")\n lDuplicado=true;\n }\t\n }\n );\n return lDuplicado\t\n }", "function findDuplicates() {\r\n\tconsole.log('findDuplicates');\r\n\t\r\n\tvar minTotalScore = 0.95;\r\n\tminTotalScore = 1;\r\n\tvar minNameScore = 0.98;\r\n\t\r\n\t// Clear previous results\r\n\tvar table = $('#sjo-api-table-dupes').empty();\r\n\t$('#sjo-api-button-dupes-pause').show();\r\n\t$('#sjo-api-button-dupes').hide();\r\n\r\n\t// Loop through 2017 candidacies\r\n\tvar groups = [];\r\n\tvar processed = [];\r\n\tvar unmatched = data.map(record => $.extend({}, record[0] ? record[0] : record[1]));\r\n\tvar index = 0;\r\n\tcheckData();\r\n\t\r\n\t// Check the next candidate in the data set\r\n\tfunction checkData() {\r\n\t\tvar candidate = unmatched[index];\r\n\t\t$('#sjo-api-status-dupes').text(`Checking ${index + 1} of ${data.length}; ${groups.length} groups found`);\r\n\t\t\r\n\t\t// Start with an unmatched 2017 candidate\r\n\t\t//if (!candidate.__matched && candidate._election_year === 2017) {\r\n\t\tif (!candidate.__matched && candidate.election_date === '2017-06-08') {\r\n\t\t\t\r\n\t\t\t// Add this candidate to the pending list\r\n\t\t\tcandidate.__matched = true;\r\n\t\t\tvar pending = [candidate];\r\n\t\t\tvar matches = [];\r\n\t\t\tvar found = false;\r\n\t\t\t\r\n\t\t\t// Work through the pending list, adding more as we go\r\n\t\t\twhile (pending.length > 0) {\r\n\t\t\t\tvar c1 = pending.pop();\r\n\t\t\t\tmatches.push(c1);\r\n\t\t\t\t\r\n\t\t\t\t// Loop through all other unmatched rows\r\n\t\t\t\t$.each(unmatched, (index2, c2) => {\r\n\t\t\t\t\tif (c2.__matched) return;\r\n\t\t\t\t\t\r\n\t\t\t\t\t// Check score\r\n\t\t\t\t\tvar score = calcScore(c1, c2);\r\n\t\t\t\t\tif (score.nameScore >= minNameScore && score.totalScore >= minTotalScore) {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// Add this candidacy\r\n\t\t\t\t\t\tc2.__matched = true;\r\n\t\t\t\t\t\tpending.push(c2);\r\n\t\t\t\t\t\tif (c1.id != c2.id) found = true;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Add to the table\r\n\t\t\tif (found) {\r\n\t\t\t\tgroups.push(matches);\r\n\t\t\t\twriteDupesTable(groups.length - 1, matches);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\tindex++;\r\n\t\tif (index < unmatched.length) {\r\n\t\t\tcheckActiveFlag();\r\n\t\t} else {\r\n\t\t\t$('#sjo-api-button-dupes-pause, #sjo-api-button-dupes-resume, #sjo-api-button-dupes-more').hide();\r\n\t\t\t$('#sjo-api-status-dupes').text(`Search complete; ${groups.length} groups found`);\r\n\t\t}\r\n\t\t\r\n\t}\r\n\t\r\n\tfunction checkActiveFlag() {\r\n\t\tif (dupesActive) {\r\n\t\t\tsetTimeout(checkData, 0);\r\n\t\t} else {\r\n\t\t\tsetTimeout(checkActiveFlag, 1000);\r\n\t\t}\r\n\t}\r\n\t\r\n\tfunction calcScore(c1, c2) {\r\n\t\t\r\n\t\tif (c1.id == c2.id) return {'totalScore': 1, 'nameScore': 1};\r\n\t\t\r\n\t\tvar zeroScore = {'totalScore': 0, 'nameScore': 0};\r\n\t\tvar totalScore = 1;\r\n\t\t\r\n\t\t// Weight down different countries\r\n\t\ttotalScore = totalScore * (c1._country === c2._country ? 1 : 0.95);\r\n\t\tif (totalScore < minTotalScore) return zeroScore;\r\n\t\t\r\n\t\t// Weight down different parties\r\n\t\ttotalScore = totalScore * (c1._party_group === c2._party_group ? 1 : c1._party_group === null || c2._party_group === null ? 0.95 : 0.90);\r\n\t\tif (totalScore < minTotalScore) return zeroScore;\r\n\t\t\r\n\t\t// Weight down different middle names \r\n\t\ttotalScore = totalScore * (c1._middle_names !== '' && c2._middle_names !== '' && c1._middle_names !== c2._middle_names ? 0.90 : 1);\r\n\t\tif (totalScore < minTotalScore) return zeroScore;\r\n\t\t\r\n\t\t// Weight down conflicting elections\r\n\t\tif (c1.election_date == c2.election_date && c1._election_type == c2._election_type) {\r\n\t\t\ttotalScore = totalScore * 0.95;\r\n\t\t\tif (totalScore < minTotalScore) return zeroScore;\r\n\t\t}\r\n\t\t\r\n\t\t// Weight down 2010 (no SOPNs)\r\n\t\tif (c1._election_year < 2015 || c2._election_year < 2015) {\r\n\t\t\ttotalScore = totalScore * 0.99;\r\n\t\t\tif (totalScore < minTotalScore) return zeroScore;\r\n\t\t}\r\n\t\t\r\n\t\t// Calculate name similarity\r\n\t\tvar nameScore = Math.max( jaroWinkler(c1.name, c2.name),\r\n\t\t\t( c2._short_name === c2.name ? 0 : jaroWinkler(c1.name, c2._short_name)),\r\n\t\t\t( c2._normal_name === c2._short_name ? 0 : jaroWinkler(c1.name, c2._normal_name)),\r\n\t\t\t\r\n\t\t\t(c1._short_name === c1.name ? 0 : jaroWinkler(c1._short_name, c2.name)),\r\n\t\t\t(c1._short_name === c1.name || c2._short_name === c2.name ? 0 : jaroWinkler(c1._short_name, c2._short_name)),\r\n\t\t\t(c1._short_name === c1.name || c2._normal_name === c2._short_name ? 0 : jaroWinkler(c1._short_name, c2._normal_name)),\r\n\t\t\t\r\n\t\t\t(c1._normal_name === c1.name ? 0 : jaroWinkler(c1._normal_name, c2.name)),\r\n\t\t\t(c1._normal_name === c1.name || c2._short_name === c2.name ? 0 : jaroWinkler(c1._normal_name, c2._short_name)),\r\n\t\t\t(c1._normal_name === c1.name || c2._normal_name === c2._short_name ? 0 : jaroWinkler(c1._normal_name, c2._normal_name)));\r\n\t\t\r\n\t\t// Calculate overall score\r\n\t\ttotalScore = totalScore * nameScore;\r\n\t\treturn {'totalScore': totalScore, 'nameScore': nameScore};\r\n\t\t\r\n\t}\r\n\t\r\n\tfunction writeDupesTable(groupIndex, matches) {\r\n\t\tconsole.log('writeDupesTable', groupIndex, matches);\r\n\t\t\r\n\t\t// Show table if any matches found\r\n\t\ttable.show();\r\n\t\t\r\n\t\tvar groupClass = `sjo-api-dupes-group-${groupIndex + 1}`;\r\n\t\t\r\n\t\t// Sort the group by ID and date\r\n\t\tmatches.sort((a, b) => a.id > b.id || (a.id == b.id && a.election_date > b.election_date));\r\n\t\t$.each(matches, (matchIndex, match) => {\r\n\t\t\t\r\n\t\t\t// Recalculate the score against all the other matches\r\n\t\t\tvar score = matches.reduce((acc, other, otherIndex) => Math.max(acc, matchIndex == otherIndex ? 0 : calcScore(match, other).totalScore), 0);\r\n\t\t\t\r\n\t\t\t// Write to the dupes table\r\n\t\t\tvar row = $(`<tr class=\"${groupClass}\"></tr>`)\r\n\t\t\t\t.addClass(matchIndex === 0 ? 'sjo-api-dupes-first' : '')\r\n\t\t\t\t.addCell(groupIndex + 1)\r\n\t\t\t\t.addCell(match.id)\r\n\t\t\t\t.addCell('') // blank column for links\r\n\t\t\t\t.addCellHTML('<a href=\"' + getLinkAddress(dataFields['name'], match) + '\">' + match.name + '</a>')\r\n\t\t\t\t.addCell(match.election_date)\r\n\t\t\t\t.addCell(match._election_area)\r\n\t\t\t\t.addCell(match.post_label)\r\n\t\t\t\t.addCell(match.party_name)\r\n\t\t\t\t.addCell(score.toFixed(2))\r\n\t\t\t\t.appendTo(table);\r\n\t\t\t\t\r\n\t\t\tif (score >= 1) {\r\n\t\t\t\trow.addClass('sjo-api-dupes-verymuch');\r\n\t\t\t\t//pauseDuplicates();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t});\r\n\t\t\r\n\t}\r\n\t\r\n}", "function duplicateCheck(elId){\n console.log('duplicateCheck ', elId)\n // debugger\n // Get name of ID\n let elType = elId.match(/\\w+/i)[0]\n // console.log('element type ', elType)\n let pId = elId.match(/\\d+/)[0]\n // console.log('pano ID: ', pId)\n let elemToTest = document.querySelector('#'+elId)\n let elemVal = elemToTest.value\n const messageEl = document.querySelector('#pano_message-'+pId)\n if (gPanos.length > 1){\n for (let i=0; i<gPanos.length-1; i++){\n if(elType == 'input_file'){ \n if ((gPanos[i].elements.inputFile.value == elemVal) && \n (gPanos[i].elements.inputFile.id !== elId)){\n // console.log('Your Image File choice is the same as pano '+ (i+1).toString() )\n messageEl.innerHTML = 'Your image file choice is the same as pano '+ (i+1).toString()\n elemToTest.style.borderColor = '#ff4400'\n elemToTest.style.borderWidth = 'medium' \n break\n } else {\n messageEl.innerHTML = ''\n elemToTest.style.borderColor = '#aaaaaa'\n elemToTest.style.borderWidth = 'thin' \n }\n } else if (elType == 'view_name'){\n console.log('view_name ', gPanos[i].elements.viewName.value, elemVal)\n if ( (gPanos[i].elements.viewName.value == elemVal) && \n (gPanos[i].elements.viewName.id !== elId) ){\n // console.log('Your View Name choice is the same in pano '+ (i+1).toString() )\n messageEl.innerHTML = 'Your View Name choice is the same as pano '+ (i+1).toString()\n elemToTest.style.borderColor = '#ff4400'\n elemToTest.style.borderWidth = 'medium' \n break\n } else {\n messageEl.innerHTML = ''\n elemToTest.style.borderColor = '#aaaaaa'\n elemToTest.style.borderWidth = 'thin' \n }\n }\n }\n }\n }", "function checkUnique(form){\n\t\n \t\tproductId = $(\"#id\").val();\n \t\tproductName = $(\"#name\").val();\n \t\t\n \t\n \t\tcsrfValue = $(\"input[name='_csrf']\").val();\n \t\n \t\t/* the value of the url is the path in the ProductRestController*/\n \t\t\n \t\t\n \t\t\n \t\tparams = {id: productId, name: productName, _csrf: csrfValue};\n \t\t\n \t\t/*sends post request to the server with the given url and params*/\n \t\t\n \t\t$.post(checkUniqueUrl, params, function(response){\n \t\t\t\n \t\t\tif (response == \"OK\"){\n \t\t\t\tform.submit();\n \t\t\t}else if(response == \"Duplicate\"){\n \t\t\t\tshowWarningModal(\"There is another product having the same name \" + productName);\n \t\t\t}else{\n \t\t\t\tshowErrorModal(\"Unknown response from server\");\n \t\t\t}\n \t\t\t\n \t\t}).fail(function(){\n \t\t\tshowErrorModal(\"Could not connect to the server\");\n \t\t});\n \t\n \t return false;\n \t}", "function removeDuplicatedFields() {\n var duplicatedFields = $(\".requestField input\").filter(function (index, elem) {\n return $(\".responseField #\" + elem.id).length > 0;\n });\n\n $(duplicatedFields).each(function (index, duplicatedField) {\n $(\".responseField #\" + duplicatedField.id).closest('.responseField ').remove();\n });\n\n refreshInputElements();\n}", "function removeDuplicatedFields() {\n var duplicatedFields = $(\".requestField input\").filter(function (index, elem) {\n return $(\".responseField #\" + elem.id).length > 0;\n });\n\n $(duplicatedFields).each(function (index, duplicatedField) {\n $(\".responseField #\" + duplicatedField.id).closest('.responseField ').remove();\n });\n\n refreshInputElements();\n}", "function isSingleConflict(currdatearr, unique, sendResponse) {\n chrome.storage.sync.get('savedCourses', function (data) {\n var courses = data.savedCourses;\n var conflict = false;\n var contains = false;\n for (let i = 0; i < courses.length; i++) {\n let course = courses[i];\n if (!conflict && isConflict(currdatearr, course.datetimearr)) {\n conflict = true;\n }\n if (!contains && isSameCourse(course, unique)) {\n contains = true;\n }\n }\n sendResponse({\n isConflict: conflict,\n alreadyContains: contains\n });\n });\n}" ]
[ "0.7790472", "0.6359789", "0.6185164", "0.60583496", "0.59461486", "0.5890801", "0.57857865", "0.563223", "0.5565228", "0.55593705", "0.55330694", "0.5467956", "0.5450589", "0.5444566", "0.54175276", "0.53952575", "0.53873485", "0.5369162", "0.53616375", "0.53610873", "0.53426355", "0.53297454", "0.5317674", "0.53074825", "0.5294661", "0.52787745", "0.52586293", "0.5256129", "0.52255225", "0.5222504", "0.5214804", "0.5206656", "0.51900005", "0.5173965", "0.5147037", "0.51456434", "0.5139741", "0.51192", "0.5118562", "0.5117601", "0.5112341", "0.51040494", "0.5091108", "0.5080844", "0.50793743", "0.5077461", "0.5074999", "0.50673056", "0.50572616", "0.5053453", "0.50479585", "0.50474626", "0.5023571", "0.50130504", "0.50001544", "0.4995824", "0.498243", "0.49799106", "0.49782264", "0.49613193", "0.49613193", "0.49613193", "0.49613193", "0.49613193", "0.49613193", "0.49581337", "0.4957174", "0.49499217", "0.4947642", "0.4941573", "0.4939531", "0.49373892", "0.4932856", "0.49279568", "0.49261504", "0.49173507", "0.49055067", "0.4896149", "0.4890395", "0.48884788", "0.48795113", "0.48747396", "0.48730394", "0.48707163", "0.48706186", "0.4862638", "0.48600483", "0.48518845", "0.48431927", "0.48389614", "0.48348522", "0.48316053", "0.4828878", "0.4825864", "0.48033467", "0.479544", "0.47951037", "0.47931585", "0.47931585", "0.4792368" ]
0.77881294
1
Function name: update fields array Author: Reccion, Jeremy Date Modified: 2018/04/12 Description: sets the 'fields' property of the specific module to the inputted array. Parameter(s): moduleName: required. string type fieldArray: required. array type. //this array is from angular's UISORTABLE Return: Promise
function updateFieldArray(moduleName, fieldArray){ var deferred = Q.defer(); moduleName = moduleName.toLowerCase(); //need to convert each 'id' property to an ObjectID for(var i = 0; i < fieldArray.length; i++){ fieldArray[i].id = new ObjectID(fieldArray[i].id); } db.modules.update({name: moduleName}, {$set: {fields: fieldArray}}, function(err){ if(err){ deferred.reject(err); } else{ deferred.resolve(); } }); return deferred.promise; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateFieldArray(moduleName, fieldArray){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n\n db.modules.update({name: moduleName}, {$set: {fields: fieldArray}}, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n deferred.resolve();\n }\n });\n\n return deferred.promise;\n}", "function updateModuleField(moduleName, fieldObject){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n\n fieldObject.id = new ObjectID(fieldObject.id);\n \n db.modules.update({name: moduleName, fields: {$elemMatch: {id: fieldObject.id}}}, {$set: {'fields.$': fieldObject}}, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n deferred.resolve();\n }\n });\n\n return deferred.promise;\n}", "function updateModuleField(moduleName, fieldObject){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n\n console.log(fieldObject);\n\n service.getModuleByName(moduleName).then(function(aModule){ \n //use array.filter() to get the duplicate fields\n var duplicateFields = aModule.fields.filter(function(field){\n //lesson learned: use toString() in id\n return field.id.toString() == fieldObject.id.toString() || field.name == fieldObject.name;\n });\n \n if(duplicateFields.length == 0){\n deferred.reject(notFound);\n }\n //valid inputs\n else if(duplicateFields.length == 1){\n //this is to ensure that the field is inside the specific module (in case of improper input parameters)\n\n fieldObject.id = new ObjectID(fieldObject.id);\n\n if(duplicateFields[0].id.toString() == fieldObject.id.toString()){\n db.modules.update({name: moduleName, fields: {$elemMatch: {id: fieldObject.id}}}, {$set: {'fields.$': fieldObject}}, function(err, writeResult){\n if(err){\n deferred.reject(err);\n }\n else{\n console.log(writeResult.result);\n deferred.resolve();\n }\n });\n }\n //the only element has the same name but is different id, therefore, not inside the module document\n else{\n deferred.reject(notFound);\n }\n }\n else{\n deferred.reject(exists);\n }\n }).catch(function(err){\n deferred.reject(err);\n });\n\n return deferred.promise;\n}", "function addModuleField(moduleName, fieldObject){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n\n //create a new objectID to used as query for updates and delete\n fieldObject.id = new ObjectID();\n\n db.modules.update({name: moduleName}, {$push: {fields: fieldObject}}, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n deferred.resolve();\n }\n });\n\n return deferred.promise;\n}", "function addModuleField(moduleName, fieldObject){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n\n //create a new objectID to used as query for updates and delete\n fieldObject.id = new ObjectID();\n\n //the query searches for the module name that do not have the inputted field name\n //this is to avoid pushing same field names on the 'fields' array of the specified module\n //writeResult will determine if the update was successful or not (i.e. writeResult.result.nModified)\n db.modules.update({name: moduleName, fields: {$not: {$elemMatch: {name: fieldObject.name}}}}, {$push: {fields: fieldObject}}, function(err, writeResult){\n if(err){\n deferred.reject(err);\n }\n else{\n //console.log(writeResult.result);\n //check the status of the update, if it failed, it means that there is an existing field name\n if(writeResult.result.nModified == 0){\n deferred.reject(exists);\n }\n else{\n deferred.resolve();\n }\n }\n });\n\n return deferred.promise;\n}", "setModuleName(field, module) {\n field.moduleName = field.moduleName || (module && module.__meta.name);\n if ((field.type === 'array') || (field.type === 'object')) {\n _.each(field.schema || [], function(subfield) {\n self.setModuleName(subfield, module);\n });\n }\n }", "function updateModule(updateModule){\n var deferred = Q.defer();\n\n updateModule.name = updateModule.name.toLowerCase();\n\n //fields array should not be editable when using this function. therefore, delete it from input\n delete updateModule.fields;\n\n db.modules.find({$or: [\n {_id: mongo.helper.toObjectID(updateModule._id)},\n {name: updateModule.name}\n ]}).toArray(function(err, modules){\n if(err){\n deferred.reject(err);\n }\n else if(modules.length == 0){\n deferred.reject(notFound);\n }\n //vali inputs, no other document have the same name\n else if(modules.length == 1){\n var oldModule = modules[0];\n \n //rename if old & new names are different\n if(oldModule.name != updateModule.name){\n db.bind(oldModule.name);\n db[oldModule.name].rename(updateModule.name, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n update();\n }\n });\n }\n //go straight to update\n else{\n update();\n }\n }\n //another module document with the same name exists\n else{\n deferred.reject(exists);\n }\n }); \n\n //updates the document in the 'modules' collection\n function update(){\n\n //create another object and copy. then delete the '_id' property of the new copy\n var forUpdate = {};\n Object.assign(forUpdate, updateModule);\n delete forUpdate._id;\n \n db.modules.update({_id: mongo.helper.toObjectID(updateModule._id)}, {$set: forUpdate}, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n deferred.resolve();\n }\n });\n }\n\n return deferred.promise;\n}", "function updateModule(updateModule){\n var deferred = Q.defer();\n\n updateModule.name = updateModule.name.toLowerCase();\n\n //fields array should not be editable when using this function. therefore, delete it from input\n delete updateModule.fields;\n\n //check if the name of the selected module has not changed\n db.modules.findOne({_id: mongo.helper.toObjectID(updateModule._id)}, function(err, aModule){\n if(err){\n deferred.reject(err);\n }\n else if(aModule){\n //if names are different, renaming the collection must be executed, then proceed to update\n if(aModule.name != updateModule.name){\n db.bind(aModule.name);\n db[aModule.name].rename(updateModule.name, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n update();\n }\n });\n }\n }\n else{\n update();\n }\n });\n\n //updates the document in the 'modules' collection\n function update(){\n\n //create another object and copy. then delete the '_id' property of the new copy\n var forUpdate = {};\n Object.assign(forUpdate, updateModule);\n delete forUpdate._id;\n \n db.modules.update({_id: mongo.helper.toObjectID(updateModule._id)}, {$set: forUpdate}, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n deferred.resolve();\n }\n });\n }\n\n return deferred.promise;\n}", "updateFieldItems() {\n this.fieldItems = this.getFieldItems();\n this.fullQueryFields = this.getFullQueryFields();\n this.availableFieldItemsForFieldMapping = this.getAvailableFieldItemsForFieldMapping();\n this.availableFieldItemsForMocking = this.getAvailableFieldItemsForMocking();\n this.mockPatterns = this.getMockPatterns();\n }", "function processFieldArray(form, fields) {\n\n fields.forEach(function (field, key) {\n // Add it\n if (field.type) {\n form.fields.push(field);\n }\n // Remove it\n if (field.hide) {\n form = removeField(form, field.name);\n }\n });\n\n}", "function processFieldArray(form, fields) {\n\n fields.forEach(function(field, key) {\n // Add it\n if(field.type) {\n form.fields.push(field);\n }\n // Remove it\n if(field.hide) {\n form = removeField(form, field.name);\n }\n });\n\n}", "function orgUpdateField(org_id, fieldName, fieldValue ) {\n\n // var member = globalMembers.find(function (member) { return member.id === member_id; }); //get the member object\n \n var ckanParameters = { id: org_id };\n ckanParameters[fieldName] = fieldValue;\n\n\n\n\n debugger;\n var client = new CKAN.Client(ckanServer, myAPIkey);\n\n client.action('organization_patch', ckanParameters,\n function (err, result) {\n if (err != null) { //some error - try figure out what\n mylog(mylogdiv, \"orgUpdateField ERROR: \" + JSON.stringify(err));\n console.log(\"orgUpdateField ERROR: \" + JSON.stringify(err));\n //return false;\n return 0;\n } else // we have managed to update. We are getting the full info for the org as the result\n {\n console.log(\"orgUpdateField RETURN: \" + JSON.stringify(result.result));\n //return true;\n return 1;\n // update the globalMembers array\n // update the screen\n\n }\n\n });\n\n\n}", "_setFields (fields, valueOptions = {}) {\n if (typeof fields !== 'object') {\n throw new Error(\"Expected an object but got \" + typeof fields);\n }\n\n for (let field in fields) {\n this._set(field, fields[field], valueOptions);\n }\n }", "function updateModuleDoc(moduleName, updateDoc){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n\n db.bind(moduleName);\n\n //create another object and copy. then delete the '_id' property of the new copy\n var forUpdate = {};\n Object.assign(forUpdate, updateDoc);\n delete forUpdate._id;\n\n db[moduleName].update({_id: mongo.helper.toObjectID(updateDoc._id)}, {$set: forUpdate}, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n deferred.resolve();\n }\n });\n\n return deferred.promise;\n}", "updateFieldsStatus () {\n let service = dependencyService\n service.updateFieldsStatus(this.formParameters)\n }", "@wire(getListOfFields,{objectAPIName: '$value'})\n wiredFields({ error, data }) {\n if (data) { \n //first parse the data as entire map is stored as JSON string\n let objStr = JSON.parse(data); \n //now loop through based on keys\n for(i of Object.keys(objStr)){\n console.log('FieldAPIName=' +i + 'FieldLabel=' + objStr[i]);\n //spread function is used to stored data and it is reversed order\n this.fieldItems = [\n {FieldLabel: objStr[i], FieldAPIName: i},...this.fieldItems]; \n }\n this.tableData = this.fieldItems;\n this.error = undefined; \n } else if (error) {\n this.error = error;\n this.data = undefined;\n }\n }", "setFieldValues(fieldValues) {\n if (Array.isArray(fieldValues)) {\n fieldValues.forEach(this.setFieldValue);\n } else {\n for (const key of Object.keys(fieldValues)) {\n this.setFieldValue({ name: key, value: fieldValues[key] })\n }\n }\n }", "function update(){\n\n //create another object and copy. then delete the '_id' property of the new copy\n var forUpdate = {};\n Object.assign(forUpdate, updateModule);\n delete forUpdate._id;\n \n db.modules.update({_id: mongo.helper.toObjectID(updateModule._id)}, {$set: forUpdate}, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n deferred.resolve();\n }\n });\n }", "function update(){\n\n //create another object and copy. then delete the '_id' property of the new copy\n var forUpdate = {};\n Object.assign(forUpdate, updateModule);\n delete forUpdate._id;\n \n db.modules.update({_id: mongo.helper.toObjectID(updateModule._id)}, {$set: forUpdate}, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n deferred.resolve();\n }\n });\n }", "function updateDepModuleVersions () {\n return request.post({\n url: `http://${HOST}/api/DepModuleVersions/add`,\n followAllRedirects: true,\n headers: {\n \"Authorization\": TOKEN\n },\n body: {\n obj: obj\n },\n json: true // Automatically stringifies the body to JSON\n }, (err, res, body) => {\n licenseObj(body);\n check(err, res, body);\n });\n}", "function updateFieldsInRecords(fields, records, replacements) {\n // Use object-literal syntax (faster than alternative)\n var convertBody = 'return {' + fields.map(function(name) {\n var key = JSON.stringify(name);\n return key + ': ' + (replacements[name] ? 'replacements[' + key + '][i]' : 'rec[' + key + ']');\n }).join(', ') + '}';\n var convert = new Function('rec', 'replacements', 'i', convertBody);\n records.forEach(function(rec, i) {\n records[i] = convert(rec, replacements, i);\n });\n }", "connectedCallback() {\n let objectApiName = this.sfdcObjectApiName;\n let fieldSetName = this.fieldSetName;\n\n //make an implicit call to fetch fields from database\n getFieldsFromFieldSet({\n strObjectApiName: objectApiName,\n strfieldSetName: fieldSetName\n })\n .then((data) => {\n let items = []; //local array to hold the field api\n\n //get the entire map\n let objStr = JSON.parse(data);\n //get the list of fields, its a reverse order to extract from map\n let listOfFields = JSON.parse(Object.values(objStr)[1]);\n //get the object name\n this.lblobjectName = Object.values(objStr)[0];\n //prepare items array using field api names\n listOfFields.map((element) => items.push(element.fieldPath));\n\n this.inputFieldAPIs = items;\n console.log(\"inputFieldAPIs\", this.inputFieldAPIs);\n console.log(this.inputFieldAPIs);\n this.error = undefined;\n })\n .catch((error) => {\n this.error = error;\n console.log(\"error\", error);\n this.lblobjectName = objectApiName;\n });\n }", "function updateOneFieldTask(id, field, data){\n $cordovaSQLite.execute(db,\n 'UPDATE tasks SET '+ field +' = ? WHERE id = ?',\n [data, id])\n .then(function(result) {}, function(error) {\n console.error('updateOneFieldTask(): ' + error);\n });\n }", "function RefreshDatarowItem(page_tblName, field_setting, update_dict, data_dicts) {\n console.log(\" --- RefreshDatarowItem ---\");\n console.log(\" page_tblName\", page_tblName);\n console.log(\" update_dict\", update_dict);\n //console.log(\"field_setting\", field_setting);\n\n if(!isEmpty(update_dict)){\n const field_names = field_setting.field_names;\n\n const is_deleted = (!!update_dict.deleted);\n const is_created = (!!update_dict.created);\n //console.log(\"is_created\", is_created);\n\n // field_error_list is not in use (yet)\n let field_error_list = [];\n const error_list = get_dict_value(update_dict, [\"error\"], []);\n console.log(\" error_list\", error_list);\n\n if(error_list && error_list.length){\n // - show modal messages\n b_show_mod_message_dictlist(error_list);\n\n // - add fields with error in field_error_list, to put old value back in field\n for (let i = 0, msg_dict ; msg_dict = error_list[i]; i++) {\n if (\"field\" in msg_dict){field_error_list.push(msg_dict.field)};\n };\n //} else {\n // close modal MSJ when no error --- already done in modal\n //$(\"#id_mod_subject\").modal(\"hide\");\n }\n\n// NIU:\n// --- get list of hidden columns\n //const col_hidden = b_copy_array_to_new_noduplicates(mod_MCOL_dict.cols_hidden);\n\n// ++++ created ++++\n // PR2021-06-16 from https://stackoverflow.com/questions/586182/how-to-insert-an-item-into-an-array-at-a-specific-index-javascript\n //arr.splice(index, 0, item); will insert item into arr at the specified index\n // (deleting 0 items first, that is, it's just an insert).\n\n if(is_created){\n // --- first remove key 'created' from update_dict\n delete update_dict.created;\n\n // --- add new item to data_dicts\n data_dicts[update_dict.mapid] = update_dict;\n\n // --- create row in table., insert in alphabetical order\n const new_tblRow = CreateTblRow(page_tblName, field_setting, update_dict)\n\n // --- scrollIntoView,\n if(new_tblRow){\n new_tblRow.scrollIntoView({ block: 'center', behavior: 'smooth' })\n\n // --- make new row green for 2 seconds,\n ShowOkElement(new_tblRow);\n }\n } else {\n\n// --- get existing data_dict\n const map_id = update_dict.mapid;\n const data_dict = data_dicts[map_id];\n\n if(data_dict){\n // ++++ deleted ++++\n if(is_deleted){\n console.log(\" is_deleted\", is_deleted);\n // delete row from data_dicts\n delete data_dicts[map_id];\n //--- delete tblRow\n\n const tblRow_tobe_deleted = document.getElementById(map_id);\n //console.log(\"tblRow_tobe_deleted\", tblRow_tobe_deleted);\n if (tblRow_tobe_deleted ){tblRow_tobe_deleted.parentNode.removeChild(tblRow_tobe_deleted)};\n\n } else {\n\n console.log(\" updated\");\n // +++++++++++ updated row +++++++++++\n // --- check which fields are updated, add to list 'updated_columns'\n if(field_names){\n let updated_columns = [];\n\n // skip first column (is margin)\n // col_field is the name of the column on page, not the db_field\n for (let i = 1, col_field, old_value, new_value; col_field = field_names[i]; i++) {\n\n let has_changed = false;\n if (col_field.slice(0, 5) === \"group\") {\n // data_dict.usergroups example: \"anlz;auth1;auth2;auth3;auth4;edit;read\"\n const usergroup = col_field.slice(6);\n // usergroup_in_data_dict and usergroup_in_update_dict are necessary to catch empty usergroup field\n const usergroup_in_data_dict = (!!data_dict.usergroups && data_dict.usergroups.includes(usergroup));\n const usergroup_in_update_dict = (!!update_dict.usergroups && update_dict.usergroups.includes(usergroup));\n has_changed = usergroup_in_data_dict != usergroup_in_update_dict;\n } else {\n has_changed = (data_dict[col_field] !== update_dict[col_field] );\n };\n\n if (has_changed){\n // --- add field to updated_columns list\n updated_columns.push(col_field)\n };\n };\n // --- update fields in data_row\n for (const [key, new_value] of Object.entries(update_dict)) {\n if (key in data_dict){\n if (new_value !== data_dict[key]) {\n data_dict[key] = new_value;\n }}};\n\n // --- update field in tblRow\n // note: when updated_columns is empty, then updated_columns is still true.\n // Therefore don't use Use 'if !!updated_columns' but use 'if !!updated_columns.length' instead\n if(updated_columns.length || field_error_list.length){\n\n // --- get existing tblRow\n let tblRow = document.getElementById(data_dict.mapid);\n if(tblRow){\n // to make it perfect: move row when username have changed\n if (updated_columns.includes(\"username\")){\n //--- delete current tblRow\n tblRow.parentNode.removeChild(tblRow);\n //--- insert row new at new position\n tblRow = CreateTblRow(page_tblName, field_setting, update_dict)\n }\n\n // loop through cells of row\n for (let i = 1, el_fldName, el, td; td = tblRow.cells[i]; i++) {\n el = td.children[0];\n if (el){\n el_fldName = get_attr_from_el(el, \"data-field\")\n UpdateField(el, update_dict);\n\n // make field green when field name is in updated_columns\n if(updated_columns.includes(el_fldName)){\n ShowOkElement(el);\n };\n };\n }; // for (let i = 1, el_fldName, el; el = tblRow.cells[i]; i++) {\n }; // if(tblRow){\n }; // if(updated_columns.length){\n }; // if(!isEmpty(data_dict) && field_names){\n }; // if(is_deleted){\n };\n }; // if(is_created)\n }; // if(!isEmpty(update_dict)){\n }", "_setFieldsRows (fieldsRows, valueOptions = {}) {\n if (!_isArray(fieldsRows)) {\n throw new Error(\"Expected an array of objects but got \" + typeof fieldsRows);\n }\n\n // Reset the objects stored fields and values\n this._reset();\n\n // for each row\n for (let i = 0; fieldsRows.length > i; ++i) {\n let fieldRow = fieldsRows[i];\n\n // for each field\n for (let field in fieldRow) {\n let value = fieldRow[field];\n\n field = this._sanitizeField(field);\n value = this._sanitizeValue(value);\n\n let index = this._fields.indexOf(field);\n\n if (0 < i && -1 === index) {\n throw new Error('All fields in subsequent rows must match the fields in the first row');\n }\n\n // Add field only if it hasn't been added before\n if (-1 === index) {\n this._fields.push(field);\n index = this._fields.length - 1;\n }\n\n // The first value added needs to add the array\n if (!_isArray(this._values[i])) {\n this._values[i] = [];\n this._valueOptions[i] = [];\n }\n\n this._values[i][index] = value;\n this._valueOptions[i][index] = valueOptions;\n }\n }\n }", "assignFields(scope) {\n const fields = Object\n .keys(scope.source)\n .filter((field) => this.assignFilter(scope.source, field, scope));\n return Promise.all(\n fields.map((fieldName) => this.assignField(fieldName, scope)),\n );\n }", "fieldsInfo () {\n return [\n {\n text: this.$t('fields.id'),\n name: 'id',\n details: false,\n table: false,\n },\n\n {\n type: 'input',\n column: 'order_nr',\n text: 'order No.',\n name: 'order_nr',\n multiedit: false,\n required: true,\n disabled: true,\n create: false,\n },\n {\n type: 'input',\n column: 'name',\n text: 'person name',\n name: 'name',\n multiedit: false,\n required: false,\n edit: false,\n create: false,\n },\n\n {\n type: 'input',\n column: 'email',\n text: 'email',\n name: 'email',\n multiedit: false,\n required: false,\n edit: false,\n create: false,\n },\n\n {\n type: 'select',\n url: 'crm/people',\n list: {\n value: 'id',\n text: 'fullname',\n data: [],\n },\n column: 'user_id',\n text: this.$t('fields.person'),\n name: 'person',\n apiObject: {\n name: 'person.name',\n },\n table: false,\n },\n {\n type: 'input',\n column: 'package_points',\n text: 'package points',\n name: 'package_points',\n required: false,\n edit: false,\n create: false,\n },\n\n // package_points\n {\n type: 'select',\n url: 'crm/package',\n list: {\n value: 'id',\n text: 'full_name',\n data: [],\n },\n column: 'package_id',\n text: 'package name',\n name: 'package',\n apiObject: {\n name: 'package.package_name',\n },\n table: false,\n },\n {\n type: 'input',\n column: 'package_name',\n text: 'package name',\n name: 'package_name',\n multiedit: false,\n required: false,\n edit: false,\n create: false,\n },\n\n {\n type: 'input',\n column: 'package_price',\n text: 'package price',\n name: 'package_price',\n multiedit: false,\n required: false,\n edit: false,\n create: false,\n },\n\n {\n type: 'input',\n column: 'pur_date',\n text: 'purche date',\n name: 'pur_date',\n multiedit: false,\n required: false,\n edit: false,\n create: false,\n },\n ]\n }", "function updateHeaderFields() {\n data.fields.forEach(field => {\n let id = GatherComponent.idByGatherTeamField(gatherMakers, gatherMakers.team, field);\n field.attributes.name = elementById(id).value;\n });\n}", "function update_array()\n{\n array_size=inp_as.value;\n generate_array();\n}", "function deleteModuleField(moduleName, fieldID){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n \n db.modules.update({name: moduleName}, {$pull: {fields: {id: mongo.helper.toObjectID(fieldID)}}}, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n deferred.resolve();\n }\n });\n\n return deferred.promise;\n}", "function deleteModuleField(moduleName, fieldID){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n \n db.modules.update({name: moduleName}, {$pull: {fields: {id: mongo.helper.toObjectID(fieldID)}}}, function(err, writeResult){\n if(err){\n deferred.reject(err);\n }\n else{\n if(writeResult.result.nModified == 0){\n deferred.reject(notFound);\n }\n else{\n deferred.resolve();\n }\n }\n });\n\n return deferred.promise;\n}", "addFields(fields) {\n if (fields[0] === false) {\n this.options.fields = false;\n\n return this;\n }\n\n this.options.fields = this.options.fields || {};\n\n fields.forEach((field) => {\n if (isArray(field)) {\n field.forEach((field) => {\n this.options.fields[field] = field;\n });\n } else if (isObject(field)) {\n this.options.fields = Object.assign(this.options.fields, field);\n } else if (isString(field)) {\n this.options.fields[field] = field;\n }\n });\n\n return this;\n }", "function setInputFieldIds(arrInputFieldIds) {\n $.each(arrInputFieldIds, function (index, value) {\n setInputFieldId(index, value);\n });\n }", "function fieldUpdates(fields, data, offset) {\n\toffset = offset || 0;\n\tlet index = -1;\n\tfields = fields.filter((field, i) => {\n\t\tif (field === 'email') {\n\t\t\tindex = i;\n\t\t\treturn false;\n\t\t} else return true;\n\t});\n\tif (index >= 0) data.splice(index, 1);\n\n\tlet output = '';\n\tfor (let i = 0; i < fields.length && i < data.length; i++) {\n\t\tconst d = i + offset + 1;\n\t\toutput = output + ' ' + fields[i] + ' = $' + d + (i < fields.length - 1 && i < data.length - 1 ? ', ' : '');\n\t}\n\treturn output;\n}", "function update_project_data(project_id) {\n\n // The authentication token for pipefy's api\n var user_token = 'Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJ1c2VyIjp7ImlkIjozMDExMTU0MjgsImVtYWlsIjoicGVkcm8uY3J1ekBtZWNhdHJvbi5vcmcuYnIiLCJhcHBsaWNhdGlvbiI6MzAwMTA0NTIzfX0.5UCErNgzErJD6if93Hn8-OlnCiXkyTIYazKKf_d2GFHPVeJZWuZdfVQHmL9ISloOdsKnkTLs4pRFYxZphe3a1w';\n\n\n // Get all cards on the project's pipe\n var cards_data = get_pipe_data(project_id, user_token);\n\n // Iterate through all the cards\n for (var card of cards_data) {\n card = card['node'];\n\n // If the card is a deliverable, update the deliverable's sheets, Otherwise, update the subdeliverable's sheets\n if (is_deliverable(card)) {\n update_deliverables(card, project_id);\n }\n else {\n update_subdeliverables(card, project_id);\n }\n\n\n }\n\n}", "refreshList(taskArray) {\n for (let tasks of taskArray){\n this.updateDB(tasks, 'default');\n }\n }", "function updateModuleDoc(moduleName, updateDoc){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n\n service.findDuplicateDoc(moduleName, updateDoc).then(function(){\n db.bind(moduleName);\n \n //convert '_id' to ObjectID\n updateDoc._id = new ObjectID(updateDoc._id);\n \n db[moduleName].update({_id: updateDoc._id}, {$set: updateDoc}, function(err, writeResult){\n if(err){\n deferred.reject(err);\n }\n else{\n if(writeResult.result.nModified == 0){\n deferred.reject(notFound);\n }\n else{\n deferred.resolve();\n }\n }\n });\n }).catch(function(err){\n deferred.reject(err);\n });\n\n return deferred.promise;\n}", "updateRecordArrays() {\n this.store.recordArrayManager.recordDidChange(this);\n }", "function changeValueInArray(id, nameOfVariable, valuetoChange, nameofArray) {\r\n\r\n// code that makes changes in the programmingButtonArray or the programmingLinksArray.\r\n// this function is needed for bens open frameworks code to change the values within your code\r\n// you can use the atomicUpdateArray() function that I wrote to make these changes. \r\n}", "renameFields() {\n for (var i = this.fields.length - 1; i >= 0; i--) {\n this.fields[i].attribute = this.key + '__' + this.fields[i].attribute;\n this.fields[i].validationKey = this.fields[i].attribute;\n\n if (this.fields[i].dependsOn) {\n Object.keys(this.fields[i].dependsOn).forEach(key => {\n this.fields[i].dependsOn[`${this.key}__${key}`] = this.fields[i].dependsOn[key];\n delete this.fields[i].dependsOn[key];\n });\n }\n }\n }", "static update(fields, value) {\n if (typeof value === 'number') {\n fields.position = value;\n } else if (typeof value === 'string') {\n fields.insertString = value;\n } else if (typeof value === 'object' && value.d !== undefined) {\n fields.delNum = value.d;\n }\n }", "function wrapFields(fields) {\n return [{\"Field\": fields}];\n}", "get clonedFields() {\n \n // check result\n if(this.record.data) {\n //define an array key, value to be sent \n let clonedFields = [];\n \n for (let i=0; i< this.fields.length; i++) {\n //extract the short fieldName from the full name to be sent to the lightning-form component\n const tmpArray = this.fields[i].split(\".\");\n \n let fieldName = tmpArray[1];\n // get the value of each field\n let fieldValue = getFieldValue(this.record.data, this.fields[i]);\n //push fieldName and fieldValue for each field\n clonedFields.push({key : fieldName, value : fieldValue });\n }\n \n return clonedFields;\n }\n else return null;\n \n }", "handleFieldsChangeByPlugin(e, value) {\n let name = value.name;\n\n if (this.currentComponent && name){\n let fields = Object.assign({}, this.currentComponent.state.fields);\n fields[name] = value.value;\n\n this.currentComponent.setState({fields: fields});\n }\n }", "addFieldValue() {\n this.add = this.add + 1;\n this.fieldArray.push(this.newAttribute);\n this.newAttribute = {};\n console.log(this.fieldArray);\n }", "function updateField(formId, fieldId, field)\n\t\t{\n\t\t\tvar deferred = $q.defer();\t\n\t\t\t// PUT the updated field information in the specified field in the\n\t\t\t// specified form\n\t\t\t$http.put(\"/api/assignment/form/\" + formId + \"/field/\" + fieldId, field)\n\t\t\t.success(function(response) \n\t\t\t{\n\t\t\t\tdeferred.resolve(response);\n\t\t\t});\n\n\t\t\treturn deferred.promise;\n\t\t}", "_updateObject(event, formData) { \n // Handle Damage Array\n let damage = Object.entries(formData).filter(e => e[0].startsWith(\"data.damage.parts\"));\n formData[\"data.damage.parts\"] = damage.reduce((arr, entry) => {\n let [i, j] = entry[0].split(\".\").slice(3);\n if ( !arr[i] ) arr[i] = [];\n arr[i][j] = entry[1];\n return arr;\n }, []);\n \n // Handle Critical Damage Array\n let criticalDamage = Object.entries(formData).filter(e => e[0].startsWith(\"data.critical.parts\"));\n formData[\"data.critical.parts\"] = criticalDamage.reduce((arr, entry) => {\n let [i, j] = entry[0].split(\".\").slice(3);\n if ( !arr[i] ) arr[i] = [];\n arr[i][j] = entry[1];\n return arr;\n }, []);\n\n // Handle Ability Adjustments array\n let abilityMods = Object.entries(formData).filter(e => e[0].startsWith(\"data.abilityMods.parts\"));\n formData[\"data.abilityMods.parts\"] = abilityMods.reduce((arr, entry) => {\n let [i, j] = entry[0].split(\".\").slice(3);\n if ( !arr[i] ) arr[i] = [];\n arr[i][j] = entry[1];\n return arr;\n }, []);\n \n // Update the Item\n super._updateObject(event, formData);\n }", "function updateField() {\r\n //update general text field\r\n for (var i = 0; i < glob_data.length; i++) {\r\n try {\r\n var this_node_key = glob_data[i].pk + '.' + glob_data[i].fields.node_name\r\n if (this_node_key == obj) {\r\n $('#node_details .description').text(glob_data[i].fields.node_description)\r\n $('#node_details .details').text(glob_data[i].fields.details)\r\n $('.node-name-details').text(glob_data[i].fields.node_name)\r\n $active_node_name = glob_data[i].fields.node_name\r\n }\r\n else { }\r\n }\r\n catch (err) {\r\n console.log(err)\r\n }\r\n }\r\n updatePicture()\r\n\r\n function updatePicture() { }\r\n // update picture set for slides\r\n var $target_slides = $('.slide img')\r\n\r\n for (var j = 0; j < $target_slides.length; j++) {\r\n $thisslide = $target_slides[j]\r\n $thisslide.src = \"\\\\static\\\\app\\\\content\\\\node_content\\\\\" + $active_node_name + \"images\\\\\" + (j + 1).toString() + \".jpg\"\r\n\r\n }\r\n }", "function updateArray(org, com) {\n const key = Object.keys(com)[0];\n switch(key) {\n case '$push':\n return [...org, ...com[key]];\n case '$unshift':\n return [...com[key], ...org];\n case '$splice':\n const newArr = [...org];\n newArr.splice(...com[key][0]);\n return newArr; \n default:\n return org;\n }\n}", "_applySortableFields(fields) {\n if (fields && fields.length) {\n let sortableCols = fields.replace(/ /g, \"\").split(',');\n sortableCols.forEach((f)=>{\n let column = this.cols.filter(obj => {\n return obj.id === f;\n });\n column[0].sortable = true;\n });\n }\n }", "expand(modules, parameterMappings) {\r\n if (parameterMappings.length) {\r\n return unimpl_1.unimpl();\r\n }\r\n this.fieldSpecs = this.fieldSpecs\r\n .map((fieldSpec) => lodash_1.cloneDeep(fieldSpec).expand(modules, parameterMappings));\r\n return this;\r\n }", "function setArrayOfValuesFNames_Ver1_2(objList, fieldIDs, fieldIDsToDisp, fieldNames) {\n\n //debugger;\n\n // We specify here the display names on the table for the various data fields\n if (fieldNames !== undefined && fieldNames !== null && fieldNames.length !== 0) {\n $.each(fieldNames, function (index, value) {\n Intern_TableFieldDispNames[index] = value;\n });\n }\n else if (fieldIDsToDisp !== undefined && fieldIDsToDisp !== null && fieldIDsToDisp.length !== 0) {\n $.each(fieldIDsToDisp, function (index, value) {\n Intern_TableFieldDispNames[index] = value;\n });\n }\n else if (fieldIDs !== undefined && fieldIDs !== null && fieldIDs.length !== 0) {\n $.each(fieldIDs, function (index, value) {\n Intern_TableFieldDispNames[index] = value;\n });\n }\n else if (objList !== undefined && objList !== null && objList.length !== 0) {\n var i = 0;\n $.each(objList[0], function (index, value) {\n Intern_TableFieldDispNames[i] = index;\n i++;\n });\n\n //debugger;\n\n }\n\n // We specify here the data fields that will be displayed on the table\n if (fieldIDsToDisp !== undefined && fieldIDsToDisp !== null && fieldIDsToDisp.length !== 0) {\n $.each(fieldIDsToDisp, function (index, value) {\n Intern_TableFieldIDs[index] = value;\n //setInputFieldId(index, value);\n });\n }\n else if (fieldIDs !== undefined && fieldIDs !== null && fieldIDs.length !== 0) {\n $.each(fieldIDs, function (index, value) {\n Intern_TableFieldIDs[index] = value;\n //setInputFieldId(index, value);\n });\n }\n else if (objList !== undefined && objList !== null && objList.length !== 0) {\n var i = 0;\n $.each(objList[0], function (index, value) {\n Intern_TableFieldIDs[i] = index;\n i++;\n });\n\n //debugger;\n\n }\n\n // We specify here the data fields to be considered in creating the array\n if (fieldIDs !== undefined && fieldIDs !== null && fieldIDs.length !== 0) {\n setInputFieldIds(fieldIDs);\n }\n else {\n setInputFieldIds(Intern_TableFieldIDs);\n }\n\n // In case we do not have anything defined in terms of the fields, we quit the function\n if (Intern_TableFieldDispNames.length === 0 || Intern_TableFieldIDs.length === 0)\n return;\n\n // Here we are building the array of the values for display in the table\n if (objList !== undefined && objList !== null /* && objList.length !== 0 */) {\n if (Setting_PointToOriginalArr === true) {\n Intern_ArrayOfValues = objList;\n }\n else {\n Intern_ArrayOfValues.splice(0, Intern_ArrayOfValues.length);\n //Intern_ArrayOfValues = [];\n $.each(objList, function (index, value) {\n Intern_ArrayOfValues[index] = {};\n $.each(value, function (index1, value1) {\n Intern_ArrayOfValues[index][index1] = value1;\n });\n });\n }\n }\n GenerateFullTable();\n }", "function updateAllProvider(req,res){\n providers.updateMany({firstName: req.params.firstName},{ $set: { firstName: req.body.firstName }},{ multi: true },(err, provider) => {\n if (err) return handleError(err);\n res.send(\"Your data is actualized\");\n })\n }", "function updateModules(containerId, moduleData, moduleType)\n{\n // get the UI tab for the appropriate module category\n let moduleTab = document.getElementById(containerId);\n\n // this clears out any elements that may already be present in the tab\n moduleTab.textContent = \"\";\n\n // get all the slot names and sort them\n let slots = Object.keys(moduleData);\n slots.sort((a, b) =>\n {\n /*\n The planetary approach suite is categorized as an optional internal module,\n though now that the Horizons expansion has been rolled into the main game,\n it will always be present. When modules like this have been made universal\n in the past (ex: discovery scanner) they eventually phased out the module\n altogether, and this may happen in the future. If it does, then this can\n be removed.\n */\n if (a === 'PlanetaryApproachSuite')\n {\n return 1;\n }\n if (b === 'PlanetaryApproachSuite')\n {\n return -1;\n }\n\n if (a === 'ShipCockpit')\n {\n return -1;\n }\n if (b === 'ShipCockpit')\n {\n return 1;\n }\n\n // fall back to the default string compare for all other modules\n return a.localeCompare(b);\n });\n\n for (let i = 0, len = slots.length; i < len; i++)\n {\n let slot = slots[i];\n let module = moduleData[slot];\n\n let shipModule = document.createElement(moduleType);\n shipModule.slotName = slot;\n shipModule.loadModuleData(module);\n moduleTab.appendChild(shipModule);\n }\n}", "function updateValues(arr, regex, replace) {\n if ( ! regex || regex.length < 1 || ! isRegexValid(regex) ) {\n error(\"Invalid regex: \" + regex);\n return undefined;\n } else if (! replace ) {\n error(\"Undefined replace string\");\n return undefined;\n }\n else {\n var re = new RegExp(regex);\n var newArr = [];\n for (var i in arr) {\n var matches = arr[i].match(regex);\n if ( matches ) {\n newArr[i] = replace; // Iterate, replacing $1, $2, placeholders\n for (var j=1; j<matches.length; j++) {\n newArr[i] = newArr[i].replace(\"$\"+j, matches[j], \"gi\");\n }\n// Logger.log(newArr[i]);\n } else newArr[i] = undefined;\n }\n return newArr;\n }\n}", "function scanFields(fieldArray, fieldName) {\n fieldArray.forEach(function (field, key) {\n if (field.name === fieldName) {\n fieldArray = fieldArray.splice(key, 1);\n }\n });\n}", "function changeMultipleSelectValues(col, selectedId, index, field) {\n\t\t\t/*var selectedObject = _.findWhere(selectListdataArray, {\"id\": selectedId});\n\t\t\t var item = $scope.data[index];\n\t\t\t if (item != null) {\n\t\t\t item[field] = selectedObject.value;\n\t\t\t }*/\n\t\t}", "function scanFields(fieldArray, fieldName) {\n fieldArray.forEach(function(field, key) {\n if(field.name === fieldName) {\n fieldArray = fieldArray.splice(key, 1);\n }\n });\n}", "updateField(recordId: number, key: string, value: string|number) {\n // Retrieving the record that is requested to go over the field update \n let record = this.crudStore.getData().get(recordId);\n\n // Asserting record retrieved successfully\n if (record) {\n // Updating field of record\n record[key] = value;\n\n // Updating record\n this.updateRecord(recordId, record)\n }\n else {\n throw \"CRUDActions.updateField: record wasn't retrieved successfully\"\n }\n }", "function ChargeArrayFromModuleRapid() {\n for (h = 0; h < arrayModNames.length - 1; h++) {\n dir2 = \"/rw/rapid/symbol/data/RAPID/T_ROB1/\" + arrayModNames[h] + \"/\" + arrayModNames[h] + \"Array\"; /*\"http://\" + url.ip + */\n xmlMod2 = LoadModulesFromRapid(dir2);\n rawDataFromArrayModule[h] = xmlMod2.getElementsByClassName(\"value\");\n }\n}", "function update(array, args) {\n\t\t var arrayLength = array.length, length = args.length;\n\t\t while (length--) array[arrayLength + length] = args[length];\n\t\t return array;\n\t\t}", "function UpdateAddableField(fieldType, fieldKey, fieldValue)\n{\n\t// fildKey is the key required to save the fieldType, ex. mobile: 01009091995, mobile is the key\n\tTi.API.info(\"UpdateAddableField: \" + fieldType + \", \" + fieldKey + \", \" + fieldValue);\n\t\n\t// TODO: Replace this with return statement\n\tif(contact == null) alert(\"Contact must be initialized ya beheema !\");\n\t\n\t// Add the new addable field to its array in contact\n\t// If contact[fieldType] is not empty, append to it, else create a new array\n\tvar fieldDictionary = contact[fieldType];\t// A workaround for iOS\n\ttry\n\t{\n\t\tfieldDictionary[fieldKey].push(fieldValue);\n\t}\n\tcatch(exp)\n\t{\n\t\tfieldDictionary[fieldKey] = [fieldValue];\n\t}\n\tcontact[fieldType] = fieldDictionary;\n\talert(contact[fieldType]);\n}", "createDataFields(updatedGroup) {\n // const teams = updatedGroup.map(\n // (team: UserTeams): EmbedFieldData => {\n // return {\n // name: team.name,\n // value: team.value,\n // };\n // }\n // );\n return [{ name: \"\\u200B\", value: \"\\u200B\" }, ...updatedGroup];\n }", "function setJourneyFormFields()\n\t{\n\t\tif ($scope.adminForm.arr_loaded_fields.length > 0)\n\t\t{\n\t\t\t$scope.adminForm.fields = Array();\n\t\t\t$scope.adminForm.fields = $scope.adminForm.arr_loaded_fields;\n\t\t\treturn $scope.adminForm.arr_loaded_fields;\n\t\t}//end if\n\t\t\n\t\tvar objRequest = {\n\t\t\tacrq: 'load-journey-admin-form',\t\n\t\t};\n\t\tvar $p = JourneysPageService.get(objRequest, \n\t\t\tfunction success(response) {\n\t\t\t\tlogToConsole(response);\n\t\t\t\t\n\t\t\t\t//check for errors\n\t\t\t\tif (typeof response.error != 'undefined' && response.error == 1)\n\t\t\t\t{\n\t\t\t\t\tdoErrorAlert('Unable to load Journeys', '<p>Request failed with response: ' + response.response + '</p>');\n\t\t\t\t\treturn false;\n\t\t\t\t}//end if\n\t\t\t\t\n\t\t\t\tangular.forEach(response.objData, function(objField, i) {\n\t\t\t\t\tswitch (objField.key)\n\t\t\t\t\t{\n\t\t\t\t\t\tcase 'date_expiry':\n\t\t\t\t\t\t objField.ngModelElAttrs = {\n\t\t\t\t\t\t 'data-provide': 'datepicker',\n\t\t\t\t\t\t 'data-date-format': 'dd M yyyy',\n\t\t\t\t\t\t 'data-date-clear-btn': 'true',\n\t\t\t\t\t\t 'data-date-autoclose': 'true',\n\t\t\t\t\t\t 'data-date-today-highlight': 'true',\n\t\t\t\t\t\t 'data-date-today-btn': 'true',\n\t\t\t\t\t\t 'readonly': 'readonly',\n\t\t\t\t\t\t }\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}//end switch\n\t\t\t\t\t\n\t\t\t\t\t$scope.adminForm.arr_loaded_fields.push(objField);\n\t\t\t\t});\n\t\t\t\t\n\t\t\t\t$scope.adminForm.fields = $scope.adminForm.arr_loaded_fields;\n\t\t\t},\n\t\t\tfunction error(errorResponse) {\n\t\t\t\tlogToConsole(errorResponse);\n\t\t\t\tdoErrorAlert('Unable to complete request', '<p>An unknown error has occurred. Please try again.</p>');\n\t\t\t}\n\t\t);\n\t\t\n\t\t$scope.loadJourneyForm.addPromise($p);\n\t}//end function", "function update() {\n\t\tfilterName = $(\"#new_pipeline #filterName\");\n\t\trequestType = $(\"#new_pipeline #requestType\");\n\t\trequestRank = $(\"#new_pipeline #requestRank\");\n\t\tmakeTrace = $(\"#new_pipeline #makeTrace\");\n\t\ttips = $(\"#new_pipeline .validateTips\");\n\t\tallFields = $([]).add(filterName).add(requestType).add(requestRank).add(makeTrace);\n\t}", "function updatePartnersFields() {\n data.partners.forEach(partner => {\n data.fields.forEach(field => {\n let id = GatherComponent.idByPartnerField(partner, field);\n partner.attributes[field.id] = elementById(id).value;\n });\n });\n}", "async function updateUnitsArray(data){\n keys = Object.keys(data)\n keys.pop()\n var i\n var unitArray = new Array()\n for(i = 0; i < keys.length; i++){\n var tempString = \"Unit_\" + keys[i]\n unitArray.push(tempString)\n }\n\n await db.collection(\"Office\").doc(\"officeView\").update({\n Units: unitArray\n })\n}", "function validateArrayFields(fields, company) {\n let error;\n _.some(fields, field => {\n try {\n if (company[field] && company[field].length > 0) {\n company[field] = JSON.parse(company[field]);\n }\n } catch (err) {\n error = AppErr.reject(err, ERROR['INVALID_' + field.toUpperCase()]);\n return true;\n }\n });\n return error;\n}", "function changeTheWholeVarValueFromItsInitialOneFromVarForList(struct_var, var_name, var_value){\n // printf(\"#### changeTheWholeVarValueFromItsInitialOneFromFileForList ####\\n\");\n \n //var row=0;\n var length=0;\n if (strcmp(struct_var[0].var_name,\"__size_of_array__\")!=0) {\n printf(\"@@ |\"+CURRENT_INPUT_STR+\"|\\n\");\n printf(\"Can not find __size_of_array__\");\n exit(0);\n }\n else{\n length=atoi(struct_var[0].var_value);\n }\n\n /*\n //struct VAR temp_var[];\n var temp_var_name=append(var_name, \"[\");\n while (row<length) {\n if (strcmp(var_name,struct_var[row].var_name)==0 || find(struct_var[row].var_name, temp_var_name)==0) {\n Var_removeVar(struct_var, struct_var[row].var_name);\n length--;\n row--;\n }\n row++;\n }\n */ \n \n Var_removeVar(struct_var, var_name);\n writeVarNameAndVarValueIntoAppointedVarForList(struct_var, var_name, var_value);\n}", "function UploadToggleMultiple(el_input) {\n console.log( \" ==== UploadToggleMultiple ====\");\n //console.log( \"el_input\", el_input);\n console.log( \" ??? permit_dict\", permit_dict);\n // only called by fields starting qith \"group\"\n\n// --- get data_dict\n const tblRow = t_get_tablerow_selected(el_input);\n const data_dict = get_datadict_from_tblRow(tblRow);\n const tblName = get_tblName_from_mapid(data_dict.mapid);\n const fldName = get_attr_from_el(el_input, \"data-field\");\n const arr = (fldName) ? fldName.split(\"_\") : null;\n const sel_usergroup = (arr && arr[1]) ? arr[1] : null;\n\n// --- get permit\n if (data_dict && sel_usergroup){\n if (!permit_dict.permit_crud) {\n // no permit\n } else if (data_dict.schoolbase_id !== permit_dict.requsr_schoolbase_pk && !permit_dict.requsr_role_system){\n b_show_mod_message_html(loc.cannot_change_other_organizations);\n } else {\n\n const has_sel_usergroup = (data_dict.usergroups) ? data_dict.usergroups.includes(sel_usergroup) : false;\n // permit_bool = true means that the user has this usergroup\n const new_permit_bool = !has_sel_usergroup\n // --- create mod_dict\n mod_dict = {mode: \"update_usergroup_multiple\",\n table: tblName,\n usergroup: sel_usergroup,\n permit_bool: new_permit_bool\n };\n\n // --- loop through tblBody.rows and fill user_pk_list, skip user of tr_clicked\n let other_org_count = 0\n mod_dict.user_pk_list = [];\n for (let i = 0, tr; tr = tblBody_datatable.rows[i]; i++) {\n if (tr.classList.contains(cls_selected) ) {\n const tr_dict = user_dicts[tr.id];\n // skip user of tr_clicked\n if (tr_dict && tr_dict.id !== data_dict.id){\n const tr_has_sel_usergroup = (tr_dict.usergroups) ? tr_dict.usergroups.includes(sel_usergroup) : false;\n // add only when value of has_sel_usergroup is same as value of tr_clicked\n if (has_sel_usergroup === tr_has_sel_usergroup){\n\n // skip users of other organizations\n if (tr_dict.schoolbase_id !== permit_dict.requsr_schoolbase_pk){\n other_org_count += 1;\n } else {\n mod_dict.user_pk_list.push(tr_dict.id);\n };\n };\n };\n };\n };\n if (!mod_dict.user_pk_list.length){\n //use UploadToggleSingle when no other rows are selected\n UploadToggleSingle(el_input)\n } else {\n // add tr_clicked to user_pk_list\n mod_dict.user_pk_list.push(data_dict.id);\n mod_dict.user_pk_count = (mod_dict.user_pk_list) ? mod_dict.user_pk_list.length : 0;\n\n const msg_list = [\"<p>\"];\n if (!mod_dict.user_pk_count){\n // this should not be possible, but let it stay\n hide_save_btn = true\n msg_list.push(...[loc.There_are_no, loc.users_selected, \"</p>\"]);\n } else {\n // mod_dict.user_pk_list always contains more than 1 user\n const added_removed_txt = (has_sel_usergroup) ? loc.willbe_removed_from_users : loc.willbe_added_to_users;\n msg_list.push(...[\"<p>\", loc.There_are, mod_dict.user_pk_count, loc.users_selected, \"</p><p>\",\n loc.Usergroup, \" '\", loc.usergroupcaption[sel_usergroup], \"' \", added_removed_txt]);\n if (other_org_count){\n const msg_list = (other_org_count === 1) ? [\"</p><p>\", loc.users_selected_other_org_sing] :\n [\"</p><p>\", loc.There_are, other_org_count, loc.users_selected_other_org_plur];\n msg_list.push(...msg_list);\n };\n msg_list.push(...[\"</p><p class='pt-2'>\", loc.Do_you_want_to_continue + \"</p>\"]);\n };\n\n el_confirm_header.innerText = (has_sel_usergroup) ? loc.Remove_usergroup : loc.Add_usergroup;\n el_confirm_loader.classList.add(cls_visible_hide)\n el_confirm_msg_container.classList.remove(\"border_bg_invalid\", \"border_bg_valid\");\n\n el_confirm_msg_container.innerHTML = (msg_list.length) ? msg_list.join(\"\") : null;\n\n el_confirm_btn_save.innerText = loc.OK;\n add_or_remove_class (el_confirm_btn_save, cls_hide, false);\n\n add_or_remove_class (el_confirm_btn_save, \"btn-primary\", true, \"btn-outline-danger\")\n\n el_confirm_btn_cancel.innerText = loc.Cancel;\n\n // set focus to cancel button\n set_focus_on_el_with_timeout(el_confirm_btn_cancel, 150);\n\n // show modal\n $(\"#id_mod_confirm\").modal({backdrop: true});\n };\n };\n };\n }", "_updateAvailableLayersModel(availableLayers, inputFields) {\n let _tempAvailableLayers = inputFields.map(input =>\n availableLayers.find(layer => input.value === layer.layerId)\n );\n\n // Set the available layers\n this._availableLayersModel.setLayers(_tempAvailableLayers);\n }", "function populateDataFields() {}", "function UpdateAssignmentCourseData(UpdatedData, Type, GivenArray) {\n if (Type == \"student_course\") {\n\n //Remove From DataBase Elements With The CourseID Selected.So I can Add The New Elements From The Same CourseID\n var FilteredCoursesStudentsArray = CoursesStudentsArray.filter(function (Element) {\n return Element.CourseId != CourseID;\n });\n var FilteredAssignmentsStudentsArray = AssignmentsStudentsArray.filter(function (Element) {\n return Element.AssignmentId != AssignmentID;\n });\n\n CoursesStudentsArray = FilteredCoursesStudentsArray;\n AssignmentsStudentsArray = FilteredAssignmentsStudentsArray;\n\n console.log(FilteredCoursesStudentsArray);\n console.log(FilteredAssignmentsStudentsArray);\n\n\n for (var i = 0; i < UpdatedData.length; i++) {\n var MaxId = Math.max.apply(Math, CoursesStudentsArray.map(function (Element) { return Element.id; }));\n CoursesStudentsArray.push({ id: MaxId + 1, CourseId: CourseID, StudentId: parseInt(UpdatedData[i]) })\n }\n for (var i = 0; i < UpdatedData.length; i++) {\n var MaxId = Math.max.apply(Math, AssignmentsStudentsArray.map(function (Element) { return Element.id; }));\n AssignmentsStudentsArray.push({ id: MaxId + 1, AssignmentId: AssignmentID, StudentId: parseInt(UpdatedData[i]) })\n }\n }\n if (Type == \"student_assignment\") {\n //Remove From DataBase Elements With The CourseID Selected.So I can Add The New Elements From The Same CourseID\n console.log(UpdatedData);\n var FilteredAssignmentsStudentsArray = AssignmentsStudentsArray.filter(function (Element) {\n return Element.AssignmentId != AssignmentID;\n });\n\n AssignmentsStudentsArray = FilteredAssignmentsStudentsArray;\n\n for (var i = 0; i < UpdatedData.length; i++) {\n var MaxId = Math.max.apply(Math, AssignmentsStudentsArray.map(function (Element) { return Element.id; }));\n AssignmentsStudentsArray.push({ id: MaxId + 1, AssignmentId: AssignmentID, StudentId: parseInt(UpdatedData[i]) })\n\n }\n }\n\n if (Type == \"course\") {\n //Remove From DataBase Elements With The CourseID Selected.So I can Add The New Elements From The Same CourseID\n var FilteredItems = GivenArray.filter(function (Element) {\n return Element.AssignmentId != AssignmentID;\n\n });\n GivenArray = FilteredItems;\n for (var i = 0; i < UpdatedData.length; i++) {\n var MaxId = Math.max.apply(Math, GivenArray.map(function (Element) { return Element.id; }));\n GivenArray.push({ id: MaxId + 1, AssignmentId: AssignmentID, CourseId: parseInt(UpdatedData[i]) })\n }\n }\n return GivenArray;\n}", "handleSave(){\n let secFields =this.template.querySelectorAll(\"lightning-input\");\n let selectedfieldList =this.template.querySelectorAll(\"lightning-dual-listbox\");\n let configDataUpdated=[]; // Holds the reconstructed JSON object\n\n //Validation logic to check for mandatory fields\n const validateInput = [...secFields]\n .reduce((validSoFar, inputCmp) => {\n inputCmp.reportValidity();\n return validSoFar && inputCmp.checkValidity();\n }, true);\n const validateSelect = [...selectedfieldList]\n .reduce((validSoFar, inputCmp) => {\n inputCmp.reportValidity();\n return validSoFar && inputCmp.checkValidity();\n }, true);\n //valid section name and fields are selected\n if (validateInput && validateSelect) {\n //Start : JSON constructon\n for(let i=0 ; i<secFields.length ; i++){\n let sectionData;\n let selectedfields = `${selectedfieldList[i].value}`.split(',');\n\n sectionData = {\"SecName\":secFields[i].value,\"FieldList\": selectedfields};\n configDataUpdated.push(sectionData);\n }\n //Stop : JSON constructon\n if(configDataUpdated){\n this.configData = configDataUpdated\n }\n \n let configDateStr = JSON. stringify(this.configData);\n //Imperative Apex call to update existing metadata record or create new record\n upsertConfigMetadat({configName:this.configName,configData:configDateStr})\n .then(() => {\n if(this.isNewSectionVisible){\n this.isNewSectionVisible = false;\n }\n //Dispatch an event to parent component to send flags to detail page\n const updateEvent = new CustomEvent('updateconfig', {\n detail: {\"showDetails\":true,\"refreshData\":true}\n });\n this.dispatchEvent(updateEvent);\n })\n .catch(error => {\n console.log('update error '+ error.status);\n });\n } \n\n \n \n }", "fields (_fields, options = {}) {\n if (_isArray(_fields)) {\n for (let field of _fields) {\n this.field(field, null, options);\n }\n }\n else {\n for (let field in _fields) {\n let alias = _fields[field];\n\n this.field(field, alias, options);\n }\n }\n }", "_pushFields(fields, indexValue, type = 'default') {\n if (!_.isUndefined(indexValue)) {\n let index = this._rowsIndex[type][indexValue];\n if (_.isUndefined(index)) {\n this._rowsIndex[type][indexValue] = this._rows[type].length;\n this._rows[type].push(fields);\n } else {\n //this._rowsIndex.default[indexValue] = this._rows.default.length;\n let checker = this._getRuleChecker().setFields({\n 'new': fields,\n 'old': this._rows[type][index]\n });\n _.each(this.config.rules, rule => {\n if (checker.check(rule)) {\n this._rows[type][index] = fields;\n\n return false; // rule is matching, break next iteration\n }\n });\n }\n } else {\n this._rows[type].push(fields);\n }\n }", "editJsonList(input) {\n let jvalue = this.get(input.path);\n if (jvalue) {\n if (jvalue.constructor === Array) {\n let listObj = jvalue.find(obj => obj[input.id] === input.value);\n const foundIndex = jvalue.findIndex(obj => obj[input.id] === input.value);\n\n if (listObj) {\n const new_configs = input.body\n Object.keys(new_configs).forEach((key) => {\n let value = findValue(listObj, key);\n if (value) {\n if (value.constructor === Array) {\n value.push(new_configs[key]);\n new_configs[key] = value;\n }\n }\n const jeditor = new this.constructor(listObj);\n jeditor.set(key, new_configs[key]);\n listObj = jeditor.toObject();\n });\n jvalue[foundIndex] = listObj;\n this.set(input.path, jvalue);\n } else {\n return ({ isError: true, error: { errorType: \"BadRequest\", \"message\": \"No Such object found.\" } });\n }\n\n } else {\n return ({ isError: true, error: { errorType: \"BadRequest\", \"message\": \"Expecting Array but found Object/String.\" } });\n }\n }\n return ({ isError: false, data: this.toObject() });\n\n }", "function setArrayOfValuesFNames(objList, fieldNames, fieldIDs) {\n\n //debugger;\n\n if (objList !== undefined && objList !== null && objList.length !== 0) {\n var tableFieldDispNamesDefined = false;\n if (Intern_TableFieldDispNames !== undefined && Intern_TableFieldDispNames !== null && Intern_TableFieldDispNames.length !== 0)\n tableFieldDispNamesDefined = true;\n if (Setting_PointToOriginalArr === true) {\n Intern_ArrayOfValues = objList;\n }\n else {\n Intern_ArrayOfValues.splice(0, Intern_ArrayOfValues.length);\n //Intern_ArrayOfValues = [];\n $.each(objList, function (index, value) {\n Intern_ArrayOfValues[index] = {};\n $.each(fieldIDs, function (index1, value1) {\n Intern_ArrayOfValues[index][fieldIDs[index1]] = value[value1];\n if (index === 0) {\n\n setInputFieldId(index1, fieldIDs[index1]);\n\n if (tableFieldDispNamesDefined === false)\n Intern_TableFieldDispNames[index1] = fieldIDs[index1];\n }\n });\n });\n }\n }\n else {\n var tableFieldDispNamesDefined = false;\n if (Intern_TableFieldDispNames !== undefined && Intern_TableFieldDispNames !== null && Intern_TableFieldDispNames.length !== 0)\n tableFieldDispNamesDefined = true;\n $.each(fieldIDs, function (index1, value1) {\n if (tableFieldDispNamesDefined === false) {\n Intern_TableFieldDispNames[index1] = fieldNames[index1];\n }\n });\n }\n GenerateFullTable();\n }", "function _Update(objRequest, objResponse) {\n nlapiLogExecution('AUDIT','UPDATE Courses', '=====START=====');\n var stCustId = objRequest['CustomerId'];\n var httpBody = objRequest;\n nlapiLogExecution('AUDIT', 'Update Course', 'Update function in Departments executed.');\n\n var objDataResponse = {\n Response: 'F',\n Message: 'Default Value',\n ReturnId: ''\n };\n\n var loadedICourseRecord = nlapiLoadRecord('customrecord_rc_course', httpBody.Id);\n\n try {\n loadedICourseRecord.setFieldValue('custrecord_rc_course_title', httpBody.Title),\n loadedICourseRecord.setFieldValue('custrecord_rc_course_number', httpBody.Number),\n loadedICourseRecord.setFieldValue('custrecord_rc_course_credit_level', httpBody.CreditLevel.Id),\n loadedICourseRecord.setFieldValue('custrecord_rc_course_credit_hours', httpBody.CreditHours),\n loadedICourseRecord.setFieldValue('custrecord_rc_course_syllabi_name', httpBody.SyllabiName),\n loadedICourseRecord.setFieldValue('custrecord_rc_course_institution', httpBody.ModeOfInstruction),\n loadedICourseRecord.setFieldValue('custrecord_rc_course_reg_course', httpBody.RegisteredCourseId)\n objDataResponse.ReturnId = nlapiSubmitRecord(loadedICourseRecord, true)\n }\n catch (ex) {\n nlapiLogExecution('ERROR', 'Something broke trying to set fields' + ex.message)\n }\n\n if(objDataResponse.ReturnId){\n objDataResponse.Response = 'T';\n objDataResponse.Message = 'Yo it seems as though we have been successful with dis otha endevour' + JSON.stringify(loadedICourseRecord)\n }\n\n // Ask john.\n //1.)How to deal with \"missing\" values. What values must be supplied at any given stage\n // Mode up is required(looking at ns)\n\n // its either a list OR a record A list has id and value when writing i only provide an ID, don't pass anything but the id\n // think of it as an Enumerator, a number that means something else.\n //2.)How to deal with list objects\n\n nlapiLogExecution('AUDIT','UPDATE Courses', '======END======');\n return JSON.stringify(objDataResponse)\n}", "parseFields(fields) {\n for (let index in fields) {\n let obj = fields[index];\n let name = \"\";\n let type = \"\";\n for (let prop in obj) {\n if (obj.hasOwnProperty(prop)) {\n if (prop === \"name\") {\n name = obj[prop];\n }\n if (prop === \"type\") {\n type = obj[prop];\n }\n }\n }\n this.fieldTypes[name] = Number(type);\n }\n }", "function getAllFields(){\n\t\t\t\n ModulesService.getModuleByName('users').then(function(response){\n $scope.fields = response.fields;\n $scope.id = response._id;\n \n $scope.fieldsLength = Object.size(response.fields);\n \n }).catch(function(err){\n alert(err.msg_error);\n });\n }", "_fields2request(includeEmpty) {\n let result = [];\n\n for (const name of this.uniqueFieldNames) {\n var newName = name;\n\n // send clonables as list (even if there's only one field) and other fields as plain values\n let potentialClones = this.fields.filter(f =>\n f.name === name && (typeof f.value !== 'undefined') && (f.value !== \"\" || includeEmpty)\n );\n\n if (potentialClones.length === 0) continue;\n\n // encode ArrayBuffer as Base64 and change field name as a flag\n let encodeValue = (val) => {\n if (val instanceof ArrayBuffer) {\n newName = `_encoded_base64_${name}`;\n return btoa(String.fromCharCode(...new Uint8Array(val)));\n }\n else {\n return val;\n }\n };\n\n let value = potentialClones[0].clonable\n ? potentialClones.map(c => encodeValue(c.value)) // array for clonable fields\n : encodeValue(potentialClones[0].value) // or plain value otherwise\n // setting 'result' must be separate step as encodeValue() modifies 'newName'\n result[newName] = value;\n\n debug(`${name} = ${ potentialClones[0].clonable ? `[${result[newName]}]` : `\"${result[newName]}\"` }`);\n }\n return result;\n }", "_syncLiveRecordArray(array, modelName) {\n (true && !(typeof modelName === 'string') && Ember.assert(`recordArrayManger.syncLiveRecordArray expects modelName not modelClass as the second param`, typeof modelName === 'string'));\n\n var hasNoPotentialDeletions = Object.keys(this._pending).length === 0;\n var map = this.store._internalModelsFor(modelName);\n var hasNoInsertionsOrRemovals = Ember.get(map, 'length') === Ember.get(array, 'length');\n\n /*\n Ideally the recordArrayManager has knowledge of the changes to be applied to\n liveRecordArrays, and is capable of strategically flushing those changes and applying\n small diffs if desired. However, until we've refactored recordArrayManager, this dirty\n check prevents us from unnecessarily wiping out live record arrays returned by peekAll.\n */\n if (hasNoPotentialDeletions && hasNoInsertionsOrRemovals) {\n return;\n }\n\n var internalModels = this._visibleInternalModelsByType(modelName);\n var modelsToAdd = [];\n for (var i = 0; i < internalModels.length; i++) {\n var internalModel = internalModels[i];\n var recordArrays = internalModel._recordArrays;\n if (recordArrays.has(array) === false) {\n recordArrays.add(array);\n modelsToAdd.push(internalModel);\n }\n }\n\n array._pushInternalModels(modelsToAdd);\n }", "_assignToActorField (fields, value) {\n const actorData = duplicate(this.actor)\n const lastField = fields.pop()\n fields.reduce((data, field) => data[field], actorData)[lastField] = value\n this.actor.update(actorData)\n }", "function updateObjectInArray(array, action) {\r\n return array.map( item => {\r\n // if the item's id in the array is not equal to the id of the object returned by the action - return as is\r\n if (item.id != action.payload.job.id) {\r\n return item\r\n }\r\n \r\n // otherwise, this is the one we want - return an updated value\r\n return {\r\n ...item,\r\n ...action.payload.job\r\n }\r\n })\r\n }", "setFields(entity, fieldValues) {\n\n if (this.guardMode) {\n throw new Error(`E_SCHEMA_GUARD_MODE: Could not mass assign entity fields in guard mode`);\n }\n\n lodash.forIn(fieldValues, (value, field) => {\n this.set(entity, field, value);\n });\n }", "function updateUserInJive(res, contactData, contactValues, person, callback) {\n\n var updatedOptions = {\n url: jiveLoginUrl + '/api/core/v3/people/' + person.id + '',\n method: 'PUT',\n headers: headers,\n body: {\n \"emails\": [{\n \"jive_label\" : \"Email\",\n \"value\":contactValues.Email\n }],\n \"jive\": {\n \"password\": \"carbonblack@123\",\n \"username\": contactValues.Email,\n \"profile\":[]\n },\n \"name\": {\n \"givenName\": contactValues.FirstName,\n \"familyName\": contactValues.LastName\n },\n \"addresses\":[],\n \"phoneNumbers\":[]\n }\n };\n\n console.log(contactValues);\n\n if(person.jive.profile !=undefined){\n updatedOptions.body.jive.profile = person.jive.profile;\n }\n if(person.addresses !=undefined){\n updatedOptions.body.addresses = person.addresses;\n }\n if(person.phoneNumbers !=undefined){\n updatedOptions.body.phoneNumbers = person.phoneNumbers;\n }\n\n contactData.mapping.forEach(function (result) {\n\n\n if (parseInt(result.mappingType) != 1) {\n\n\n if (result.jiveField == \"Title\") {\n\n if (person.jive.profile == \"undefined\") {\n updatedOptions.body.jive.profile = [];\n\n var title = {\n \"jive_label\": \"Title\",\n \"value\": contactValues[result.salesforceField],\n };\n updatedOptions.body.jive.profile.push(title);\n\n }\n\n else {\n\n var titleIndex = lodash.findIndex(updatedOptions.body.jive.profile, {'jive_label': 'Title'});\n if (titleIndex != -1) {\n updatedOptions.body.jive.profile[titleIndex].value = contactValues[result.salesforceField];\n }\n else {\n var title = {\n \"jive_label\": \"Title\",\n \"value\": contactValues[result.salesforceField]\n };\n updatedOptions.body.jive.profile.push(title);\n }\n\n }\n\n }\n\n\n if (result.jiveField == \"Department\") {\n\n if (person.jive.profile == \"undefined\") {\n updatedOptions.body.jive.profile = [];\n\n var title = {\n \"jive_label\": \"Department\",\n \"value\": contactValues[result.salesforceField],\n };\n updatedOptions.body.jive.profile.push(title);\n\n }\n\n else {\n\n var titleIndex = lodash.findIndex(updatedOptions.body.jive.profile, {'jive_label': 'Department'});\n if (titleIndex != -1) {\n updatedOptions.body.jive.profile[titleIndex].value = contactValues[result.salesforceField];\n }\n else {\n var title = {\n \"jive_label\": \"Department\",\n \"value\": contactValues[result.salesforceField]\n };\n updatedOptions.body.jive.profile.push(title);\n }\n\n }\n }\n\n if (result.jiveField == \"Availability\") {\n\n if (person.jive.profile == \"undefined\") {\n updatedOptions.body.jive.profile = [];\n\n var title = {\n \"jive_label\": \"Availability\",\n \"value\": contactValues[result.salesforceField],\n };\n updatedOptions.body.jive.profile.push(title);\n\n }\n\n else {\n\n var titleIndex = lodash.findIndex(updatedOptions.body.jive.profile, {'jive_label': 'Availability'});\n if (titleIndex != -1) {\n updatedOptions.body.jive.profile[titleIndex].value = contactValues[result.salesforceField];\n }\n else {\n var title = {\n \"jive_label\": \"Availability\",\n \"value\": contactValues[result.salesforceField]\n };\n updatedOptions.body.jive.profile.push(title);\n }\n\n }\n }\n\n if (result.jiveField == \"Hire Date\") {\n\n if (person.jive.profile == \"undefined\") {\n updatedOptions.body.jive.profile = [];\n\n var title = {\n \"jive_label\": \"Hire Date\",\n \"value\": contactValues[result.salesforceField],\n };\n updatedOptions.body.jive.profile.push(title);\n\n }\n\n else {\n\n var titleIndex = lodash.findIndex(updatedOptions.body.jive.profile, {'jive_label': 'Hire Date'});\n if (titleIndex != -1) {\n updatedOptions.body.jive.profile[titleIndex].value = contactValues[result.salesforceField];\n }\n else {\n var title = {\n \"jive_label\": \"Hire Date\",\n \"value\": contactValues[result.salesforceField]\n };\n updatedOptions.body.jive.profile.push(title);\n }\n\n }\n }\n\n if (result.jiveField == \"Biography\") {\n\n if (person.jive.profile == \"undefined\") {\n updatedOptions.body.jive.profile = [];\n\n var title = {\n \"jive_label\": \"Biography\",\n \"value\": contactValues[result.salesforceField],\n };\n updatedOptions.body.jive.profile.push(title);\n\n }\n\n else {\n\n var titleIndex = lodash.findIndex(updatedOptions.body.jive.profile, {'jive_label': 'Biography'});\n if (titleIndex != -1) {\n updatedOptions.body.jive.profile[titleIndex].value = contactValues[result.salesforceField];\n }\n else {\n var title = {\n \"jive_label\": \"Biography\",\n \"value\": contactValues[result.salesforceField]\n };\n updatedOptions.body.jive.profile.push(title);\n }\n\n }\n }\n\n if (result.jiveField == \"Company\") {\n\n if (person.jive.profile == \"undefined\") {\n updatedOptions.body.jive.profile = [];\n\n var title = {\n \"jive_label\": \"Company\",\n \"value\": contactValues[result.salesforceField],\n };\n updatedOptions.body.jive.profile.push(title);\n\n }\n\n else {\n\n var titleIndex = lodash.findIndex(updatedOptions.body.jive.profile, {'jive_label': 'Company'});\n if (titleIndex != -1) {\n updatedOptions.body.jive.profile[titleIndex].value = contactValues[result.salesforceField];\n }\n else {\n var title = {\n \"jive_label\": \"Company\",\n \"value\": contactValues[result.salesforceField]\n };\n updatedOptions.body.jive.profile.push(title);\n }\n\n }\n }\n\n if (result.jiveField == \"Twitter\") {\n\n if (person.jive.profile == \"undefined\") {\n updatedOptions.body.jive.profile = [];\n\n var title = {\n \"jive_label\": \"Twitter\",\n \"value\": contactValues[result.salesforceField],\n };\n updatedOptions.body.jive.profile.push(title);\n\n }\n\n else {\n\n var titleIndex = lodash.findIndex(updatedOptions.body.jive.profile, {'jive_label': 'Twitter'});\n if (titleIndex != -1) {\n updatedOptions.body.jive.profile[titleIndex].value = contactValues[result.salesforceField];\n }\n else {\n var title = {\n \"jive_label\": \"Twitter\",\n \"value\": contactValues[result.salesforceField]\n };\n updatedOptions.body.jive.profile.push(title);\n }\n\n }\n }\n\n if (result.jiveField == \"LinkedIn\") {\n\n if (person.jive.profile == \"undefined\") {\n updatedOptions.body.jive.profile = [];\n\n var title = {\n \"jive_label\": \"LinkedIn\",\n \"value\": contactValues[result.salesforceField],\n };\n updatedOptions.body.jive.profile.push(title);\n\n }\n\n else {\n\n var titleIndex = lodash.findIndex(updatedOptions.body.jive.profile, {'jive_label': 'LinkedIn'});\n if (titleIndex != -1) {\n updatedOptions.body.jive.profile[titleIndex].value = contactValues[result.salesforceField];\n }\n else {\n var title = {\n \"jive_label\": \"LinkedIn\",\n \"value\": contactValues[result.salesforceField]\n };\n updatedOptions.body.jive.profile.push(title);\n }\n\n }\n }\n\n if (result.jiveField == \"Facebook\") {\n\n if (person.jive.profile == \"undefined\") {\n updatedOptions.body.jive.profile = [];\n\n var title = {\n \"jive_label\": \"Facebook\",\n \"value\": contactValues[result.salesforceField],\n };\n updatedOptions.body.jive.profile.push(title);\n\n }\n\n else {\n\n var titleIndex = lodash.findIndex(updatedOptions.body.jive.profile, {'jive_label': 'Facebook'});\n if (titleIndex != -1) {\n updatedOptions.body.jive.profile[titleIndex].value = contactValues[result.salesforceField];\n }\n else {\n var title = {\n \"jive_label\": \"Facebook\",\n \"value\": contactValues[result.salesforceField]\n };\n updatedOptions.body.jive.profile.push(title);\n }\n\n }\n }\n\n if (result.jiveField == \"food\") {\n\n if (person.jive.profile == \"undefined\") {\n updatedOptions.body.jive.profile = [];\n\n var title = {\n \"jive_label\": \"food\",\n \"value\": contactValues[result.salesforceField],\n };\n updatedOptions.body.jive.profile.push(title);\n\n }\n\n else {\n\n var titleIndex = lodash.findIndex(updatedOptions.body.jive.profile, {'jive_label': 'food'});\n if (titleIndex != -1) {\n updatedOptions.body.jive.profile[titleIndex].value = contactValues[result.salesforceField];\n }\n else {\n var title = {\n \"jive_label\": \"food\",\n \"value\": contactValues[result.salesforceField]\n };\n updatedOptions.body.jive.profile.push(title);\n }\n\n }\n }\n\n if (result.jiveField == \"followerCount\") {\n updatedOptions.body[result.jiveField] = contactValues[result.salesforceField];\n }\n\n\n if (result.jiveField == \"followed\") {\n updatedOptions.body[result.jiveField] = contactValues[result.salesforceField];\n }\n\n\n if (result.jiveField == \"Address\") {\n\n if (contactValues[result.salesforceField] != null) {\n\n\n if (updatedOptions.body.addresses == \"undefined\") {\n\n var addresses = {\n \"jive_label\": \"Address\",\n \"type\": \"work\",\n \"value\": {\n \"country\": contactValues[result.salesforceField].country,\n \"locality\": contactValues[result.salesforceField].street,\n \"postalCode\": contactValues[result.salesforceField].postalCode,\n \"region\": contactValues[result.salesforceField].state,\n \"streetAddress\": contactValues[result.salesforceField].street,\n \"formatted\": contactValues[result.salesforceField].street\n }\n };\n updatedOptions.body.addresses.push(addresses);\n\n }\n else {\n\n var titleIndex = lodash.findIndex(updatedOptions.body.addresses, {'jive_label': 'Address'});\n if (titleIndex != -1) {\n updatedOptions.body.addresses[titleIndex].value = {\n \"country\": contactValues[result.salesforceField].country,\n \"locality\": contactValues[result.salesforceField].street,\n \"postalCode\": contactValues[result.salesforceField].postalCode,\n \"region\": contactValues[result.salesforceField].state,\n \"streetAddress\": contactValues[result.salesforceField].street,\n \"formatted\": contactValues[result.salesforceField].street\n };\n }\n else {\n var addresses = {\n \"jive_label\": \"Address\",\n \"type\": \"work\",\n \"value\": {\n \"country\": contactValues[result.salesforceField].country,\n \"locality\": contactValues[result.salesforceField].street,\n \"postalCode\": contactValues[result.salesforceField].postalCode,\n \"region\": contactValues[result.salesforceField].state,\n \"streetAddress\": contactValues[result.salesforceField].street,\n \"formatted\": contactValues[result.salesforceField].street\n }\n };\n updatedOptions.body.addresses.push(addresses);\n }\n\n }\n }\n }\n\n\n if (result.jiveField == \"Home Address\") {\n\n if (contactValues[result.salesforceField] != null) {\n\n\n if (updatedOptions.body.addresses == \"undefined\") {\n\n var addresses = {\n \"jive_label\": \"Home Address\",\n \"type\": \"home\",\n \"value\": {\n \"country\": contactValues[result.salesforceField].country,\n \"locality\": contactValues[result.salesforceField].street,\n \"postalCode\": contactValues[result.salesforceField].postalCode,\n \"region\": contactValues[result.salesforceField].state,\n \"streetAddress\": contactValues[result.salesforceField].street,\n \"formatted\": contactValues[result.salesforceField].street\n }\n };\n updatedOptions.body.addresses.push(addresses);\n\n }\n else {\n\n var titleIndex = lodash.findIndex(updatedOptions.body.addresses, {'jive_label': 'Home Address'});\n if (titleIndex != -1) {\n updatedOptions.body.addresses[titleIndex].value = {\n \"country\": contactValues[result.salesforceField].country,\n \"locality\": contactValues[result.salesforceField].street,\n \"postalCode\": contactValues[result.salesforceField].postalCode,\n \"region\": contactValues[result.salesforceField].state,\n \"streetAddress\": contactValues[result.salesforceField].street,\n \"formatted\": contactValues[result.salesforceField].street\n };\n }\n else {\n var addresses = {\n \"jive_label\": \"Home Address\",\n \"type\": \"home\",\n \"value\": {\n \"country\": contactValues[result.salesforceField].country,\n \"locality\": contactValues[result.salesforceField].street,\n \"postalCode\": contactValues[result.salesforceField].postalCode,\n \"region\": contactValues[result.salesforceField].state,\n \"streetAddress\": contactValues[result.salesforceField].street,\n \"formatted\": contactValues[result.salesforceField].street\n }\n };\n updatedOptions.body.addresses.push(addresses);\n }\n\n }\n }\n }\n\n\n if (result.jiveField == \"displayName\") {\n updatedOptions.body[result.jiveField] = contactValues[result.salesforceField];\n\n }\n\n\n if (result.jiveField == \"mentionName\") {\n updatedOptions.body[result.jiveField] = contactValues[result.salesforceField];\n }\n\n\n if (result.jiveField == \"followingCount\") {\n updatedOptions.body[result.jiveField] = contactValues[result.salesforceField];\n }\n\n\n if (result.jiveField == \"Phone Number\") {\n if (updatedOptions.body.phoneNumbers == \"undefined\") {\n var phoneNumbers = {\n \"jive_label\": \"Phone Number\",\n \"primary\": true,\n \"type\": \"work\",\n \"value\": contactValues[result.salesforceField],\n };\n\n updatedOptions.body.phoneNumbers.push(phoneNumbers);\n }\n else {\n var titleIndex = lodash.findIndex(updatedOptions.body.phoneNumbers, {'jive_label': 'Phone Number'});\n if (titleIndex != -1) {\n updatedOptions.body.phoneNumbers[titleIndex].value = contactValues[result.salesforceField];\n }\n else{\n var phoneNumbers = {\n \"jive_label\": \"Phone Number\",\n \"primary\": true,\n \"type\": \"work\",\n \"value\": contactValues[result.salesforceField]\n };\n updatedOptions.body.phoneNumbers.push(phoneNumbers);\n }\n\n }\n\n }\n\n if (result.jiveField == \"Mobile Phone Number\") {\n if (updatedOptions.body.phoneNumbers == \"undefined\") {\n var phoneNumbers = {\n \"jive_label\": \"Mobile Phone Number\",\n \"type\": \"mobile\",\n \"value\": contactValues[result.salesforceField],\n };\n\n updatedOptions.body.phoneNumbers.push(phoneNumbers);\n }\n else {\n var titleIndex = lodash.findIndex(updatedOptions.body.phoneNumbers, {'jive_label': 'Mobile Phone Number'});\n if (titleIndex != -1) {\n updatedOptions.body.phoneNumbers[titleIndex].value = contactValues[result.salesforceField];\n }\n else{\n var phoneNumbers = {\n \"jive_label\": \"Mobile Phone Number\",\n \"type\": \"mobile\",\n \"value\": contactValues[result.salesforceField]\n };\n updatedOptions.body.phoneNumbers.push(phoneNumbers);\n }\n\n }\n\n }\n\n if (result.jiveField == \"Home Phone Number\") {\n if (updatedOptions.body.phoneNumbers == \"undefined\") {\n var phoneNumbers = {\n \"jive_label\": \"Home Phone Number\",\n \"type\": \"home\",\n \"value\": contactValues[result.salesforceField],\n };\n\n updatedOptions.body.phoneNumbers.push(phoneNumbers);\n }\n else {\n var titleIndex = lodash.findIndex(updatedOptions.body.phoneNumbers, {'jive_label': 'Home Phone Number'});\n if (titleIndex != -1) {\n updatedOptions.body.phoneNumbers[titleIndex].value = contactValues[result.salesforceField];\n }\n else{\n var phoneNumbers = {\n \"jive_label\": \"Home Phone Number\",\n \"type\": \"home\",\n \"value\": contactValues[result.salesforceField]\n };\n updatedOptions.body.phoneNumbers.push(phoneNumbers);\n }\n\n }\n\n }\n\n\n if (result.jiveField == \"familyName\") {\n updatedOptions.body.name[result.jiveField] = contactValues[result.salesforceField];\n }\n\n\n if (result.jiveField == \"givenName\") {\n updatedOptions.body.name[result.jiveField] = contactValues[result.salesforceField];\n }\n\n\n if(result.jiveField == \"Email\"){\n console.log(\"dfdfsdf\");\n }\n\n\n if(result.jiveField == \"Location\"){\n updatedOptions.body[result.jiveField] = contactValues[result.salesforceField];\n }\n\n }\n });\n\n console.log(updatedOptions.body);\n updatedOptions.body = JSON.stringify(updatedOptions.body);\n request(updatedOptions, function (error, response, data) {\n if (!error && response.statusCode == 200) {\n // console.log(error);\n // console.log(data);\n data = JSON.parse(data);\n profileLogs.push({\n \"message\": \"User Updated in jive \",\n \"userId\": data.id,\n \"contactId\": contactValues.Email,\n \"status\": \"Success\",\n \"timestamp\": new Date()\n });\n callback(null);\n\n }\n else {\n data = JSON.parse(data);\n if (data.error.message) {\n profileLogs.push({\n \"message\": data.error.message,\n \"userId\": 0,\n \"contactId\": contactValues.Email,\n \"status\": \"Updation Failure\",\n \"timestamp\": new Date()\n });\n callback(null);\n }\n else {\n console.log(\"here\");\n // console.log(error);\n // console.log(response);\n data = JSON.stringify(data);\n console.log(\"data....\", data);\n profileLogs.push({\n \"message\": data,\n \"userId\": 0,\n \"contactId\": contactValues.Email,\n \"status\": \"Updation Failure\",\n \"timestamp\": new Date()\n });\n res.send(data);\n }\n }\n\n\n });\n}", "static async updateDashboard(email, dashboardID, fields, data) {\n\t\tdata = data.map((item, i) => (i < fields.length && fields[i] === 'metadata' ? JSON.stringify(item) : item));\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tDatabase.sendQuery(`UPDATE Dashboard SET ${fieldUpdates(fields, data, 2)} WHERE ( email = $1 ) AND ( ID = $2) RETURNING *;`, [email, dashboardID, ...data])\n\t\t\t\t.then((result) => {\n\t\t\t\t\t// console.log(result);\n\t\t\t\t\tif (result.rows.length > 0) resolve(result.rows[0]);\n\t\t\t\t\telse reject(result);\n\t\t\t\t})\n\t\t\t\t.catch((result) => reject(result));\n\t\t});\n\t}", "async setAirfieldData() {\n let n = 0;\n while(n < this.state.airfieldData.length) {\n await Meteor.call(\"updateAirfield\", this.state.airfieldData[n]);\n n++;\n }\n return null;\n }", "function reformatData(response,request, requestedFields) {\n console.log(\"In reformat data method\");\n \n //do not parse\n var formattedData = [];\n \n for(var i = 0; i < response.length; i++){\n var row = {'values': []};\n for(var m = 0; m < requestedFields.length; m++){\n var field = requestedFields[m];\n row.values.push(response[i][field]);\n }\n formattedData.push(row);\n }\n \n console.log(\"formattedData: \" + JSON.stringify(formattedData));\n \n \n \n return formattedData;\n}", "function Module(initial_array) {\n this.some_array = []\n if (initial_array) {\n this.some_array = initial_array.slice(0)\n }\n this.events = {}\n }", "function updateModelArray(targetArray, sourceArray, stepFn, chunkSize) {\n chunkSize = chunkSize || 5;\n var jj = 0, len = sourceArray.length;\n setTimeout(function () {\n function processNext() {\n for (var kk = 0; jj < len && kk < chunkSize; kk++, jj++) {\n var elm = sourceArray[jj];\n targetArray.push(elm);\n }\n\n var done = jj >= len;\n var cont = stepFn(done);\n\n if (!done && cont) {\n setTimeout(processNext, 0);\n }\n }\n processNext();\n }, 0);\n\n }", "setMultiple(filterFn, field, value) {\n const me = this,\n records = [],\n changes = [];\n me.forEach(r => {\n if (filterFn(r)) {\n changes.push(r.set(field, value, true));\n records.push(r);\n }\n }); // TODO: should consolidate with update, make it take an array instead? to only have to listen for one event outside of store?\n\n me.trigger('updateMultiple', {\n records,\n all: me.records.length === records.length\n });\n me.trigger('change', {\n action: 'updatemultiple',\n records,\n all: me.records.length === records.length\n });\n if (me.reapplyFilterOnUpdate && me.isFiltered) me.filter();\n }", "async function updateArray(userId) {\n\n return contactRef.doc(userId.value).update({\n UserContactData: firebase.firestore.FieldValue.arrayUnion(\"First contact\", \"second contact\")\n });\n}", "function changeArrayToObject(array) {\n\n}", "function update(index, value, array) {\n // TODO return a new copy of the array with the given value at index\n var newArr = array.slice();\n newArr[index] = value;\n return newArr;\n}", "set(id, fields) {\n let version = this._versions.get(id);\n\n let isNew = false;\n\n if (version) {\n Object.assign(version, fields);\n } else {\n version = _objectSpread(\n {\n _id: id,\n },\n fields\n );\n isNew = true;\n\n this._versions.set(id, version);\n }\n\n this._watchCallbacks.forEach((_ref2) => {\n let { fn, filter } = _ref2;\n\n if (!filter || filter === version._id) {\n fn(version, isNew);\n }\n });\n }", "function changeSearchableListValues(col, selectedArray, index, field) {\n\t\t\t//means we are editing one or more than one row and check box is selected.\n//\t\t\tfor (var index = 0; index < $scope.item.selectedItems.length; index++) {\n//\t\t\t\tvar item = $scope.item.selectedItems[index];\n//\t\t\t\tvar data = getDataById(item.id);\n//\t\t\t\tif (data != null) {\n//\t\t\t\t\tdata.searchableList = selectedArray;\n//\t\t\t\t}\n//\t\t\t}\n\t\t\tvar item = $scope.data[index];\n\t\t\tif (item != null) {\n\t\t\t\titem[field] = selectedArray;\n\t\t\t\t//TODO save to server..\n\t\t\t}\n\t\t}", "function changeModName() {\n //console.log('Modname' + modName);\n db.collection('modules')\n .doc(module.value)\n .update({\n 'module.name': modName,\n })\n .then(function () {\n console.log('modName updated successfully');\n history.push('/success');\n });\n }", "function updateItem(options) {\n\n var deferred = $q.defer();\n\n var defObject = {\n listName: false,\n data: false,\n id: false,\n fields: false\n };\n\n var settings = $.extend({}, defObject, options);\n\n if ((!settings.listName) && (!settings.data) && (!settings.id) && (!settings.fields)) {\n deferred.reject(settings);\n return deferred.promise;\n }\n\n var context = SP.ClientContext.get_current();\n\n var oList = context.get_web().get_lists().getByTitle(settings.listName);\n\n // query field by field name and value \n var oListItem = oList.getItemById(settings.id);\n\n\n settings.data = helperService.parse(settings.data, settings.fields.mappingToSP);\n delete settings.data.ID;\n\n //Bulk create list items\n $.each(settings.data, function (key, value) {\n // check if mutiple lookup\n if (Object.prototype.toString.call(value) === '[object Array]') {\n var lookups = [];\n $.each(value, function (i, lid) {\n var lookup = new SP.FieldLookupValue();\n lookup.set_lookupId(lid);\n lookups.push(lookup);\n });\n oListItem.set_item(key, lookups);\n } else {\n oListItem.set_item(key, value);\n }\n });\n\n oListItem.update();\n\n context.executeQueryAsync(success, fail);\n\n\n function success() {\n // load query details to json object\n var taskEntry = oListItem.get_fieldValues();\n deferred.resolve(helperService.parse(taskEntry, options.fields.mappingFromSP));\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 }" ]
[ "0.8652673", "0.70994407", "0.69737965", "0.6589965", "0.6513358", "0.6509463", "0.59435564", "0.5773354", "0.5769816", "0.5576439", "0.55589837", "0.55294067", "0.54397786", "0.5399783", "0.5358418", "0.53507483", "0.530652", "0.5295252", "0.5295252", "0.5285423", "0.5277235", "0.525803", "0.52191067", "0.51791704", "0.51658857", "0.5165864", "0.51583374", "0.51289386", "0.5128533", "0.51214904", "0.5108588", "0.5095027", "0.50791276", "0.50618553", "0.5056874", "0.50554085", "0.50553656", "0.5038779", "0.49957907", "0.49940816", "0.49871278", "0.49748585", "0.4950098", "0.49301964", "0.4927337", "0.49110395", "0.48945034", "0.48908958", "0.48880246", "0.48813576", "0.48496428", "0.48487338", "0.48458794", "0.48455724", "0.48443887", "0.48408628", "0.483697", "0.48369068", "0.48342806", "0.4832561", "0.48295796", "0.48218337", "0.4818046", "0.48158953", "0.4813075", "0.4813048", "0.4806103", "0.4799531", "0.47569495", "0.47545034", "0.47527748", "0.47512892", "0.47443736", "0.4744108", "0.47400248", "0.4739386", "0.47386295", "0.47384396", "0.47321117", "0.4726556", "0.4725819", "0.47209638", "0.4720144", "0.47153845", "0.4714923", "0.47027326", "0.4700571", "0.46837318", "0.46830645", "0.46762335", "0.4666136", "0.4661912", "0.4660278", "0.465559", "0.46503523", "0.46447796", "0.46409106", "0.46373224", "0.46370944", "0.4621595" ]
0.84816843
1
Clears the query params
clearQueryParams() { this.queryParams = {}; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "removeAllURLQueryString() {\n delete this.urlObj.search;\n }", "clearQs() {\n this.forwardQueryString = false;\n this.queryString = {};\n return this;\n }", "clearInitialSearch() {\n const params = this.params();\n delete params.q;\n\n m.route(app.route(this.searchRoute, params));\n }", "reset() {\n this.set('query', '');\n }", "clearQueryString () {\n window.history.replaceState({}, null, this._getPathFromUrl())\n }", "function clearUrlQuery() {\n if (window.location.search && window.history && window.history.pushState) {\n window.history.pushState({}, document.title, window.location.pathname);\n }\n}", "function clearQueryString() { // jshint ignore:line\n const newurl = window.location.protocol + \"//\" + window.location.host + window.location.pathname;\n window.history.pushState && window.history.pushState({\n path: newurl\n }, \"\", newurl);\n }", "reset() {\n if (this._queryStartKey) {\n this._queryStartKey = undefined;\n }\n if (this._querySkip) {\n this._querySkip = undefined;\n }\n if (this.isSearch) {\n this.isSearch = false;\n }\n if (this.querying) {\n this._querying = false;\n }\n if (this.requests) {\n this.requests = undefined;\n }\n }", "deleteURLQueryString(key) {\n const searchParams = new URL.URLSearchParams(this.urlObj.search);\n searchParams.delete(key);\n this.urlObj.search = searchParams.toString();\n }", "clear() { \n this.state.page=0;\n this.state.filters='';\n this.state.search='';\n document.getElementById('searchInput').value = '';\n for (var key in this.state.listFilters){\n document.getElementById(key).value='';\n this.state.listFilters[key]='';\n this.state.filters='';\n } \n this.loadData(''); \n }", "async clearSelectedFilters(lens) {\n if (lens) {\n await this.$store.dispatch('resetFilterState', { resourceName: this.resourceName, lens })\n } else {\n await this.$store.dispatch('resetFilterState', { resourceName: this.resourceName })\n }\n\n this.updateQueryString({\n [this.pageParameter]: 1,\n [this.filterParameter]: '',\n })\n }", "_clearFilterInput() {\r\n const that = this;\r\n\r\n that._filterInfo.query = '';\r\n delete that._filterInfo.inputFilters;\r\n that.$.filterInput.value = '';\r\n }", "clearQuery() {\n this.setState({\n query: '',\n value: 'none',\n })\n }", "_reset () {\n if (this._queryable || this.reset) {\n if (this.reset) {\n // If there's a reset method available, run that\n this.reset()\n } else {\n // If queryable, clear the query string\n window.history.replaceState({}, null, this._getPathFromUrl())\n // Reload the video\n window.location.reload()\n }\n }\n }", "clear() {\n this.queries.length = 0;\n }", "clearSearch() {\n this.props.Store.setQuery('');\n }", "function resetSearch(query) {\n\n if (query !== \"date\"){\n datesearch.property(\"value\", \"\");\n }\n if (query !== \"city\"){\n citysearch.property(\"value\", \"\");\n }\n if (query !== \"state\"){\n statesearch.property(\"value\", \"\");\n }\n if (query !== \"country\"){\n countrysearch.property(\"value\", \"\");\n }\n if (query !== \"shape\"){\n shapesearch.property(\"value\", \"\");\n }\n if (query !== \"comment\"){\n commentsearch.property(\"value\", \"\");\n }\n}", "clear() {\n window.location.href = this.collectionData.url + Utils.getQueryString();\n }", "function clearLastQuery()/*:void*/ {\n this.lastQuery = null;\n }", "function clearForm(){\r\n\t$('#param-values').empty();\r\n}", "function reset(){\n\t/* MAKE URL */\n\tselected.clear();\n\twindow.location.href = makeQueryString();\n}", "clearPrivateParams() {\n if (this.isDummy()) {\n return;\n }\n\n Object.keys(this.privateParams).forEach(name => {\n const param = this.privateParams[name];\n param.fill(0);\n delete this.privateParams[name];\n });\n this.privateParams = null;\n this.isEncrypted = true;\n }", "function resetFilters() {\n\n $('#title-search').val('');\n\t$('#categories').val('all');\n\t$('#countries').val('all');\n $('#years').val('all');\n\n send_data['title'] = '';\n\tsend_data['category'] = '';\n\tsend_data['country'] = '';\n send_data['year'] = '';\n\tsend_data['format'] = 'json';\n}", "deleteParams(filter){\n\n\t\tdelete this.attributes.params[filter];\n\n\t\tthis.sendParams();\n\n\t}", "function removeParamsFromUrl(paramKey) {\n\n\n var nextUrl = window.location.origin + window.location.pathname;\n\n var params = getUrlVars(); //Get all the query params as an ARRAY\n params[paramKey] = '';\n var size = Object.keys(params).length;\n var i = 0;\n if (size == 0) {\n window.location.href = window.location.origin + window.location.pathname;\n } else {\n nextUrl += '?'; // ? for started to attach the query string to url\n\n // This is for search,selection by any one of ways => BRAND or SEARCH Keyword\n if (paramKey == 'search' && params['brand'] != undefined) {\n params['brand'] = '';\n }\n if (paramKey == 'brand' && params['search'] != undefined) {\n params['search'] = '';\n }\n\n // Attach the query params to the nextURL \n $.each(params, function(key, value) {\n if (value != '') {\n if (i == size) {\n nextUrl += key + '=' + value;\n } else {\n nextUrl += key + '=' + value + '&';\n }\n }\n\n i++;\n });\n\n window.location.href = nextUrl;\n }\n}", "function clearFilter(){\n vm.search = '';\n }", "function reset_search()\n {\n $(rcmail.gui_objects.qsearchbox).val('');\n\n if (search_request) {\n search_request = search_query = null;\n fetch_notes();\n }\n }", "function clear_search()\r\n {\r\n $(\"#home_grid\").jqGrid('setGridParam', {\r\n datatype: 'json'\r\n }).trigger('reloadGrid');\r\n }", "static clearQueryData() {\n this.standardizeQueryData();\n queryData[this.className()] = {};\n }", "function resetAllSearchVals(){\n search_term = '';\n page = 1;\n classFilter = 'collection';\n typeFilter = 'All';\n groupFilter = 'All';\n subjectFilter = 'All';\n gcmdFilter='All';\n fortwoFilter='All';\n forfourFilter='All';\n forsixFilter='All';\n resultSort = 'score desc';\n temporal = 'All'; \n n = '';\n e = '';\n s='';\n w='';\n mapSearch=0;\n spatial_included_ids=''; \n }", "function clearQueryData() {\n\t\t\tlastLogStamp = 0;\n\t\t\t$timeout.cancel(queryLogsTimeout);\n\t\t\t$timeout.cancel(displayLogsTimeout);\n\t\t\tcurQueryId = \"\";\n\t\t\t$scope.resultsAvailable = false;\n\t\t\t$scope.queryLogsBusy = false;\n\t\t\t$scope.resultsBusy = false;\n\t\t\t$scope.data.logs = [];\n\t\t\tupdateLogsText();\n\t\t\t$scope.data.queryResponse.schema = [];\n\t\t\t$scope.data.queryResponse.results = [];\n\t\t}", "function clearInputs() {\r\n $('#user-query').val(\"\");\r\n}", "reset() {\n this._results = [];\n this._resultsCache = {};\n this._isSearching = false;\n this.updateQuery(\"\");\n }", "_clearFilter() {\n hashHistory.push({pathname: \"/users\", query: {}})\n }", "function set_url_params(query, init_query) {\n var base_url = script_vars.current_url;\n var base_url_depaged = script_vars.current_url_depaged;\n var url = '';\n\n Object.keys(query).forEach(function(key) {\n console.log(query[key])\n // Go through each query key and set/delete url param\n if (typeof query[key] != 'undefined') {\n if(url) {\n url += '&';\n }\n url+= key + '=' + query[key];\n }\n })\n\n if(url) {\n url = '?' + url;\n }\n\n // If query has changed navigate to depaged base url (reset the page)\n if (query !== init_query) {\n // TODO - determine whether we need to detect page has not changed\n base_url = base_url_depaged;\n }\n\n window.location = base_url + url;\n }", "function resetAllExceptKeywordRequest() {\n\t$('#catId').val(0);\n\t$('#order').val(4);\n\t$('#brands').val('');\n\t$('#pageIndex').val(1);\n\t$('#keyWord').blur();\n\thideBrandsBox();\n\tappui.showHUD('正在加载');\n\trequestGoodList();\n}", "function cleanSearch() {\n setOrigin(null);\n setDestination(null);\n setSearchAvailable(false);\n setSearchPending(false);\n setSearchResults(null);\n setSearchError(false);\n }", "clear() {\n this.autocompleteCache = [];\n this.internalQuery = null;\n this.autocompleteSelectedQuery = null;\n this.autocomplete.perform();\n }", "function clearsearch() {\n searchResultArray.clear();\n searchTrailArray.clear();\n}", "reset() {\n this._query = '';\n this._note = '';\n this._expiresText = '';\n this._errMsg = '';\n this._render();\n }", "function resetParam(name) {\n\t(0, _trackMap.deleteMarker)(params[name].name);\n\tparams[name] = {};\n\t(0, _submitButton.resetCalc)();\n}", "function clearSearch() {\n clearPlaces();\n \n // Remove home marker\n if (homeMarker) {\n homeMarker.setMap(null);\n homeMarker = null;\n }\n home = null;\n\n // Reset map\n map.setCenter({lat: 36.150813, lng: -40.352239});\n map.setZoom(4);\n \n // Remove search input\n document.getElementById('addressInput').value = '';\n document.getElementById(HOURS_ID).value = '';\n document.getElementById(MINUTES_ID).value = '';\n $('.multi-select-pill').removeClass('selected');\n}", "function clear () {\n self.searchTerm = '';\n search();\n }", "clearUserSearch() {\n this.get('searchResults').length = 0;\n this.set('totalSearchResults', 0);\n }", "function clearAll() {\n\n\t\t\t// Clear the sorts and filters, defer the query\n \tclearAllSorts();\n \tclearAllFilters();\n\n }", "function removeQueryStringParm(parm, saveStateInd) {\r\n\r\n var parms = [];\r\n if (typeof parm === \"string\") {\r\n parms.push(parm);\r\n } else {\r\n parms = parm;\r\n }\r\n var qs = convertQueryStringToObj();\r\n $.each(parms, function(i, item) {\r\n delete qs[item];\r\n });\r\n \r\n var newqs = convertObjToQueryString(qs);\r\n if (saveStateInd) {\r\n var currURL = window.location.protocol + \"//\" + window.location.host + window.location.pathname + newqs;\r\n if (history.pushState) {\r\n history.pushState({}, \"ignored title\", currURL); \r\n }\r\n }\r\n\r\n return ;\r\n}", "function Clear_Search()\n{\n\tdocument.getElementById(\"AppSearchAllCriteriaType1\").value = \"application_id\";\n\tdocument.getElementById(\"AppSearchAllCriteriaType2\").value = \"\";\n\tdocument.getElementById(\"AppSearchAllDeliminator1\").value = \"is\";\n\tdocument.getElementById(\"AppSearchAllDeliminator2\").value = \"is\";\n\tdocument.getElementById(\"AppSearchAllCriteria1\").value = \"\";\n\tdocument.getElementById(\"AppSearchAllCriteria2\").value = \"\";\n\tdocument.getElementById(\"AppSearchAllOption\").checked = false;\n}", "function removeValueQuery(key, value) {\n\tarray = urlParams.getAll(key).filter((el) => el != value);\n\turlParams.delete(key);\n\tarray.forEach((el) => {\n\t\turlParams.append(key, el.replaceAll(' ', '-'));\n\t});\n}", "_setQueryStringOptions () {\n this.qs = this._get('qs', {})\n }", "function clearDBQuery(){\n $('#dataBrowserQueryText').val('');\n onQueryTextChange();\n}", "clearClause() {\n this.filterClause = '';\n this.filterClauseKey.value = '';\n this.filterClauseInclExcl.value = 'includes';\n this.filterClauseSev.value = '';\n this.filterClauseCat.value = '';\n this.filterClauseAddAnd.disabled = true;\n this.filterClauseAddOr.disabled = true;\n }", "clearSearch(){\n let input = document.querySelector('#photo-search');\n\t\tinput.value = '';\n this.total_results = 0;\n this.is_search = false;\n this.search_term = '';\n }", "function remove_query_arg(key, sourceURL) {\r\n\r\n var rtn = sourceURL.split(\"?\")[0],\r\n param,\r\n params_arr = [],\r\n queryString = (sourceURL.indexOf(\"?\") !== -1) ? sourceURL.split(\"?\")[1] : \"\";\r\n\r\n if (queryString !== \"\") {\r\n params_arr = queryString.split(\"&\");\r\n for (var i = params_arr.length - 1; i >= 0; i -= 1) {\r\n param = params_arr[i].split(\"=\")[0];\r\n if (param === key) {\r\n params_arr.splice(i, 1);\r\n }\r\n }\r\n\r\n rtn = rtn + \"?\" + params_arr.join(\"&\");\r\n\r\n }\r\n\r\n if (rtn.split(\"?\")[1] == \"\") {\r\n rtn = rtn.split(\"?\")[0];\r\n }\r\n\r\n return rtn;\r\n }", "function delete2Params(param1, param2) {\n var searchParams = new URLSearchParams(url.search.slice(1))\n\n //delete the param\n searchParams.delete(param1)\n searchParams.delete(param2)\n\n //load up new url\n var newUrl = \"?\" + searchParams.toString()\n toNewURL(newUrl)\n }", "function remove_param(name) {\n var params = get_params();\n var index = params.search('&' + name + '=');\n if (index === -1) {\n return;\n }\n var start = index + ('&' + name + '=').length;\n var end_index = params.substr(start).search('&');\n if (end_index < 0) {\n params = params.substr(0, index);\n } else {\n params = params.substr(0, index) + params.substr(start + end_index);\n }\n set_cookie('params', params);\n}", "function removeParam() {\n window.history.pushState({}, document.title, \"/trade\");\n }", "clear()\n {\n this._keywordByFilter.clear();\n this._simpleFiltersByKeyword.clear();\n this._complexFiltersByKeyword.clear();\n this._compiledPatternsByKeyword.clear();\n this._keywordlessCompiledPatterns = false;\n this._filterDomainMapsByKeyword.clear();\n this._filterMapsByType.clear();\n }", "function clearFilters() {\n searchName = null;\n searchMemberKey = null;\n orderBy = null;\n viewTotal = 200;\n showOnlyParentGroups = true;\n flattenGroups = false;\n\n document.getElementById(\"search\").value = \"\";\n document.getElementById(\"user-sel\").value = searchMemberKey;\n document.getElementById(\"order-by-sel\").value = orderBy;\n document.getElementById(\"view-total-groups-sel\").value = viewTotal;\n document.getElementById(\"parent-groups-check\").checked = showOnlyParentGroups;\n document.getElementById(\"flatten-groups-check\").checked = flattenGroups;\n\n getAllGroups();\n}", "clear(shouldTriggerQuery = true) {\n if (this.$filterElm && this.$selectOperatorElm) {\n this._clearFilterTriggered = true;\n this._shouldTriggerQuery = shouldTriggerQuery;\n this.searchTerms = [];\n this.$selectOperatorElm.val(0);\n this.$filterInputElm.val('');\n this.onTriggerEvent(null);\n }\n }", "clear(shouldTriggerQuery = true) {\n if (this.$filterElm) {\n this._clearFilterTriggered = true;\n this._shouldTriggerQuery = shouldTriggerQuery;\n this.searchTerms = [];\n this._currentValues = [];\n this.$filterElm.val('');\n this.$filterElm.trigger('change');\n }\n }", "function clearFilter() {\n loadOsListAll();\n setFiltered(false);\n }", "reset() {\n this.router.clear();\n this.calls.clear();\n }", "function resetAddressSearch() {\n $('.searchbox').val('');\n addressPoint.clearLayers();\n addressPoint.closePopup();\n }", "clearFilters() {\n this.filters.clear();\n this.filter();\n }", "function clearSearchFormData(){\r\n\t$(\"#free-time\").val(\"\");\r\n\t// Grab select field, select the relevant option, de-select any others and refresh.\r\n\tvar plrs = $('#select-players');\r\n\tplrs.val('').attr('selected', true).siblings('option').removeAttr('selected');\r\n\tplrs.selectmenu(\"refresh\", true);\r\n\t}", "componentDidMount() {\n this.clearQuery()\n }", "function clearForm(){\n\t$('#departure_city').prop('selectedIndex',0);\n\t$('#arrival_city').prop('selectedIndex',0);\n\t$('input[name=\"sort_route\"]').prop('checked', false);\n\t\n\t$('#search').trigger('click');\n\t\n}", "function clear() {\n vm.searchText = null;\n }", "function clearSearchResults() {\n document.getElementById('clear_search_results').style.display = 'none';\n document.getElementById('tags_nav').style.display = 'initial';\n document.getElementById('categories_nav').style.display = 'initial';\n document.getElementById('search').value = '';\n popParamFromURL('searchTerm');\n savedNavURL = false;\n displayTen();\n}", "clearAuthData (state) {\n state.token = null\n state.userId = null\n state.user = null\n }", "@task\n *resetFilters() {\n yield super.setupForm(FILTER_FORM_UUID);\n this.updateQueryParams();\n this.registerObserver();\n }", "clearFilter(){\n\t\tthis.filtered = [];\n\t}", "clearInput(input, event) {\n event.preventDefault();\n console.log(\"clearInput: \" + input);\n if( input == 'terms' ) {\n let filters = this.props.filters;\n filters.terms_search = '';\n filters.resource_filter = null;\n filters.group_filter = null;\n filters.employer_id_filter = null;\n filters.do_terms_search = true;\n filters.do_time_search = true;\n this.props.setFilter( filters );\n\n } else if( input == 'units' ) {\n let filters = this.props.filters;\n filters.units_search = '';\n filters.unit_filter = null;\n filters.do_units_filtering = true;\n filters.do_time_search = true;\n this.props.setFilter( filters );\n }\n }", "clear(shouldTriggerQuery = true) {\n if (this.flatInstance && this.$selectOperatorElm) {\n this._clearFilterTriggered = true;\n this._shouldTriggerQuery = shouldTriggerQuery;\n this.searchTerms = [];\n this.$selectOperatorElm.val(0);\n this.flatInstance.clear();\n }\n }", "function clearLookupValues(filter){\n filter.lookupResults = [];\n $scope.data.searchVal = '';\n}", "function clearFilters() {\n setDefaults();\n if(index != -1){\n submit();\n }\n}", "clearSearchResults() {\n this.fetchConsumerList()\n this.setState({ isFilterApplied: false })\n this.props.history.push(`/home/consumers`)\n }", "function clearSearchForm() {\n \"use strict\";\n setFormHairType(\"short\");\n setFormTraits(\"\");\n}", "function clearFilters(){\n $('.js-filter-beds').prop('selectedIndex', 0);\n $('.js-filter-baths').prop('selectedIndex', 0);\n $('.js-filter-gender').prop('selectedIndex', 0);\n $('.js-filter-price').val('');\n $('.js-filter-reward').attr('checked', false);\n}", "function wipeUrlProps(options) {\n\t for (var i = 0, l = urlProps.length; i < l; ++i) {\n\t options[urlProps[i]] = null;\n\t }\n\t}", "function clearSelected() {\n selectedUser = null;\n selectedUserId = null;\n editIndex = null;\n }", "function clearSearch () {\n try {\n $rootScope.search_result = [];\n }\n catch (err) {\n console.error (`Clear search results problem: ${err}`);\n }\n }", "clear(shouldTriggerQuery = true) {\n if (this.$filterElm) {\n this._clearFilterTriggered = true;\n this._shouldTriggerQuery = shouldTriggerQuery;\n this.searchTerms = [];\n this.$filterElm.val('');\n this.$filterElm.trigger('keyup');\n }\n }", "clear(shouldTriggerQuery = true) {\n if (this.$filterElm) {\n this._clearFilterTriggered = true;\n this._shouldTriggerQuery = shouldTriggerQuery;\n this.searchTerms = [];\n this.$filterElm.val('');\n this.$filterElm.trigger('keyup');\n }\n }", "removeQuery(url) {\n return url ? url.replace(/\\?.*$/, '') : '';\n }", "function clearFilterInput(e) {\n inputFilter.value = '';\n headerState(e);\n}", "function clearInput() {\n\tresults.value = \"\";\n}", "function unloadParams() {\r\n try {\r\n var cur_params = window.location.search.replace(/%20/g, \" \").split(\"?\").join(\"\").split(\",\");\r\n var cclParams = \"^MINE^\";\r\n \t// Get Application and Personnel details\r\n \t\tAjaxHandler.ajax_request({\r\n\t\t\t\trequest : {\r\n\t\t\t\t\ttype : \"XMLCCLREQUEST\",\r\n\t\t\t\t\ttarget : \"inn_mp_get_app_prsnl\",\r\n\t\t\t\t\tparameters : cclParams,\r\n\t\t\t\t\tsynchronous: true\r\n\t\t\t\t},\r\n\t\t\t\tresponse : {\r\n\t\t\t\t\ttype : \"JSON\",\r\n\t\t\t\t\ttarget : function(scriptResponse){\r\n\t\t\t\t\t\tvar recordData = scriptResponse.response.RECORD_DATA;\r\n\t\t\t\t\t\t// set criterion values if empty/not specified\r\n\t\t\t\t\t\tif(criterion.application_id == 0){\t\t\r\n\t\t\t\t \tcriterion.application_id = recordData.APPLICATION_NBR;\r\n\t\t\t\t }\r\n\t\t\t\t if(criterion.personnel_id == 0){\t\t\r\n\t\t\t\t \tcriterion.personnel_id = recordData.PERSONNEL_ID;\r\n\t\t\t\t }\r\n\t\t\t\t if(criterion.position_cd == 0){\t\t\t\t\t \t\r\n\t\t\t\t \tcriterion.position_cd = recordData.PERSONNEL_POSITION_CD;\r\n\t\t\t\t }\r\n \t\t\t\t// set criterion values based on parameters\r\n\t\t\t\t\t\tsetCriterion(cur_params);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n } catch (e) {\r\n errmsg(e.message, \"unloadParams()\");\r\n }\r\n }", "clear()\n {\n let {_filters} = this;\n\n if (_filters.size == 0)\n return;\n\n _filters.clear();\n\n this.emit(\"snippets.filtersCleared\");\n }", "function clearSearch() {\n $(\"#search-input\").val(\"\");\n var value = $(\"#search-input\").val();\n\n $(\"#parent-table\").remove();\n $(\"#pagination-info\").remove();\n saveSearchString(value);\n populateTable();\n $('#search-input').val(value);\n}", "clear() {\n super.clear();\n\n if (this.getInitialSearch()) {\n this.clearInitialSearch();\n } else {\n m.redraw();\n }\n }", "function resetAdvFilters() {\n\n\t$('#adv_filter_state option:selected').attr('selected', false);\n\t$('#adv_filter_state option:first').attr('selected', 'selected');\n\t\n\t$('#adv_filter_locality option:selected').attr('selected', false);\n\t$('#adv_filter_locality option:first').attr('selected', 'selected');\n\t\n\t$('#adv_filter_cinema option:selected').attr('selected', false);\n\t$('#adv_filter_cinema option:first').attr('selected', 'selected');\n\t\n\t$('#adv_result_count').empty();\n\t$('#adv_result_hidden').empty();\n\n}", "clear() {\n this._selectedFilesMetaData = [];\n this.uploadResponse = [];\n this.modelValue = [];\n }", "function clear(){\n\n var http = new XMLHttpRequest();\n var url = 'http://localhost:8091/radix/clear';\n var params = 'orem=ipsum&name=binny';\n http.open('GET', url, true);\n\n http.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');\n\n http.onreadystatechange = function() {\n if(http.readyState == 4 && http.status == 200) {\n console.log(http.responseText);\n // alert(http.responseText);\n\n }\n }\n http.send(params);\n\n}", "clearFilter() {\n if (!this.settings.filterable) {\n return;\n }\n\n this.clearFilterFields();\n\n this.applyFilter();\n this.element.trigger('filtered', { op: 'clear', conditions: [] });\n }", "@action.bound\n resetFilter() {\n this.filterSongName = '';\n this.filterArtistName = '',\n this.filterGradesRange = [1, 5];\n }", "clear() {\n this.searchModule.textSearchResults.clearResults();\n this.searchModule.clearSearchHighlight();\n this.searchModule.viewer.renderVisiblePages();\n }", "function resetValues () {\n $(\"#searchTerm\").val(\"\");\n $(\"#sel1\").val(\"\");\n $(\"#startYear\").val(\"\");\n $(\"#endYear\").val(\"\"); \n }", "_handleRequestUpdateClear(options)\n {\n this._updater.clear();\n }", "clearFilters()\n {\n this._filterText = [];\n this._filterTextIndex.clear();\n }" ]
[ "0.7641261", "0.75850177", "0.7096127", "0.7081908", "0.7053546", "0.70035225", "0.6965717", "0.69373214", "0.67906666", "0.6681247", "0.6549215", "0.65451187", "0.64949024", "0.6426417", "0.64178604", "0.6417518", "0.63831586", "0.6334712", "0.63329154", "0.6330536", "0.6310441", "0.62950426", "0.6291418", "0.6245377", "0.6229312", "0.6192033", "0.61899996", "0.61670303", "0.6153861", "0.6148208", "0.6131474", "0.60899127", "0.6088945", "0.6041408", "0.6032844", "0.6003636", "0.6001068", "0.59848535", "0.5967183", "0.59505486", "0.594919", "0.59287995", "0.5911643", "0.59105515", "0.59076905", "0.58923835", "0.5891337", "0.58796716", "0.5874388", "0.58578", "0.5856874", "0.58543867", "0.58482975", "0.58479595", "0.5841024", "0.5840767", "0.584006", "0.58233815", "0.58211166", "0.5816214", "0.5816048", "0.5815349", "0.57939005", "0.57862043", "0.5782798", "0.5751942", "0.572022", "0.57025224", "0.568481", "0.56730276", "0.56591594", "0.5628048", "0.5625433", "0.56207466", "0.5610886", "0.561014", "0.56093836", "0.56087434", "0.5606168", "0.56028366", "0.56010157", "0.5594548", "0.55924654", "0.55924654", "0.5588068", "0.55840725", "0.55832946", "0.5582999", "0.5579724", "0.55783165", "0.55739766", "0.55699146", "0.55696744", "0.55555516", "0.5550684", "0.5536458", "0.55310994", "0.5528104", "0.55147266", "0.55124843" ]
0.8285499
0
Clones the query params
_cloneQueryParams() { var extend = function (object) { const scratch = {}; Object.keys(object).forEach((key) => { const value = object[key]; if (Array.isArray(value)) { scratch[key] = value.splice(0); } else if (typeof value === 'object') { scratch[key] = extend(value); } else { scratch[key] = value; } }, this); return scratch; }; return extend(this.queryParams); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "clearQueryParams() {\n this.queryParams = {};\n }", "clearQs() {\n this.forwardQueryString = false;\n this.queryString = {};\n return this;\n }", "addQueryParams(additionalQueryParams) {\n for (const key in additionalQueryParams) {\n if (additionalQueryParams.hasOwnProperty(key)) {\n if (additionalQueryParams[key] !== this._queryParams[key]) {\n //changes detected.\n this._queryParams = _.assign({}, this._queryParams, additionalQueryParams);\n this._invalidateSettings();\n break;\n }\n }\n }\n }", "removeAllURLQueryString() {\n delete this.urlObj.search;\n }", "function set_url_params(query, init_query) {\n var base_url = script_vars.current_url;\n var base_url_depaged = script_vars.current_url_depaged;\n var url = '';\n\n Object.keys(query).forEach(function(key) {\n console.log(query[key])\n // Go through each query key and set/delete url param\n if (typeof query[key] != 'undefined') {\n if(url) {\n url += '&';\n }\n url+= key + '=' + query[key];\n }\n })\n\n if(url) {\n url = '?' + url;\n }\n\n // If query has changed navigate to depaged base url (reset the page)\n if (query !== init_query) {\n // TODO - determine whether we need to detect page has not changed\n base_url = base_url_depaged;\n }\n\n window.location = base_url + url;\n }", "function clearQueryString() { // jshint ignore:line\n const newurl = window.location.protocol + \"//\" + window.location.host + window.location.pathname;\n window.history.pushState && window.history.pushState({\n path: newurl\n }, \"\", newurl);\n }", "function queryParams() {\n const params = {};\n urlBase.searchParams.forEach((value, key) => {\n params[key] = value;\n });\n\n return params;\n }", "function queryParams() {\n const params = {};\n urlBase.searchParams.forEach((value, key) => {\n params[key] = value;\n });\n\n return params;\n }", "deleteURLQueryString(key) {\n const searchParams = new URL.URLSearchParams(this.urlObj.search);\n searchParams.delete(key);\n this.urlObj.search = searchParams.toString();\n }", "getQueryParameters(queryParameters, routeParams) {\n const urlSearchParams = new URLSearchParams(queryParameters);\n const dictParams = Object.fromEntries(urlSearchParams.entries());\n Object.keys(dictParams).forEach(key => {\n routeParams[key] = dictParams[key];\n });\n }", "getQueryParameters(queryParameters, routeParams) {\n const urlSearchParams = new URLSearchParams(queryParameters);\n const dictParams = Object.fromEntries(urlSearchParams.entries());\n Object.keys(dictParams).forEach(key => {\n routeParams[key] = dictParams[key];\n });\n }", "_prepare(params_orig) {\n let pars = [];\n for (let par in params_orig) {\n pars.push({ name: par, values: params_orig[par] });\n }\n\n this._combinations = [{}];\n for (let i = 0; i < pars.length; i++) {\n let collected_new = [];\n for (let obj of this._combinations) {\n for (let j = 0; j < pars[i].values.length; j++) {\n let obj2 = this.clone(obj);\n obj2[pars[i].name] = pars[i].values[j];\n collected_new.push(obj2);\n }\n }\n this._combinations = collected_new;\n }\n this._params = pars;\n }", "function clearUrlQuery() {\n if (window.location.search && window.history && window.history.pushState) {\n window.history.pushState({}, document.title, window.location.pathname);\n }\n}", "parseQueryParam(params) {\n const key = matchQueryParams(this.remaining);\n\n if (!key) {\n return;\n }\n\n this.capture(key);\n let value = '';\n\n if (this.consumeOptional('=')) {\n const valueMatch = matchUrlQueryParamValue(this.remaining);\n\n if (valueMatch) {\n value = valueMatch;\n this.capture(value);\n }\n }\n\n const decodedKey = decodeQuery(key);\n const decodedVal = decodeQuery(value);\n\n if (params.hasOwnProperty(decodedKey)) {\n // Append to existing values\n let currentVal = params[decodedKey];\n\n if (!Array.isArray(currentVal)) {\n currentVal = [currentVal];\n params[decodedKey] = currentVal;\n }\n\n currentVal.push(decodedVal);\n } else {\n // Create a new value\n params[decodedKey] = decodedVal;\n }\n }", "_setQueryStringOptions () {\n this.qs = this._get('qs', {})\n }", "parseQueryParam(params) {\n const key = matchQueryParams(this.remaining);\n if (!key) {\n return;\n }\n this.capture(key);\n let value = '';\n if (this.consumeOptional('=')) {\n const valueMatch = matchUrlQueryParamValue(this.remaining);\n if (valueMatch) {\n value = valueMatch;\n this.capture(value);\n }\n }\n const decodedKey = decodeQuery(key);\n const decodedVal = decodeQuery(value);\n if (params.hasOwnProperty(decodedKey)) {\n // Append to existing values\n let currentVal = params[decodedKey];\n if (!Array.isArray(currentVal)) {\n currentVal = [currentVal];\n params[decodedKey] = currentVal;\n }\n currentVal.push(decodedVal);\n }\n else {\n // Create a new value\n params[decodedKey] = decodedVal;\n }\n }", "parseQueryParam(params) {\n const key = matchQueryParams(this.remaining);\n if (!key) {\n return;\n }\n this.capture(key);\n let value = '';\n if (this.consumeOptional('=')) {\n const valueMatch = matchUrlQueryParamValue(this.remaining);\n if (valueMatch) {\n value = valueMatch;\n this.capture(value);\n }\n }\n const decodedKey = decodeQuery(key);\n const decodedVal = decodeQuery(value);\n if (params.hasOwnProperty(decodedKey)) {\n // Append to existing values\n let currentVal = params[decodedKey];\n if (!Array.isArray(currentVal)) {\n currentVal = [currentVal];\n params[decodedKey] = currentVal;\n }\n currentVal.push(decodedVal);\n }\n else {\n // Create a new value\n params[decodedKey] = decodedVal;\n }\n }", "parseQueryParam(params) {\n const key = matchQueryParams(this.remaining);\n if (!key) {\n return;\n }\n this.capture(key);\n let value = '';\n if (this.consumeOptional('=')) {\n const valueMatch = matchUrlQueryParamValue(this.remaining);\n if (valueMatch) {\n value = valueMatch;\n this.capture(value);\n }\n }\n const decodedKey = decodeQuery(key);\n const decodedVal = decodeQuery(value);\n if (params.hasOwnProperty(decodedKey)) {\n // Append to existing values\n let currentVal = params[decodedKey];\n if (!Array.isArray(currentVal)) {\n currentVal = [currentVal];\n params[decodedKey] = currentVal;\n }\n currentVal.push(decodedVal);\n }\n else {\n // Create a new value\n params[decodedKey] = decodedVal;\n }\n }", "parseQueryParam(params) {\n const key = matchQueryParams(this.remaining);\n if (!key) {\n return;\n }\n this.capture(key);\n let value = '';\n if (this.consumeOptional('=')) {\n const valueMatch = matchUrlQueryParamValue(this.remaining);\n if (valueMatch) {\n value = valueMatch;\n this.capture(value);\n }\n }\n const decodedKey = decodeQuery(key);\n const decodedVal = decodeQuery(value);\n if (params.hasOwnProperty(decodedKey)) {\n // Append to existing values\n let currentVal = params[decodedKey];\n if (!Array.isArray(currentVal)) {\n currentVal = [currentVal];\n params[decodedKey] = currentVal;\n }\n currentVal.push(decodedVal);\n }\n else {\n // Create a new value\n params[decodedKey] = decodedVal;\n }\n }", "parseQueryParam(params) {\n const key = matchQueryParams(this.remaining);\n if (!key) {\n return;\n }\n this.capture(key);\n let value = '';\n if (this.consumeOptional('=')) {\n const valueMatch = matchUrlQueryParamValue(this.remaining);\n if (valueMatch) {\n value = valueMatch;\n this.capture(value);\n }\n }\n const decodedKey = decodeQuery(key);\n const decodedVal = decodeQuery(value);\n if (params.hasOwnProperty(decodedKey)) {\n // Append to existing values\n let currentVal = params[decodedKey];\n if (!Array.isArray(currentVal)) {\n currentVal = [currentVal];\n params[decodedKey] = currentVal;\n }\n currentVal.push(decodedVal);\n }\n else {\n // Create a new value\n params[decodedKey] = decodedVal;\n }\n }", "loadQueryParams() {\n queryParamsToFormStore(\n this.args.queryParams,\n this.formStore,\n this.sourceNode\n );\n }", "clearQueryString () {\n window.history.replaceState({}, null, this._getPathFromUrl())\n }", "function delete2Params(param1, param2) {\n var searchParams = new URLSearchParams(url.search.slice(1))\n\n //delete the param\n searchParams.delete(param1)\n searchParams.delete(param2)\n\n //load up new url\n var newUrl = \"?\" + searchParams.toString()\n toNewURL(newUrl)\n }", "makeQueryData () {\n\t\t// remove the parameter in question from the query data\n\t\tconst queryData = super.makeQueryData();\n\t\tdelete queryData[this.parameter];\n\t\treturn queryData;\n\t}", "function updateQuery() {\n var newUrl = window.location.href;\n // clean out valueless parameters to simplify ensuing matching\n newUrl = newUrl.replace(/(.*[?&])param1(&(.*))?$/, \"$1$3\");\n if (param1 !== default1) {\n if (newUrl.match(/[?&]param1=/)) {\n newUrl = newUrl.replace(/(.*[?&]param1=)[^&]*(.*)/, '$1' + param1 + '$2');\n } else if (newUrl.indexOf('?') > 0) {\n newUrl = newUrl + '&param1=' + param1;\n } else {\n newUrl = newUrl + '?param1=' + param1;\n }\n } else {\n newUrl = newUrl.replace(/(.*[?&])param1=[^&]*&?(.*)/, '$1$2');\n }\n\n // tidy up\n if (newUrl.match(/[?&]$/)) {\n newUrl = newUrl.slice(0, -1);\n } \n window.history.pushState('', '', newUrl);\n}", "function pproxy_params_copy(obj){\n var newObj=new Object();\n for(var k in obj){\n\t\tvar arr=new Array();\n\t\tfor(var i in obj[k]){\n\t\t\tarr[i]=obj[k][i]+\"\";\n\t\t}\n\t\tnewObj[k]=arr;\n }\n return newObj\n}", "function removeParamsFromUrl(paramKey) {\n\n\n var nextUrl = window.location.origin + window.location.pathname;\n\n var params = getUrlVars(); //Get all the query params as an ARRAY\n params[paramKey] = '';\n var size = Object.keys(params).length;\n var i = 0;\n if (size == 0) {\n window.location.href = window.location.origin + window.location.pathname;\n } else {\n nextUrl += '?'; // ? for started to attach the query string to url\n\n // This is for search,selection by any one of ways => BRAND or SEARCH Keyword\n if (paramKey == 'search' && params['brand'] != undefined) {\n params['brand'] = '';\n }\n if (paramKey == 'brand' && params['search'] != undefined) {\n params['search'] = '';\n }\n\n // Attach the query params to the nextURL \n $.each(params, function(key, value) {\n if (value != '') {\n if (i == size) {\n nextUrl += key + '=' + value;\n } else {\n nextUrl += key + '=' + value + '&';\n }\n }\n\n i++;\n });\n\n window.location.href = nextUrl;\n }\n}", "clearInitialSearch() {\n const params = this.params();\n delete params.q;\n\n m.route(app.route(this.searchRoute, params));\n }", "get queryParams() {\n if (this.args.query) {\n return this.args.query;\n } else {\n return {};\n }\n }", "function QueryParameters() {}", "toParams() {\n // The query params\n let data = this.build();\n\n // Transform it to params\n return Store.toParam(data);\n }", "reset() {\n this.set('query', '');\n }", "url({ url }) {\n const removeKeysStartingWith = [\"utm_\", \"uta_\"]; // Remove all query parameters beginning with these strings\n const removeKeys = [\"fblid\", \"gclid\"]; // Remove all query parameters matching these keys\n\n const search = url.search\n .split(\"&\")\n .map((parameter) => parameter.split(\"=\"))\n .filter(([key]) => !removeKeysStartingWith.some((startingWith) => key.startsWith(startingWith)))\n .filter(([key]) => !removeKeys.some((removeKey) => key === removeKey));\n\n return {\n ...url,\n search: search.map((parameter) => parameter.join(\"=\")).join(\"&\"),\n };\n }", "function setParams(state) {\r\n var selector = state.activeFilter.selector;\r\n var newParam = \"?filter=\" + selector.replace(/^\\./g, \"\");\r\n\r\n if (selector === targetSelector && getSelectorFromParam()) {\r\n // Equivalent to filter \"all\", remove the hash\r\n history.pushState(null, document.title, window.location.pathname);\r\n // or history.replaceState()\r\n } else if (\r\n newParam !== getSelectorFromParam() &&\r\n selector !== targetSelector\r\n ) {\r\n // Change the hash\r\n history.pushState(\r\n null,\r\n document.title,\r\n window.location.pathname + newParam\r\n ); // or history.replaceState()\r\n }\r\n }", "function normalizeQueryParams(params) {\n return params && params[0] !== '?' ? '?' + params : params;\n }", "function updateParamsToUrl(paramKey, paramValue) {\n\n paramValue = window.btoa(JSON.stringify(paramValue));\n\n var nextUrl = window.location.origin + window.location.pathname;\n\n var params = getUrlVars(); //Get all the query params as an ARRAY\n\n var size = Object.keys(params).length;\n var i = 0;\n if (size == 0) {\n window.location.href = window.location.href + \"?\" + paramKey + \"=\" + paramValue;\n } else {\n\n nextUrl += '?'; // ? for started to attach the query string to url\n\n params[paramKey] = paramValue;\n\n // This is for search,selection by any one of ways => BRAND or SEARCH Keyword\n if (paramKey == 'search' && params['brand'] != undefined) {\n params['brand'] = '';\n }\n if (paramKey == 'brand' && params['search'] != undefined) {\n params['search'] = '';\n }\n\n if (paramKey == 'brand') {\n params['width'] = '';\n params['diameter'] = '';\n }\n\n // Attach the query params to the nextURL \n $.each(params, function(key, value) {\n if (value != '') {\n if (i == size) {\n nextUrl += key + '=' + value;\n } else {\n nextUrl += key + '=' + value + '&';\n }\n }\n\n i++;\n });\n\n\n window.location.href = nextUrl;\n }\n}", "function urlQueryValues() {}", "function refreshParams() {\n params = { X_max: X_max, X_min: X_min, max_: max_, min_: min_ };\n }", "static prepareUrlParams(params) {\n return Object.keys(params)\n .filter(k => isTruthy(params[k]))\n .map(k => `${encodeURIComponent(k)}=${encodeURIComponent(params[k])}`)\n .join('&');\n }", "getQueryParameters () {\n\t\tconst queryParameters = super.getQueryParameters();\n\t\t// set team ID to the other team\n\t\tif (this.otherTeam) {\n\t\t\tqueryParameters.teamId = this.otherTeam.teamId;\n\t\t}\n\t\treturn queryParameters;\n\t}", "function applyQueryStringFiltersToRequest(data) {\n var urlParams = new URLSearchParams(location.search);\n urlParams.forEach(function(value, key) {\n if (key.match(/^filter-/)) {\n if (typeof data.filter_def === 'undefined') {\n data.filter_def = {};\n }\n data.filter_def[key.replace(/^filter-/, '')] = value;\n }\n });\n }", "initializeFiltersFromQueryString() {\n if (this.initialEncodedFilters == '') {\n return\n }\n this.filters = JSON.parse(\n decodeURIComponent(atob(this.initialEncodedFilters))\n )\n }", "appendAll(params) {\n const updates = [];\n Object.keys(params).forEach(param => {\n const value = params[param];\n if (Array.isArray(value)) {\n value.forEach(_value => {\n updates.push({\n param,\n value: _value,\n op: 'a'\n });\n });\n } else {\n updates.push({\n param,\n value: value,\n op: 'a'\n });\n }\n });\n return this.clone(updates);\n }", "function getUrlParams (options$$1) {\n if (options$$1.url.indexOf('?') !== -1) {\n options$$1.requestParams = options$$1.requestParams || {};\n var queryString = options$$1.url.substring(options$$1.url.indexOf('?') + 1);\n options$$1.url = options$$1.url.split('?')[0];\n options$$1.requestParams = JSON.parse('{\"' + decodeURI(queryString).replace(/\"/g, '\\\\\"').replace(/&/g, '\",\"').replace(/=/g, '\":\"') + '\"}');\n }\n options$$1.url = cleanUrl(options$$1.url.split('?')[0]);\n return options$$1;\n}", "function replaceParams() {\n var href = $(this).attr(\"href\") || $(this).serialize()\n href = PlaceGuide.cleanParamString(href)\n var state = href.match(/[\\?\\&]/) ? $.deparam.querystring(href) : {}\n $.bbq.pushState(state, PlaceGuide.REPLACE_EXISTING)\n return false\n }", "function queryParamsValues() {\n const params = [];\n urlBase.searchParams.forEach((value) => {\n params.push(value);\n });\n\n return params;\n }", "function serialize_params(newparams){\n let params = new URLSearchParams(window.location.search);\n const validCategories = [\"a\",\"n\",\"q\"] //list of params that should be encoded\n //encodes params, deleting any that are empty\n for (const key in newparams){\n if (validCategories.includes(key)) {\n //if there's any content left in the param, update it. If not, delete it.\n newparams[key].length ? params.set(key, Base64.encodeURI(JSON.stringify(newparams[key]))) : params.delete(key);\n }\n }\n //if there are any params that shouldn't be encoded, deal with them here\n const utilParams = [\"t\"];\n //sets changes to threshold value---removes if value is at default number of if it's not a number\n if (typeof newparams[\"t\"] === \"number\"){\n if (newparams[\"t\"] === 0.4){\n params.delete(\"t\");\n } else {\n params.set(\"t\", newparams[\"t\"]);\n }\n } else {\n params.delete(\"t\");\n }\n //deletes any params that aren't approved\n params.forEach(function(value, key){\n if (!validCategories.includes(key) && !utilParams.includes(key)){\n params.delete(key);\n }\n });\n window.location.search = params;\n}", "function useQuery() {\n return new URLSearchParams(useLocation().search);\n }", "function useQuery() {\n return new URLSearchParams(useLocation().search);\n }", "function updateURL () {\n var newSearch = \"?\" + Object.keys(parameters).filter(function (key) {\n return Boolean(parameters[key])\n }).map(function (key) {\n return encodeURIComponent(key) + \"=\" + encodeURIComponent(parameters[key])\n }).join(\"&\");\n history.replaceState(null, null, newSearch)\n }", "static updateQueryParams(currentQueryParams = '', newParams) {\n const processedParams = ParamsHelper.parseQueryParams(currentQueryParams);\n const mergedParams = {\n ...processedParams,\n ...newParams,\n };\n\n const entries = Object.entries(mergedParams);\n if (!entries.length) {\n return '';\n }\n return entries.reduce((acc, [key, value], index) => {\n const encodedKey = window.encodeURIComponent(key);\n const encodedValue = window.encodeURIComponent(value);\n\n const valueString = `${encodedKey}=${encodedValue}`;\n return `${acc}${index > 0 ? '&' : ''}${valueString}`;\n }, '?');\n }", "function setUrlSearchParams(data) {\n let urlSearchParams = new URLSearchParams();\n for (let name in data) {\n urlSearchParams.append(name, data[name]);\n }\n return urlSearchParams;\n}", "function setUrlSearchParams(data) {\n let urlSearchParams = new URLSearchParams();\n for (let name in data) {\n urlSearchParams.append(name, data[name]);\n }\n return urlSearchParams;\n}", "addFieldsToParam(searchParam) {\n let allFields = this.fields.split(',');\n allFields.push('Id');\n allFields.push('Name');\n let cleanFields = this.dedupeArray(allFields).join(',');\n searchParam.fieldsToQuery = cleanFields;\n }", "function queryParamsValues() {\n const params = [];\n urlBase.searchParams.forEach((value) => {\n params.push(value);\n });\n\n return params;\n }", "function removeQueryStringParm(parm, saveStateInd) {\r\n\r\n var parms = [];\r\n if (typeof parm === \"string\") {\r\n parms.push(parm);\r\n } else {\r\n parms = parm;\r\n }\r\n var qs = convertQueryStringToObj();\r\n $.each(parms, function(i, item) {\r\n delete qs[item];\r\n });\r\n \r\n var newqs = convertObjToQueryString(qs);\r\n if (saveStateInd) {\r\n var currURL = window.location.protocol + \"//\" + window.location.host + window.location.pathname + newqs;\r\n if (history.pushState) {\r\n history.pushState({}, \"ignored title\", currURL); \r\n }\r\n }\r\n\r\n return ;\r\n}", "appendAll(params) {\n const updates = [];\n Object.keys(params).forEach(param => {\n const value = params[param];\n if (Array.isArray(value)) {\n value.forEach(_value => {\n updates.push({ param, value: _value, op: 'a' });\n });\n }\n else {\n updates.push({ param, value, op: 'a' });\n }\n });\n return this.clone(updates);\n }", "appendAll(params) {\n const updates = [];\n Object.keys(params).forEach(param => {\n const value = params[param];\n if (Array.isArray(value)) {\n value.forEach(_value => {\n updates.push({ param, value: _value, op: 'a' });\n });\n }\n else {\n updates.push({ param, value, op: 'a' });\n }\n });\n return this.clone(updates);\n }", "appendAll(params) {\n const updates = [];\n Object.keys(params).forEach(param => {\n const value = params[param];\n if (Array.isArray(value)) {\n value.forEach(_value => {\n updates.push({ param, value: _value, op: 'a' });\n });\n }\n else {\n updates.push({ param, value, op: 'a' });\n }\n });\n return this.clone(updates);\n }", "appendAll(params) {\n const updates = [];\n Object.keys(params).forEach(param => {\n const value = params[param];\n if (Array.isArray(value)) {\n value.forEach(_value => {\n updates.push({ param, value: _value, op: 'a' });\n });\n }\n else {\n updates.push({ param, value, op: 'a' });\n }\n });\n return this.clone(updates);\n }", "setFilters ({ state }, filters) {\n const mergedQuery = {\n ...state.route.query, // merge with search term and location\n ...filters\n }\n const query = removeEmptyKeys(mergedQuery)\n router.replace({ query })\n }", "function queryParams(params) {\n // params.advFilter = \"projectID\";\n params.hostID = id;\n params.sortName='levelRisk';\n params.sortOrder='desc';\n return(params);\n // return {advFilter: 'projectID', advFilterValue: id};\n}", "filterInstances() {\n let hidden_filters = ['offset', 'limit', 'page'];\n let filters = this.getFiltersPrepared(this.qs_url);\n\n for(let filter in filters) {\n if(hidden_filters.includes(filter)){\n delete filters[filter];\n }\n }\n\n this.$router.push({\n name: this.$route.name,\n params: this.$route.params,\n query: filters,\n });\n }", "_clearFilter() {\n hashHistory.push({pathname: \"/users\", query: {}})\n }", "function getQueryParams() {\n var queryParams = currentState.state.allQueryParams();\n var allParams = currentState.params;\n\n var params = {};\n\n for (var param in allParams) {\n if (param in queryParams)\n params[param] = allParams[param];\n }\n\n return params;\n }", "function updateParams() {\n let params = [];\n params.push(getPlayerParams());\n params.push(getPilesParams());\n document.getElementById('new_parameters').value = JSON.stringify(params);\n all_params = params;\n}", "function remove_query_arg(key, sourceURL) {\r\n\r\n var rtn = sourceURL.split(\"?\")[0],\r\n param,\r\n params_arr = [],\r\n queryString = (sourceURL.indexOf(\"?\") !== -1) ? sourceURL.split(\"?\")[1] : \"\";\r\n\r\n if (queryString !== \"\") {\r\n params_arr = queryString.split(\"&\");\r\n for (var i = params_arr.length - 1; i >= 0; i -= 1) {\r\n param = params_arr[i].split(\"=\")[0];\r\n if (param === key) {\r\n params_arr.splice(i, 1);\r\n }\r\n }\r\n\r\n rtn = rtn + \"?\" + params_arr.join(\"&\");\r\n\r\n }\r\n\r\n if (rtn.split(\"?\")[1] == \"\") {\r\n rtn = rtn.split(\"?\")[0];\r\n }\r\n\r\n return rtn;\r\n }", "function normalizeQueryParams(params) {\n return params && params[0] !== '?' ? '?' + params : params;\n}", "function normalizeQueryParams(params) {\n return params && params[0] !== '?' ? '?' + params : params;\n}", "function queryObj() {\n var result = {}, keyValuePairs = location.search.slice(1).split('&');\n\n keyValuePairs.forEach(function(keyValuePair) {\n keyValuePair = keyValuePair.split('=');\n result[keyValuePair[0]] = keyValuePair[1] || '';\n });\n\n return result;\n}", "function normalizeQueryParams(params) {\n return params && params[0] !== '?' ? '?' + params : params;\n}", "function normalizeQueryParams(params) {\n return params && params[0] !== '?' ? '?' + params : params;\n}", "function normalizeQueryParams(params) {\n return params && params[0] !== '?' ? '?' + params : params;\n}", "function normalizeQueryParams(params) {\n return params && params[0] !== '?' ? '?' + params : params;\n}", "function normalizeQueryParams(params) {\n return params && params[0] !== '?' ? '?' + params : params;\n}", "function useQueryParams () {\n return new URLSearchParams(useLocation().search);\n}", "clearPrivateParams() {\n if (this.isDummy()) {\n return;\n }\n\n Object.keys(this.privateParams).forEach(name => {\n const param = this.privateParams[name];\n param.fill(0);\n delete this.privateParams[name];\n });\n this.privateParams = null;\n this.isEncrypted = true;\n }", "toUrlParams(query) {\n\t\tconsole.debug(query)\n\t\tconst params = {\n\t\t\tfr : query.offset,\n\t\t\tsz : query.size,\n\t\t\tcids : query.collectionId\n\t\t}\n\n\t\tif(query.searchLayers) {\n\t\t\tconst sl = Object.keys(query.searchLayers).filter((l) => {\n\t\t\t\treturn query.searchLayers[l];\n\t\t\t});\n\t\t\tif(sl.length > 0) {\n\t\t\t\tparams['sl'] = sl.join(',');\n\t\t\t}\n\t\t}\n\n\t\tif(query.term) {\n\t\t\tparams['st'] = query.term;\n\t\t}\n\n\t\tif(query.dateRange) {\n\t\t\tlet dr = query.dateRange.field + '__';\n\t\t\tdr += query.dateRange.start + '__';\n\t\t\tdr += query.dateRange.end;\n\t\t\tparams['dr'] = dr;\n\t\t}\n\n\t\tif(query.fieldCategory) {\n params['fc'] ='';\n query.fieldCategory.map(function(item){\n params['fc'] += item.id + '|';\n\t\t\t});\n params['fc'] = params['fc'].slice(0, -1);\n\t\t}\n\n\t\tlet sf = []\n\t\tif(query.selectedFacets) {\n\t\t\tsf = Object.keys(query.selectedFacets).map((key) => {\n\t\t\t\treturn query.selectedFacets[key].map((value) => {\n\t\t\t\t\treturn key + '|' + value;\n\t\t\t\t})\n\t\t\t});\n\t\t\tparams['sf'] = sf.join(',');\n\t\t}\n\n\t\tif(query.sort) {\n\t\t\tlet s = query.sort.field + '__';\n\t\t\ts += query.sort.order;\n\t\t\tparams['s'] = s;\n\t\t}\n\t\treturn params;\n\t}", "function useQuery() {\n return new URLSearchParams(useLocation().search);\n}", "function useQuery() {\n return new URLSearchParams(useLocation().search);\n}", "function useQuery() {\n return new URLSearchParams(useLocation().search);\n}", "function useQuery() {\n return new URLSearchParams(useLocation().search);\n}", "function useQuery() {\n return new URLSearchParams(useLocation().search);\n}", "function useQuery() {\n return new URLSearchParams(useLocation().search);\n}", "function useQuery() {\n return new URLSearchParams(useLocation().search);\n}", "function useQuery() {\n return new URLSearchParams(useLocation().search);\n}", "setQueryParameter(key, value) {\n if (key) {\n if (value) {\n if (typeof value == 'string') {\n this.queryParams[key.toLowerCase()] = value;\n }\n else if (Array.isArray(value)) {\n const valueArray = value;\n const params = [];\n for (const v of valueArray) {\n params.push(String(v));\n }\n this.queryParams[key.toLowerCase()] = params;\n }\n }\n else {\n this.queryParams[key.toLowerCase()] = '';\n }\n }\n return this;\n }", "function parseCurrentUrlParams () {\n\t\tme.urlParams = me.paramsToObject(window.location.search.substr(1));\n\t}", "function getParameters() {\n let filtersParameter = filters.val() === '' ? '' : 'filters=' + filters.val();\n\n // let parameters = '?' + filtersParameter;\n return parameters= '?' + filtersParameter;\n }", "function reconstructParameters(params) {\n const res = {};\n const keys = Object.keys(params);\n keys.forEach(k => {\n _.set(res, k, params[k]);\n });\n return res;\n}", "copyUrlParams() {\n console.info(this.selectedRequest);\n let params = getUrlQuery(this.selectedRequest.url).split(\"&\");\n copyToClipboard(params.join(Services.appinfo.OS === \"WINNT\" ? \"\\r\\n\" : \"\\n\"));\n }", "function appendToQuery(params) {\n\tvar queryPiece = [];\n\tfor (var key in params) {\n\t\tvar tempString = encodeURIComponent(key) + '=' + encodeURIComponent(params[key]);\n\t\tqueryPiece.push(tempString);\n\t}\n\treturn queryPiece.join('&');\n}", "function setQueryParams(params) {\n const queryItems = Object.keys(params)\n .map(key => `${encodeURIComponent(key)}=${encodeURIComponent(params[key])}`)\n return queryItems.join('&');\n}", "append(current_url, key, value) {\n const current = url.parse(current_url)\n const params = new URLSearchParams(current.search)\n \n params.set(key, value)\n return params.toString()\n }", "function qsok(name) {\n // copy this specific one into the init params\n name = name.toLowerCase();\n if (queryStringInitParams.hasOwnProperty(name)) {\n initParams[name] = queryStringInitParams[name];\n }\n return name;\n }", "function URLSearchParams(query) {\n var\n index, key, value,\n pairs, i, length,\n dict = Object.create(null)\n ;\n this[secret] = dict;\n if (!query) return;\n if (typeof query === 'string') {\n if (query.charAt(0) === '?') {\n query = query.slice(1);\n }\n for (\n pairs = query.split('&'),\n i = 0,\n length = pairs.length; i < length; i++\n ) {\n value = pairs[i];\n index = value.indexOf('=');\n if (-1 < index) {\n appendTo(\n dict,\n decode(value.slice(0, index)),\n decode(value.slice(index + 1))\n );\n } else if (value.length){\n appendTo(\n dict,\n decode(value),\n ''\n );\n }\n }\n } else {\n if (isArray(query)) {\n for (\n i = 0,\n length = query.length; i < length; i++\n ) {\n value = query[i];\n appendTo(dict, value[0], value[1]);\n }\n } else {\n for (key in query) {\n appendTo(dict, key, query[key]);\n }\n }\n }\n}", "getRedCapQueryParams() {\n let params = new URLSearchParams(location.search)\n // get PID from current location\n let pid = params.get('pid')\n let query_params = {\n pid,\n page: 'api',\n type: 'module',\n prefix: this.module_prefix,\n }\n if(window.redcap_csrf_token) query_params.redcap_csrf_token = window.redcap_csrf_token // csrf token for post requests\n return query_params\n }", "function updateURL() {\n var filters = window.getPostFilterValues();\n var params = '';\n for(let key in filters){\n var val = filters[key];\n if (typeof val === 'object') {\n params += key + '=' + val.join(',') + \"&\";\n }else{\n params += key + '=' + val + \"&\";\n }\n }\n params = params.length > 0 ? params.substr(0, params.length - 1) : params;\n var newUrl = window.location.href;\n newUrl = newUrl.split('?')[0] + ('?' + params);\n window.history.pushState(null, null, newUrl);\n }", "_prepareParams (params) {\n if (params == null) {\n params = {}\n }\n if (params.auth == null) {\n params.auth = {}\n }\n if (params.auth.key == null) {\n params.auth.key = this._authKey\n }\n if (params.auth.expires == null) {\n params.auth.expires = this._getExpiresDate()\n }\n\n return JSON.stringify(params)\n }", "function updateParam(name, value) {\n var newUrlHash = biomart.url.jsonify(location.href);\n if (value) biomart.params[name] = value;\n else delete biomart.params[name];\n _urlHash.query = $.param(biomart.params);\n newUrlHash.fragment = biomart.url.stringify(_urlHash);\n location = biomart.url.stringify(newUrlHash);\n }" ]
[ "0.72527725", "0.6354464", "0.62944865", "0.62072563", "0.6136836", "0.60743904", "0.603191", "0.5953603", "0.5945542", "0.59019774", "0.59019774", "0.58880925", "0.58802503", "0.5855626", "0.58492976", "0.58412933", "0.58412933", "0.58412933", "0.58412933", "0.58412933", "0.5818707", "0.5778576", "0.5764598", "0.57406044", "0.57304937", "0.56753093", "0.56500256", "0.5636668", "0.56286365", "0.5602003", "0.559752", "0.5596152", "0.5594516", "0.55589527", "0.55574775", "0.5531558", "0.5523139", "0.54927474", "0.54766726", "0.5475744", "0.5472837", "0.5463148", "0.5458727", "0.54540354", "0.5453324", "0.544651", "0.54427886", "0.54347324", "0.54347324", "0.5414539", "0.54105717", "0.5407067", "0.5407067", "0.54054165", "0.54026973", "0.5395951", "0.5389972", "0.5389972", "0.5389972", "0.5389972", "0.5384536", "0.53838146", "0.5371047", "0.537101", "0.5360238", "0.5350843", "0.53301936", "0.5315261", "0.5315261", "0.5306617", "0.5305627", "0.5305627", "0.5305627", "0.5305627", "0.5305627", "0.5303447", "0.5301264", "0.52972984", "0.529027", "0.529027", "0.529027", "0.529027", "0.529027", "0.529027", "0.529027", "0.529027", "0.5287995", "0.52861947", "0.5284518", "0.5271361", "0.526622", "0.52587765", "0.5257812", "0.5250142", "0.52413833", "0.5238001", "0.52344954", "0.5229706", "0.5221984", "0.521503" ]
0.7555594
0
returns true if the month and year are within min date and max date
function isMonthYearInRange (month, year) { // adjust month to 1-based because format date returns month as 1-based var monthPlusOne = month + 1; var leadingZero = monthPlusOne < 10 ? '0' : ''; if (parseInt(year + leadingZero + monthPlusOne) < parseInt(formatDate(minDate, 'YYYYMM')) || parseInt(year + leadingZero + monthPlusOne) > parseInt(formatDate(maxDate, 'YYYYMM'))) { return false; } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_isYearAndMonthBeforeMinDate(year, month) {\n if (this.minDate) {\n const minYear = this._dateAdapter.getYear(this.minDate);\n const minMonth = this._dateAdapter.getMonth(this.minDate);\n return year < minYear || (year === minYear && month < minMonth);\n }\n return false;\n }", "_isYearAndMonthBeforeMinDate(year, month) {\n if (this.minDate) {\n const minYear = this._dateAdapter.getYear(this.minDate);\n const minMonth = this._dateAdapter.getMonth(this.minDate);\n return year < minYear || (year === minYear && month < minMonth);\n }\n return false;\n }", "_isYearAndMonthAfterMaxDate(year, month) {\n if (this.maxDate) {\n const maxYear = this._dateAdapter.getYear(this.maxDate);\n const maxMonth = this._dateAdapter.getMonth(this.maxDate);\n return year > maxYear || (year === maxYear && month > maxMonth);\n }\n return false;\n }", "_isYearAndMonthAfterMaxDate(year, month) {\n if (this.maxDate) {\n const maxYear = this._dateAdapter.getYear(this.maxDate);\n const maxMonth = this._dateAdapter.getMonth(this.maxDate);\n return year > maxYear || (year === maxYear && month > maxMonth);\n }\n return false;\n }", "function isMonthSmallerThanMaxMonth(monthInfo) \n{ \t\t\n\tvar upperDateFlag=isDateSmallerThanMaxDate(\"01/\"+monthInfo); \n\tvar lowerDateFlag=isDateBiggerThanMinDate(\"01/\"+monthInfo); \n\tif (!upperDateFlag || !lowerDateFlag)\n\t\treturn false;\n\t\telse\n\t\treturn true;\n\t//return isDateSmallerThanMaxDate(\"01/\"+monthInfo); \n}", "function withinDate(d, m, y) {\n\n startDateArray = $('#startDate').val().split(\" \");\n endDateArray = $('#endDate').val().split(\" \");\n\n var startDay = parseInt(startDateArray[0]);\n var startMonth2 = monthNames.indexOf(startDateArray[1]) + 1;\n if (startMonth2 < 10){\n startMonth2 = \"0\" + startMonth2;\n }\n var startMonth = parseInt(startMonth2);\n var startYear = parseInt(startDateArray[2]);\n\n var endDay = parseInt(endDateArray[0]);\n var endMonth2 = monthNames.indexOf(endDateArray[1]) + 1;\n if (endMonth2 < 10){\n endMonth2 = \"0\" + endMonth2;\n }\n var endMonth = parseInt(endMonth2);\n var endYear = parseInt(endDateArray[2]);\n\n var d1 = [startMonth, startDay, startYear];\n var d2 = [endMonth, endDay, endYear];\n var c = [m, d, y];\n\n var from = new Date(d1); // -1 because months are from 0 to 11\n var to = new Date(d2);\n var check = new Date(c);\n\n return(check >= from && check <= to);\n }", "function dateWithinRange(date) {\n \n var currentDate = new Date(date);\n \n var minDate = new Date(startDate);\n var maxDate = new Date(endDate);\n\n if (currentDate > minDate && currentDate < maxDate ){ // checks if dates are within range\n return true;\n }\n\n if(isNaN(minDate.valueOf() || maxDate.valueOf )){ //if no contraints are entered, return all dates\n return true;\n }\n else{\n return false;\n } \n }", "function isValid(year, month, date) {\n\t if ( month === 1 && date > 28) {\n\t return date === 29 && ((year % 4 === 0 && year % 100 !== 0) || year % 400 === 0);\n\t }\n\n\t if ( month === 3 || month === 5 || month === 8 || month === 10) {\n\t return date < 31;\n\t }\n\n\t return true;\n\t }", "function isValid(year, month, date) {\n if (!(0 < date && date < 31)) {\n return false;\n }\n if (!(0 <= month && month < 11)) {\n return false;\n }\n\n if (month === 1 && date > 28) {\n return date === 29 && ((year % 4 === 0 && year % 100 !== 0) || year % 400 === 0);\n }\n\n if (month === 3 || month === 5 || month === 8 || month === 10) {\n return date < 31;\n }\n\n return true;\n }", "function isValid(year, month, date) {\n if ( month === 1 && date > 28) {\n return date === 29 && ((year % 4 === 0 && year % 100 !== 0) || year % 400 === 0);\n }\n\n if ( month === 3 || month === 5 || month === 8 || month === 10) {\n return date < 31;\n }\n\n return true;\n }", "function isValid(year, month, date) {\n if (date < 1) {\n return false;\n }\n\n if (month === 1 && date > 28) {\n return date === 29 && (year % 4 === 0 && year % 100 !== 0 || year % 400 === 0);\n }\n\n if (month === 3 || month === 5 || month === 8 || month === 10) {\n return date < 31;\n }\n\n return true;\n }", "function isValid(year, month, date) {\n if (date < 1) {\n return false;\n }\n\n if (month === 1 && date > 28) {\n return date === 29 && (year % 4 === 0 && year % 100 !== 0 || year % 400 === 0);\n }\n\n if (month === 3 || month === 5 || month === 8 || month === 10) {\n return date < 31;\n }\n\n return true;\n }", "function isValid(year, month, date) {\n if (date < 1) {\n return false;\n }\n\n if (month === 1 && date > 28) {\n return date === 29 && (year % 4 === 0 && year % 100 !== 0 || year % 400 === 0);\n }\n\n if (month === 3 || month === 5 || month === 8 || month === 10) {\n return date < 31;\n }\n\n return true;\n }", "function isValid(year, month, date) {\n if (date < 1) {\n return false;\n }\n\n if (month === 1 && date > 28) {\n return date === 29 && (year % 4 === 0 && year % 100 !== 0 || year % 400 === 0);\n }\n\n if (month === 3 || month === 5 || month === 8 || month === 10) {\n return date < 31;\n }\n\n return true;\n }", "function isValid(year, month, date) {\n if (date < 1) {\n return false;\n }\n\n if (month === 1 && date > 28) {\n return date === 29 && (year % 4 === 0 && year % 100 !== 0 || year % 400 === 0);\n }\n\n if (month === 3 || month === 5 || month === 8 || month === 10) {\n return date < 31;\n }\n\n return true;\n }", "function isValid(year, month, date) {\n if (date < 1) {\n return false;\n }\n\n if (month === 1 && date > 28) {\n return date === 29 && (year % 4 === 0 && year % 100 !== 0 || year % 400 === 0);\n }\n\n if (month === 3 || month === 5 || month === 8 || month === 10) {\n return date < 31;\n }\n\n return true;\n }", "function isValid(year, month, date) {\n if (date < 1) {\n return false;\n }\n\n if (month === 1 && date > 28) {\n return date === 29 && (year % 4 === 0 && year % 100 !== 0 || year % 400 === 0);\n }\n\n if (month === 3 || month === 5 || month === 8 || month === 10) {\n return date < 31;\n }\n\n return true;\n }", "function isValid(year, month, date) {\n if (date < 1) {\n return false;\n }\n\n if (month === 1 && date > 28) {\n return date === 29 && (year % 4 === 0 && year % 100 !== 0 || year % 400 === 0);\n }\n\n if (month === 3 || month === 5 || month === 8 || month === 10) {\n return date < 31;\n }\n\n return true;\n }", "function isValid(year, month, date) {\n if (date < 1) {\n return false;\n }\n\n if (month === 1 && date > 28) {\n return date === 29 && (year % 4 === 0 && year % 100 !== 0 || year % 400 === 0);\n }\n\n if (month === 3 || month === 5 || month === 8 || month === 10) {\n return date < 31;\n }\n\n return true;\n }", "function isValid(year, month, date) {\n if (date < 1) {\n return false;\n }\n\n if (month === 1 && date > 28) {\n return date === 29 && (year % 4 === 0 && year % 100 !== 0 || year % 400 === 0);\n }\n\n if (month === 3 || month === 5 || month === 8 || month === 10) {\n return date < 31;\n }\n\n return true;\n }", "function isValid(year, month, date) {\n if (date < 1) {\n return false;\n }\n\n if (month === 1 && date > 28) {\n return date === 29 && (year % 4 === 0 && year % 100 !== 0 || year % 400 === 0);\n }\n\n if (month === 3 || month === 5 || month === 8 || month === 10) {\n return date < 31;\n }\n\n return true;\n }", "function isValid(year, month, date) {\n if (date < 1) {\n return false;\n }\n\n if (month === 1 && date > 28) {\n return date === 29 && (year % 4 === 0 && year % 100 !== 0 || year % 400 === 0);\n }\n\n if (month === 3 || month === 5 || month === 8 || month === 10) {\n return date < 31;\n }\n\n return true;\n }", "function isValid(year, month, date) {\n if (date < 1) {\n return false;\n }\n\n if (month === 1 && date > 28) {\n return date === 29 && (year % 4 === 0 && year % 100 !== 0 || year % 400 === 0);\n }\n\n if (month === 3 || month === 5 || month === 8 || month === 10) {\n return date < 31;\n }\n\n return true;\n }", "function isValid(year, month, date) {\n if (date < 1) {\n return false;\n }\n\n if (month === 1 && date > 28) {\n return date === 29 && (year % 4 === 0 && year % 100 !== 0 || year % 400 === 0);\n }\n\n if (month === 3 || month === 5 || month === 8 || month === 10) {\n return date < 31;\n }\n\n return true;\n }", "function isValid(year, month, date) {\n if (date < 1) {\n return false;\n }\n\n if (month === 1 && date > 28) {\n return date === 29 && (year % 4 === 0 && year % 100 !== 0 || year % 400 === 0);\n }\n\n if (month === 3 || month === 5 || month === 8 || month === 10) {\n return date < 31;\n }\n\n return true;\n }", "function isValid(year, month, date) {\n if (date < 1) {\n return false;\n }\n\n if (month === 1 && date > 28) {\n return date === 29 && (year % 4 === 0 && year % 100 !== 0 || year % 400 === 0);\n }\n\n if (month === 3 || month === 5 || month === 8 || month === 10) {\n return date < 31;\n }\n\n return true;\n }", "function isValid(year, month, date) {\n if (date < 1) {\n return false;\n }\n\n if (month === 1 && date > 28) {\n return date === 29 && ((year % 4 === 0 && year % 100 !== 0) || year % 400 === 0);\n }\n\n if (month === 3 || month === 5 || month === 8 || month === 10) {\n return date < 31;\n }\n\n return true;\n }", "function isValid(year, month, date) {\n if (date < 1) {\n return false;\n }\n\n if (month === 1 && date > 28) {\n return date === 29 && ((year % 4 === 0 && year % 100 !== 0) || year % 400 === 0);\n }\n\n if (month === 3 || month === 5 || month === 8 || month === 10) {\n return date < 31;\n }\n\n return true;\n }", "function isValid(year, month, date) {\n if (date < 1) {\n return false;\n }\n\n if (month === 1 && date > 28) {\n return date === 29 && ((year % 4 === 0 && year % 100 !== 0) || year % 400 === 0);\n }\n\n if (month === 3 || month === 5 || month === 8 || month === 10) {\n return date < 31;\n }\n\n return true;\n }", "function isValid(year, month, date) {\n if ( month === 1 && date > 28) {\n return date === 29 && ((year % 4 === 0 && year % 100 !== 0) || year % 400 === 0);\n }\n\n if ( month === 3 || month === 5 || month === 8 || month === 10) {\n return date < 31;\n }\n\n return true;\n }", "function isValid(year, month, date) {\n if ( month === 1 && date > 28) {\n return date === 29 && ((year % 4 === 0 && year % 100 !== 0) || year % 400 === 0);\n }\n\n if ( month === 3 || month === 5 || month === 8 || month === 10) {\n return date < 31;\n }\n\n return true;\n }", "function isValid(year, month, date) {\n if ( month === 1 && date > 28) {\n return date === 29 && ((year % 4 === 0 && year % 100 !== 0) || year % 400 === 0);\n }\n\n if ( month === 3 || month === 5 || month === 8 || month === 10) {\n return date < 31;\n }\n\n return true;\n }", "function isValid(year, month, date) {\n if ( month === 1 && date > 28) {\n return date === 29 && ((year % 4 === 0 && year % 100 !== 0) || year % 400 === 0);\n }\n\n if ( month === 3 || month === 5 || month === 8 || month === 10) {\n return date < 31;\n }\n\n return true;\n }", "function isValid(year, month, date) {\n if ( month === 1 && date > 28) {\n return date === 29 && ((year % 4 === 0 && year % 100 !== 0) || year % 400 === 0);\n }\n\n if ( month === 3 || month === 5 || month === 8 || month === 10) {\n return date < 31;\n }\n\n return true;\n }", "function isValid(year, month, date) {\n if ( month === 1 && date > 28) {\n return date === 29 && ((year % 4 === 0 && year % 100 !== 0) || year % 400 === 0);\n }\n\n if ( month === 3 || month === 5 || month === 8 || month === 10) {\n return date < 31;\n }\n\n return true;\n }", "function isValid(year, month, date) {\n if ( month === 1 && date > 28) {\n return date === 29 && ((year % 4 === 0 && year % 100 !== 0) || year % 400 === 0);\n }\n\n if ( month === 3 || month === 5 || month === 8 || month === 10) {\n return date < 31;\n }\n\n return true;\n }", "function isValid(year, month, date) {\n\t\t\tif (date < 1) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tif ( month === 1 && date > 28) {\n\t\t\t\treturn date === 29 && ((year % 4 === 0 && year % 100 !== 0) || year % 400 === 0);\n\t\t\t}\n\n\t\t\tif ( month === 3 || month === 5 || month === 8 || month === 10) {\n\t\t\t\treturn date < 31;\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}", "function isWithinMonth(creationDate, baseDate) {\n var creationMonth = creationDate.getMonth();\n var creationYear = creationDate.getYear();\n if(creationMonth == baseDate.getMonth() && creationYear == baseDate.getYear()) {\n return true;\n } else {\n return false;\n }\n}", "get hasValidDates() {\n let me = this,\n start = me.startDateMS,\n end = me.endDateMS;\n\n return !start || !end || end - start >= 0;\n }", "function isWithinYear(date1, date2) {\n\t\tvar year1 = parseInt(date1[0]);\n\t\tvar year2 = parseInt(date2[0]);\n\t\tvar month1 = parseInt(date1[1]);\n\t\tvar month2 = parseInt(date2[1]);\n\t\tvar day1 = parseInt(date1[2]);\n\t\tvar day2 = parseInt(date2[2]);\n\t\tif (year1 === year2) {\n\t\t\treturn true;\n\t\t} else if (year2 === year1 + 1 && (month2 < month1) || (month2 === month1 && day2 < day1)) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "validateRange(value) {\r\n let maxYear = new Date(value.max).getFullYear();\r\n let latestYear = new Date(this.latestDate).getFullYear();\r\n if (value.min > this.earliestDate &&\r\n maxYear <= latestYear) {\r\n this.setState({\r\n value: {\r\n min: value.min,\r\n max: value.max\r\n }\r\n })\r\n }\r\n }", "findRangeofDates(){ \n\t\tlet min=new Date(2030,1,1); \n\t\tlet max=new Date(1990,1,1);\n\t\tconst ar=this.props.data;\n\t\tfor(let i=0;i<ar.length;i++){\n\t\t\tif(ar[i].start<min)\n\t\t\t\tmin=ar[i].start;\n\t\t\tif(ar[i].end>max)\n\t\t\t\tmax=ar[i].end;\n\t\t}\n\t\tthis.min=min;\n\t\tthis.max=max;\n\t}", "function validate(yr,mo,da){\n if ((yr <=current_year) && (mo<=12) && (da<=31)){\n return true\n }\n else{\n return false\n }\n}", "get hasValidDates() {\n const {\n startDateMS,\n endDateMS\n } = this;\n return !startDateMS || !endDateMS || endDateMS - startDateMS >= 0;\n }", "validateTwoDates(startDate, endDate){\n if( startDate < endDate) {\n return true;\n } else {\n return false\n }\n }", "static dateOutOfRange(date, minDate, maxDate, config) {\n let result = false;\n if (minDate != null && date.isBefore(minDate, 'day')) {\n result = true;\n }\n if (maxDate != null && date.isAfter(maxDate, 'day')) {\n result = true;\n }\n if (config && config.calendarSettings) {\n const settings = config.calendarSettings;\n if (settings.disableDays &&\n settings.disableDays.some(disabledDate => this.checkDayForDisabled(disabledDate, date))) {\n result = true;\n }\n }\n return result;\n }", "hasActivePolicyInYear(policies, minYear, maxYear) {\n // console.log(policies)\n // console.log(minYear)\n if (policies) {\n for (let i = 0; i < policies.length; i++) {\n let start = policies[i][\"Year of establishment\"]\n let end = policies[i][\"Year of disestablishment\"]\n if (start !== \"Nil\" && start !== undefined && end !== undefined) {\n if (parseInt(start.substr(0,4) < maxYear && (end === \"Nil\" || parseInt(end.substr(0, 4)) > minYear))) {\n console.log(\"yay\")\n return true\n }\n }\n }\n }\n return false\n \n}", "get isValid() {\n let me = this,\n result = true; //super.isValid(),\n\n if (result) {\n let start = me.startDate,\n end = me.endDate;\n result = !start || !end || end - start >= 0;\n }\n\n return result;\n }", "function isdate(dd, mm, yy) {\r\n var maxDayArray = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];\r\n var Xday = dd\r\n var Xmonth = mm\r\n var Xyear = yy\r\n\r\n if ((Xyear < 1900) || (mm > 12)) { return false; }\r\n\r\n if (((Xmonth == 2) && (Xyear % 4 > 0)) || (Xmonth != 2)) {\r\n\r\n if (Xday > maxDayArray[Xmonth - 1])\r\n return false;\r\n }\r\n else {\r\n if (Xday > 29)\r\n return false;\r\n }\r\n\r\n\r\n return true;\r\n}", "_rangeValidation(initialDate) {\n const that = this;\n\n if (initialDate.compare(that.min) === -1) {\n return that.min.clone();\n }\n else if (initialDate.compare(that.max) === 1) {\n return that.max.clone();\n }\n else {\n return initialDate;\n }\n }", "function valDate(dateStar, dateEnd) {\n\tvar arrayDateStart = dateStar.split(\"-\");\n\tvar arrayDateEnd = dateEnd.split(\"-\");\n\tvar dateStarDay = arrayDateStart[0];\n\tvar dateStarMonth = arrayDateStart[1];\n\tvar dateStarYear = arrayDateStart[2];\n\tvar dateEndDay = arrayDateEnd[0];\n\tvar dateEndMonth = arrayDateEnd[1];\n\tvar dateEndYear = arrayDateEnd[2];\n\n\tif (dateStar == dateEnd) {\n\t\treturn true;\n\t} else {\n\t\tif (parseInt(dateStarYear) < parseInt(dateEndYear)) {\n\t\t\treturn true;\n\t\t} else if (parseInt(dateStarYear) > parseInt(dateEndYear)) {\n\t\t\treturn false;\n\t\t} else if (parseInt(dateStarYear) == parseInt(dateEndYear)) {\n\t\t\tif (parseInt(dateStarMonth) < parseInt(dateEndMonth)) {\n\t\t\t\treturn true;\n\t\t\t} else if (parseInt(dateStarMonth) > parseInt(dateEndMonth)) {\n\t\t\t\treturn false;\n\t\t\t} else if (parseInt(dateStarMonth) == parseInt(dateEndMonth)) {\n\t\t\t\tif (parseInt(dateStarDay) > parseInt(dateEndDay)) {\n\t\t\t\t\treturn false;\n\t\t\t\t} else if (parseInt(dateStarDay) < parseInt(dateEndDay)) {\n\t\t\t\t\treturn true;\n\t\t\t\t} else if (parseInt(dateStarDay) == parseInt(dateEndDay)) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\t}\n}", "_isDisabled(month,minDate,maxDate){// First day of the month\nvar firstDate=new Date(0,0);firstDate.setFullYear(month.getFullYear());firstDate.setMonth(month.getMonth());firstDate.setDate(1);// Last day of the month\nvar lastDate=new Date(0,0);lastDate.setFullYear(month.getFullYear());lastDate.setMonth(month.getMonth()+1);lastDate.setDate(0);if(minDate&&maxDate&&minDate.getMonth()===maxDate.getMonth()&&minDate.getMonth()===month.getMonth()&&0<=maxDate.getDate()-minDate.getDate()){return!1}return!this._dateAllowed(firstDate,minDate,maxDate)&&!this._dateAllowed(lastDate,minDate,maxDate)}", "function validateDate() {\n var date1 = strToDate($('#timeMin').val());\n var date2 = strToDate($('#timeMax').val());\n return Date.compare(date1, date2);\n \n}", "validateEndDate(start_time, end_time){\n let start_date = new Date(start_time);\n let end_date = new Date(end_time);\n if(start_date.getFullYear() == end_date.getFullYear()){\n if(start_date.getMonth() == end_date.getMonth()){\n if(start_date.getDate() == end_date.getDate()){\n let hourToMilliseconds = 3600000;\n if(end_date.getTime() - start_date.getTime() >= hourToMilliseconds){\n return true;\n }\n }\n }\n }\n\n return false;\n }", "function myFunction(date1, date2) {\n return (\n date1.getYear() === date2.getYear() &&\n date1.getMonth() === date2.getMonth() &&\n date1.getDate() === date2.getDate()\n );\n}", "function inRange(start, end, date) {\n if (start && date.isBefore(start)) {\n return false\n }\n if (end && date.isAfter(end)) {\n return false\n }\n return true\n}", "function fecha2MayorFecha1(fechaFinal,fechaFormulario){\n\n if((Date.parse(fechaFormulario)) <= (Date.parse(fechaFinal))) {\n alert(\"fecha nacimiento mayor que la actual\");\n return true;\n\n }else{\n return false;\n }\n\n\n\n\n\n}", "dateShallowIntersectsDate(date1, date2) {\n if (date1.isDate) {\n return date2.isDate ? date1.dateTime === date2.dateTime : this.dateShallowIncludesDate(date2, date1);\n }\n\n if (date2.isDate) {\n return this.dateShallowIncludesDate(date1, date2);\n } // Both ranges\n\n\n if (date1.start && date2.end && date1.start > date2.end) {\n return false;\n }\n\n if (date1.end && date2.start && date1.end < date2.start) {\n return false;\n }\n\n return true;\n }", "dateShallowIntersectsDate(date1, date2) {\n if (date1.isDate) {\n return date2.isDate ? date1.dateTime === date2.dateTime : this.dateShallowIncludesDate(date2, date1);\n }\n\n if (date2.isDate) {\n return this.dateShallowIncludesDate(date1, date2);\n } // Both ranges\n\n\n if (date1.start && date2.end && date1.start > date2.end) {\n return false;\n }\n\n if (date1.end && date2.start && date1.end < date2.start) {\n return false;\n }\n\n return true;\n }", "function isDateAllowed(date, min, max, allowedFn) {\n return (!allowedFn || allowedFn(date)) && (!min || date >= min.substr(0, 10)) && (!max || date <= max);\n}", "function isAfter (date1, date2) {\n if (date1.getFullYear() > date2.getFullYear()) return true\n else if (date1.getFullYear() >= date2.getFullYear() && date1.getMonth() > date2.getMonth()) return true\n else if (date1.getFullYear() >= date2.getFullYear() && date1.getMonth() >= date2.getMonth() && date1.getDate() >= date2.getDate()) return true\n else return false\n}", "function filteredByYear(min, max){\n filters.year = {\n apply: (d) => d.year >= min && d.year <= max,\n min, max\n }\n applyFilters(false)\n}", "function CheckDate(theYear, startYear, feet) {\n if (theYear > startYear)\n return true;\n else return false;\n}", "function customRangeCheck(d, constraints, selector) {\n\t\t\t\t\t\treturn (\"min\" in constraints ? (gdate.compare(d, constraints.min, selector) >= 0) : true)\n\t\t\t\t\t\t\t\t&& (\"max\" in constraints ? (gdate.compare(d, constraints.max, selector) <= 0) : true); // Boolean\n\t\t\t\t\t}", "function isPhotoInDateRange(info, yearRange) {\n if (isFullTimeRange(yearRange)) return true;\n\n const [first, last] = yearRange;\n const {date} = info;\n return (date && date >= first && date <= last);\n}", "function isValidDate(date){\n var currentDate=$(\"#calendar\").fullCalendar('getDate');\n var currentMonth=currentDate.get('month');\n if(date.get('month')!=currentMonth){\n return false;\n }\n return true;\n}", "get isValid() {\n let result = true; //super.isValid(),\n\n if (result) {\n const {\n startDate,\n endDate\n } = this;\n result = !startDate || !endDate || endDate - startDate >= 0;\n }\n\n return result;\n }", "function validateSelectedDates(dataSource, startDate, endDate){\n\t\t for(var i in dataSource) {\t\n \t \tif((dataSource[i].startDate.getTime() >= startDate.getTime() && dataSource[i].startDate.getTime() <= endDate.getTime())\t||\n \t \t (dataSource[i].endDate.getTime() <= endDate.getTime() && dataSource[i].endDate.getTime() >= startDate.getTime()) ||\n \t \t (startDate.getTime() >= dataSource[i].startDate.getTime() && startDate.getTime() <= dataSource[i].endDate.getTime())){\n \t \t\treturn false;\n \t \t}\n }\n\t\t return true;\n\t}", "isFullMonth() {\n\t\tif(this._type == \"month\" && this._end == null) {\n\t\t\treturn true;\n\t\t}\n\t\telse if(this._type == \"day\") {\n\t\t\treturn (this._start.day == 1 && this._end != null && this._end.month == this._start.month && this._end.day != undefined && this._end.day == Constants.MONTH_END_DAY[this._end.month-1]);\n\t\t}\n\t\telse {\n\t\t\treturn false;\n\t\t}\n\t}", "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 }", "validate() {\n // TODO raise error, return code 400 when invalid params detected\n if (this.pubdateMax && this.pubdateMin && this.pubdateMax < this.pubdateMin) {\n // TODO\n }\n }", "function _biggerThanTodayMonth(_Date2) {\n vDate1 = _getCurrentDate().split(\"-\")\n\t vDate2 = _Date2.value.split(\"-\")\n\n\t _Year1 = parseInt(vDate1[0]-0)\n\t _Month1 = parseInt(vDate1[1]-0)\n\t _Day1 = parseInt(vDate1[2]-0)\n\n\t _Year2 = parseInt(vDate2[0]-0)\n\t _Month2 = parseInt(vDate2[1]-0)\n\t _Day2 = parseInt(vDate2[2]-0)\n\n if (_Year1 > _Year2) {\n\t return false\n\t }\n\n\t if ((_Year1 == _Year2) && (_Month1 > _Month2)) {\n\t return false\n\t }\n\n return true\n\n}", "function meetsMinimumAge(birthDate, minAge) {\n var tempDate = new Date(birthDate.getFullYear() + minAge, birthDate.getMonth(), birthDate.getDate());\n if (tempDate <= new Date()) {\n return true;\n }\n else {\n return false;\n }\n}", "function checkOverEighteenFn(year, month, day) {\n // Write your code here\n let d = new Date();\n year = d.getFullYear() - year\n if(year >= 18){\n return true\n }\n \n return false\n}", "function compare_dates(fecha, fecha2) \r\n { \r\n\t\r\n var xMonth=fecha.substring(3, 5); \r\n var xDay=fecha.substring(0, 2); \r\n var xYear=fecha.substring(6,10); \r\n var yMonth=fecha2.substring(3,5);\r\n var yDay=fecha2.substring(0, 2);\r\n var yYear=fecha2.substring(6,10); \r\n \r\n if (xYear > yYear){ \r\n return(true); \r\n }else{ \r\n if (xYear == yYear){ \r\n\t if (xMonth > yMonth){ \r\n\t \t\treturn(true); \r\n\t }else{ \r\n\t\t if (xMonth == yMonth){ \r\n\t\t if (xDay> yDay) \r\n\t\t return(true); \r\n\t\t else \r\n\t\t return(false); \r\n\t\t }else{\r\n\t\t \t return(false); \r\n\t\t } \r\n\t } \r\n }else{\r\n \t return(false); \r\n } \r\n \r\n } \r\n}", "function compareDates(d1, m1, y1, d2, m2, y2) {\n\n\tvar date1\t= new Number(d1);\n\tvar month1\t= new Number(m1);\n\tvar year1\t= new Number(y1);\n\tvar date2\t= new Number(d2);\n\tvar month2\t= new Number(m2);\n\tvar year2\t= new Number(y2);\n\n\tvar\treturnVal = 0;\n\tif (year1 < year2) {\n\t\treturnVal = -1;\n\t} else if (year1 > year2) {\n\t\treturnVal = 1;\n\t} else {\n\t\t//alert('same year');\n\t\tif (month1 < month2) {\n\t\t\treturnVal = -1;\n\t\t} else if (month1 > month2) {\n\t\t\treturnVal = 1;\n\t\t} else {\n\t\t\t//alert('same month');\n\t\t\tif (date1 < date2) {\n\t\t\t\treturnVal = -1;\n\t\t\t} else if (date1 > date2) {\n\t\t\t\treturnVal = 1;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn returnVal;\n\n}", "function inRange(min, number, max){\n\t\t\t\t\treturn number >= min && number <= max;\n\t\t\t\t}", "inWindowForStartAndEndDates({startDate,endDate}){\n return (\n ((!this.getStartDate() || this.getStartDate().isSameOrBefore(endDate)) && (!this.getEndDate() || this.getEndDate().isSameOrAfter(startDate))) ||\n ((!this.getEndDate() || this.getEndDate().isSameOrAfter(startDate)) && (!this.getStartDate() || this.getStartDate().isSameOrBefore(endDate)))\n )\n }", "function isValid(from, to) {\n var today = Date();\n\n return (today >= from && today < to);\n}", "function validateAgeRanges(){\r\n\r\n\tvar status = true;\r\n\tvar lowAgeString = $(\"codesForm:lowAge\").value;\r\n\tvar lowAgeUnit = $(\"codesForm:lowAgeUnit\").value;\r\n\tvar highAgeString = $(\"codesForm:highAge\").value;\r\n\tvar highAgeUnit = $(\"codesForm:highAgeUnit\").value;\r\n\tlowAge = parseInt(lowAgeString);\r\n\thighAge = parseInt(highAgeString);\r\n\t\r\n\tif((highAgeUnit == lowAgeUnit)&&(lowAge >= highAge))\t\r\n\t\tstatus = false;\r\n\t\r\n\telse if(highAgeUnit!=lowAgeUnit){\r\n\t\tif((lowAgeUnit == \"year\")&&(highAgeUnit == \"month\")&&(lowAge*12 >= highAge))\r\n\t\t\tstatus = false;\r\n\t\tif((lowAgeUnit == \"year\")&&(highAgeUnit == \"week\")&&(lowAge*365 >= highAge*7))\r\n\t\t\tstatus = false;\r\n\t\tif((lowAgeUnit == \"year\")&&(highAgeUnit == \"day\")&&(lowAge*365 >= highAge))\r\n\t\t\tstatus = false;\r\n\t\tif((lowAgeUnit == \"month\")&&(highAgeUnit == \"year\")&&(lowAge >= highAge*12))\r\n\t\t\tstatus = false;\r\n\t\tif((lowAgeUnit == \"month\")&&(highAgeUnit == \"week\")&&(lowAge*30 >= highAge*7))\r\n\t\t\tstatus = false;\r\n\t\tif((lowAgeUnit == \"month\")&&(highAgeUnit == \"day\")&&(lowAge*30 >= highAge))\r\n\t\t\tstatus = false;\r\n\t\tif((lowAgeUnit == \"week\")&&(highAgeUnit == \"year\")&&(lowAge*7 >= highAge*365))\r\n\t\t\tstatus = false;\r\n\t\tif((lowAgeUnit == \"week\")&&(highAgeUnit == \"month\")&&(lowAge*7 >= highAge*30))\r\n\t\t\tstatus = false;\r\n\t\tif((lowAgeUnit == \"week\")&&(highAgeUnit == \"day\")&&(lowAge*7 >= highAge))\r\n\t\t\tstatus = false;\r\n\t\tif((lowAgeUnit == \"day\")&&(highAgeUnit == \"year\")&&(lowAge >= highAge*365))\r\n\t\t\tstatus = false;\r\n\t\tif((lowAgeUnit == \"day\")&&(highAgeUnit == \"month\")&&(lowAge >= highAge*30))\r\n\t\t\tstatus = false;\r\n\t\tif((lowAgeUnit == \"day\")&&(highAgeUnit == \"week\")&&(lowAge >= highAge*7))\r\n\t\t\tstatus = false;\r\n\t}\r\n\t\r\n\tif(status == false)\r\n\t\t$('ageRangeErrorBox').innerHTML = \"Enter correct age range.Higher age range should be greater than low age range.\";\r\n\telse\r\n\t\t$('ageRangeErrorBox').innerHTML = \"\";\r\n\treturn status;\r\n}", "function ofAge() {\n\n var bDay = document.getElementById('numDay').value;\n var bMonth = document.getElementById('numMonth').selectedIndex;\n var bYear = document.getElementById('numYear').value;\n var cDay = new Date().getDate();\n var cMonth = new Date().getMonth() + 1;\n var cYear = new Date().getFullYear();\n\n if (cYear - bYear > 18) {\n return true;\n }\n if (cYear - bYear == 18 && cMonth - bMonth > 0) {\n return true;\n }\n if (cYear - bYear == 18 && cMonth - bMonth == 0 && bDay - cDay >= 0) {\n return true;\n } else {\n return false;\n }\n}", "isValid() {\n return ((this.start instanceof Date) && (this.end instanceof Date)\n && (this.id >= 1) && (this.location));\n }", "function restrictPassedDate(){\n let date = new Date(),\n day = date.getDate(),\n month = date.getMonth()+1,\n year = date.getFullYear();\n if(day < 10){\n day = `0${day}`;\n }\n if(month < 10){\n month = `0${month}`;\n }\n dateStart.min = `${year}-${month}-${day}`;\n dateEnd.min = `${year}-${month}-${day}`;\n}", "clampDate(date, min, max) {\n if (min && this.compareDate(date, min) < 0) {\n return min;\n }\n if (max && this.compareDate(date, max) > 0) {\n return max;\n }\n return date;\n }", "clampDate(date, min, max) {\n if (min && this.compareDate(date, min) < 0) {\n return min;\n }\n if (max && this.compareDate(date, max) > 0) {\n return max;\n }\n return date;\n }", "clampDate(date, min, max) {\n if (min && this.compareDate(date, min) < 0) {\n return min;\n }\n if (max && this.compareDate(date, max) > 0) {\n return max;\n }\n return date;\n }", "function within(min1, max1, min2, max2) {\n return (min1 <= max2 && max1 >= min2);\n}", "function _isNextMonth(d1, d2) {\n if (_isSameYear(d1, d2)) {\n return d2.getMonth() - d1.getMonth() === 1;\n } else if (_isNextYear(d1, d2)) {\n return d1.getMonth() === 11 && d2.getMonth() === 0;\n }\n return false;\n }", "function isDateSmallerThanMaxDate(dateInfo) \n{\n\t var valid=false;\n\t var newDate=new Date(MAX_DATE); \n\t var newDateInfo=new Date(dateInfo);\t \n\t if (newDate>newDateInfo) \n\t\tvalid=true; \n\t return valid;\n}", "_shouldEnableMonth(month) {\n const activeYear = this._dateAdapter.getYear(this.activeDate);\n if (month === undefined || month === null ||\n this._isYearAndMonthAfterMaxDate(activeYear, month) ||\n this._isYearAndMonthBeforeMinDate(activeYear, month)) {\n return false;\n }\n if (!this.dateFilter) {\n return true;\n }\n const firstOfMonth = this._dateAdapter.createDate(activeYear, month, 1);\n // If any date in the month is enabled count the month as enabled.\n for (let date = firstOfMonth; this._dateAdapter.getMonth(date) == month; date = this._dateAdapter.addCalendarDays(date, 1)) {\n if (this.dateFilter(date)) {\n return true;\n }\n }\n return false;\n }", "_shouldEnableMonth(month) {\n const activeYear = this._dateAdapter.getYear(this.activeDate);\n if (month === undefined || month === null ||\n this._isYearAndMonthAfterMaxDate(activeYear, month) ||\n this._isYearAndMonthBeforeMinDate(activeYear, month)) {\n return false;\n }\n if (!this.dateFilter) {\n return true;\n }\n const firstOfMonth = this._dateAdapter.createDate(activeYear, month, 1);\n // If any date in the month is enabled count the month as enabled.\n for (let date = firstOfMonth; this._dateAdapter.getMonth(date) == month; date = this._dateAdapter.addCalendarDays(date, 1)) {\n if (this.dateFilter(date)) {\n return true;\n }\n }\n return false;\n }", "function isValidDate(mode,givenYear, givenMonth, givenDay){\n\n var flagYear,flagMonth,flagDay;\n\n if(!isNaN(givenYear) && givenYear.length==4){//Check if a valid year was given\n flagYear=true\n }else{\n flagYear=false;\n }\n\n //Check if a valid month was given\n if(mode!='year' && isNaN(givenMonth) && allMonths.includes(givenMonth) ){\n flagMonth=true;\n }else{\n flagMonth=false;\n }\n\n //check if a value day was given\n if(mode!='year' && mode!='month' && parseInt(givenDay)>0 && parseInt(givenDay)<=monthToNumOfDay[givenMonth] ){\n flagDay=true\n }else{\n flagDay=false;\n }\n\n\n if(mode=='year'){\n return flagYear\n }else if(mode=='month'){\n return flagYear && flagMonth;\n }else if(mode=='day'){\n return flagYear && flagMonth && flagDay;\n }\n\n}", "_hasSameMonthAndYear(d1, d2) {\n return !!(d1 && d2 && this._dateAdapter.getMonth(d1) == this._dateAdapter.getMonth(d2) &&\n this._dateAdapter.getYear(d1) == this._dateAdapter.getYear(d2));\n }", "_hasSameMonthAndYear(d1, d2) {\n return !!(d1 && d2 && this._dateAdapter.getMonth(d1) == this._dateAdapter.getMonth(d2) &&\n this._dateAdapter.getYear(d1) == this._dateAdapter.getYear(d2));\n }", "function dateRestrict() {\n let today = new Date();\n const dd = String(today.getDate()).padStart(2, '0');\n const mm = String(today.getMonth() + 1).padStart(2, '0');\n const yyyy = today.getFullYear();\n const dateToday = yyyy+'-'+mm+'-'+dd;\n const dateFuture = addDays(today, 16);\n const ddFuture = String(dateFuture.getDate()).padStart(2, '0');\n const mmFuture = String(dateFuture.getMonth() + 1).padStart(2, '0');\n const yyyyFuture = dateFuture.getFullYear();\n const dateMax = yyyyFuture+'-'+mmFuture+'-'+ddFuture;\n document.getElementById('date').min = dateToday;\n document.getElementById('date').max = dateMax;\n}", "isValid() {\n const { start, end } = this.selection;\n // Empty ranges are valid.\n if (start == null && end == null) {\n return true;\n }\n // Complete ranges are only valid if both dates are valid and the start is before the end.\n if (start != null && end != null) {\n return this._isValidDateInstance(start) && this._isValidDateInstance(end) &&\n this._adapter.compareDate(start, end) <= 0;\n }\n // Partial ranges are valid if the start/end is valid.\n return (start == null || this._isValidDateInstance(start)) &&\n (end == null || this._isValidDateInstance(end));\n }", "isValid() {\n const { start, end } = this.selection;\n // Empty ranges are valid.\n if (start == null && end == null) {\n return true;\n }\n // Complete ranges are only valid if both dates are valid and the start is before the end.\n if (start != null && end != null) {\n return this._isValidDateInstance(start) && this._isValidDateInstance(end) &&\n this._adapter.compareDate(start, end) <= 0;\n }\n // Partial ranges are valid if the start/end is valid.\n return (start == null || this._isValidDateInstance(start)) &&\n (end == null || this._isValidDateInstance(end));\n }", "function verifyYear(inputYear, min, max) {\n if (inputYear < min || inputYear > max) {\n showError();\n } else if (inputYear.length < 4 || inputYear.length > 4) {\n showError();\n } else {\n getAnimal(inputYear);\n }\n}", "function minAndMaxAreValid(type, min, max) {\r\n var result = false;\r\n var minValid = true;\r\n var maxValid = true;\r\n\r\n if (type === 'date') {\r\n if (min !== undefined && !(minValid = dateIsValid(min))) {\r\n console.warn('Browsers which natively support the \"date\" input type expect date values to be of the form \"YYYY-MM-DD\" (see ISO-8601 https://www.iso.org/iso-8601-date-and-time-format.html). Bootbox does not enforce this rule, but your min value may not be enforced by this browser.');\r\n }\r\n else if (max !== undefined && !(maxValid = dateIsValid(max))) {\r\n console.warn('Browsers which natively support the \"date\" input type expect date values to be of the form \"YYYY-MM-DD\" (see ISO-8601 https://www.iso.org/iso-8601-date-and-time-format.html). Bootbox does not enforce this rule, but your max value may not be enforced by this browser.');\r\n }\r\n }\r\n else if (type === 'time') {\r\n if (min !== undefined && !(minValid = timeIsValid(min))) {\r\n throw new Error('\"min\" is not a valid time. See https://www.w3.org/TR/2012/WD-html-markup-20120315/datatypes.html#form.data.time for more information.');\r\n }\r\n else if (max !== undefined && !(maxValid = timeIsValid(max))) {\r\n throw new Error('\"max\" is not a valid time. See https://www.w3.org/TR/2012/WD-html-markup-20120315/datatypes.html#form.data.time for more information.');\r\n }\r\n }\r\n else {\r\n if (min !== undefined && isNaN(min)) {\r\n minValid = false;\r\n throw new Error('\"min\" must be a valid number. See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-min for more information.');\r\n }\r\n\r\n if (max !== undefined && isNaN(max)) {\r\n maxValid = false;\r\n throw new Error('\"max\" must be a valid number. See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-max for more information.');\r\n }\r\n }\r\n\r\n if (minValid && maxValid) {\r\n if (max <= min) {\r\n throw new Error('\"max\" must be greater than \"min\". See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-max for more information.');\r\n }\r\n else {\r\n result = true;\r\n }\r\n }\r\n\r\n return result;\r\n }" ]
[ "0.7404555", "0.7404555", "0.7337931", "0.7337931", "0.72220564", "0.6979821", "0.6933853", "0.66925365", "0.6619252", "0.6610714", "0.66050076", "0.66050076", "0.66050076", "0.66050076", "0.66050076", "0.66050076", "0.66050076", "0.66050076", "0.66050076", "0.66050076", "0.66050076", "0.66050076", "0.66050076", "0.66050076", "0.66050076", "0.66050076", "0.6601084", "0.6601084", "0.6601084", "0.65813214", "0.65813214", "0.65813214", "0.65813214", "0.65813214", "0.65813214", "0.65813214", "0.6574291", "0.6572233", "0.65162367", "0.6505857", "0.648535", "0.6471824", "0.64494437", "0.6400678", "0.63806033", "0.63136065", "0.62999445", "0.6293036", "0.6286808", "0.6277158", "0.623961", "0.62234175", "0.61633044", "0.61242646", "0.6100039", "0.60889935", "0.6088751", "0.6087004", "0.6087004", "0.6080402", "0.6077239", "0.6066025", "0.6066014", "0.6047951", "0.6038259", "0.6035168", "0.6032271", "0.60186124", "0.601819", "0.6007345", "0.6007345", "0.59914285", "0.5984315", "0.5975112", "0.59740865", "0.5935084", "0.5918721", "0.5911662", "0.59080976", "0.58589065", "0.58490396", "0.58378863", "0.5837783", "0.5823777", "0.58146924", "0.58146924", "0.58146924", "0.5813549", "0.58072305", "0.5800716", "0.5800244", "0.5800244", "0.57980466", "0.5789944", "0.5789944", "0.57721066", "0.57478446", "0.57478446", "0.57379544", "0.5736457" ]
0.7219827
5
sets that.selectedMonth and that.selectedYear if different. returns true if the properties were set
function setMonthYear(date) { var month = date.getMonth(); var year = date.getFullYear(); // update properties if different if (month !== that.selectedMonth || year !== that.selectedYear) { that.selectedMonth = month; that.selectedYear = year; return true; } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_setSelectedMonth(value) {\n if (value instanceof DateRange) {\n this._selectedMonth = this._getMonthInCurrentYear(value.start) ||\n this._getMonthInCurrentYear(value.end);\n }\n else {\n this._selectedMonth = this._getMonthInCurrentYear(value);\n }\n }", "_setSelectedMonth(value) {\n if (value instanceof DateRange) {\n this._selectedMonth = this._getMonthInCurrentYear(value.start) ||\n this._getMonthInCurrentYear(value.end);\n }\n else {\n this._selectedMonth = this._getMonthInCurrentYear(value);\n }\n }", "function pickYearAndMonth(year, month) {\n self.date.year = year || new Date().getFullYear();\n self.date.month = month || self.months[new Date().getMonth()];\n self.date.day = new Date().getDay();\n self.activeDay = self.date.day;\n\n getMonthNotes(year, month);\n }", "function setSelectedMonth()\n{\nptr= arguments[0];\nnew_date= arguments[1];\nptr=new_date.getMonth()+ptr;\nindex=ptr\nif(index == 12)\n index = 0;\nelse if(index == -1)\n index = 11;\nisLeap=leapYear(new_date.getFullYear)\nif(isLeap)\n new_date.setDate(calLeapPeriods[index]);\nelse\n new_date.setDate(calPeriods[index]);\nnew_date.setMonth(ptr);\n}", "_setMonth(date, monthSelector, updateDatesOnly) {\n const that = this,\n selectedDates = that._getDays(date, that.selectedDates),\n importantDates = that._getDays(date, that.importantDates),\n restrictedDates = that._getDays(date, that.restrictedDates);\n\n date.setDate(1);\n\n if (!monthSelector) {\n monthSelector = that.$.month;\n }\n\n monthSelector._date = new Date(date);\n\n if (!updateDatesOnly) {\n if (!that._viewDates || that._viewDates.length >= that.months) {\n that._viewDates = [];\n }\n\n that._viewDates.push(new Date(date));\n }\n\n date = new Date(date);\n\n //Correct the start day according to firstDayOfWeek property\n let firstDayOfWeek = (date.getDay() - that.firstDayOfWeek + 7) % 7;\n\n date.setDate(0);\n\n let previusMonthDays = date.getDate();\n\n date.setDate(32); // current month.\n date.setDate(1); // set to first day of month.\n date.setDate(32); // next month.\n\n if (that._selectedCells) {\n for (let i = 0; i < that._selectedCells.length; i++) {\n if (that._selectedCells[i].closest('.jqx-calendar-month') === monthSelector) {\n that._setCellState(that._selectedCells[i], 'selected', false);\n }\n }\n }\n\n that._setMonthContent(date, monthSelector, {\n previusMonthDays: previusMonthDays,\n firstDayOfWeek: firstDayOfWeek,\n selectedDates: selectedDates,\n importantDates: importantDates,\n restrictedDates: restrictedDates\n });\n }", "function updateMonth(month, date) {\n month.getElementsByTagName(\"option\")[date.getMonth()].selected = \"selected\";\n}", "function ds_setDateParts( year, month, date ) {\r\r\n\tthis.dayObj[date-1].selected = true;\r\r\n\tthis.monthObj[month-1].selected = true;\r\r\n\tfor( i=0; i < this.yearObj.length; i++ ) {\r\r\n\t\tif( this.yearObj[i].value == year )\r\r\n\t\t\tthis.yearObj[i].selected = true;\r\r\n\t}\r\r\n\tthis.adjustDaysInMonth();\r\r\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 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 }", "_yearSelected(event) {\n const year = event.value;\n this.yearSelected.emit(this._dateAdapter.createDate(year, 0, 1));\n let month = this._dateAdapter.getMonth(this.activeDate);\n let daysInMonth = this._dateAdapter.getNumDaysInMonth(this._dateAdapter.createDate(year, month, 1));\n this.selectedChange.emit(this._dateAdapter.createDate(year, month, Math.min(this._dateAdapter.getDate(this.activeDate), daysInMonth)));\n }", "_yearSelected(event) {\n const year = event.value;\n this.yearSelected.emit(this._dateAdapter.createDate(year, 0, 1));\n let month = this._dateAdapter.getMonth(this.activeDate);\n let daysInMonth = this._dateAdapter.getNumDaysInMonth(this._dateAdapter.createDate(year, month, 1));\n this.selectedChange.emit(this._dateAdapter.createDate(year, month, Math.min(this._dateAdapter.getDate(this.activeDate), daysInMonth)));\n }", "_hasSameMonthAndYear(d1, d2) {\n return !!(d1 && d2 && this._dateAdapter.getMonth(d1) == this._dateAdapter.getMonth(d2) &&\n this._dateAdapter.getYear(d1) == this._dateAdapter.getYear(d2));\n }", "_hasSameMonthAndYear(d1, d2) {\n return !!(d1 && d2 && this._dateAdapter.getMonth(d1) == this._dateAdapter.getMonth(d2) &&\n this._dateAdapter.getYear(d1) == this._dateAdapter.getYear(d2));\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}", "isMonthActive(month) {\n const date = this.createMoment(this.value).month(month);\n return date.isSame(this.value, 'month') && date.isSame(this.activeDate, 'year');\n }", "_monthSelectedInYearView(normalizedMonth) {\n this.monthSelected.emit(normalizedMonth);\n }", "_monthSelectedInYearView(normalizedMonth) {\n this.monthSelected.emit(normalizedMonth);\n }", "function chkDurationMonth(fromMonth, toMonth){\n\tif((fromMonth.selectedIndex >= 0) && (toMonth.selectedIndex >= 0)){\n\t\tif(fromMonth.selectedIndex > toMonth.selectedIndex){\n\t\t\ttoMonth.selectedIndex = fromMonth.selectedIndex;\n\t\t}\t\t\n\t}\n}", "isCurrentMonth(month) {\n const date = this.activeDate.clone().month(month);\n return date.isSame(this._current, 'month') && date.isSame(this._current, 'year');\n }", "function chkDurationYear(fromYear, toYear){\n\tif((fromYear.selectedIndex >= 0) && (toYear.selectedIndex >= 0)){\n\t\tif(fromYear.selectedIndex > toYear.selectedIndex){\n\t\t\ttoYear.selectedIndex = fromYear.selectedIndex;\n\t\t}\n\t}\n}", "isValid() {\n return this.selection != null && this._isValidDateInstance(this.selection);\n }", "isValid() {\n return this.selection != null && this._isValidDateInstance(this.selection);\n }", "function validateSelects() {\n $(\"#metric_results\").empty();\n\n if( $('#selectYear').val()!='' && $('#selectMonth').val()!='' ) {\n globalYear = parseInt($('#selectYear').val());\n globalMonth = parseInt($('#selectMonth').val());\n genera_tabla(globalYear, globalMonth);\n }\n}", "SetSelectedYears(years) {\n console.debug(`ContaplusModel::SetSelectedYears(${years})`)\n this.years_selected = years\n }", "function validateMonth(oMon) {\n var isValidMon = false,\n existMonths = shareData.curFyMonths;\n angular.forEach(existMonths, function (month, i) {\n if (month.value == oMon) {\n isValidMon = true;\n }\n })\n return isValidMon;\n\n }", "_monthSelected(event) {\n const month = event.value;\n const normalizedDate = this._dateAdapter.createDate(this._dateAdapter.getYear(this.activeDate), month, 1);\n this.monthSelected.emit(normalizedDate);\n const daysInMonth = this._dateAdapter.getNumDaysInMonth(normalizedDate);\n this.selectedChange.emit(this._dateAdapter.createDate(this._dateAdapter.getYear(this.activeDate), month, Math.min(this._dateAdapter.getDate(this.activeDate), daysInMonth)));\n }", "_monthSelected(event) {\n const month = event.value;\n const normalizedDate = this._dateAdapter.createDate(this._dateAdapter.getYear(this.activeDate), month, 1);\n this.monthSelected.emit(normalizedDate);\n const daysInMonth = this._dateAdapter.getNumDaysInMonth(normalizedDate);\n this.selectedChange.emit(this._dateAdapter.createDate(this._dateAdapter.getYear(this.activeDate), month, Math.min(this._dateAdapter.getDate(this.activeDate), daysInMonth)));\n }", "function sameYearAndMonth(d1, d2) {\n\treturn (\n\t\td1.getFullYear() == d2.getFullYear() &&\n\t\td1.getMonth() == d2.getMonth()\n\t);\n}", "function ArchiveSelectYear(year)\n{\n // DESCRIPTION:\n // Selects the year and\n // checks valid months\n\n var lastSelection = document.getElementById(\"selectedYear\").value;\n\n document.getElementById(\"selectedYear\").value = year;\n\n document.getElementById(\"year\" + lastSelection).classList.remove(\"active\");\n document.getElementById(\"year\" + year).classList.add(\"active\");\n\n var validMonths = document.getElementById(\"valMonth_\" + year).value\n\n\n if(validMonths.includes(\"|01|\"))\n {\n document.getElementById(\"month1\").className = \"\";\n document.getElementById(\"month1\").onclick = function() { ArchiveSelectMonth(01); }\n }\n else\n {\n document.getElementById(\"month1\").className = \"invalid\";\n document.getElementById(\"month1\").onclick = \"\";\n }\n\n if(validMonths.includes(\"|02|\"))\n {\n document.getElementById(\"month2\").className = \"\";\n document.getElementById(\"month2\").onclick = function() { ArchiveSelectMonth(02); }\n }\n else\n {\n document.getElementById(\"month2\").className = \"invalid\";\n document.getElementById(\"month2\").onclick = \"\";\n }\n\n if(validMonths.includes(\"|03|\"))\n {\n document.getElementById(\"month3\").className = \"\";\n document.getElementById(\"month3\").onclick = function() { ArchiveSelectMonth(03); }\n }\n else\n {\n document.getElementById(\"month3\").className = \"invalid\";\n document.getElementById(\"month3\").onclick = \"\";\n }\n\n if(validMonths.includes(\"|04|\"))\n {\n document.getElementById(\"month4\").className = \"\";\n document.getElementById(\"month4\").onclick = function() { ArchiveSelectMonth(04); }\n }\n else\n {\n document.getElementById(\"month4\").className = \"invalid\";\n document.getElementById(\"month4\").onclick = \"\";\n }\n\n if(validMonths.includes(\"|05|\"))\n {\n document.getElementById(\"month5\").className = \"\";\n document.getElementById(\"month5\").onclick = function() { ArchiveSelectMonth(05); }\n }\n else\n {\n document.getElementById(\"month5\").className = \"invalid\";\n document.getElementById(\"month5\").onclick = \"\";\n }\n\n if(validMonths.includes(\"|06|\"))\n {\n document.getElementById(\"month6\").className = \"\";\n document.getElementById(\"month6\").onclick = function() { ArchiveSelectMonth(06); }\n }\n else\n {\n document.getElementById(\"month6\").className = \"invalid\";\n document.getElementById(\"month6\").onclick = \"\";\n }\n\n if(validMonths.includes(\"|07|\"))\n {\n document.getElementById(\"month7\").className = \"\";\n document.getElementById(\"month7\").onclick = function() { ArchiveSelectMonth(07); }\n }\n else\n {\n document.getElementById(\"month7\").className = \"invalid\";\n document.getElementById(\"month7\").onclick = \"\";\n }\n\n if(validMonths.includes(\"|08|\"))\n {\n document.getElementById(\"month8\").className = \"\";\n document.getElementById(\"month8\").onclick = function() { ArchiveSelectMonth(08); }\n }\n else\n {\n document.getElementById(\"month8\").className = \"invalid\";\n document.getElementById(\"month8\").onclick = \"\";\n }\n\n if(validMonths.includes(\"|09|\"))\n {\n document.getElementById(\"month9\").className = \"\";\n document.getElementById(\"month9\").onclick = function() { ArchiveSelectMonth(09); }\n }\n else\n {\n document.getElementById(\"month9\").className = \"invalid\";\n document.getElementById(\"month9\").onclick = \"\";\n }\n\n if(validMonths.includes(\"|10|\"))\n {\n document.getElementById(\"month10\").className = \"\";\n document.getElementById(\"month10\").onclick = function() { ArchiveSelectMonth(10); }\n }\n else\n {\n document.getElementById(\"month10\").className = \"invalid\";\n document.getElementById(\"month10\").onclick = \"\";\n }\n\n if(validMonths.includes(\"|11|\"))\n {\n document.getElementById(\"month11\").className = \"\";\n document.getElementById(\"month11\").onclick = function() { ArchiveSelectMonth(11); }\n }\n else\n {\n document.getElementById(\"month11\").className = \"invalid\";\n document.getElementById(\"month11\").onclick = \"\";\n }\n\n if(validMonths.includes(\"|12|\"))\n {\n document.getElementById(\"month12\").className = \"\";\n document.getElementById(\"month12\").onclick = function() { ArchiveSelectMonth(12); }\n }\n else\n {\n document.getElementById(\"month12\").className = \"invalid\";\n document.getElementById(\"month12\").onclick = \"\";\n }\n\n UpdateArchiveFrame();\n}", "handleSelectChange(e) {\r\n // check if target is year or month\r\n if (e.target.name == \"month\") {\r\n this.setState({\r\n month: e.target.value\r\n });\r\n }\r\n if (e.target.name == \"year\") {\r\n this.setState({\r\n year: e.target.value\r\n });\r\n }\r\n }", "static isSameYearMonth(dateA, dateB) {\n return (\n dateA.getFullYear() === dateB.getFullYear()\n && dateA.getMonth() === dateB.getMonth()\n );\n }", "function selectMonth() {\n currentMonth = Number(months.val());\n initBodyTable();\n}", "function diaS() {\r\n\r\n var month = document.getElementById(\"selMonth\").selectedIndex;;\r\n var year = document.getElementById(\"tfYear\").value;\r\n var iday = document.getElementById(\"tfDay\").value;\r\n var setdays = document.getElementById(\"setDay\").value;\r\n\r\n if ((isValidDays(iday)) && (isValidYear(year) && (isValidSetDays(setdays)))){\r\n printCalendar(year, month, iday, setdays);\r\n }\r\n \r\n}", "_setSelectedYear(value) {\n this._selectedYear = null;\n if (value instanceof DateRange) {\n const displayValue = value.start || value.end;\n if (displayValue) {\n this._selectedYear = this._dateAdapter.getYear(displayValue);\n }\n }\n else if (value) {\n this._selectedYear = this._dateAdapter.getYear(value);\n }\n }", "_setSelectedYear(value) {\n this._selectedYear = null;\n if (value instanceof DateRange) {\n const displayValue = value.start || value.end;\n if (displayValue) {\n this._selectedYear = this._dateAdapter.getYear(displayValue);\n }\n }\n else if (value) {\n this._selectedYear = this._dateAdapter.getYear(value);\n }\n }", "function formatYearMonthPicker(){\n\n if( $('input.month') && $('input.month').length > 0 ) {\n $('input.month').each(function(){\n if($(this).is('[readonly]') || $(this).is('[disabled]')){\n $.appendYmpicker($(this),\"\",\"\",true);\n } else {\n $.appendYmpicker($(this));\n }\n });\n }\n\n }", "function ds_adjustDaysInMonth() {\r\r\n\tMonth = this.monthObj[this.monthObj.selectedIndex].value;\r\r\n\t//alert( Month );\r\r\n\tYear = this.yearObj[this.yearObj.selectedIndex].value;\r\r\n\t//alert( Year);\r\r\n\t\r\r\n\tDaysForThisSelection = this._getDaysInMonth(Month, Year);\r\r\n\tPrevDaysInSelection = this.dayObj.length;\r\r\n\t//code added\r\r\n\tPrevDaysInSelection = PrevDaysInSelection - 1;\r\r\n\t\r\r\n\tif (PrevDaysInSelection > DaysForThisSelection) {\r\r\n\t\tfor (i=0; i<(PrevDaysInSelection-DaysForThisSelection); i++) {\r\r\n\t\t\tthis.dayObj.options[this.dayObj.options.length - 1] = null\r\r\n\t\t}\r\r\n\t}\r\r\n\tif (DaysForThisSelection > PrevDaysInSelection) {\r\r\n\t\tvar prevLastDay = this.dayObj.options.length;\r\r\n\t\tfor( i = prevLastDay+1; i <= DaysForThisSelection; i++ ) {\r\r\n\t\t\tvar newOption = new Option( i, i );\r\r\n\t\t\tvar optionsColl = this.dayObj.options;\r\r\n\t\t\toptionsColl[optionsColl.length] = newOption;\r\r\n\t\t}\r\r\n\t}\r\r\n\tif (this.dayObj.selectedIndex < 0)\r\r\n\t\tthis.dayObj.selectedIndex == 0;\r\r\n}", "function hasPreSelectionChanged(date1, date2) {\n if (date1 && date2) {\n return Object(date_fns_getMonth__WEBPACK_IMPORTED_MODULE_23__[\"default\"])(date1) !== Object(date_fns_getMonth__WEBPACK_IMPORTED_MODULE_23__[\"default\"])(date2) || Object(date_fns_getYear__WEBPACK_IMPORTED_MODULE_24__[\"default\"])(date1) !== Object(date_fns_getYear__WEBPACK_IMPORTED_MODULE_24__[\"default\"])(date2);\n }\n\n return date1 !== date2;\n}", "function hasPreSelectionChanged(date1, date2) {\n if (date1 && date2) {\n return Object(date_fns_getMonth__WEBPACK_IMPORTED_MODULE_23__[\"default\"])(date1) !== Object(date_fns_getMonth__WEBPACK_IMPORTED_MODULE_23__[\"default\"])(date2) || Object(date_fns_getYear__WEBPACK_IMPORTED_MODULE_24__[\"default\"])(date1) !== Object(date_fns_getYear__WEBPACK_IMPORTED_MODULE_24__[\"default\"])(date2);\n }\n\n return date1 !== date2;\n}", "function allAcademic()\n {\n try{ \n var k=0;\n var j=0;\n var year_option=document.getElementById(\"all_year\").selected;\n // var insti=document.getElementById(\"inst\").selected;\n // alert(year_option);\n if(year_option==true)\n { \n var n=document.getElementById(\"years\").value;\n for(var i=1;i<=n;i++){\n document.getElementById(\"acad_year\"+i).selected=true;\n k++;}\n if(k>0)\n {\n return true;\n }\n\n }else{\n var n=document.getElementById(\"years\").value;\n \n for(var i=1;i<=n;i++){\n if(document.getElementById(\"acad_year\"+i).selected==true)\n { \n j++;\n }\n }\n if(j==0)\n {\n alert(\"Please select a academic year\");\n return false;\n}else{\n return true;\n}\n}\n\n \n}\n catch(e)\n {\n //alert(e);\n }\n }", "onChange(event) {\n this.selectedYearAsText = event.year.toString();\n this.selectedMonthIndex = event.monthIndex;\n this.selectedMonthAsText = moment__WEBPACK_IMPORTED_MODULE_4___default()().month(event.monthIndex).format('MMMM');\n setTimeout(() => {\n this.year = event.year;\n this.month = (event.monthIndex + 1);\n }, 75);\n }", "function verifyDaysOfMonth(selectDay, selectMonth, selectYear) {\n var selectedMonth = selectMonth[0].selectedIndex,\n selectedYear = selectYear.val(),\n current_MaxDaysOfMonth = selectDay.children(':last').val(),\n correct_MaxDaysOfMonth = (new Date(selectedYear, selectedMonth, 0)).getDate();\n\n // Too much days.\n if (current_MaxDaysOfMonth > correct_MaxDaysOfMonth) {\n while (current_MaxDaysOfMonth > correct_MaxDaysOfMonth) {\n selectDay.children(\":last\").remove();\n current_MaxDaysOfMonth--;\n }\n // Missing days.\n } else if (current_MaxDaysOfMonth < correct_MaxDaysOfMonth) {\n while (current_MaxDaysOfMonth < correct_MaxDaysOfMonth) {\n var newDay = parseInt(current_MaxDaysOfMonth) + 1;\n $(\"<option></option>\").attr('value', newDay).text(newDay).appendTo(selectDay);\n current_MaxDaysOfMonth++;\n }\n }\n }", "_setSelected(selected) {\n if (selected === this._selected) {\n return false;\n }\n this._selected = selected;\n if (selected) {\n this.selectionList.selectedOptions.select(this);\n }\n else {\n this.selectionList.selectedOptions.deselect(this);\n }\n this.selectedChange.emit(selected);\n this._changeDetector.markForCheck();\n return true;\n }", "_setSelected(selected) {\n if (selected === this._selected) {\n return false;\n }\n this._selected = selected;\n if (selected) {\n this.selectionList.selectedOptions.select(this);\n }\n else {\n this.selectionList.selectedOptions.deselect(this);\n }\n this._changeDetector.markForCheck();\n return true;\n }", "_isYearAndMonthBeforeMinDate(year, month) {\n if (this.minDate) {\n const minYear = this._dateAdapter.getYear(this.minDate);\n const minMonth = this._dateAdapter.getMonth(this.minDate);\n return year < minYear || (year === minYear && month < minMonth);\n }\n return false;\n }", "_isYearAndMonthBeforeMinDate(year, month) {\n if (this.minDate) {\n const minYear = this._dateAdapter.getYear(this.minDate);\n const minMonth = this._dateAdapter.getMonth(this.minDate);\n return year < minYear || (year === minYear && month < minMonth);\n }\n return false;\n }", "function onChangeMonthYear(year, month, inst) {\n datepicker('setDate', `${year}-${month}-01`);\n const yyyymm = year + ((month < 10) ? '0' : '') + month;\n return fetchDates(topic, yyyymm);\n }", "checkMonthDataAval( monthId, yearId = this.state.selYear ) {\n\t\tconst {expenseData, noData} = this.state\n\t\tlet expenses = expenseData.getExpenses()\n\t\tfor( let i = 0; i < expenses.length; i++ ){\n\t\t\tif( expenses[i].month === monthId && expenses[i].year === yearId ){\n\t\t\t\tif( noData === true ){\n\t\t\t\t\tthis.setState( {noData:false} )\n\t\t\t\t}\n\t\t\t\treturn true\n\t\t\t}\n\t\t}\n\t\tif( noData === false ){\n\t\t\tthis.setState( {noData:true} )\n\t\t}\n\t\treturn false\n\t}", "function isSameMonth(a, b) {\n return a.getFullYear() === b.getFullYear() && b.getMonth() === a.getMonth();\n}", "function checkMonth (theField, emptyOK)\r\n{ if (checkMonth.arguments.length == 1) emptyOK = defaultEmptyOK;\r\n if ((emptyOK == true) && (isEmpty(theField.value))) return true;\r\n if (!isMonth(theField.value, false))\r\n return warnInvalid (theField, iMonth);\r\n else return true;\r\n}", "function checkMonth (theField, emptyOK)\r\n{ if (checkMonth.arguments.length == 1) emptyOK = defaultEmptyOK;\r\n if ((emptyOK == true) && (isEmpty(theField.value))) return true;\r\n if (!isMonth(theField.value, false))\r\n return warnInvalid (theField, iMonth);\r\n else return true;\r\n}", "function hasPreSelectionChanged(date1, date2) {\n if (date1 && date2) {\n return getMonth(date1) !== getMonth(date2) || getYear(date1) !== getYear(date2);\n }\n\n return date1 !== date2;\n}", "function hasPreSelectionChanged(date1, date2) {\n if (date1 && date2) {\n return getMonth(date1) !== getMonth(date2) || getYear(date1) !== getYear(date2);\n }\n\n return date1 !== date2;\n}", "function hasPreSelectionChanged(date1, date2) {\n if (date1 && date2) {\n return getMonth(date1) !== getMonth(date2) || getYear(date1) !== getYear(date2);\n }\n\n return date1 !== date2;\n}", "function hasPreSelectionChanged(date1, date2) {\n if (date1 && date2) {\n return getMonth(date1) !== getMonth(date2) || getYear(date1) !== getYear(date2);\n }\n\n return date1 !== date2;\n}", "function selectYear(event) {\r\n setRootDate(safeSetYear(listYear.value));\r\n listMonth.dispatchEvent(new Event('change'));\r\n }", "function checkDate() {\n if (age.month == 'none' || age.day == 'none' || age.year == 'none') {\n // Fade in the error...\n $('#modal-error').css('visibility', 'visible').hide().fadeIn('slow');\n\n // changes the background color of the select if invalid\n if (age.month == 'none') {\n $(\"#verify-month\").css('background', 'rgba(223,32,44,0.5)');\n // Look for change of value and change background color when valid\n $(\"#verify-month\").on('change', function () {\n if ($(\"#verify-month\").val() == 'none') {\n $(\"#verify-month\").css('background', 'rgba(223,32,44,0.5)');\n } else {\n $(\"#verify-month\").css('background', 'white');\n }\n });\n }\n\n // changes the background color of the select if invalid\n if (age.day == 'none') {\n $(\"#verify-day\").css('background', 'rgba(223,32,44,0.5)');\n // Look for change of value and change background color when valid\n $(\"#verify-day\").on('change', function () {\n if ($(\"#verify-day\").val() == 'none') {\n $(\"#verify-day\").css('background', 'rgba(223,32,44,0.5)');\n } else {\n $(\"#verify-day\").css('background', 'white');\n }\n });\n }\n\n // changes the background color of the select if invalid\n if (age.year == 'none') {\n $(\"#verify-year\").css('background', 'rgba(223,32,44,0.5)');\n // Look for change of value and change background color when valid\n $(\"#verify-year\").on('change', function () {\n if ($(\"#verify-year\").val() == 'none') {\n $(\"#verify-year\").css('background', 'rgba(223,32,44,0.5)');\n } else {\n $(\"#verify-year\").css('background', 'white');\n }\n });\n }\n } else {\n oldEnough();\n }\n }", "_selectMonth(normalizedMonth) {\n this.monthSelected.emit(normalizedMonth);\n }", "_selectMonth(normalizedMonth) {\n this.monthSelected.emit(normalizedMonth);\n }", "function checkCurrentDate(frmName){\n\t//alert(\"checkCurrentDate\");\n\tvar e = document.getElementById(\"TRANS_DATE_TO\");\n\tvar strDuration = e.options[e.selectedIndex].value;\n\talert(\"Selected Value\" + strDuration );\n\tvar d = new Date();\n var currentMonth = d.getMonth()+ 1;\n //var currentDay = d.getDate(); \n var currentYear = d.getFullYear();\n // alert(\"current\"+currentMonth+\"-\"+currentYear);\n \n //var duration=frmName.TRANS_DATE_TO.value.split(\"/\");\n var duration=strDuration.split(\"/\");\n var durationYear=duration[1];\n var durationMonth=duration[0];\n //alert(\"duration\"+durationYear+\"-\"+durationMonth);\n \n if((currentYear < durationYear)){\n \talert(\"Sorry Report available only until current Month : \");\n \tfrmName.TRANS_DATE_TO.focus();\n\t\tfrmName.TRANS_DATE_TO.select();\n \treturn false;\n }\n \n if(currentYear > durationYear){\n \t//alert(\"COrrect \");\n \t\n \treturn true;\n \t\n }\n if(currentYear == durationYear){\n \tif(currentMonth >= durationMonth){\n \t\t//alert(\"COrrect \");\n \t\treturn true;\n \t\t\n \t}\n \telse{\n \talert(\"Sorry Report available only until current Month : \");\n \tfrmName.TRANS_DATE_TO.focus();\n\t\tfrmName.TRANS_DATE_TO.select();\n \treturn false;\n \t}\n }\n \n \n}", "function isDate()\n{\n\tvar yy,mm,dd;\n\tvar im,id,iy;\n\tvar present_date = new Date();\n\tyy = 1900 + present_date.getYear();\n\tif (yy > 3000)\n\t{\n\t\tyy = yy - 1900;\n\t}\n\tmm = present_date.getMonth();\n\tdd = present_date.getDate();\n\tim = document.forms[0].month.selectedIndex;\n\tid = document.forms[0].day.selectedIndex;\n\tiy = document.forms[0].year.selectedIndex;\n\tvar entered_month = document.forms[0].month.options[im].value;\n\tvar invalid_month = document.forms[0].month.options[im].value - 1; \n\tvar entered_day = document.forms[0].day.options[id].value; \n\tvar entered_year = document.forms[0].year.options[iy].value; \n\tif ( (entered_day == 0) || (entered_month == 0) || (entered_year == 0) )\n\t{\n\t\talert(\"Please enter your birhtday\");\n\t\treturn false;\n\t}\n\tif ( is_greater_date(entered_year,entered_month,entered_day,yy,mm,dd) && is_valid_day(invalid_month,entered_day,entered_year) )\n\t{\n\t\treturn true; \n\t}\n\treturn false;\n}", "function update_month() { //this is helper function for when component param changes, update months and year\n\n\tvar solution2 = $('#solution_param').val();//Grab Parameters\n\tvar component2 = $('#component_param').val();\n\tvar start_year2 = $('#yearparam_start').val();\n\n\tvar temp_url = replace_url;//Formulate URL\n\ttemp_url += \"GenerateMonthList\";\n\ttemp_url += \"/\" + solution2;\n\ttemp_url += \"/\" + component2;\n\ttemp_url += \"/\" + start_year2;\n\t\n\n\tvar $month = $('#monthparam_start');\n\t$month.empty(); //clear out the year options\n\n\t$.ajax({\n\t\turl: temp_url,\n\t\tbeforeSend: function() {\n\t\t\t$('#loading-year-click').show();\n\t\t},\n\t\ttype: 'GET',\n\t\tdataType: 'json',\n\n\t\tsuccess: function(order) {\n\t\t\t$month.append($('<option>', {value:\"\"}).text(\"Please select an option\"));\t\n\t\t\t$.each(order, function(key, value) {\n\t\t\t\t$month.append($('<option>', {\n\t\t\t\t\tvalue: value\n\t\t\t\t}).text(value));\n\t\t\t});\n\t\t},\n\t\tcomplete: function() {\n\t\t\t$('#loading-year-click').hide();\n\t\t}\n\t});//end of AJAX call\n\treturn false;\n}//end of update_month()", "set month(month) {\n this.viewModel = this._service.getMonth(month);\n }", "get _shouldUpdateSelection(){return this.selected!=null||this.selectedValues!=null&&this.selectedValues.length;}", "function onClickPreYear(preYear, month, year) {\n preYear.onclick = function() {\n selectCbo(parseInt(year.options[year.selectedIndex].value) - 1, \n month.options[month.selectedIndex].value, \n daysInMonth(month.options[month.selectedIndex].value, \n parseInt(year.options[year.selectedIndex].value) - 1));\n var newDate = new Date();\n newDate.setFullYear(parseInt(year.options[year.selectedIndex].value) - 1, \n month.options[month.selectedIndex].value,\n 1);\n updateYear(year, newDate);\n }\n}", "function updateYear(year, date) {\n year.getElementsByTagName(\"option\")[date.getFullYear() - 1900].selected = \"selected\";\n}", "function ArchiveSelectMonth(month)\n{\n // DESCRIPTION:\n // Selects the month\n\n var lastSelection = document.getElementById(\"selectedMonth\").value;\n\n document.getElementById(\"selectedMonth\").value = month;\n\n document.getElementById(\"month\" + lastSelection).classList.remove(\"active\"); \n document.getElementById(\"month\" + month).classList.add(\"active\");\n\n UpdateArchiveFrame();\n}", "_validateSelectedDates(dates) {\n const that = this;\n let outOfRangeDates = [];\n\n if (!dates) {\n dates = that.selectedDates;\n }\n\n let selectedDates = dates.slice(0),\n filter = function (date) {\n if (date.getTime() >= that.min.getTime() && date.getTime() <= that.max.getTime() && !isRestrictedDate(date)) {\n return true;\n }\n\n outOfRangeDates.push(date);\n return;\n },\n isRestrictedDate = function (date) {\n for (let d = 0; d < that.restrictedDates.length; d++) {\n if (that.restrictedDates[d].getTime() === date.getTime()) {\n return true;\n }\n }\n }\n\n //Synchronize the attribute.\n that.selectedDates = selectedDates.filter(filter);\n\n //Unselects dates that are out of range.\n if (that._viewDates) {\n outOfRangeDates.map(date => that._selectDate(date));\n that._focusCell();\n }\n }", "selectMonth(normalizedMonth) {\r\n this.monthSelected.emit(normalizedMonth);\r\n }", "yearChangeRequiresMapping(year1, year2) {\n if (year1 === \"2017\") return year2 !== \"2017\";\n if (year2 === \"2017\") return year1 !== \"2017\";\n return false;\n }", "clickLeftMonthSelectYear() {\n $(this.rootElement)\n .$$('select')[0]\n .click();\n }", "clickRightMonthSelectYear() {\n $(this.rootElement)\n .$$('select')[1]\n .click();\n }", "isYearActive(year) {\n const date = this.createMoment(this.value).year(year);\n return date.isSame(this.value, 'year');\n }", "_shouldEnableMonth(month) {\n const activeYear = this._dateAdapter.getYear(this.activeDate);\n if (month === undefined || month === null ||\n this._isYearAndMonthAfterMaxDate(activeYear, month) ||\n this._isYearAndMonthBeforeMinDate(activeYear, month)) {\n return false;\n }\n if (!this.dateFilter) {\n return true;\n }\n const firstOfMonth = this._dateAdapter.createDate(activeYear, month, 1);\n // If any date in the month is enabled count the month as enabled.\n for (let date = firstOfMonth; this._dateAdapter.getMonth(date) == month; date = this._dateAdapter.addCalendarDays(date, 1)) {\n if (this.dateFilter(date)) {\n return true;\n }\n }\n return false;\n }", "_shouldEnableMonth(month) {\n const activeYear = this._dateAdapter.getYear(this.activeDate);\n if (month === undefined || month === null ||\n this._isYearAndMonthAfterMaxDate(activeYear, month) ||\n this._isYearAndMonthBeforeMinDate(activeYear, month)) {\n return false;\n }\n if (!this.dateFilter) {\n return true;\n }\n const firstOfMonth = this._dateAdapter.createDate(activeYear, month, 1);\n // If any date in the month is enabled count the month as enabled.\n for (let date = firstOfMonth; this._dateAdapter.getMonth(date) == month; date = this._dateAdapter.addCalendarDays(date, 1)) {\n if (this.dateFilter(date)) {\n return true;\n }\n }\n return false;\n }", "_dateSelected(event) {\n const date = event.value;\n const selectedYear = this._dateAdapter.getYear(this.activeDate);\n const selectedMonth = this._dateAdapter.getMonth(this.activeDate);\n const selectedDate = this._dateAdapter.createDate(selectedYear, selectedMonth, date);\n let rangeStartDate;\n let rangeEndDate;\n if (this._selected instanceof DateRange) {\n rangeStartDate = this._getDateInCurrentMonth(this._selected.start);\n rangeEndDate = this._getDateInCurrentMonth(this._selected.end);\n }\n else {\n rangeStartDate = rangeEndDate = this._getDateInCurrentMonth(this._selected);\n }\n if (rangeStartDate !== date || rangeEndDate !== date) {\n this.selectedChange.emit(selectedDate);\n }\n this._userSelection.emit({ value: selectedDate, event: event.event });\n }", "function setDate(e){\n\t\tif($('#selected-accomodation-' + idNumber).val() == null){return;}\n\t\tvar id = prevFocus ? prevFocus.attr('id') : null;\n\t\tvar secondElementId;\n\t\tvar elementDate;\n\t\tvar dataSource = $('#year-calendar').data('calendar').getDataSource();\n\t\tvar isDateValid;\n\t\t\n\t if(~id.indexOf(\"start-date\")){\n\t \tsecondElementId = \"#end-date-\" + idNumber;\n\t \tsecondElementDate = new Date(changeDateFormat($(secondElementId).val()));\t\n\t \tisDateValid = validateSelectedDates(dataSource, e.date, secondElementDate);\t\n\t \tif ((isNaN(secondElementDate) || e.date < secondElementDate) && (isDateValid)){setSelectedDate(id, e);}\t\n\t }else if(~id.indexOf(\"end-date\")){\n\t \tsecondElementId = \"#start-date-\" + idNumber;\n\t \tsecondElementDate = new Date(changeDateFormat($(secondElementId).val()));\n\t \tisDateValid = validateSelectedDates(dataSource, secondElementDate, e.date);\n\t \tif (!(isNaN(secondElementDate)) && (e.date >= secondElementDate) && (isDateValid)){\tsetSelectedDate(id, e);}\t\n\t }else{\n\t \treturn;\n\t }\n\t}", "function fillMonthYear() {\n\tvar i, j;\n\tvar month_arr = [\"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"];\n\t\n\tfor (i = 0; i < month_arr.length; i++) {\n\t\tselect_month.innerHTML += \"<option value='\" + i + \"'>\" + month_arr[i] + \"</option\";\n\t}\n\tfor (j = 1920; j < 2101; j++){\n\t\tselect_year.innerHTML += \"<option value='\" + j + \"'>\" + j + \"</option\";\n\t}\n\tcreateCalendar(current_month, current_year);\n}", "_isYearAndMonthAfterMaxDate(year, month) {\n if (this.maxDate) {\n const maxYear = this._dateAdapter.getYear(this.maxDate);\n const maxMonth = this._dateAdapter.getMonth(this.maxDate);\n return year > maxYear || (year === maxYear && month > maxMonth);\n }\n return false;\n }", "_isYearAndMonthAfterMaxDate(year, month) {\n if (this.maxDate) {\n const maxYear = this._dateAdapter.getYear(this.maxDate);\n const maxMonth = this._dateAdapter.getMonth(this.maxDate);\n return year > maxYear || (year === maxYear && month > maxMonth);\n }\n return false;\n }", "function select(element){\n element.siblings().removeClass(\"news-archive__filter--active\");\n element.addClass(\"news-archive__filter--active\");\n element.attr(\"data-year\") ? selectedYear = element.attr(\"data-year\") : selectedMonth = element.attr(\"data-month\");\n}", "function onClickPreMonth(preMonth, month, year) {\n preMonth.onclick = function() {\n selectCbo(year.options[year.selectedIndex].value, \n parseInt(month.options[month.selectedIndex].value) - 1, \n daysInMonth(parseInt(month.options[month.selectedIndex].value) - 1, \n year.options[year.selectedIndex].value));\n var newDate = new Date();\n newDate.setFullYear(year.options[year.selectedIndex].value, \n parseInt(month.options[month.selectedIndex].value) - 1,\n 1);\n updateMonth(month, newDate);\n updateYear(year, newDate);\n }\n}", "_isSelected(value) {\n return this.startValue === value || this.endValue === value;\n }", "_isSelected(value) {\n return this.startValue === value || this.endValue === value;\n }", "startsMonth() {\n\t\treturn this._type == \"month\" || this._type == \"always\" || (this._type == \"day\" && this._start.day == 1);\n\t}", "function onChangeSelect(month, year) {\n month.onchange = year.onchange = function() {\n selectCbo(year.options[year.selectedIndex].value, \n month.options[month.selectedIndex].value, \n daysInMonth(month.options[month.selectedIndex].value, \n year.options[year.selectedIndex].value));\n }\n}", "function setExpiryDate(year, month) \n{\n\tthis.year = year;\n\tthis.month = month;\n\treturn this;\n}", "compare(monthObject) {\n let y_cmp = this._year - monthObject.year;\n return y_cmp == 0 ? (this._month - monthObject.month) : (y_cmp > 0 ? 1 : -1);\n }", "function isMonthYearInRange (month, year) {\n // adjust month to 1-based because format date returns month as 1-based\n var monthPlusOne = month + 1;\n var leadingZero = monthPlusOne < 10 ? '0' : '';\n \n if (parseInt(year + leadingZero + monthPlusOne) < parseInt(formatDate(minDate, 'YYYYMM')) ||\n parseInt(year + leadingZero + monthPlusOne) > parseInt(formatDate(maxDate, 'YYYYMM'))) {\n \n return false;\n }\n \n return true;\n }", "function toYearUpdated(event) {\n var year = asInt(getYearChoiceTo());\n $(\"#inputGroupSelect02 option\").each(function(index, element) {\n element.disabled = (year > 0 && index > 0 && asInt(element.value) >= year);\n });\n}", "function showOption() {\n\tvar month = document.getElementById(\"m_select\");\n var year = document.getElementById(\"y_select\");\n\tclearRow();\n\tshowCalendar(month.value,year.value);\n}", "function validateMonth(year,value){\n var current_year = parseInt(year.val());\n if(value > 12){\n year.val(current_year+1);\n return 1;\n }else if(value<1){\n year.val(current_year-1);\n return 12;\n }else{\n return value;\n }\n}", "function FillDateList(thisDay, thisMonth, thisYear)\n{\n var leapyear;\n var datecounter=0;\n var dateselected=0;\n var num=thisMonth.selectedIndex;\n \n dateselected=thisDay.selectedIndex;\n\n // check the selected year is leap year or not\n if ( (parseInt(thisYear.value) % 4 == 0 && parseInt(thisYear.value) % 100 != 0 ) \n || parseInt(thisYear.value) % 400 == 0 ) \n {\n leapyear = true;\n } else {\n leapyear = false;\n }\n\t\n // Check if the selected month is April, June, September, November or not\n if(num == 3 || num == 5 || num == 8 || num == 10){\n num=30;\n } else { // else check if it is Febuary or not\n if(num == 1) {\n\t // check leap year\n\t if(leapyear) num=29;\n\t if(!leapyear) num=28;\n } else {\n\t num= 31;\n }\n }\n\n if (dateselected < 0) dateselected=0;\n if (dateselected > num-1) dateselected=num-1;\n\t\n for (datecounter=0;datecounter<num;datecounter++)\n {\n thisDay.options[datecounter] = new Option(String(datecounter+1), String(datecounter+1));\n \n }\n \n thisDay.length = datecounter;\n thisDay.options.length = datecounter;\n thisDay.selectedIndex = dateselected;\n}", "function _isSameMonth(d1, d2) {\n return _isSameYear(d1, d2) && d1.getMonth() === d2.getMonth();\n }", "function isValidDate(date){\n var currentDate=$(\"#calendar\").fullCalendar('getDate');\n var currentMonth=currentDate.get('month');\n if(date.get('month')!=currentMonth){\n return false;\n }\n return true;\n}", "function fromYearUpdated(event) {\n var year = asInt(getYearChoiceFrom());\n $(\"#inputGroupSelect03 option\").each(function(index, element) {\n element.disabled = (year > 0 && index > 0 && asInt(element.value) <= year);\n });\n}", "function updateSelect(cal)\r\n{\r\n var date= cal.date;\r\n var selectMonth = document.getElementById(\"drop_dmonth\");\r\n selectMonth.selectedIndex = (date.getMonth()+1);\r\n var selectDay = document.getElementById(\"drop_dday\");\r\n selectDay.selectedIndex = (date.getDate());\r\n var selectYear = document.getElementById(\"drop_dyear\");\r\n //selectYear.selectedIndex = (date.getFullYear()-2011);\r\n var year_option = document.getElementById(\"txt_year_option\").value;\r\n //alert(\"\"+year_option+\"\");\r\n selectYear.selectedIndex = (date.getFullYear()-parseInt(year_option));\r\n var selectHour = document.getElementById(\"drop_dhour\");\r\n selectHour.selectedIndex = (date.getHours()+1);\r\n var selectMinute = document.getElementById(\"drop_dmin\");\r\n if(date.getMinutes()==0)\r\n {\r\n selectMinute.selectedIndex = 1 ;\r\n }\r\n else if(date.getMinutes() > 0 && date.getMinutes() <= 15 )\r\n {\r\n selectMinute.selectedIndex = 2 ;\r\n }\r\n else if(date.getMinutes() > 15 && date.getMinutes() <= 30 )\r\n {\r\n selectMinute.selectedIndex = 3 ;\r\n }\r\n else if(date.getMinutes() > 30 && date.getMinutes() <= 59 )\r\n {\r\n selectMinute.selectedIndex = 4 ;\r\n }\r\n}", "isCurrentYear(year) {\n const date = this.createMoment(this.value).year(year);\n return date.isSame(this._current, 'year');\n }", "function isSameMonth ( dt, dt2 ) {\n\t\treturn dt.getMonth() === dt2.getMonth() && dt.getFullYear() === dt2.getFullYear();\n\t}", "function selectMonth(event) {\r\n if (toggleTimeCal.classList.contains('calActive')) { switchTimeCal(event, true) }\r\n setRootDate(safeSetMonth(listMonth.selectedIndex));\r\n renderCalendar();\r\n calendar.dispatchEvent(new Event('click'));\r\n }" ]
[ "0.65656024", "0.65656024", "0.63593584", "0.60906655", "0.5955042", "0.5863237", "0.5845072", "0.57911855", "0.5727883", "0.56956816", "0.56956816", "0.56865835", "0.56865835", "0.5653115", "0.56506276", "0.5645195", "0.5645195", "0.564405", "0.55890894", "0.557247", "0.5555571", "0.5555571", "0.5540653", "0.5527973", "0.5509826", "0.54617286", "0.54617286", "0.54534113", "0.54321355", "0.54085684", "0.5389302", "0.53677356", "0.53567713", "0.53383374", "0.53383374", "0.53361934", "0.5333466", "0.5318786", "0.5318786", "0.5299096", "0.52705806", "0.52597463", "0.52367145", "0.52330613", "0.52318585", "0.52318585", "0.5229404", "0.5219339", "0.5211916", "0.52098936", "0.52098936", "0.52088", "0.52088", "0.52088", "0.52088", "0.5199658", "0.5193958", "0.51881367", "0.51881367", "0.51813895", "0.5178327", "0.51690453", "0.51638734", "0.5148923", "0.5148763", "0.51464653", "0.5144577", "0.5143624", "0.5133363", "0.5129443", "0.51237774", "0.5120624", "0.51068294", "0.50971687", "0.50971687", "0.5079463", "0.50764203", "0.5067104", "0.50668925", "0.50668925", "0.506619", "0.50407225", "0.50368667", "0.50368667", "0.5036624", "0.5034479", "0.5030572", "0.5025509", "0.502076", "0.50057334", "0.49937767", "0.49922737", "0.49852931", "0.49828073", "0.4978909", "0.4968106", "0.49669853", "0.4955055", "0.49549866", "0.4954135" ]
0.776558
0
maybe there is a better way to do this 1. start counting the days from the left side (firstDayOfWeek) 2. increment firstDayOfWeek to mimic moving towards the right side (firstDayOfMonth) 3. if firstDayOfWeek becomes > 6 reset to 0 continue until firstDayOfWeek === firstDayOfMonth
function getDaysBeforeFirstDayOfMonth(firstDayOfWeek, firstDayOfMonth) { if (firstDayOfMonth === firstDayOfWeek || firstDayOfMonth < 0 || firstDayOfMonth > 6 || firstDayOfWeek < 0 || firstDayOfWeek > 6) { return; } var daysBefore = 0; while (firstDayOfWeek !== firstDayOfMonth) { daysBefore++; firstDayOfWeek++; if (firstDayOfWeek > 6) { firstDayOfWeek = 0; } } return daysBefore; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function weekCycler (day) {\n day += 1;\n if (day > 6) {\n day = 0;\n }\n return day\n}", "weekDaysBeforeFirstDayOfTheMonth() {\n const firstDayOfTheMonth = new Date(`${this.displayedYear}-${pad(this.displayedMonth + 1)}-01T00:00:00+00:00`);\n const weekDay = firstDayOfTheMonth.getUTCDay();\n return (weekDay - parseInt(this.firstDayOfWeek) + 7) % 7;\n }", "adjDayOfWeekToStartOnMonday(today) {\n let dayOfWeek = this.dateAdapter.getDayOfWeek(today);\n dayOfWeek = dayOfWeek === 0 ? 6 : (dayOfWeek - 1);\n return dayOfWeek;\n }", "function adjustWeekDay(firstDayOfWeek, dateWeekDay) {\n return firstDayOfWeek !== _dateValues_dateValues__WEBPACK_IMPORTED_MODULE_1__.DayOfWeek.Sunday && dateWeekDay < firstDayOfWeek\n ? dateWeekDay + _dateValues_timeConstants__WEBPACK_IMPORTED_MODULE_0__.TimeConstants.DaysInOneWeek\n : dateWeekDay;\n}", "getCalendarDays(_ref2) {\n let monthComps = _ref2.monthComps,\n prevMonthComps = _ref2.prevMonthComps,\n nextMonthComps = _ref2.nextMonthComps;\n const days = [];\n const firstDayOfWeek = monthComps.firstDayOfWeek,\n firstWeekday = monthComps.firstWeekday;\n const prevMonthDaysToShow = firstWeekday + (firstWeekday < firstDayOfWeek ? daysInWeek : 0) - firstDayOfWeek;\n let prevMonth = true;\n let thisMonth = false;\n let nextMonth = false; // Formatter for aria labels\n\n const formatter = new Intl.DateTimeFormat(this.id, {\n weekday: 'long',\n year: 'numeric',\n month: 'long',\n day: 'numeric'\n }); // Init counters with previous month's data\n\n let day = prevMonthComps.days - prevMonthDaysToShow + 1;\n let dayFromEnd = prevMonthComps.days - day + 1;\n let weekdayOrdinal = Math.floor((day - 1) / daysInWeek + 1);\n let weekdayOrdinalFromEnd = 1;\n let week = prevMonthComps.weeks;\n let weekFromEnd = 1;\n let month = prevMonthComps.month;\n let year = prevMonthComps.year; // Store todays comps\n\n const today = new Date();\n const todayDay = today.getDate();\n const todayMonth = today.getMonth() + 1;\n const todayYear = today.getFullYear(); // Cycle through 6 weeks (max in month)\n\n for (let w = 1; w <= 6; w++) {\n // Cycle through days in week\n for (let i = 1, weekday = firstDayOfWeek; i <= daysInWeek; i++, weekday += weekday === daysInWeek ? 1 - daysInWeek : 1) {\n // We need to know when to start counting actual month days\n if (prevMonth && weekday === firstWeekday) {\n // Reset counters for current month\n day = 1;\n dayFromEnd = monthComps.days;\n weekdayOrdinal = Math.floor((day - 1) / daysInWeek + 1);\n weekdayOrdinalFromEnd = Math.floor((monthComps.days - day) / daysInWeek + 1);\n week = 1;\n weekFromEnd = monthComps.weeks;\n month = monthComps.month;\n year = monthComps.year; // ...and flag we're tracking actual month days\n\n prevMonth = false;\n thisMonth = true;\n } // Append day info for the current week\n // Note: this might or might not be an actual month day\n // We don't know how the UI wants to display various days,\n // so we'll supply all the data we can\n\n\n const date = new Date(year, month - 1, day);\n const id = this.format(date, 'YYYY-MM-DD');\n const weekdayPosition = i;\n const weekdayPositionFromEnd = daysInWeek - i;\n const isToday = day === todayDay && month === todayMonth && year === todayYear;\n const isFirstDay = thisMonth && day === 1;\n const isLastDay = thisMonth && day === monthComps.days;\n const onTop = w === 1;\n const onBottom = w === 6;\n const onLeft = i === 1;\n const onRight = i === daysInWeek;\n days.push({\n id,\n label: day.toString(),\n ariaLabel: formatter.format(date),\n day,\n dayFromEnd,\n weekday,\n weekdayPosition,\n weekdayPositionFromEnd,\n weekdayOrdinal,\n weekdayOrdinalFromEnd,\n week,\n weekFromEnd,\n month,\n year,\n date,\n dateTime: date.getTime(),\n isToday,\n isFirstDay,\n isLastDay,\n inMonth: thisMonth,\n inPrevMonth: prevMonth,\n inNextMonth: nextMonth,\n onTop,\n onBottom,\n onLeft,\n onRight,\n classes: [`id-${id}`, `day-${day}`, `day-from-end-${dayFromEnd}`, `weekday-${weekday}`, `weekday-position-${weekdayPosition}`, `weekday-ordinal-${weekdayOrdinal}`, `weekday-ordinal-from-end-${weekdayOrdinalFromEnd}`, `week-${week}`, `week-from-end-${weekFromEnd}`, {\n 'is-today': isToday,\n 'is-first-day': isFirstDay,\n 'is-last-day': isLastDay,\n 'in-month': thisMonth,\n 'in-prev-month': prevMonth,\n 'in-next-month': nextMonth,\n 'on-top': onTop,\n 'on-bottom': onBottom,\n 'on-left': onLeft,\n 'on-right': onRight\n }]\n }); // See if we've hit the last day of the month\n\n if (thisMonth && isLastDay) {\n thisMonth = false;\n nextMonth = true; // Reset counters to next month's data\n\n day = 1;\n dayFromEnd = nextMonthComps.days;\n weekdayOrdinal = 1;\n weekdayOrdinalFromEnd = Math.floor((nextMonthComps.days - day) / daysInWeek + 1);\n week = 1;\n weekFromEnd = nextMonthComps.weeks;\n month = nextMonthComps.month;\n year = nextMonthComps.year; // Still in the middle of the month (hasn't ended yet)\n } else {\n day++;\n dayFromEnd--;\n weekdayOrdinal = Math.floor((day - 1) / daysInWeek + 1);\n weekdayOrdinalFromEnd = Math.floor((monthComps.days - day) / daysInWeek + 1);\n }\n } // Append week days\n\n\n week++;\n weekFromEnd--;\n }\n\n return days;\n }", "getCalendarDays(_ref2) {\n let monthComps = _ref2.monthComps,\n prevMonthComps = _ref2.prevMonthComps,\n nextMonthComps = _ref2.nextMonthComps;\n const days = [];\n const firstDayOfWeek = monthComps.firstDayOfWeek,\n firstWeekday = monthComps.firstWeekday;\n const prevMonthDaysToShow = firstWeekday + (firstWeekday < firstDayOfWeek ? daysInWeek : 0) - firstDayOfWeek;\n let prevMonth = true;\n let thisMonth = false;\n let nextMonth = false; // Formatter for aria labels\n\n const formatter = new Intl.DateTimeFormat(this.id, {\n weekday: 'long',\n year: 'numeric',\n month: 'long',\n day: 'numeric'\n }); // Init counters with previous month's data\n\n let day = prevMonthComps.days - prevMonthDaysToShow + 1;\n let dayFromEnd = prevMonthComps.days - day + 1;\n let weekdayOrdinal = Math.floor((day - 1) / daysInWeek + 1);\n let weekdayOrdinalFromEnd = 1;\n let week = prevMonthComps.weeks;\n let weekFromEnd = 1;\n let month = prevMonthComps.month;\n let year = prevMonthComps.year; // Store todays comps\n\n const today = new Date();\n const todayDay = today.getDate();\n const todayMonth = today.getMonth() + 1;\n const todayYear = today.getFullYear(); // Cycle through 6 weeks (max in month)\n\n for (let w = 1; w <= 6; w++) {\n // Cycle through days in week\n for (let i = 1, weekday = firstDayOfWeek; i <= daysInWeek; i++, weekday += weekday === daysInWeek ? 1 - daysInWeek : 1) {\n // We need to know when to start counting actual month days\n if (prevMonth && weekday === firstWeekday) {\n // Reset counters for current month\n day = 1;\n dayFromEnd = monthComps.days;\n weekdayOrdinal = Math.floor((day - 1) / daysInWeek + 1);\n weekdayOrdinalFromEnd = Math.floor((monthComps.days - day) / daysInWeek + 1);\n week = 1;\n weekFromEnd = monthComps.weeks;\n month = monthComps.month;\n year = monthComps.year; // ...and flag we're tracking actual month days\n\n prevMonth = false;\n thisMonth = true;\n } // Append day info for the current week\n // Note: this might or might not be an actual month day\n // We don't know how the UI wants to display various days,\n // so we'll supply all the data we can\n\n\n const date = new Date(year, month - 1, day);\n const id = this.format(date, 'YYYY-MM-DD');\n const weekdayPosition = i;\n const weekdayPositionFromEnd = daysInWeek - i;\n const isToday = day === todayDay && month === todayMonth && year === todayYear;\n const isFirstDay = thisMonth && day === 1;\n const isLastDay = thisMonth && day === monthComps.days;\n const onTop = w === 1;\n const onBottom = w === 6;\n const onLeft = i === 1;\n const onRight = i === daysInWeek;\n days.push({\n id,\n label: day.toString(),\n ariaLabel: formatter.format(date),\n day,\n dayFromEnd,\n weekday,\n weekdayPosition,\n weekdayPositionFromEnd,\n weekdayOrdinal,\n weekdayOrdinalFromEnd,\n week,\n weekFromEnd,\n month,\n year,\n date,\n dateTime: date.getTime(),\n isToday,\n isFirstDay,\n isLastDay,\n inMonth: thisMonth,\n inPrevMonth: prevMonth,\n inNextMonth: nextMonth,\n onTop,\n onBottom,\n onLeft,\n onRight,\n classes: [`id-${id}`, `day-${day}`, `day-from-end-${dayFromEnd}`, `weekday-${weekday}`, `weekday-position-${weekdayPosition}`, `weekday-ordinal-${weekdayOrdinal}`, `weekday-ordinal-from-end-${weekdayOrdinalFromEnd}`, `week-${week}`, `week-from-end-${weekFromEnd}`, {\n 'is-today': isToday,\n 'is-first-day': isFirstDay,\n 'is-last-day': isLastDay,\n 'in-month': thisMonth,\n 'in-prev-month': prevMonth,\n 'in-next-month': nextMonth,\n 'on-top': onTop,\n 'on-bottom': onBottom,\n 'on-left': onLeft,\n 'on-right': onRight\n }]\n }); // See if we've hit the last day of the month\n\n if (thisMonth && isLastDay) {\n thisMonth = false;\n nextMonth = true; // Reset counters to next month's data\n\n day = 1;\n dayFromEnd = nextMonthComps.days;\n weekdayOrdinal = 1;\n weekdayOrdinalFromEnd = Math.floor((nextMonthComps.days - day) / daysInWeek + 1);\n week = 1;\n weekFromEnd = nextMonthComps.weeks;\n month = nextMonthComps.month;\n year = nextMonthComps.year; // Still in the middle of the month (hasn't ended yet)\n } else {\n day++;\n dayFromEnd--;\n weekdayOrdinal = Math.floor((day - 1) / daysInWeek + 1);\n weekdayOrdinalFromEnd = Math.floor((monthComps.days - day) / daysInWeek + 1);\n }\n } // Append week days\n\n\n week++;\n weekFromEnd--;\n }\n\n return days;\n }", "function forwardWeek() {\n weekArray[0][\"day\"] = weekArray[0][\"day\"] + 7;\n numberOfDays(weekArray[0][\"year\"], weekArray[0][\"month\"]);\n\n if (parseInt(weekArray[0][\"day\"]) > daysInMonth) {\n weekArray[0][\"day\"] = weekArray[0][\"day\"] - daysInMonth;\n weekArray[0][\"month\"] = parseInt(weekArray[0][\"month\"]) + 1;\n }\n\n increaseDays();\n displayDates();\n}", "function russifyWeekDay(day) {\n if (day == 0)\n return 6;\n return day - 1;\n }", "function addDaysFromPastMonth(){\n var startDay = getFirstSunday();\n if(startDay!=1){\n var numberOfDaysInPreviousMonth = getNumberOfDaysInPreviousMonth();\n while(startDay<=numberOfDaysInPreviousMonth){\n createDayDiv(dateInfo.currentYear, dateInfo.currentMonth-1, startDay);\n startDay++;\n }\n }\n}", "function monthCycler (month) {\n //cycle through days of the month\n for (let i = 0 ; i < months[currentMonth] ; i++) {\n //Check if it's one of our sundays and increment the count if true\n if ((i === 0) && (currentDay === 6)) {\n specialSundays++;\n }\n currentDay = weekCycler(currentDay);\n }\n //increment currentMonth\n month++;\n if (month > 11) {\n month = 0;\n }\n return month;\n}", "function startOfWeek() {\n\t\t\t// console.log('StarOfWeek :: targetYear 1 : ' + targetYear);\n\t\t\t// console.log('StarOfWeek :: targetDayOfWeek : '+targetDayOfWeek);\n\t\t\tif (targetDayOfWeek == 0) {\n\t\t\t\ttargetSundayDate = [targetYear,targetMonth,targetDay];\n\t\t\t\t// console.log('if (targetDayOfWeek == 0) then '+targetSundayDate)\n\t\t\t\t// console.log('StarOfWeek :: targetYear 3 : ' + targetYear);\n\t\t\t} else if(targetDayOfWeek<=targetDay) {\n\t\t\t\t// console.log('if(targetDayOfWeek<=targetDay) :: ('+targetDayOfWeek+'<='+targetDay+')');\n\t\t\t\ttargetSundayDate = [targetYear,targetMonth,\n\t\t\t\t\ttargetDay-targetDayOfWeek];\n\t\t\t\t// console.log('StarOfWeek :: targetYear 4 : ' + targetYear);\n\t\t\t} else {\n\t\t\t\t// console.log('if(targetDayOfWeek>targetDay) :: ('+targetDayOfWeek+'>'+targetDay+')');\n\t\t\t\t// console.log('targetMonth :: '+targetMonth);\n\t\t\t\tif (targetMonth==0) {\n\t\t\t\t\tvar tempMonth = 11;\n\t\t\t\t\tvar tempYear = targetYear-1;\n\t\t\t\t} else {\n\t\t\t\t\tvar tempMonth = targetMonth - 1;\n\t\t\t\t\tvar tempYear = targetYear;\n\t\t\t\t}\n\t\t\t\t// console.log('monthName[tempMonth] :: '+monthName[tempMonth]);\n\t\t\t\tvar tempSundayDay = monthLength[tempMonth] \n\t\t\t\t\t- (targetDayOfWeek-targetDay);\n\t\t\t\ttargetSundayDate = [tempYear,tempMonth,tempSundayDay];\n\t\t\t\t// console.log('StarOfWeek :: targetYear 5 : ' + targetSundayDate[0]);\n\t\t\t}\n\n\t\t\t// console.log('StarOfWeek :: targetYear 2 : ' + targetYear);\n\t\t\t// console.log('function startOfWeek :: Sunday: '+ targetSundayDate[2]+' '+monthName[targetSundayDate[1]]+' '+targetSundayDate[0]);\n\t\t\tadjustForLeapYears('startOfWeek()',targetSundayDate[0]);\n\t\t}", "function populateWeekDays() {\n let today = new Date();\n let week = [\n \"Sunday\",\n \"Monday\",\n \"Tuesday\",\n \"Wednesday\",\n \"Thursday\",\n \"Friday\",\n \"Saturday\",\n ];\n\n let weekDay = today.getDay();\n\n let i = 1;\n while (i < 6) {\n weekDay = weekDay + 1;\n if (weekDay === 7) {\n weekDay = 0;\n }\n\n let forecastWeek = document.querySelector(`#week-${i}`);\n forecastWeek.innerHTML = week[weekDay];\n i++;\n }\n}", "firstWeekdayInMonth() {\n return new Date(this.year, this.monthIndex, 1).getDay() + 1;\n }", "function countingSundays() {\n var sundayCount = 0;\n var firstOfMonth = ((365 % 7) + 1) % 7;\n for (var year = 1901; year <= 2000; year++) {\n for (var month = 1; month <= 12; month++) {\n if (month == 9 || month == 4 || month == 6 || month == 11) {\n firstOfMonth = ((30 % 7) + firstOfMonth) % 7;\n } else if (month == 2 && year % 4 == 0) {\n firstOfMonth = ((29 % 7) + firstOfMonth) % 7;\n } else if (month == 2) {\n firstOfMonth = ((28 % 7) + firstOfMonth) % 7;\n } else {\n firstOfMonth = ((31 % 7) + firstOfMonth) % 7;\n }\n if (firstOfMonth == 0) {\n sundayCount ++;\n }\n }\n }\n return sundayCount;\n}", "function nextWeek () {\n\tif(day > daysInMonth-6) { // if there is less than 6 days to the end of the month\n\t\tday = 1; // change the day to first day of month\n\t\tnextMonth(); // calling a \"next month\" funtion to change the month\n\t} else { // if there is more than 6 days to the end of the month\n\t\tweekToDisplay[4]++; // show next week\n\t\tday+=7; // add 7 to current day\n\t}\n\tremoveWeeks(); // remove calendar elements\n\tcreateCalendar(); // create new calendar elements\n}", "function getFirstSunday(){\n var date = new Date(dateInfo.currentYear, dateInfo.currentMonth, 1, 0, 0, 0, 0);\n if(date.getDay()==0){\n return 1;\n }\n else\n {\n startDay = getNumberOfDaysInPreviousMonth();\n // start at the endo of the month and subtract the number of days to get Sunday\n for(var i=0;i<date.getDay()-1;i++){\n startDay--;\n }\n return startDay;\n }\n}", "function first_day (new_date) {\n\tvar day_of_week = new_date.getDay();\n\tvar day_in_month = new_date.getDate();\n\tif (day_in_month > 1) {\n\t\tday_in_month -= 1;\n\t\tday_in_month = day_in_month % 7;\n\t\twhile (day_in_month > 0) {\n\t\t\tif (day_of_week === 0) {\n\t\t\t\tday_of_week = 6;\n\t\t\t} else {\n\t\t\t\tday_of_week --;\n\t\t\t}\n\n\t\t\tday_in_month --;\n\t\t}\n\t} \n\treturn day_of_week;\n}", "function arrangDays(month, day) {\n //-------------------------------------------------------------------------------//\n //------------------------------------- Week One --------------------------------//\n //-------------------------------------------------------------------------------//\n if (day >= 1 && day <= 7) {\n //-------------------- cheks if jan contains a prorities----------------------//\n if (month.hasOwnProperty('Week1')) {\n month.Week1.tatal += 1;\n //------------------------- week 1 and have a value for thisday then add 1\n\n month.Week1.days[day - 1] += 1;\n }\n }\n //-------------------------------------------------------------------------------//\n //------------------------------------- Week tow --------------------------------//\n //-------------------------------------------------------------------------------//\n if (day > 7 && day <= 14) {\n //-------------------- cheks if jan contains a prorities----------------------//\n if (month.hasOwnProperty('Week2')) {\n month.Week2.tatal += 1;\n //------------------------- week 2 and have a value for thisday then add 1\n\n month.Week2.days[day - 8] += 1;\n }\n }\n\n //---------------------------------------------------------------------------------//\n //------------------------------------- Week three --------------------------------//\n //---------------------------------------------------------------------------------//\n if (day > 14 && day <= 22) {\n //-------------------- cheks if jan contains a prorities-------------------------//\n if (month.hasOwnProperty('Week3')) {\n month.Week2.tatal += 1;\n //------------------------- week 3 and have a value for thisday then add 1\n\n month.Week3.days[day - 15] += 1;\n }\n }\n\n //---------------------------------------------------------------------------------//\n //------------------------------------- Week three --------------------------------//\n //---------------------------------------------------------------------------------//\n if (day > 22 && day <= 31) {\n //-------------------- cheks if jan contains a prorities-------------------------//\n if (month.hasOwnProperty('Week4')) {\n month.Week2.tatal += 1;\n //------------------------- week 4 and have a value for thisday then add 1\n\n month.Week4.days[day - 22] += 1;\n\n //------------------------- week 4 and dose not have this a value for thisday then =1\n }\n }\n}", "function startOfWeek(date) {\n var d = moment(date)\n var day = d.day()\n if (day === 0) {\n d = d.day(-6)\n return d\n }\n else {\n return d.day(1)\n }\n //var newDate = d.set('date', d.date() - d.day())\n //console.log(\"New Date\", newDate.toString())\n // set day of the week to monday. \n // if it is a sunday, set it to last monday\n return newDate\n}", "function DefWeekNum(dd)\n{\nnumd = 0;\nnumw = 0;\nfor (n=1; n<QueryMonth; n++)\n{\nnumd += MonthLength[n];\n}\nnumd = numd + dd - (9 - DefDateDay(QueryYear,1,1));\nnumw = Math.floor(numd / 7) + 1;\n\nif (DefDateDay(QueryYear,1,1) == 1) { numw++; }\nreturn numw;\n}", "function addDayOfWeekToMissedDays()\r\n{\r\n\t$(\"tr td[colspan=4]:not(.grey)\").each(function(){\r\n\t\tvar dateField = this.previousSibling.previousSibling;\r\n\t\t\t\t\r\n\t\tif(isInt($(dateField).text()[0]))\r\n\t\t{\t\t\r\n\t\t\tsetupDay(dateField,\tnull);\r\n\t\t}\r\n\t});\r\n}", "function DefDateDay(yy,mm,dd)\n{\nreturn Math.floor((Date2Days(yy,mm,dd)-2) % 7) + 1;\n}", "function scheduleNextWeek() {\n const date = new Date();\n const day = date.getDay();\n if (day === 0) {\n schedulePlusN(1)();\n } else if (day > 0) {\n schedulePlusN(8 - day)();\n }\n }", "function findWeeksInMonth () {\n\tvar startingDay = 1; // setting a first day of the month \n\tvar daysInStartingWeek = 7 - startingDay; // count days in the first week\n\tvar daysLeft = daysInMonth - daysInStartingWeek; // substracting 1 week\n\tvar weeksLeft = Math.floor(daysLeft/7); // count how many full weeks left in a month\n\tweeksLeft++; // 1 week added for the first week\n\tif(daysLeft%7 !== 0) { // if there is something left from the full weeks...\n\t numberOfWeeks = ++weeksLeft; // add 1 to weeks number and save it in a variable\n\t} else { // if there is nothing left but the full weeks...\n\t numberOfWeeks = weeksLeft; // save a result in a variable\n\t}\n}", "function weekdayCalculation() {\n\t\t\t//define local variables\n\t\t\tvar daysOfWeek = [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"];\n\t\t\tvar currentDate = new Date(self.year, self.activedate.month - 1, self.activedate.day);\n\t\t\tvar wkdayNum = currentDate.getDay();\n\t\t\tself.activedate.wkday = daysOfWeek[wkdayNum];\n\t\t}", "function setUpCalendar(date) {\n \n var firstDayofMonth = new Date(date.getFullYear(),date.getMonth()),\n lastDayofMonth = new Date(date.getFullYear(),date.getMonth()+1)\n polishDays = [6,0,1,2,3,4,5];\n\n lastDayofMonth.setDate(lastDayofMonth.getDate()-1);\n\n for (let i = 1; i < 43; i++) {\n var newSpan = document.createElement(\"span\");\n\n if ((i- polishDays[firstDayofMonth.getDay()] > 0) && (lastDayofMonth.getDate()+1 > i - polishDays[firstDayofMonth.getDay()])){\n newSpan.appendChild(document.createTextNode(i - polishDays[firstDayofMonth.getDay()])); \n newSpan.classList.add(\"day-in-calendar\");\n } \n \n if (i - polishDays[firstDayofMonth.getDay()]=== date.getDate()) {\n newSpan.classList.add(\"picked\");\n } \n \n if(i - polishDays[firstDayofMonth.getDay()] < lastDayofMonth.getDate() +(7-lastDayofMonth.getDay()+1)) {\n if ((i- polishDays[firstDayofMonth.getDay()] > 0) && i%7 ===1 &&newSpan.textContent ==\"\") {\n break;\n }\n df.appendChild(newSpan); \n }\n \n }\n\n calendarDaysHolder.appendChild(df);\n addEventsToDays(\"click\",markAsPicked);\n}", "function beginingOfMonth (currentDay, currentDayName) {\n $.each(daysNames, function(key, value) { \n if (key == currentDayName) {\n positionOfCurrentDay = value;\n }\n });\n\n var supportValue = positionOfCurrentDay - (currentDay - 1);\n\n if (positionOfCurrentDay < currentDay) {\n firstDayOfMnthPosition = 7 + supportValue % 7;\n } else {\n firstDayOfMnthPosition = supportValue;\n }\n }", "function backWeek() {\n weekArray[0][\"day\"] = weekArray[0][\"day\"] - 7;\n // Monday\n if (parseInt(weekArray[0][\"day\"]) < 0) {\n numberOfDays(weekArray[0][\"year\"], parseInt(weekArray[0][\"month\"]) - 1);\n weekArray[0][\"day\"] = parseInt(daysInMonth) + parseInt(weekArray[0][\"day\"]);\n weekArray[0][\"month\"] = parseInt(weekArray[0][\"month\"]) - 1;\n }\n\n if (parseInt(weekArray[0][\"day\"]) === 0) {\n weekArray[0][\"month\"] = parseInt(weekArray[0][\"month\"]) - 1;\n if (parseInt(weekArray[0][\"month\"]) === 0) {\n weekArray[0][\"month\"] = 12;\n weekArray[0][\"year\"] = parseInt(weekArray[0][\"year\"]) - 1;\n }\n numberOfDays(weekArray[0][\"year\"], weekArray[0][\"month\"]);\n weekArray[0][\"day\"] = daysInMonth;\n }\n increaseDays();\n displayDates();\n}", "function getWeekDayFirst(){\n var currentMonthFirstDayDate = getMonthFirstDayDate();\n var weekDay = currentMonthFirstDayDate.getDay();\n\n if(weekDay == 0){\n weekDay = 7;\n }\n\n return weekDay;\n}", "function addDaysFromNextMonth(){\n if(new Date(dateInfo.currentYear, dateInfo.currentMonth, monthInfo[dateInfo.currentMonth][1],0,0,0,0).getDay()!=6){\n var day = new Date(dateInfo.currentYear, dateInfo.currentMonth+1, 1,0,0,0,0).getDay();\n var j=1;\n for(i=day;i<=6;i++){\n createDayDiv(dateInfo.currentYear, dateInfo.currentMonth+1, j++);\n }\n }\n}", "function getMonthBeginWeekDay() {\n var temp = currentWeekDay + (7 - currentDay % 7) + 1;\n if (temp > 6) {\n temp -= 7;\n }\n return temp;\n}", "get dayOfWeek() {\n return ((this.date.getUTCDay() + 6) % 7);\n }", "function getWeekOfYearFullDays(date, firstDayOfWeek, numberOfFullDays) {\n var dayOfYear = getDayOfYear(date) - 1;\n var num = date.getDay() - (dayOfYear % _dateValues_timeConstants__WEBPACK_IMPORTED_MODULE_0__.TimeConstants.DaysInOneWeek);\n var lastDayOfPrevYear = new Date(date.getFullYear() - 1, _dateValues_dateValues__WEBPACK_IMPORTED_MODULE_1__.MonthOfYear.December, 31);\n var daysInYear = getDayOfYear(lastDayOfPrevYear) - 1;\n var num2 = (firstDayOfWeek - num + 2 * _dateValues_timeConstants__WEBPACK_IMPORTED_MODULE_0__.TimeConstants.DaysInOneWeek) % _dateValues_timeConstants__WEBPACK_IMPORTED_MODULE_0__.TimeConstants.DaysInOneWeek;\n if (num2 !== 0 && num2 >= numberOfFullDays) {\n num2 -= _dateValues_timeConstants__WEBPACK_IMPORTED_MODULE_0__.TimeConstants.DaysInOneWeek;\n }\n var num3 = dayOfYear - num2;\n if (num3 < 0) {\n num -= daysInYear % _dateValues_timeConstants__WEBPACK_IMPORTED_MODULE_0__.TimeConstants.DaysInOneWeek;\n num2 = (firstDayOfWeek - num + 2 * _dateValues_timeConstants__WEBPACK_IMPORTED_MODULE_0__.TimeConstants.DaysInOneWeek) % _dateValues_timeConstants__WEBPACK_IMPORTED_MODULE_0__.TimeConstants.DaysInOneWeek;\n if (num2 !== 0 && num2 + 1 >= numberOfFullDays) {\n num2 -= _dateValues_timeConstants__WEBPACK_IMPORTED_MODULE_0__.TimeConstants.DaysInOneWeek;\n }\n num3 = daysInYear - num2;\n }\n return Math.floor(num3 / _dateValues_timeConstants__WEBPACK_IMPORTED_MODULE_0__.TimeConstants.DaysInOneWeek + 1);\n}", "function makeCalender() {\n let dayTrack = 1;\n let monthTrack = 1;\n let weekDay;\n\n for (let i = 0; i < 366; i++) {\n weekDay = getDayOfTheWeek(2020, monthTrack, dayTrack);\n console.log(dayTrack + \"-\" + monthTrack + \n \"-2020 is a \" + weekDay);\n if (dayTrack == maxDayPerMonth[monthTrack]) {\n dayTrack = 1;\n monthTrack += 1;\n } else {\n dayTrack += 1;\n }\n }\n}", "function shortestWeekDaysNumber(date) {\n const month = date.getMonth();\n const year = date.getFullYear();\n const lastDay = new Date(year, month + 1, 0).getDay();\n const firstDay = new Date(year, month, 1).getDay();\n // comparing position first day and last day of month\n if (firstDay === 0) {\n return 1;\n }\n if (lastDay === 0) {\n return 8 - firstDay;\n }\n return lastDay < 8 - firstDay ? lastDay : 8 - firstDay;\n}", "function incrementBusinessDateBy(start_date, increment_by) {\n var date_to_increment = start_date;\n var end_date = \"\", count = 0;\n while(count < Math.abs(increment_by)){\n end_date = new Date(date_to_increment.setDate(date_to_increment.getDate() + (increment_by > 0 ? 1 : -1)));\n if(end_date.getDay() != 0 && end_date.getDay() != 6){\n count++;\n }\n }\n return end_date;\n}", "function fullWeeksNumberInMonth(date) {\n const mondays = [];\n let amountWeeks = 0;\n let day;\n const month = date.getMonth();\n const year = date.getFullYear();\n const amountDays = new Date(year, month + 1, 0).getDate();\n for (let i = 1; i <= amountDays; i++) {\n day = new Date(year, month, i).getDay();\n if (day === 1) { // '1' means monday in Date object\n mondays.push(new Date(year, month, i).getDate());\n }\n }\n mondays.forEach((monday) => (monday + 6 <= amountDays ? amountWeeks++ : false));\n return amountWeeks;\n}", "function renderWeek(num){\n var daysThisWeek = [31, (((weekThisYear % 4 === 0) && (weekThisYear % 100 !== 0)) || (weekThisYear % 400 === 0)) ? 29 : 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];\n if(calendarId.rows.length > 0){\n var rowLength = calendarId.rows.length;\n for(let c = 0; c < rowLength; c++){\n calendarId.deleteRow(0);\n }\n }\n var row = calendarId.insertRow(0);\n if(num > 0){\n weekThisMonday = weekThisMonday + 1;\n console.log('used');\n }else if(num < 0){\n weekThisMonday = weekThisMonday - 13;\n console.log('used');\n }\n for(let i = 0; i < 7; i++){\n if(i !== 6){\n if((weekThisMonday > daysThisWeek[weekThisMonth]) && ((weekThisMonth + 1) > 11)){\n ++weekThisYear;\n weekThisMonth = 0;\n weekThisMonday = 1;\n tmp[i] = {year: weekThisYear, month: weekThisMonth, date: weekThisMonday, day: ((i+1) < 7) ? (i+1) : 0};\n ++weekThisMonday;\n }else if((weekThisMonday > daysThisWeek[weekThisMonth]) && ((weekThisMonth + 1) <= 11)){\n ++weekThisMonth;\n weekThisMonday = 1;\n tmp[i] = {year: weekThisYear, month: weekThisMonth, date: weekThisMonday, day: ((i+1) < 7) ? (i+1) : 0};\n ++weekThisMonday;\n }else if(((weekThisMonday + i) < 1) && ((weekThisMonth - 1) < 0)){\n --weekThisYear;\n weekThisMonth = 11;\n weekThisMonday = daysThisWeek[weekThisMonth] + weekThisMonday;\n tmp[i] = {year: weekThisYear, month: weekThisMonth, date: weekThisMonday, day: ((i+1) < 7) ? (i+1) : 0};\n ++weekThisMonday;\n }else if((weekThisMonday < 1) && ((weekThisMonth - 1) >= 0)){\n --weekThisMonth;\n weekThisMonday = daysThisWeek[weekThisMonth] + weekThisMonday;\n tmp[i] = {year: weekThisYear, month: weekThisMonth, date: weekThisMonday, day: ((i+1) < 7) ? (i+1) : 0};\n ++weekThisMonday;\n }else{\n tmp[i] = {year: weekThisYear, month: weekThisMonth, date: weekThisMonday, day: ((i+1) < 7) ? (i+1) : 0};\n ++weekThisMonday;\n }\n }else{\n if((weekThisMonday > daysThisWeek[weekThisMonth]) && ((weekThisMonth + 1) > 11)){\n ++weekThisYear;\n weekThisMonth = 0;\n weekThisMonday = 1;\n tmp[i] = {year: weekThisYear, month: weekThisMonth, date: weekThisMonday, day: ((i+1) < 7) ? (i+1) : 0};\n }else if((weekThisMonday > daysThisWeek[weekThisMonth]) && ((weekThisMonth + 1) <= 11)){\n ++weekThisMonth;\n weekThisMonday = 1;\n tmp[i] = {year: weekThisYear, month: weekThisMonth, date: weekThisMonday, day: ((i+1) < 7) ? (i+1) : 0};\n }else if(((weekThisMonday + i) < 1) && ((weekThisMonth - 1) < 0)){\n --weekThisYear;\n weekThisMonth = 11;\n weekThisMonday = daysThisWeek[weekThisMonth] + weekThisMonday;\n tmp[i] = {year: weekThisYear, month: weekThisMonth, date: weekThisMonday, day: ((i+1) < 7) ? (i+1) : 0};\n }else if((weekThisMonday < 1) && ((weekThisMonth - 1) >= 0)){\n --weekThisMonth;\n weekThisMonday = daysThisWeek[weekThisMonth] + weekThisMonday;\n tmp[i] = {year: weekThisYear, month: weekThisMonth, date: weekThisMonday, day: ((i+1) < 7) ? (i+1) : 0};\n }else{\n tmp[i] = {year: weekThisYear, month: weekThisMonth, date: weekThisMonday, day: ((i+1) < 7) ? (i+1) : 0};\n }\n }\n }\n for(let i = 0; i < 7; i++){\n var cell = row.insertCell(i);\n cell.innerText = tmp[i].date;\n cell.className = \"calendarThis\";\n if((tmp[i].date === timeNow.date) && (tmp[i].month === timeNow.month) && (tmp[i].year === timeNow.year)){\n cell.className = \"calendarToday\";\n }\n }\n }", "function initDayOfMonth() {\n let dayOfCurrentMonth; //define array day in current month\n let dayOfPrevMonth; //definde array day in prevent month\n let dayOfNextMounth; //definde array day in next month\n let countDay = 0; //initialize value index of day in array current month\n let countNextDay = 0; //initialize value index of day in array current next month\n\n dayOfCurrentMonth = getDaysOfMonth(currentYear, currentMonth);\n if (currentMonth === 0) {\n dayOfPrevMonth = getDaysOfMonth(currentYear - 1, 11);\n } else {\n dayOfPrevMonth = getDaysOfMonth(currentYear, currentMonth - 1);\n }\n dayOfPrevMonth.splice(0, dayOfPrevMonth.length - 6);\n\n if (currentMonth === 11) {\n dayOfNextMounth = getDaysOfMonth(currentYear + 1, 0);\n } else {\n dayOfNextMounth = getDaysOfMonth(currentYear, currentMonth + 1);\n }\n\n let listClassCss;\n for (let tr = 0; tr < 6; tr++) {\n let dataColum = \"\";\n for (let th = 0; th < ARR_DAY_OF_WEEKS.length; th++) {\n if (dayOfCurrentMonth[countDay] != undefined ||\n dayOfCurrentMonth[countDay] != null) {\n if (dayOfCurrentMonth[countDay].getDay() === th) {\n let date = dayOfCurrentMonth[countDay];\n listClassCss = \"date-num\";\n if (date.getDate() === now.getDate() &&\n date.getMonth() === now.getMonth() &&\n date.getFullYear() === now.getFullYear()) {\n listClassCss += \" current-date\";\n }\n dataColum += `<td class='${listClassCss}' onclick='selectDay(event,${date.getDate()},${date.getMonth()},${date.getFullYear()})'>${dayOfCurrentMonth[countDay].getDate()}</td>`;\n countDay++;\n } else {\n dayOfPrevMonth.forEach(date => {\n if (date.getDay() === th) {\n dataColum += `<td class='date-num date-prev' onclick='selectDay(event, ${date.getDate()}, ${date.getMonth()}, ${date.getFullYear()})'>${date.getDate()}</td>`;\n return;\n }\n });\n }\n } else {\n let date = dayOfNextMounth[countNextDay];\n dataColum += `<td class='date-num date-next' onclick='selectDay(event, ${date.getDate()}, ${date.getMonth()}, ${date.getFullYear()})'>${dayOfNextMounth[countNextDay].getDate()}</td>`;\n countNextDay++;\n }\n }\n bodyDate.append(`<tr>${dataColum}</tr>`);\n }\n trDates = $('.date-num');\n}", "function addDayNumbersAndCurrentId (numberOfWeeks, firstDayOfMonthName, daysInMonth) {\n\tvar daysCounter = daysInMonth; // set daysCounter to a number of days in month\n\tvar currentDayNumber = 1; // start counting days from 1\n\tfor (var i = 0; i < numberOfWeeks; i++) { // repete as many times as there is weeks in a month\n\t\tfor(var j = firstDayOfMonthName ; j < 7; j++) { // repete up to 7 times starting from the particular day\n\t\t\tif(daysCounter == 0) { // if there is no more days...\n\t\t\t\treturn; // break the loop\n\t\t\t}\n\t\t\tvar currentSelector = \"#week\" + i + \" \" + \".day\" + j + \" .dayNumber\"; // set a selector\n\t\t\tif(currentDayNumber === day) { // if currently day number is equal to a current day...\n\t\t\t\tdocument.querySelector(currentSelector).setAttribute(\"id\", \"currentDay\"); // add an Id to found element // not necessary anymore; better to remove if Maeli doesn't use it\n\t\t\t\tweekToDisplay = \"week\" + i; // save a currenty used week's number\n\t\t\t\tdocument.querySelector(currentSelector).parentNode.setAttribute(\"id\", \"divCurrentDay\") // add an Id to found element\n\t\t\t}\n\t\t\tdocument.querySelector(currentSelector).innerHTML = (currentDayNumber); // add HTML content to a selected element\n\t\t\tif(findEventIndex(currentDayNumber)) { // if there is an event connected to currently use day ...\n\t\t\t\tdocument.querySelector(currentSelector).style.fontWeight = \"bold\"; // change style of the used element to bold\n\t\t\t\tdocument.querySelector(currentSelector).style.color = \"black\"; // change style of the used element to black\n\t\t\t}\n\t\t\tcurrentDayNumber++ // increase used day number\n\t\t\tdaysCounter--; // decrease day counter\n\t\t}\n\t\tfirstDayOfMonthName = 0; // after inner loop finish to run change day of the week to Sunday\n\t}\n}", "_weeks() {\n const { day } = this.props;\n const weeks = [];\n\n let endOfMonth = Utils.endOfMonth(day);\n let startOfMonth = Utils.beginningOfMonth(day);\n let fistDayOfMonth = (new Date(day.getFullYear(), day.getMonth(), 1).getDay());\n\n while (fistDayOfMonth-- > 0) {\n startOfMonth.setDate(startOfMonth.getDate() - 1);\n }\n\n for (let i = 0; i < 5 || startOfMonth.getTime() < endOfMonth.getTime(); i++) {\n const week = [];\n weeks.push(week);\n for (let j = 0; j < Utils.WEEK_DAYS.length; j++) {\n\n const _day = new Date(startOfMonth.getTime());\n const className = _day.getMonth() === day.getMonth() ? '' : 'not-current-period';\n _day.setDate(_day.getDate() + 1);\n startOfMonth = _day;\n week.push(\n {\n date: _day,\n className,\n },\n );\n }\n }\n return weeks;\n }", "function dayOfWeek(){\r\n var localOffsetInHours = 2;\r\n var date = new Date();\r\n var offsetInMinutes = date.getTimezoneOffset() + localOffsetInHours * 60;\r\n var d = new Date(date.valueOf() + offsetInMinutes * 60 * 1000);\r\n \r\n var day = d.getDay();\r\n \r\n if( day == 0 ){\r\n // we need it monday-based, not sunday-based\r\n day = 7;\r\n }\r\n return day;\r\n}", "function nextWeek()\n{\n\tfor(var i in datesPerWeek)\n\t{\n\t\tvar selectedDate = datesPerWeek[i].split(\"/\");\n\t\tif( parseInt(selectedDate[0]) + 7 > parseInt(daysPerMonth[selectedDate[1]-1]))\n\t\t{\n\t\t\tvar overflowed = (parseInt(selectedDate[0]) + 7) - parseInt(daysPerMonth[selectedDate[1]-1]);\n\t\t\tdatesPerWeek[i] = DateFormat(overflowed, parseInt(selectedDate[1]) + 1, selectedDate[2]);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tdatesPerWeek[i] = DateFormat(parseInt(selectedDate[0]) + 7, selectedDate[1], selectedDate[2]);\n\t\t}\n\t}\n\tcreateTable();\n}", "getCalendar(calendarMonth) {\n const currentDay = moment(this.getFirstDayOfTheMonth(calendarMonth))\n const lastDayOfTheMonth = moment(this.getLastDayOfTheMonth(calendarMonth))\n\n const weeks = []\n\n do {\n weeks.push([])\n do {\n const isCurrentMonth = calendarMonth.isSame(currentDay, 'month')\n\n const day = {\n isCurrentMonth,\n date: currentDay.date(),\n moment: currentDay.clone()\n }\n weeks[weeks.length - 1].push(day)\n }\n while (currentDay.add(1, 'day').isoWeekday() !== 1)\n }\n while (!currentDay.isAfter(lastDayOfTheMonth))\n\n if (weeks.length === 4) {\n const x = moment(this.getFirstDayOfTheMonth(calendarMonth)).subtract(7, 'days')\n\n weeks.unshift([])\n\n for (let i = 0; i < 7; ++i) {\n const day = {\n isCurrentMonth: false,\n date: x.date(),\n moment: x.clone()\n }\n weeks[0].push(day)\n x.add(1, 'day')\n }\n }\n if (weeks.length === 5) {\n const x = moment(this.getLastDayOfTheMonth(calendarMonth)).add(2, 'days')\n\n weeks.push([])\n\n for (let i = 0; i < 7; ++i) {\n const day = {\n isCurrentMonth: false,\n date: x.date(),\n moment: x.clone()\n }\n weeks[weeks.length - 1].push(day)\n x.add(1, 'days')\n }\n }\n\n return weeks\n }", "function getDayFix(getDay){\n if (getDay > 0){\n return getDay - 1;\n }\n else if(getDay === 0){\n return 6;\n };\n}", "function getNextMonthOverlappingDays(date) {\n var lastWeekDay = moment(date).endOf('month').weekday();\n var nextMonthDays = [];\n var howManyNextDays = 6 - lastWeekDay;\n for (var i = 1; i <= howManyNextDays; i += 1) {\n nextMonthDays.push('');\n }\n return nextMonthDays;\n}", "function countSundays(){\n\treturn Math.floor((12/7)*100);\n}", "static calcFirstDayOfMonth(date) {\n const dateCopy = date;\n dateCopy.setDate(1);\n return dateCopy.getDay();\n }", "function updateCalendar(){\r\n\tlet weeks = currentMonth.getWeeks();\r\n\tlet dayArray=[];\r\n\tlet arrayIndex=0;\r\n\tlet previous=0;\r\n\t\r\n\tfor(var w in weeks){\r\n\t\tlet days = weeks[w].getDates();\r\n\t\t// days contains normal JavaScript Date objects.\r\n\t\t\r\n\t\t//alert(\"Week starting on \"+days[0]);\r\n\t\t\r\n\t\tfor(var d in days){\r\n\t\t\tlet str= days[d].toString();\r\n\t\t\tlet strSplit=str.split(\" \");\r\n\t\t\t\r\n\t\t\tconsole.log(parseInt(strSplit[2]));\r\n\t\t\t\r\n\t\t\tif (parseInt(strSplit[2])-1 == previous)\r\n\t\t\t{\r\n\t\t\t\tdocument.getElementById(arrayIndex.toString()).innerText=parseInt(strSplit[2]);\r\n\t\t\t\tprevious++;\r\n\t\t\t}\r\n\t\t\tarrayIndex++;\r\n\t\t\t// You can see console.log() output in your JavaScript debugging tool, like Firebug,\r\n\t\t\t// WebWit Inspector, or Dragonfly.\r\n\t\t}\r\n\t}\r\n}", "function countDaysOfWeek(data) {\n //Resetting the counters with each call\n countMonday = 0,\n countTuesday = 0,\n countWednesday = 0,\n countThursday = 0,\n countFriday = 0,\n countSaturday = 0,\n countSunday = 0;\n //A for loop that inspect each index in the data set\n for(var i = 0; i < data.length; ++i){\n if(data[i].DayOfWeek == \"Monday\"){\n countMonday++;\n } else if (data[i].DayOfWeek ==\"Tuesday\" ){\n countTuesday++;\n } else if (data[i].DayOfWeek == \"Wednesday\" ){\n countWednesday++;\n } else if (data[i].DayOfWeek == \"Thursday\" ) {\n countThursday++;\n } else if (data[i].DayOfWeek == \"Friday\" ){\n countFriday++;\n } else if (data[i].DayOfWeek == \"Saturday\"){\n countSaturday++;\n } else {\n countSunday++;\n }\n }\n //Return an array with objects and values\n return [{DayOfWeek: \"Monday\", Frequency: countMonday},\n {DayOfWeek: \"Tuesday\", Frequency: countTuesday},\n {DayOfWeek: \"Wednesday\", Frequency: countWednesday},\n {DayOfWeek: \"Thursday\", Frequency: countThursday},\n {DayOfWeek: \"Friday\", Frequency: countFriday},\n {DayOfWeek: \"Saturday\", Frequency: countSaturday},\n {DayOfWeek: \"Sunday\", Frequency: countSunday}];\n}", "function makeWeek(){\t\n\tvar week = \"<tr>\";\t//our new string of tags to make week row\n\tvar numOfBlanks = 0;\n\tif(firstWeekFlag){\n\t\t//loop for initial blanks\n\t\tfor (var i = getFirstDay(); i > 0; i--) {\n\t\t\tweek = week + \"<td> </td>\";\n\t\t\tnumOfBlanks++;\n\t\t};\t\n\t\tfirstWeekFlag = false;\t//remember to reset flag\n\t}\t\t\n\t//given number of blanks before first day (weekDay), loop until end of week\n\tfor (var i = 0; i < (7 - numOfBlanks); i++) {\n\t\t//highlight today's date on calendar\n if(todaysYear == currentYear && todaysMonth == currentMonth\n && todaysDate == currentDate){\n week = week + \"<td style='background:pink' class='day' data-day='\" + \n \tcurrentDate + \"'>\" + currentDate + \"</td>\";\n }else{\n\t //add blanks at end of month\n\t\t\tif(currentDate > getLastDay()){\n\t\t\t\tweek = week + \"<td> </td>\";\n\t\t\t}else {\n\t\t\t\tweek = week + \"<td class='day' data-day='\" + currentDate + \"'>\" + currentDate + \"</td>\";\n\t\t\t}\n\t\t}\n\t\tcurrentDate++;\n\t};\t\n\tweek = week + \"</tr>\";\n\treturn week;\n}", "_refreshDayOfWeekTitles() {\n const that = this;\n let days = [],\n date = new Date(),\n dayObject;\n\n function formatDayName(date) {\n let result;\n\n if (that.dayNameFormat === 'firstTwoLetters') {\n result = new Intl.DateTimeFormat(that.locale, { weekday: 'long' }).format(date);\n result = result.charCodeAt(0) === 8206 ? result.substring(1, 3) : result.substring(0, 2);\n }\n else {\n result = new Intl.DateTimeFormat(that.locale, { weekday: that.dayNameFormat }).format(date);\n }\n\n return result;\n }\n\n for (let i = 1; i < 8; i++) {\n date.setDate(i);\n dayObject = { number: date.getDay(), name: formatDayName(date) };\n days.push(dayObject);\n }\n\n days.sort((a, b) => (a.number > b.number ? 1 : -1));\n\n const months = that.$.monthsContainer.children;\n let dayNameHolders, counter;\n\n for (let m = 0; m < months.length; m++) {\n dayNameHolders = months[m].getElementsByClassName('jqx-calendar-week-titles')[0].children;\n counter = that.firstDayOfWeek > 6 ? 0 : that.firstDayOfWeek; //Validates firstDayOfWeek\n\n if (that.rightToLeft) {\n for (let d = dayNameHolders.length - 1; d >= 0; d--) {\n dayNameHolders[d].textContent = days[counter++].name;\n counter = counter > 6 ? 0 : counter;\n }\n }\n else {\n for (let d = 1; d < dayNameHolders.length; d++) {\n dayNameHolders[d].textContent = days[counter++].name;\n counter = counter > 6 ? 0 : counter;\n }\n }\n }\n\n //Update the weekTitles for nextMonths\n if (that.hasAnimation) {\n const weekTitles = that.$.monthsContainer.getElementsByClassName('jqx-calendar-week-titles')[0].innerHTML,\n nextMonthWeekTitleContainers = that.$.nextMonthsContainer.getElementsByClassName('jqx-calendar-week-titles');\n\n for (let i = 0; i < nextMonthWeekTitleContainers.length; i++) {\n nextMonthWeekTitleContainers[i].innerHTML = weekTitles;\n }\n }\n }", "function calDays(calDate) {\r\n // determine the starting day of the month \r\n var day = new Date(calDate.getFullYear(), calDate.getMonth(), 1);\r\n var weekDay = day.getDay(); \r\n // write blank cells preceeding the starting day \r\n var htmlCode = \"<tr>\"; \r\n for(var i = 0; i < weekDay; i++) {\r\n htmlCode += \"<td></td>\";\r\n }\r\n\r\n // write the cells for each day of the month \r\n var totalDays = daysInMonth(calDate);\r\n var highlightDay = calDate.getDate();\r\n\r\n for(var i = 1; i <= totalDays; i ++) {\r\n day.setDate(i);\r\n weekDay = day.getDay();\r\n\r\n // Lets see if that week day is sunday if so , we need a new <tr> element \r\n if(weekDay === 0) {\r\n htmlCode += \"<tr>\";\r\n }\r\n\r\n // check to see if the counter is up to the highlightDay \r\n if(i === highlightDay) {\r\n htmlCode += \"<td class='calendar_dates' id='calendar_today'>\" + i + dayEvent[i] + \"</td>\"\r\n } else {\r\n // if its not sunday just continue with a <td> element\r\n htmlCode += \"<td class='calendar_dates'>\" + i + dayEvent[i] +\"</td>\"\r\n }\r\n\r\n // before we loop, lets see if we're at saturday if so, we need a closing </tr> tag\r\n if(weekDay === 6) {\r\n htmlCode += \"</tr>\";\r\n }\r\n\r\n } //end of for loop\r\n\r\nreturn htmlCode;\r\n\r\n\r\n}", "function findSunday() {\n let currentDate = new Date();\n let currentDay = currentDate.getDay();\n let findPrevSunday = new Date();\n\n findPrevSunday.setDate(findPrevSunday.getDate() - currentDay);\n\n let date = findPrevSunday.getDate();\n let day = findPrevSunday.getDay();\n let month = findPrevSunday.getMonth();\n month++; //increment month to account for zero-index\n let year = findPrevSunday.getFullYear();\n\n if (date.toString().length <= 1) { // prepend with 0 for single digit dates.\n date = '0' + date;\n }\n\n if (month.toString().length <= 1) { // prepend with 0 for single digit months.\n month = '0' + month;\n }\n\n return year + '-' + month + '-' + date;\n\n}", "function getnthrev(curdate) {\n\n var mlen = [\"31\", \"28\", \"31\", \"30\", \"31\", \"30\", \"31\", \"31\", \"30\", \"31\", \"30\", \"30\", \"31\"];\n var cd = new Date(curdate);\n var m = cd.getMonth(); // Jan is 0\n var y = cd.getFullYear();\n var d = cd.getDate();\n var h = cd.getHours();\n var min = cd.getMinutes();\n\n var ly = y / 4;\n if (ly.toString().indexOf(\".\") == -1) {\n //Leap year\n mlen[1] = \"29\";\n }\n\n //\n var lastday = mlen[m];\n var monthdaylast = new Date(y, m, lastday, h, min, \"0\", \"0\"); //date format of the last day of the month for curdate monthday1\n var daylastofmonth = monthdaylast.getDay() + 1; //the day of the week for the last day of the month day1ofmonth\n\n var DayofWeek = cd.getDay() + 1; //The day of the week for curdate\n\n var sunofcurweek = d - DayofWeek + 1;\n var sunoflastweek = lastday - daylastofmonth + 1;\n\n var physicalweek = (sunoflastweek - sunofcurweek) / 7 + 1;\n var res;\n if (DayofWeek > daylastofmonth) {\n res = physicalweek - 1;\n } else {\n res = physicalweek;\n }\n\n return res;\n}", "function n_weeks(weekday, jd, nthweek) {\n var j = 7 * nthweek;\n if (nthweek > 0) {\n j += previous_weekday(weekday, jd);\n } else {\n j += next_weekday(weekday, jd);\n }\n return j;\n}", "function dayOfTheWeek(dayCount) {\n\n let daysSinceBase = dayCount - 1;\n\n var iterator = 0;\n\n for (let i = daysSinceBase; i < daysSinceBase + 7; i++) {\n\n if (i % 7 == 0) {\n return weekDays[iterator]\n }\n iterator++;\n }\n}", "function weekOfYear(mom, firstDayOfWeek, firstDayOfWeekOfYear) {\n var end = firstDayOfWeekOfYear - firstDayOfWeek,\n daysToDayOfWeek = firstDayOfWeekOfYear - mom.day();\n\n\n if (daysToDayOfWeek > end) {\n daysToDayOfWeek -= 7;\n }\n\n if (daysToDayOfWeek < end - 7) {\n daysToDayOfWeek += 7;\n }\n\n return Math.ceil(moment(mom).add('d', daysToDayOfWeek).dayOfYear() / 7);\n }", "function weekOfYear(mom, firstDayOfWeek, firstDayOfWeekOfYear) {\n var end = firstDayOfWeekOfYear - firstDayOfWeek,\n daysToDayOfWeek = firstDayOfWeekOfYear - mom.day();\n\n\n if (daysToDayOfWeek > end) {\n daysToDayOfWeek -= 7;\n }\n\n if (daysToDayOfWeek < end - 7) {\n daysToDayOfWeek += 7;\n }\n\n return Math.ceil(moment(mom).add('d', daysToDayOfWeek).dayOfYear() / 7);\n }", "function weekOfYear(mom, firstDayOfWeek, firstDayOfWeekOfYear) {\n var end = firstDayOfWeekOfYear - firstDayOfWeek,\n daysToDayOfWeek = firstDayOfWeekOfYear - mom.day();\n\n\n if (daysToDayOfWeek > end) {\n daysToDayOfWeek -= 7;\n }\n\n if (daysToDayOfWeek < end - 7) {\n daysToDayOfWeek += 7;\n }\n\n return Math.ceil(moment(mom).add('d', daysToDayOfWeek).dayOfYear() / 7);\n }", "function weekOfYear(mom, firstDayOfWeek, firstDayOfWeekOfYear) {\n var end = firstDayOfWeekOfYear - firstDayOfWeek,\n daysToDayOfWeek = firstDayOfWeekOfYear - mom.day();\n\n\n if (daysToDayOfWeek > end) {\n daysToDayOfWeek -= 7;\n }\n\n if (daysToDayOfWeek < end - 7) {\n daysToDayOfWeek += 7;\n }\n\n return Math.ceil(moment(mom).add('d', daysToDayOfWeek).dayOfYear() / 7);\n }", "function weekOfYear(mom, firstDayOfWeek, firstDayOfWeekOfYear) {\n var end = firstDayOfWeekOfYear - firstDayOfWeek,\n daysToDayOfWeek = firstDayOfWeekOfYear - mom.day();\n\n\n if (daysToDayOfWeek > end) {\n daysToDayOfWeek -= 7;\n }\n\n if (daysToDayOfWeek < end - 7) {\n daysToDayOfWeek += 7;\n }\n\n return Math.ceil(moment(mom).add('d', daysToDayOfWeek).dayOfYear() / 7);\n }", "static nextDayOfWeek (dayInt, startDate = null) {\n var date = (startDate) ? moment(startDate).add(1, 'days') : moment()\n // // test xmas 2014, a thursday or 4\n // date = (startDate) ? moment(startDate).add(1, 'days') : moment('12/25/2014', 'MM/DD/YYYY')\n\n if (date.isoWeekday() <= dayInt) {\n // return that week's day\n return date.isoWeekday(dayInt)\n } else {\n // return the following week's day\n return date.add(1, 'weeks').isoWeekday(dayInt)\n }\n }", "function weekNumber(d, firstWeekday) {\n firstWeekday = firstWeekday || 'sunday';\n\n // This works by shifting the weekday back by one day if we\n // are treating Monday as the first day of the week.\n\td.day = d.day || d.obj.getDay();\n var wday = d.day;\n if (firstWeekday == 'monday') {\n if (wday == 0) // Sunday\n wday = 6;\n else\n wday--;\n }\n\n\td.year = d.year || d.obj.getFullYear();\n var firstDayOfYear = new Date(d.year, 0, 1)\n , yday = ((d.time - firstDayOfYear))/ 86400000\n , firstDayNo = (yday + 7 - wday)\n ;\n return (firstDayNo - firstDayNo % 7) / 7;\n }", "function weekDayIdxByLocalizedDayName(dateObject)\n{\n var dayName = Qt.formatDateTime(dateObject, \"dddd\")\n\n var myDate = new Date(2012, 0, 2) // This was a Moday for sure.\n for(var i = 0; i < 7; i++){\n if(Qt.formatDateTime(myDate, \"dddd\" ) == dayName)\n {\n return i-1;\n }\n else{\n myDate.setDate(myDate.getDate() + 1)\n }\n }\n\n console.log(\"Error, calculation of weekday index failed.\")\n return -1\n}", "renderDays() {\n const dateFormat = \"dddd\";\n const days = [];\n\n // the start of the week\n let startDate = dateFns.startOfWeek(this.state.currentMonth);\n\n // go through seven days and display their names\n for (let i = 0; i < 7; i++) {\n days.push(\n <div className=\"col col-center\" key={i}>\n {dateFns.format(dateFns.addDays(startDate, i), dateFormat)}\n </div>\n );\n }\n\n return <div className=\"days row\">{days}</div>;\n }", "function C(a){var b=G.start.day();// normalize dayOffset to beginning-of-week\n// first date's day of week\n// # of cells from full weeks\n// # of cells from partial last week\nreturn a+=b,Math.floor(a/7)*N+Q[(a%7+7)%7]-Q[b]}", "function n_weeks(weekday, jd, nthweek)\n {\n var j = 7 * nthweek;\n\n if (nthweek > 0) {\n\t j += previous_weekday(weekday, jd);\n } else {\n\t j += next_weekday(weekday, jd);\n }\n return j;\n }", "calculateWeek(forDay) {\n const deltaStart = this.dateAdapter.getFirstDayOfWeek() -\n this.dateAdapter.getDayOfWeek(forDay);\n const start = this.dateAdapter.addCalendarDays(forDay, deltaStart);\n const end = this.dateAdapter.addCalendarDays(start, 6);\n return [start, end];\n }", "function y(a){var b=G.start.day();// normlize cellOffset to beginning-of-week\n// first date's day of week\n// # of days from full weeks\n// # of days from partial last week\nreturn a+=Q[b],7*Math.floor(a/N)+R[(a%N+N)%N]-b}", "function get1stDayOfMonth(date){\r\n\t\t\treturn new Date(date).getDay();\r\n\t\t}", "function nextGameDay() {\n var dt = new Date()\n var gameDays = [0, 1, 4]\n\n while(!gameDays.includes(dt.getDay())) {\n dt.setDate(dt.getDate() + 1)\n }\n return dt\n}", "function createCalendar(year, month) {\n //where the first of month start in the week\n let firstDayofMonth = new Date(year, month - 1, 1).getDay() //weeks starts index=0 and sunday=0 \n let monthTest = new Date(year, month, 1).getMonth() // here month index start 1;\n console.log(monthTest)\n // console.log(firstDayofMonth)\n let totalDaysinMonth = new Date(year, month, 0).getDate()\n console.log(totalDaysinMonth)\n changeBody(month)\n getHoliday()\n displayMonthYear(year, month)\n\n clearCalendar()\n\n let day = 1; //everymonth start day=1\n //loop to create row/data \n let calendarBody = document.querySelector('#calendar-body')\n for (let i = 0; i < 7; i++) {\n let tr = document.createElement(\"tr\") //create row\n tr.setAttribute(\"class\", \"calendar-row\")\n for (let z = 0; z < 7; z++) { //seven days a week\n //on the first row, indicate first day of month start in week\n //empty html element\n if (i === 0 && z < firstDayofMonth) {\n let td = document.createElement(\"td\")\n td.innerText = \"\"\n tr.append(td) ////each row should have data with empty date\n } else {\n if (day > totalDaysinMonth) { //loop stop when reach to total days\n break;\n }\n let td = document.createElement(\"td\")\n //highlight today;\n if (day === currentDate && month === currentMonth && year === currentYear) {\n td.setAttribute(\"class\", \"itstoday\")\n }\n td.innerText = day;\n tr.append(td)\n\n day++; //increment day\n }\n }\n calendarBody.append(tr) //insert row into calendar body\n }\n return calendarBody;\n}", "function updateCalendar(){\n \tvar weeks = currentMonth.getWeeks();\n\n var x = getMonthName(currentMonth.month);\n\n document.getElementById(\"month_year_label\").textContent = x + \" \" + currentMonth.year;\n\n\n\n //console.log(currentMonth.month);\n console.log(\"pressed\");\n\n \tfor(var w in weeks){\n //days is an array with each day in a week\n \t var days = weeks[w].getDates();\n var week_number = parseInt(w);\n //console.log(w);\n var week_id = \"week-\" + week_number;\n //console.log(week_id);\n \t// days contains normal JavaScript Date objects.\n //console.log()\n var week1_node = document.getElementById(week_id).getElementsByClassName(\"calendar-day\");\n\n \t\tfor(var d in days){\n\n \t\t\t// You can see console.log() output in your JavaScript debugging tool, like Firebug,\n \t\t\t// WebWit Inspector, or Dragonfly.\n // for(int i = 0; i < week1_node.childNodes.length-1; i++){\n week1_node[d].innerHTML = \"<div class='month-day-calendar' value=\" + days[d].getDate() + \"> <div>\" + days[d].getDate() + \"</div></div>\";\n week1_node[d].setAttribute(\"value\", days[d]);\n //week1_node.childNodes[7].textContent = d;\n\n // }\n \t\t\t//console.log(days[d].toISOString());\n \t\t}\n\n \t}\n // if 6 weeks (0-5 weeks) (length = 6) update everything, else 5 weeks (0-4 weeks) (length = 5) and don't show last week (hidden)\n if (weeks.length == 5) {\n // clear sixth week (week-5)\n var week_six_node = document.getElementById(\"week-5\").getElementsByClassName(\"calendar-day\");\n // days = weeks[4].getDates();\n\n for (i = 0; i < week_six_node.length; i++) {\n // var apple = document.getElementById(\"my-list\").getElementsByClassName(\"fruits\")[0];\n // document.getElementById(\"my-list\").removeChild(apple);\n week_six_node[i].style.visibility = \"hidden\";\n }\n\n } else {\n // clear sixth week (week-5)\n var week_six_node = document.getElementById(\"week-5\").getElementsByClassName(\"calendar-day\");\n // days = weeks[4].getDates();\n\n for (i = 0; i < week_six_node.length; i++) {\n // var apple = document.getElementById(\"my-list\").getElementsByClassName(\"fruits\")[0];\n // document.getElementById(\"my-list\").removeChild(apple);\n week_six_node[i].style.visibility = \"visible\";\n }\n }\n\n\n }", "function getStartOfWeek() {\n\tvar startOfWeek = getStartOfToday();\n\t// Get the day of week where Monday is 0 and Sunday is 6.\n\tvar dayOfWeek = (startOfWeek.getUTCDay() + 6) % 7;\n\tstartOfWeek.setUTCDate(startOfWeek.getUTCDate() - dayOfWeek);\n\treturn startOfWeek;\n}", "function updateDays() {\n var days = fjDateTab.querySelectorAll('.fj-date-tab'),\n temp, num = days.length;\n while(num--) {\n temp = curStart.clone()\n .add(num, 'd');\n // if today or tomorrow then same else change\n days[num].querySelector('.fj-date-title')\n .innerHTML = temp.calendar(curStart, {\n sameDay: '[Today]',\n nextDay: '[Tomorrow]',\n nextWeek: 'ddd',\n lastDay: '[Yesterday]',\n lastWeek: '[Last] ddd',\n sameElse: 'ddd'\n });\n days[num].querySelector('.fj-date-subtitle')\n .innerHTML = temp.format('D MMM');\n }\n}", "dayOfWeek(day, month, year) {\n var y0 = year - Math.floor((14 - month) / 12);\n var x = y0 + Math.floor((y0 / 4)) - Math.floor((y0 / 100)) + Math.floor((y0 / 400));\n m0 = month + 12 * Math.floor((14 - month) / 12) - 2;\n var d0 = (day + x + Math.floor((31 * m0) / 12)) % 7;\n console.log(d0);\n var res = [\"Sunday\", \"Monday\", \"Tuesday\", \"Wendsday\", \"Thursday\", \"Friday\", \"saturday\"];\n if (d0 <= res.length) {\n console.log(\"The day falls on :\" + res[d0])\n } else {\n console.log(\"Invalid day \")\n }\n }", "function pullDays(){\n\t\t\t\n\t\t\tvar week = [0,1,2,3,4,5,6];\n\t\t\tvar currentDay = 0;\n\n\t\t\tfor(var i = 0; i < week.length; i++){\n\t\t\t\tweek[currentDay].index = currentDay;\n\t\t\t\tcurrentDay++;\n\t\t\t\trenderWeek(week[currentDay]);\n\n\t\t\t}\n\n\t\t\tconsole.log('This is the CurentDay being passed -->');\n\t\t\tconsole.log(currentDay);\n\n}", "function calDays(calDate) {\r\n //Determine the starting days of the month\r\n let day = new Date(calDate.getFullYear(), calDate.getMonth(), 1);\r\n let weekDay = day.getDay();\r\n\r\n //Write blank cells preceding the starting day\r\n let htmlCode = \"<tr >\";\r\n for (let i = 0; i < weekDay; i++) {\r\n htmlCode += \"<td class='day'></td>\";\r\n }\r\n\r\n //Write the cells for each day of the month\r\n let totalDays = daysInMonth(calDate);\r\n\r\n let highlightDay = calDate.getDate();\r\n for (let i = 1; i <= totalDays; i++) {\r\n day.setDate(i);\r\n weekDay = day.getDay();\r\n\r\n if (weekDay === 0) htmlCode += \"<tr>\";\r\n \r\n // Checks if highlightDay is today and if there are more than one event listed in eventList\r\n if (i === highlightDay && dayEvent[i] !== \"\" && dayEvent2[i] !== \"\") {\r\n \r\n // Concats the table data for today with up to 2 events\r\n htmlCode += \"<td class='weekDates' id='today'><div class='date'>\" + i + \"</div> <div class='event'>\" + dayEvent[i] + \" <br />\" + dayEvent2[i] + \"</div></td>\";\r\n\r\n // Checks if highlightDay is today and there is an event on dayEvent[i]\r\n } else if (i === highlightDay && dayEvent[i] !== \"\") {\r\n\r\n // Concats the table data for today with event tags and event info\r\n htmlCode += \"<td class='weekDates' id='today'><div class='date'>\" + i + \"</div> <div class='event'>\" + dayEvent[i] + \"</td>\";\r\n\r\n // Checks if there event on dayEvent[i] is an empty string\r\n } else if (i === highlightDay) {\r\n\r\n // Concats the table data for today with up to 2 events\r\n htmlCode += \"<td class='weekDates' id='today'><div class='date'>\" + i + \"</div></td>\";\r\n\r\n } else if (dayEvent[i] === \"\") {\r\n\r\n // Concats ONLY the table data and the date\r\n htmlCode += \"<td class='weekDates'><div class='date'>\" + i + \"</div></td>\";\r\n\r\n // Checks for a second event\r\n } else if (dayEvent2[i] !== \"\") {\r\n\r\n // Concats the table data for 2 events on any day but the today.\r\n htmlCode += \"<td class='weekDates'><div class='date'>\" + i + \"</div> <div class='event'>\" + dayEvent[i] + \"</div> <div class='event'>\" + dayEvent2[i] + \"</div></td>\";\r\n\r\n } else {\r\n // Concats table data for every day except today with a single event for the day\r\n htmlCode += \"<td class='weekDates'><div class='date'>\" + i + \"</div> <div class='event'>\" + dayEvent[i] + \"</div></td>\";\r\n\r\n }\r\n\r\n if (weekDay === 6) htmlCode += \"</tr>\";\r\n }\r\n return htmlCode;\r\n}", "back_one_week() {\n this.start_date = this.start_date.next_day(-7);\n return this.update_data();\n }", "function utcWeekday(i) {\n return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__interval__[\"a\" /* default */])(function(date) {\n date.setUTCDate(date.getUTCDate() - (date.getUTCDay() + 7 - i) % 7);\n date.setUTCHours(0, 0, 0, 0);\n }, function(date, step) {\n date.setUTCDate(date.getUTCDate() + step * 7);\n }, function(start, end) {\n return (end - start) / __WEBPACK_IMPORTED_MODULE_1__duration__[\"a\" /* durationWeek */];\n });\n}", "function utcWeekday(i) {\n return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__interval__[\"a\" /* default */])(function(date) {\n date.setUTCDate(date.getUTCDate() - (date.getUTCDay() + 7 - i) % 7);\n date.setUTCHours(0, 0, 0, 0);\n }, function(date, step) {\n date.setUTCDate(date.getUTCDate() + step * 7);\n }, function(start, end) {\n return (end - start) / __WEBPACK_IMPORTED_MODULE_1__duration__[\"a\" /* durationWeek */];\n });\n}", "function utcWeekday(i) {\n return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__interval__[\"a\" /* default */])(function(date) {\n date.setUTCDate(date.getUTCDate() - (date.getUTCDay() + 7 - i) % 7);\n date.setUTCHours(0, 0, 0, 0);\n }, function(date, step) {\n date.setUTCDate(date.getUTCDate() + step * 7);\n }, function(start, end) {\n return (end - start) / __WEBPACK_IMPORTED_MODULE_1__duration__[\"a\" /* durationWeek */];\n });\n}", "function fillDays() {\n var i;\n var calendarDays = document\n .getElementById(\"calendarTable\")\n .getElementsByTagName(\"tbody\")[0]\n .getElementsByClassName(\"day\");\n\n //get month -current month is April -so this got 3\n month = date.getMonth();\n console.log(month);\n //get year -current year is 2019\n year = date.getFullYear();\n console.log(year);\n var daysOffset = new Date(year, month, 1).getDay();\n console.log(daysOffset);\n var numberOfDays = new Date(year, month + 1, 0).getDate(); //0 for day gives last day of the PREVIOUS month\n console.log(numberOfDays);\n\n //clear cells\n for (i = 0; i < calendarDays.length; i++) {\n calendarDays[i].innerHTML = \"&nbsp\";\n }\n\n //populate cells with dates, 1-31\n for (i = 1; i <= numberOfDays; i++) {\n calendarDays[daysOffset].innerHTML = i;\n daysOffset++;\n }\n}", "set weekStartDay(weekStartDay) {\n const me = this;\n me.dayNames = [];\n me.dayNumbers = [];\n me.canonicalDayNumbers = [];\n me._weekStartDay = weekStartDay != null ? weekStartDay : DateHelper.weekStartDay;\n\n // So, if they set weekStartDay to 1 meaning Monday which is ISO standard, we will\n // have mapping of internal day number to canonical day number (as used by Date class)\n // and to abbreviated day name like this:\n // canonicalDayNumbers = [1, 2, 3, 4, 5, 6, 0] // Use for translation from our day number to Date class's day number\n // dayNumbers = [6, 0, 1, 2, 3, 4, 5] // Use for translation from Date object's day number to ours\n // dayNames = ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']\n for (let i = 0; i < 7; i++) {\n const canonicalDay = (me._weekStartDay + i) % 7;\n me.canonicalDayNumbers[i] = canonicalDay;\n me.dayNumbers[canonicalDay] = i;\n me.dayNames[i] = shortDayNames[canonicalDay];\n }\n }", "dayOfWeek(m,d,y){\n var year = (y-(Math.floor(14-m)/12));\n var x = year+Math.floor((year/4))-Math.floor((year/100))+Math.floor((year/400));\n var month = m+12 *(Math.floor((14-m)/12))-2;\n day = Math.ceil(((d+x+Math.floor(31*month/12))%7));\n return day;\n }", "function calculateWeekDay() {\n\tJD0h += 1.5;\n\tlet res = JD0h - 7 * Math.floor(JD0h / 7);\n\tif (res === 0) {\n\t\tDoW = \"SUN\";\n\t}\n\tif (res === 1) {\n\t\tDoW = \"MON\";\n\t}\n\tif (res === 2) {\n\t\tDoW = \"TUE\";\n\t}\n\tif (res === 3) {\n\t\tDoW = \"WED\";\n\t}\n\tif (res === 4) {\n\t\tDoW = \"THU\";\n\t}\n\tif (res === 5) {\n\t\tDoW = \"FRI\";\n\t}\n\tif (res === 6) {\n\t\tDoW = \"SAT\";\n\t}\n}", "function getMonthForWeekend() {\n let monthForWeekend;\n // Get current date\n const todaysDateObject = new Date();\n monthForWeekend = todaysDateObject.getMonth();\n const dateForWeekend = getDateForWeekend();\n\n // IF dateForweekend 5 and todaysDateObject is 29 --> weekend is next month\n // If date for weekend is 25 and current date is 23, weekend is this month\n\n if (dateForWeekend < todaysDateObject.getDate()) {\n monthForWeekend = todaysDateObject.getMonth() + 1;\n }\n console.log(\n monthForWeekend,\n dateForWeekend,\n todaysDateObject.getDate()\n );\n // Get length of month\n return monthForWeekend;\n }", "function addDates() {\n var month = months.indexOf($('.date-month').text());\n var year = parseInt($('.date-year').text());\n var day = new Date(year, month, 1).getDay();\n var maxDays = new Date(year, month+1, 0).getDate();\n var row = 1;\n dates = [];\n counts = new Array(maxDays).fill(0);\n \n for (var i=1; i<=maxDays; i++) {\n dates.push([row, day]);\n addDate(row, day, i);\n removeShade(row, day);\n if (day === 6) {\n day = 0;\n row++;\n }\n else {\n day++;\n }\n }\n addTomatoCounts();\n}", "resetDays() {\n this.resetFilled();\n let days = this.days;\n let filled = this.filled;\n let current = filled.start;\n let daysBetween = filled.days(Op.UP);\n let total = Math.max(this.minimumSize, daysBetween);\n for (let i = 0; i < total; i++) {\n let day = days[i];\n if (!day || !day.sameDay(current)) {\n day = new CalendarDay(current.date);\n if (i < days.length) {\n days.splice(i, 1, day);\n }\n else {\n days.push(day);\n }\n }\n day.inCalendar = this.span.contains(day);\n current = current.next();\n }\n if (days.length > total) {\n days.splice(total, days.length - total);\n }\n return this;\n }", "function weekday(i) {\n return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__interval__[\"a\" /* default */])(function(date) {\n date.setDate(date.getDate() - (date.getDay() + 7 - i) % 7);\n date.setHours(0, 0, 0, 0);\n }, function(date, step) {\n date.setDate(date.getDate() + step * 7);\n }, function(start, end) {\n return (end - start - (end.getTimezoneOffset() - start.getTimezoneOffset()) * __WEBPACK_IMPORTED_MODULE_1__duration__[\"d\" /* durationMinute */]) / __WEBPACK_IMPORTED_MODULE_1__duration__[\"a\" /* durationWeek */];\n });\n}", "function weekday(i) {\n return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__interval__[\"a\" /* default */])(function(date) {\n date.setDate(date.getDate() - (date.getDay() + 7 - i) % 7);\n date.setHours(0, 0, 0, 0);\n }, function(date, step) {\n date.setDate(date.getDate() + step * 7);\n }, function(start, end) {\n return (end - start - (end.getTimezoneOffset() - start.getTimezoneOffset()) * __WEBPACK_IMPORTED_MODULE_1__duration__[\"d\" /* durationMinute */]) / __WEBPACK_IMPORTED_MODULE_1__duration__[\"a\" /* durationWeek */];\n });\n}", "function weekday(i) {\n return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__interval__[\"a\" /* default */])(function(date) {\n date.setDate(date.getDate() - (date.getDay() + 7 - i) % 7);\n date.setHours(0, 0, 0, 0);\n }, function(date, step) {\n date.setDate(date.getDate() + step * 7);\n }, function(start, end) {\n return (end - start - (end.getTimezoneOffset() - start.getTimezoneOffset()) * __WEBPACK_IMPORTED_MODULE_1__duration__[\"d\" /* durationMinute */]) / __WEBPACK_IMPORTED_MODULE_1__duration__[\"a\" /* durationWeek */];\n });\n}", "function isJanFristOnSaturday() {\n\tlet array = [];\n\tfor (let i = 14; i <= 50; i++) {\n\t\tif (new Date(`January 1, 20${i}`).getDay() === 0) array.push(i);\n\t}\n\treturn console.log(`Anwser 7: 1st January is being a Sunday ${array}`);\n}", "function weekNumber(d, firstWeekday) {\n firstWeekday = firstWeekday || 'sunday';\n\n // This works by shifting the weekday back by one day if we\n // are treating Monday as the first day of the week.\n var wday = d.getDay();\n if (firstWeekday === 'monday') {\n if (wday === 0) {// Sunday\n wday = 6;\n } else {\n wday--;\n }\n }\n\n// var firstDayOfYear = new Date(d.getFullYear(), 0, 1);\n\n// fake.setTime(0);\n fake.setFullYear(d.getFullYear());\n fake.setMonth(0, 1);\n var firstDayOfYear = fake;\n\n var yday = (d - firstDayOfYear) / DAY_SECS; // 86400000;\n var weekNum = (yday + 7 - wday) / 7;\n return Math.floor(weekNum); // >> 0; // Math.floor(weekNum);\n }", "function generateDays(i) {\n\tif(today == 6){\n\t\ttoday = -1;\n\t}\n\tdaysUpdate[i] = days[today + 1];\n\ttoday++;\n}", "function dayofweek(d,m,y){\n let t = [ 0, 3, 2, 5, 0, 3, 5, 1, 4, 6, 2, 4 ];\n y -= m < 3;\n return ( y + y/4 - y/100 + y/400 + t[m-1] + d) % 7;\n}", "function checkPatientsPerDay()\n{\n if(Patient.list[tableBody.rows[1].cells[0].innerHTML].lastPatientBool == true)\n {\n let today = weekdaysShort[todayNr];\n daysPassedArray[currentWeek][todayNr] = true;\n \n // Only show immediatly if de currentweek is also the week that is displayed in the agenda\n if(week == currentWeek)\n {\n document.querySelectorAll(\".\" + today).forEach(div =>{\n div.classList.add(\"greyedOutSlot\");\n });\n\n document.querySelectorAll(\".\" + today + \"Header\").forEach(div =>{\n div.classList.add(\"greyedOutHeader\");\n \n });\n }\n //go to the next day or if at the end of the week and the next week\n if(todayNr < 6)\n {\n todayNr += 1;\n }\n else\n {\n todayNr = 0;\n currentWeek += 1;\n }\n }\n}", "function fillEnd(month,year){\n var date = new Date(month+\"/01/\"+year);\n var lastDay = new Date(date.getFullYear(), date.getMonth() + 1, 0);\n return 6-lastDay.getDay();\n}", "function calcTotalDayAgain() {\n var eventCount = $this.find('.this-month .event-single').length;\n $this.find('.total-bar b').text(eventCount);\n $this.find('.events h3 span b').text($this.find('.events .event-single').length)\n }" ]
[ "0.68556434", "0.68231857", "0.6699148", "0.66821057", "0.6583973", "0.6583973", "0.6548333", "0.6470098", "0.6458274", "0.6440805", "0.6351508", "0.6340209", "0.6316454", "0.63061154", "0.630426", "0.6291998", "0.62695694", "0.6254319", "0.62514544", "0.62332827", "0.6209635", "0.6209629", "0.61916196", "0.6170158", "0.6169891", "0.61681974", "0.6163723", "0.61594677", "0.6124332", "0.61192447", "0.6116867", "0.60925525", "0.60902077", "0.60869724", "0.60861975", "0.6080372", "0.605815", "0.6043698", "0.60320765", "0.6025678", "0.6011852", "0.6011668", "0.5996319", "0.5985033", "0.5975107", "0.5959425", "0.59351194", "0.59324586", "0.59082156", "0.58944976", "0.5880686", "0.5865879", "0.5849471", "0.58430344", "0.58313394", "0.58174783", "0.58035076", "0.57927966", "0.57927966", "0.57927966", "0.57927966", "0.57927966", "0.5784067", "0.57761014", "0.5763128", "0.57613975", "0.57607484", "0.5758794", "0.57535374", "0.5749477", "0.573762", "0.57368207", "0.5730916", "0.57111484", "0.5705123", "0.5698747", "0.56984735", "0.56773686", "0.5673289", "0.56684875", "0.56667763", "0.56667763", "0.56667763", "0.56622857", "0.5657927", "0.5653794", "0.56421465", "0.563839", "0.563552", "0.5634845", "0.56334084", "0.56334084", "0.56334084", "0.5619572", "0.56149626", "0.5607199", "0.56028104", "0.5597433", "0.5583664", "0.558135" ]
0.67823327
2
build the calendar array
function buildCalendar() { var year = that.selectedYear; var month = that.selectedMonth; var firstDateOfMonth = getDate(year, month, 1); var firstDayOfMonth = firstDateOfMonth.getDay(); var firstDayOfWeek = that.options.firstDayOfWeek; var rowIndex = 0, datesInWeek = 0, date = 1; calendarItems = []; that.weeks = []; // if first day of month != firstDayOfWeek then start dates from prior month if (firstDayOfWeek != firstDayOfMonth) { var daysBefore = getDaysBeforeFirstDayOfMonth(firstDayOfWeek, firstDayOfMonth); if (daysBefore) { // 0 is one day prior; 1 is two days prior and so forth date = date - daysBefore; } } while (date <= getDaysInMonth(year, month)) { calendarItems.push(createCellData(getDate(year, month, date++))); } // fill remaining cells with dates from next month while ((calendarItems.length % 7) !== 0) { calendarItems.push(createCellData(getDate(year, month, date++))); } // populate the that.weeks array. create a 2D array of 7 days per row angular.forEach(calendarItems, function (cellData) { if ((datesInWeek % 7) === 0) { that.weeks.push([]); rowIndex = that.weeks.length - 1; } that.weeks[rowIndex].push(cellData); datesInWeek++; }); //raise the callback for each cell data raiseRenderDateCallback(calendarItems); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function constructCalendar(selectedDate){\n scope.calendarDays = [];\n //Setting up the array\n var endOfMonth = angular.copy(defaultDate);\n endOfMonth = endOfMonth.endOf('month').format('DD');\n var currentDate = angular.copy(defaultDate);\n\t\t\t\tvar currentDisplayDate = angular.copy(defaultDate);\n\t\t\t\t currentDisplayDate = currentDisplayDate.format('mmmm yyyy');\n currentDate = currentDate.startOf('month');\n //Building The Array\n for (var i = 0; i < endOfMonth; i++){\n var day = {\n date: moment(currentDate), //date of the calendar\n dayOfWeek: moment(currentDate).format('dddd'),\n dateNumber: moment(currentDate).format('DD'),\n events: [] //empty array for events to occur\n }\n \n if (day.date.isSame(moment(), 'day')){\n day.isToday = true;\n }\n scope.calendarDays.push(day)\n currentDate = currentDate.add(1, 'days');\n }\n scope.headingDays = [\"Sunday\" ,\"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"];\n console.log(scope.headingDays);\n //Adding Events\n addInactiveDates();\n populateEvents();\n assignColors(); \n }", "function buildDayArray(dayCal){\n //look through the json file \"Eight Day Calendar\" and assemble arrays of each date\n for (let i = 0; i < dayCal.VCALENDAR[0].VEVENT.length; i++){\n let day = dayCal.VCALENDAR[0].VEVENT[i].SUMMARY;\n let dtStamp = dayCal.VCALENDAR[0].VEVENT[i];\n let date = dtStamp[\"DTSTART;VALUE=DATE\"];\n\n if ( day === 'Day 1'){\n day1dates.push(date);\n }\n if ( day === 'Day 2'){\n day2dates.push(date);\n }\n if ( day === 'Day 3'){\n day3dates.push(date);\n }\n if ( day === 'Day 4'){\n day4dates.push(date);\n }\n if ( day === 'Day 5'){\n day5dates.push(date);\n }\n if ( day === 'Day 6'){\n day6dates.push(date);\n }\n if ( day === 'Day 7'){\n day7dates.push(date);\n }\n if (day === 'Day 8'){\n day8dates.push(date);\n }\n }\n day1dates.push('Day 1');\n day2dates.push('Day 2');\n day3dates.push('Day 3');\n day4dates.push('Day 4');\n day5dates.push('Day 5');\n day6dates.push('Day 6');\n day7dates.push('Day 7');\n day8dates.push('Day 8');\n daySpace.textContent = matchDayDate();\n}", "calendarFill(data) {\n\n //get month and year of transmitted data\n const currentMonth = data.getMonth();\n const currentYear = data.getFullYear();\n\n // get in what day of a week the month starts\n const startMonth = new Date(currentYear, currentMonth, 0).getDay() + 1;\n\n // get current amount of days\n const currentAmountOfDays = 33 - new Date(currentYear, currentMonth, 33).getDate();\n\n // get how many weeks are in month\n function getWeeks(year, month) {\n const l = new Date(year, month + 1, 0);\n return Math.ceil((l.getDate() - (l.getDay() ? l.getDay() : 7)) / 7) + 1;\n }\n const currentWeeks = getWeeks(currentYear, currentMonth);\n\n //array output with calendar\n const daysInWeek = 7;\n const arr = [];\n let counter = 0;\n let day = 1;\n for (let i = 0; i < currentWeeks; i++) {\n arr[i] = [];\n for (let j = 0; j < daysInWeek; j++) {\n counter += 1;\n if (counter < startMonth) {\n arr[i][j] = null;\n } else if (counter >= currentAmountOfDays + startMonth) {\n arr[i][j] = null;\n } else {\n arr[i][j] = day++;\n }\n }\n };\n return arr;\n\n }", "function createCal(year, month) {\n var day = 1, i, j, haveDays = true,\n startDay = new Date(year, month, day).getDay(),\n daysInMonths = [31, (((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0)) ? 29 : 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31],\n calendar = [];\n\n startDay -= firstDay;\n if (startDay < 0) {\n startDay = 7 + startDay;\n }\n\n if (createCal.cache[year] && !isIE11) {\n if (createCal.cache[year][month]) {\n return createCal.cache[year][month];\n }\n } else {\n createCal.cache[year] = {};\n }\n\n i = 0;\n while (haveDays) {\n calendar[i] = [];\n for (j = 0; j < 7; j++) {\n if (i === 0) {\n if (j === startDay) {\n calendar[i][j] = day++;\n startDay++;\n }\n } else if (day <= daysInMonths[month]) {\n calendar[i][j] = day++;\n } else {\n calendar[i][j] = '';\n haveDays = false;\n }\n if (day > daysInMonths[month]) {\n haveDays = false;\n }\n }\n i++;\n }\n\n ////6th week of month fix IF NEEDED\n //if (calendar[5]) {\n // for (i = 0; i < calendar[5].length; i++) {\n // if (calendar[5][i] !== '') {\n // calendar[4][i] = '<span>' + calendar[4][i] + '</span><span>' + calendar[5][i] + '</span>';\n // }\n // }\n // calendar = calendar.slice(0, 5);\n //}\n\n for (i = 0; i < calendar.length; i++) {\n calendar[i] = '<tr><td class=\"eformDay month_holder\" data-month=\"'+(parseInt(month)+1)+'\" onclick=\"pureJSCalendar.dayClick(this)\">' + calendar[i].join('</td><td class=\"eformDay\" onclick=\"pureJSCalendar.dayClick(this)\">') + '</td></tr>';\n }\n\n const calendarInnerHtml = calendar.join('');\n calendar = document.createElement('table', { class: 'curr' });\n calendar.innerHTML = calendarInnerHtml;\n const tdEmty = calendar.querySelectorAll('td:empty');\n for (var i = 0; i < tdEmty.length; ++i) {\n tdEmty[i].classList.add('nil');\n }\n if (month === new Date().getMonth()) {\n const calTd = calendar.querySelectorAll('td');\n const calTdArray = Array.prototype.slice.call(calTd);\n calTdArray.forEach(function (current, index, array) {\n if (current.innerHTML === new Date().getDate().toString()) {\n current.classList.add('today');\n }\n });\n }\n\n createCal.cache[year][month] = { calendar: function () { return calendar }, label: months[month] + ' ' + year };//calendar.clone()\n\n //DisableCalendarDays();\n return createCal.cache[year][month];\n }", "createDateArray() {\n\t\tvar datesArray = [];\n\t\t\n\t\tfor(var i = 0; i < 6; i++){\n\t\t\tvar currentDate = new Date();\n\t\t\tcurrentDate.setDate(currentDate.getDate() + i);\n\t\t\t\n\t\t\tvar dd = currentDate.getDate();\n\t\t\tvar mm = currentDate.getMonth() + 1; //January is 0!\n\t\t\tvar yyyy = currentDate.getFullYear();\n\n\t\t\tif (dd < 10) {\n\t\t\t dd = '0' + dd;\n\t\t\t}\n\n\t\t\tif (mm < 10) {\n\t\t\t mm = '0' + mm;\n\t\t\t}\n\n\t\t\tdatesArray.push([mm, dd, yyyy].join('-'));\n\t\t}\n\t\treturn datesArray;\n\t}", "CreateCalendarDataItem(obj = {}) {\n const {\n index_date,\n year,\n month_id,\n day,\n } = obj;\n\n let _class_name = this.config.classname.date;\n\n // Get Event-Data on Target-Day.\n let _date_event_data_obj = this.GetEventData({\n year: year,\n month_id: month_id,\n day: day,\n });\n let _date_event_data = _date_event_data_obj.result;\n\n // Set day-of-week.\n let _date_day_of_week = this.state.week_data[index_date % 7];\n\n // On Today.\n if (\n day === this.NowDt.date() &&\n this.state.year === this.NowDt.year() &&\n this.state.month_id === this.NowDt.month()\n ) {\n _class_name += ` ${this.config.classname.today}`;\n }\n\n // Not this Month.\n if (!day) _class_name += ` ${this.config.classname.date_disable}`;\n\n // When has event data.\n if (_date_event_data.length) {\n _class_name += ` ${this.config.classname.date_hasevent}`;\n } else {\n _class_name += ` ${this.config.classname.date_noevent}`;\n }\n\n let _date_event = [];\n let _date_event_html = '';\n if(_date_event_data.length){\n // Create Event data.\n\n let _class_name_parent = '';\n\n _date_event_data.map((val, index) => {\n if(val.category_en){\n _class_name_parent += ` u-has-${val.category_en}`;\n }\n _date_event.push(val);\n\n if(typeof this.config.template.date_data === 'function' ){\n _date_event_html += Str2Mustache(this.config.template.date_data(val), val);\n } else {\n _date_event_html += Str2Mustache(this.config.template.date_data, val);\n }\n\n });\n _class_name += _class_name_parent;\n }\n\n let _date = CALENDAR_MODULE.AnalyzeDate(year, month_id, day).current;\n\n // Create Calendar HTML data for one day.\n let _return = Object.assign(_date,\n {\n index: index_date,\n class_name: _class_name,\n day_of_week: _date_day_of_week,\n date_data: _date_event_html,\n date_data_ary: _date_event\n }\n );\n\n return _return;\n }", "function BuildDates(date){\r\n var array = new Array();\r\n array['day'] = (date.getDate() < 10) ?\r\n '0' + date.getDate().toString() :\r\n date.getDate().toString();\r\n \r\n array['month'] = (date.getMonth() < 9) ?\r\n '0' + (date.getMonth()+1).toString() :\r\n (date.getMonth()+1).toString();\r\n \r\n array['year'] = date.getFullYear().toString();\r\n return array;\r\n}", "function createArray(){\n for (let i = 1; i <= 30; i++){\n let currentDate = new Date (`2020-11-${i} 15:00`);\n let item = { \"index\": i, \"date\": currentDate,\"dateString\":currentDate.toISOString().slice(0,10)}\n \n dateArray[i] = item\n addDateToDiv(item) \n }\n}", "function getCalendar(year, month, day) {\n var days = new Date(year, month + 1, 0).getDate();\n var offset = new Date(year, month, 1).getDay() - 1;\n offset = offset === -1 ? 6 : offset;\n var lines = Math.ceil((days + offset) / 7);\n var cal = [];\n var actual_day = 1 - offset;\n for (var l = 0; l < lines; l++) {\n var row = [];\n for (var c = 0; c < 7; c++) {\n row.push({\n id: actual_day,\n number: new Date(year, month, actual_day).getDate(),\n otherMonth: actual_day < 1 || actual_day > days,\n selected: actual_day === day,\n today: actual_day === new Date().getDate() && month === new Date().getMonth() && year === new Date().getFullYear()\n });\n actual_day++;\n }\n cal.push(row);\n }\n return cal;\n}", "function fillCalendar() {\n console.log(\"inside the fill calendar\");\n // for (let i = 0; i < events.length; i++) {\n // console.log(events[i].title);\n // }\n let currentMonth = date.getMonth()+1;\n let dateComp = new Date(date.getFullYear()+yearCounter, currentMonth-1+monthCounter, date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds());\n let year = new Date(date.getFullYear()+yearCounter, currentMonth+monthCounter, 0).getFullYear();\n let month = new Date(date.getFullYear()+yearCounter, currentMonth+monthCounter, 0).getMonth();\n let numDaysInMonth = new Date(date.getFullYear()+yearCounter, currentMonth+monthCounter, 0).getDate();\n let monthStartingDay = new Date(date.getFullYear()+yearCounter, currentMonth+-1+monthCounter, 1).getDay();\n let numDaysLastMonth = new Date(date.getFullYear()+yearCounter, currentMonth+monthCounter-1, 0).getDate();\n let monthStartingDayCopy = monthStartingDay;\n let counter = 1;\n let counter2 = 0;\n let counter3 = 0;\n let counter4 = 1;\n //\n //prints month and year above calendar\n //\n $(\"#month\").html(`${months[month]}`);\n $(\"#year\").html(`${year}`);\n //\n //clears all day boxes on calendar\n //\n $(\".day-box\").html(\" \"); \n // while loop fills in boxes for last month\n // first for-loop fills in first row for curreny month\n // second for-loop fills in the rest of the rows for current month\n // third for-loop fills in the rest of the rows for next month\n while (counter2 < monthStartingDay) {\n $(`#c${counter2}`).append(`<span class=\"faded\">${numDaysLastMonth-monthStartingDayCopy+1}</span>`);\n counter2++;\n monthStartingDayCopy--;\n }\n for (let j = monthStartingDay; j < 7; j++) {\n $(`#c${j}`).append(`<span class=\"bold\">${counter}</span>`);\n for (let i = 0 ; i < events.length; i++) {\n //\n // If the current date is equal to the date generated by fillCalender()\n // then highlight current day's box to lightgreen using currentDay class\n //\n if (currentMonth + monthCounter == parseInt(events[i].startMonth) && counter == parseInt(events[i].startDay)) {\n $(`#c${j}`).append(`<p class=\"event ${events[i].tag}\">${events[i].startHour}:${events[i].startMinutes} ${events[i].title}</p>`);\n }\n }\n counter++;\n }\n for (let j = 7; counter <= numDaysInMonth; j++) {\n $(`#c${j}`).append(`<span class=\"bold\">${counter}</span>`);\n if (date.getMonth() == dateComp.getMonth() && date.getDate() == dateComp.getDate() && date.getFullYear() == dateComp.getFullYear()) {\n currentDayIDNum = date.getDate()-monthStartingDay+1;\n $(`#c${currentDayIDNum}`).find(\"span\").addClass(\"currentDay\");\n } else {\n $(`#c${currentDayIDNum}`).find(\"span\").removeClass(\"currentDay\");\n }\n for (let i = 0 ; i < events.length; i++) {\n // console.log(\"Event index: \" + i)\n if (currentMonth + monthCounter == parseInt(events[i].startMonth) && counter == parseInt(events[i].startDay)) {\n $(`#c${j}`).append(`<p class=\"event ${events[i].tag}\">${events[i].startHour}:${events[i].startMinutes} ${events[i].title}</p>`);\n }\n }\n counter++;\n counter3 = j+1;\n }\n for (j = counter3; j < 42; j++) {\n $(`#c${j}`).append(`<span class=\"faded\">${counter4}</span>`);\n counter3++;\n counter4++;\n }\n console.log(\"Outside fill calendar\");\n}", "getOrganizedArr() {\n this.dayArr = [[],[],[],[],[],[],[]];\n this.items.forEach(item => {\n this.placeEventIntoDayArray(item);\n });\n this.dayArr = this.sortDayArr(this.dayArr);\n return this.dayArr;\n }", "function createCalendarQueue(): number[] {\n return range(Calendar_ROW * Calendar_COL)\n}", "function fillCurrent() {\n for (let i = startDay; i < endDate + startDay; i++) {\n dateArray.push(i - startDay + 1)\n }\n }", "function createCalendar() {\n addCalendar();\n displayDates();\n}", "function createCalendar(){\n // display the current month and year at the top of the calendar\n calendarHeader.innerHTML = `<h1>${monthInfo[dateInfo.currentMonth][0]} ${dateInfo.currentYear}</h1>`;\n checkLeapYear();\n addDaysFromPastMonth();\n addDaysFromCurrentMonth();\n addDaysFromNextMonth();\n}", "function updateCalendar(){\n //events = [];\n document.getElementById(\"display_events\").innerHTML = \"\";\n //document.getElementById(\"days\").innerHTML = \"\";\n $(\"#days\").empty();\n\tlet weeks = currentMonth.getWeeks();\n \n const data = {'month': currentMonth.month+1, 'year': currentMonth.year};\n eventsDay(data);\n //console.log(currentMonth);\n let index = 0;\n\tfor(let w in weeks){\n\t\tlet days = weeks[w].getDates();\n index++;\n\t\t// days contains normal JavaScript Date objects.\n\t\t//alert(\"Week starting on \"+days[0]); \n\t\t//$(\"#days\").append(\"<div class='calendar__week'>\");\n\t\tfor(let d in days){ \n\t\t\t// You can see console.log() output in your JavaScript debugging tool, like Firebug,\n\t\t\t// WebWit Inspector, or Dragonfly.\n const dayRegex = /(\\d{2})/g;\n const dayMatch = dayRegex.exec(days[d])[1];\n //const data = {'day': dayMatch, 'month': currentMonth.month+1, 'year': currentMonth.year};\n let name =\"\";\n let namearray = [];\n let count = 0;\n for (let i = 0; i < eventclass.length; ++i) {\n //console.log(eventclass[i].name);\n //console.log(eventclass[i].day + \" \" + dayMatch);\n const c = eventclass[i].tag;\n let color;\n if (c == 'holiday') {\n color = 'green';\n }\n else if (c == 'birthday') {\n color = 'pink';\n }\n else if (c == 'exam') {\n color = 'blue';\n }\n else if (c == 'important') {\n color = 'red';\n }\n else {\n color = '#aab2b8';\n }\n //console.log(eventclass[i].name + \" \" + eventclass[i].month);\n \n if (eventclass[i].day == dayMatch && currentMonth.month+1 == eventclass[i].month && currentMonth.year == eventclass[i].year) {\n //console.log(\"entered\");\n if (eventclass[i].day < 7) {\n if(index > 1) {\n //console.log(\"less than 1\");\n //\n }\n else {\n name= name.concat(\"<div id='eventbox'><span style='color:\"+color+\";'>\" + eventclass[i].name + \"</span> <button class='mod' id='modify_btn' value=\" + eventclass[i].id +\">Edit</button> <button class='del' id='delete_btn' value=\" + eventclass[i].id +\">Delete</button> <button class='time' id='time_btn' value=\" + eventclass[i].id +\">View Details</button></div>\");\n name = name.concat(\"<br>\");\n //console.log(eventclass[i].month);\n //console.log(\"greater\");\n }\n \n }\n else if (eventclass[i].day > 23) {\n if(index < 3) {\n //\n }\n else {\n name= name.concat(\"<div id='eventbox'><span style='color:\"+color+\";'>\" + eventclass[i].name + \"</span> <button class='mod' id='modify_btn' value=\" + eventclass[i].id +\">Edit</button> <button class='del' id='delete_btn' value=\" + eventclass[i].id +\">Delete</button> <button class='time' id='time_btn' value=\" + eventclass[i].id +\">View Details</button></div>\");\n name = name.concat(\"<br>\");\n \n }\n }\n else {\n //sname = name.concat(eventclass[i].name);\n // name= name.concat(\"<button class='mod' id='modify_btn' value=\" + eventclass[i].id +\">\" + eventclass[i].name + \"</button><p>\");\n name= name.concat(\"<div id='eventbox'><span style='color:\"+color+\";'>\" + eventclass[i].name + \"</span> <button class='mod' id='modify_btn' value=\" + eventclass[i].id +\">Edit</button> <button class='del' id='delete_btn' value=\" + eventclass[i].id +\">Delete</button> <button class='time' id='time_btn' value=\" + eventclass[i].id +\">View Details</button></div>\");\n name = name.concat(\"<br>\");\n //console.log(\"work\");\n //name = name + \"\\n\" + \"\\n\";\n //namearray[count] = name;\n //count ++;\n }\n\n }\n }\n if(name == \"\"){\n $(\"#days\").append(\"<li><div class='box'>\" + dayMatch + \"</div></li>\");\n } else {\n \n $(\"#days\").append(\"<li><div class='box'>\" + dayMatch + \"<br>\" +name + \"</div></li>\");\n }\n }\n\t}\n const mod_buttons = document.getElementsByClassName('mod');\n const del_buttons = document.getElementsByClassName('del');\n const time_buttons = document.getElementsByClassName('time');\n for ( let j in Object.keys( mod_buttons ) ) {\n mod_buttons[j].addEventListener(\"click\", modifyEvents, false);\n }\n for ( let k in Object.keys( del_buttons ) ) {\n del_buttons[k].addEventListener(\"click\", deleteEvents, false);\n }\n for ( let m in Object.keys( time_buttons ) ) {\n time_buttons[m].addEventListener(\"click\", viewtime, false);\n }\n \n}", "function makeDayArray() {\n this.length=7;\n this[1] = \"Sun.\"; this[2] = \"Mon.\"; this[3] = \"Tues.\";\n this[4] = \"Wed.\"; this[5] = \"Thurs.\"; this[6] = \"Fri.\";\n this[7] = \"Sat.\";\n return this;\n}", "function buildDay () {\n\n}", "function populate() {\n for (let i = 0; i < 42; i++) {\n calendarCells[i].textContent = dateArray[i];\n }\n }", "function buildDayArray(days) {\n var daysToGoal = _getDaysToGoal(config.startDate, config.goalDate);\n var date = moment(new Date(config.startDate));\n var dayNumber = 0;\n\n\n console.log(\"CONFIG IN BUILD DAY ARRAY\");\n console.log(config);\n for (var i = 0; i <= daysToGoal; i++) {\n\n var currentDay = new Day();\n\n //set our known values for the array\n currentDay.date = _addDay(date);\n currentDay.dayNumber = dayNumber;\n currentDay.dailyCalories = config.dailyCalories;\n currentDay.activityLevel = config.activityLevel;\n currentDay.height = config.height;\n currentDay.gender = config.gender;\n currentDay.age = config.age;\n\n //check for cheat days, modify the day we built if they exist\n currentDay = _checkCheatDay(currentDay, config.cheatDays);\n\n days.push(currentDay);\n\n dayNumber++;\n date = currentDay.date;\n }\n\n return days;\n }", "function getCalenderBody(){\n const dates = [];\n const lastDate = new Date(year, month + 1, 0).getDate(); //5月の最後の日にち\n for(let i = 1; i <= lastDate; i++){\n dates.push(\n {\n date: i,\n isToday: false,\n isDisable: false\n }\n );\n }\n\n if(year === dat.getFullYear() && month ===dat.getMonth()){\n dates[dat.getDate() - 1].isToday = true;\n } \n return dates;\n }", "function buildSeasonsArray()\n{\n var startDateString;\n var finishDateString;\n\n SEASONS_ARRAY = new Array(N_SEASONS);\n for (var i = 0; i < N_SEASONS; ++i)\n {\n SEASONS_ARRAY[i] = new Array(3); // Contents: 'seasonName',\n // 'startDateArray', 'finishDateArray'.\n\n startDateString = getNextWordFromCodedData();\n SEASONS_ARRAY[i]['startDateArray' ] = convMySQLdateStringToIntArray(startDateString);\n\n eatWhiteSpaceFromCodedData();\n\n finishDateString = getNextWordFromCodedData();\n SEASONS_ARRAY[i]['finishDateArray'] = convMySQLdateStringToIntArray(finishDateString);\n\n eatWhiteSpaceFromCodedData();\n\n SEASONS_ARRAY[i]['seasonName' ] = String(getRemainingLineFromCodedData());\n }\n}", "_getDays(c) {\n let sched = {\n m: [],\n t: [],\n w: [],\n r: [],\n f: [],\n };\n c.schedule.forEach(s => {\n switch(s.days) {\n case \"M\":\n sched.m.push(this._format(c.crn, s.startTime, s.endTime));\n break;\n case \"T\":\n sched.t.push(this._format(c.crn, s.startTime, s.endTime));\n break;\n case \"W\":\n sched.w.push(this._format(c.crn, s.startTime, s.endTime));\n break;\n case \"R\":\n sched.r.push(this._format(c.crn, s.startTime, s.endTime));\n break;\n case \"F\":\n sched.f.push(this._format(c.crn, s.startTime, s.endTime));\n break;\n case \"MWF\":\n [sched.m, sched.w, sched.f].map(d => d.push(this._format(c.crn, s.startTime, s.endTime)));\n break;\n case \"TR\":\n [sched.t, sched.r].map(d => d.push(this._format(c.crn, s.startTime, s.endTime)));\n break;\n case \"MW\":\n [sched.m, sched.w].map(d => d.push(this._format(c.crn, s.startTime, s.endTime)));\n break;\n default:\n }\n })\n return sched;\n }", "function createDemoEvents() {\n // Date for the calendar events (dummy data)\n var date = new Date();\n var d = date.getDate(),\n m = date.getMonth(),\n y = date.getFullYear();\n\n return [\n {\n title: 'All Day Event',\n start: new Date(y, m, 1),\n backgroundColor: '#f56954', //red\n borderColor: '#f56954' //red\n },\n {\n title: 'Long Event',\n start: new Date(y, m, d - 5),\n end: new Date(y, m, d - 2),\n backgroundColor: '#f39c12', //yellow\n borderColor: '#f39c12' //yellow\n },\n {\n title: 'Meeting',\n start: new Date(y, m, d, 10, 30),\n allDay: false,\n backgroundColor: '#0073b7', //Blue\n borderColor: '#0073b7' //Blue\n },\n {\n title: 'Lunch',\n start: new Date(y, m, d, 12, 0),\n end: new Date(y, m, d, 14, 0),\n allDay: false,\n backgroundColor: '#00c0ef', //Info (aqua)\n borderColor: '#00c0ef' //Info (aqua)\n },\n {\n title: 'Birthday Party',\n start: new Date(y, m, d + 1, 19, 0),\n end: new Date(y, m, d + 1, 22, 30),\n allDay: false,\n backgroundColor: '#00a65a', //Success (green)\n borderColor: '#00a65a' //Success (green)\n },\n {\n title: 'Open Google',\n start: new Date(y, m, 28),\n end: new Date(y, m, 29),\n url: '//google.com/',\n backgroundColor: '#3c8dbc', //Primary (light-blue)\n borderColor: '#3c8dbc' //Primary (light-blue)\n }\n ];\n }", "function calendar(year) {\n console.log(\"creating calendar\")\n for (var monthCount = 0; monthCount < 13; monthCount++) {\n var newList = $(\"<ul>\");\n newList.addClass(\"main\");\n for (var dayCount = 0; dayCount < 32; dayCount++) {\n\n if (dayCount===0 && monthCount===0) {\n var newListItem = $(\"<li>\")\n newListItem.addClass(\"cEmpty\")\n // newListItem.addClass(\"cLabel\");\n newList.append(newListItem)\n }\n else if (monthCount ===0)\n {\n var newListItem = $(\"<li>\");\n newListItem.addClass(\"cEmpty\");\n var labelDiv = $(\"<div>\")\n labelDiv.addClass(\"cLabel\");\n labelDiv.text(dayCount);\n newListItem.append(labelDiv);\n newList.append(newListItem);\n\n } else if (dayCount ===0) {\n var monthName = moment(monthCount, \"M\").format(\"MMM\")\n var newListItem = $(\"<li>\");\n newListItem.addClass(\"cEmpty\");\n var labelDiv = $(\"<div>\");\n labelDiv.addClass(\"cLabel\");\n labelDiv.text(monthName.substring(0,1));\n newListItem.append(labelDiv);\n newList.append(newListItem)\n } else {\n\n var newListItem = $(\"<li>\")\n\n var dateDiv = $(\"<div>\")\n var date = String(monthCount) + \"/\" + String(dayCount) + \"/\" + year\n var dateFormat = \"M/D/YYYY\"\n var convertedDate = moment(date, dateFormat)\n var dayOfTheWeek = convertedDate.format(\"d\") // sunday =0\n\n\n\n if (!convertedDate.isValid()) {\n newListItem.addClass(\"cEmpty\")\n } else {\n dateDiv.addClass(\"cDate\")\n dateDiv.addClass(date)\n dateDiv.text(convertedDate.format(\"MM/DD/YY\"));\n newListItem.append(dateDiv)\n\n var location = $(\"<div>\")\n location.addClass(\"cLocation\")\n location.text(\"Gary, IN\")\n newListItem.append(location)\n\n var mood = Math.floor(Math.random() * (9 - 1)) + 1\n newListItem.addClass(\"type-\" + mood)\n newListItem.addClass(\"cat-\" + dayOfTheWeek)\n }\n\n\n\n newList.append(newListItem)\n }\n }\n $(\".wrapper\").append(newList)\n }\n }", "function makeDateObjects(data){\r\n\t\tconsole.log(\"makeDateObjects\");\r\n\t\tfor (i = 0; i < data.length; i++){\r\n\t\t\tvar datestring = data[i][selectedOptions.dateField];\r\n\t\t\tvar thisYear = parseInt(datestring.substring(0,4));\r\n\t\t\tvar thisMonth = parseInt(datestring.substring(5,7));\r\n\t\t\tvar thisDay = parseInt(datestring.substring(8,10));\r\n\t\t\tvar thisDateComplete = new Date(thisYear, thisMonth-1, thisDay); // JS-Date Month begins at 0\r\n\t\t\tzaehlstellen_data[i][selectedOptions.dateField] = thisDateComplete;\r\n\t\t}\r\n\t}", "function createCalendar () {\n\tshowDays(); // works when days were previously hidden\n\tfindDaysInMonth(); // find how many days are in a current month\n\tfindWeeksInMonth(); // find how many weeks are in the current month\n\tvar firstDayOfMonthName = findFirstDayOfMonthName(); // find day of week of the first day of a month \n\tcreateWeeks(numberOfWeeks); // creating and displaying weeks depending on how many weeks are in a month (\"numberOfWeeks\")\n\taddDayNumbersAndCurrentId(numberOfWeeks, firstDayOfMonthName, daysInMonth); // adding a number of a day in a calendar elements; adding id to a current day\n\thideEmptyDays(); // hiding days elements of a calendar which don't contain a number of a day; adding a pointer to the one that are visible\n\tchangeWeeksDisplay(\"none\"); // hide all weeks (= view: week) \n\tdocument.getElementById(weekToDisplay).style.display = \"flex\"; // display a current week\n\taddDayClickEvent(); // add \"click\" event to new calendar days elements\n\taddWeekClickEvent(); // add \"click\" event to new calendar weeks elements\n}", "function buildEvents(calendar) {\n var start = startDate(calendar);\n var end = endDate(calendar);\n\n clearEvents(calendar);\n\n // Extract current filters from table\n var table_options = $(table).bootstrapTable('getOptions');\n var filters = table_options.query_params || {};\n\n filters.min_date = start;\n filters.max_date = end;\n filters.part_detail = true;\n\n // Request build orders from the server within specified date range\n inventreeGet(\n '{% url \"api-build-list\" %}',\n filters,\n {\n success: function(response) {\n\n for (var idx = 0; idx < response.length; idx++) {\n\n var order = response[idx];\n\n var date = order.creation_date;\n\n if (order.completion_date) {\n date = order.completion_date;\n } else if (order.target_date) {\n date = order.target_date;\n }\n\n var title = `${order.reference}`;\n\n var color = '#4c68f5';\n\n if (order.completed) {\n color = '#25c234';\n } else if (order.overdue) {\n color = '#c22525';\n }\n\n var event = {\n title: title,\n start: date,\n end: date,\n url: `/build/${order.pk}/`,\n backgroundColor: color,\n };\n\n calendar.addEvent(event);\n }\n }\n }\n );\n }", "function generateDate(today) {\n for (i = 0; i < datelen; i++) {\n var newday = new Date(today.getFullYear(), today.getMonth(), today.getDate()+i);\n dateArray.push(newday);\n }\n return dateArray\n }", "function creatMonthsArray(month, daysCount) {\n console.log(daysCount);\n debugger;\n var month2 = new Object({\n Week1: { days: new Array(7).fill(0), tatal: 0 },\n Week2: { days: new Array(7).fill(0), tatal: 0 },\n Week3: { days: new Array(7).fill(0), tatal: 0 },\n });\n if (daysCount === 31) {\n month2.Week4 = { days: new Array(10).fill(0), tatal: 0 };\n } else if (daysCount === 30) {\n month2.Week4 = { days: new Array(9).fill(0), tatal: 0 };\n } else if (daysCount === 29) {\n month2.Week4 = { days: new Array(8).fill(0), tatal: 0 };\n } else if (daysCount === 28) {\n month2.Week4 = { days: new Array(7).fill(0), tatal: 0 };\n }\n\n switch (month) {\n case 1:\n console.log(jan, 'month');\n jan = month2;\n break;\n case 2:\n Feb = month2;\n break;\n case 3:\n Mar = month2;\n break;\n case 4:\n aprile = month2;\n break;\n case 5:\n may = month2;\n break;\n case 6:\n jun = month2;\n break;\n case 7:\n jul = month2;\n break;\n case 8:\n ogst = month2;\n break;\n case 9:\n sept = month2;\n break;\n case 10:\n oct = month2;\n break;\n case 11:\n nov = month2;\n break;\n case 12:\n dec = month2;\n break;\n }\n}", "function calendar() {\n var monthNames = [\"Январь\", \"Февраль\", \"Март\", \"Апрель\", \"Май\", \"Июнь\", \"Июль\", \"Август\", \"Сентябрь\", \"Октябрь\", \"Ноябрь\", \"Декабрь\"];\n\n var dayNames = [\"Пн\", \"Вт\", \"Ср\", \"Чт\", \"Пт\", \"Сб\", \"Вс\"];\n\n var events = [\n {\n date: \"8/3/2013\",\n title: 'Двойной заказ',\n link: '',\n linkTarget: '_blank',\n color: '',\n //content: 'Два заказа, один на выезде, другой в городе ',\n class: 'tripleOutdore',\n displayMonthController: true,\n displayYearController: true,\n nMonths: 6\n }\n ];\n\n $('#calendari_lateral1').bic_calendar({\n //list of events in array\n events: events,\n //enable select\n enableSelect: true,\n //enable multi-select\n multiSelect: false, //set day names\n dayNames: dayNames,\n //set month names\n monthNames: monthNames,\n //show dayNames\n showDays: true,\n //show month controller\n displayMonthController: true,\n //show year controller\n displayYearController: false,\n //set ajax call\n reqAjax: {\n type: 'get',\n url: 'http://fierydream.com/js/someJSON/events.json'\n }\n });\n }", "constructor() {\n\n \n this.today = new Date();\n this.year = this.today.getFullYear();\n this.month = this.today.getMonth();\n\n this.monthInfo = {\n firstDayOfWeek: new Date (this.year, this.month, 1).getDay(),\n daysLast: new Date (this.year, this.month, 0).getDate(),\n daysThis: new Date (this.year + parseInt((this.month + 1) / 12), (this.month + 1), 0).getDate()\n }\n\n this.calendar = C('calendar')[0];\n this.monthView = O('month-view');\n this.calendarType = 'M';\n this.events = {};\n \n this.getJson();\n this.updateCalendar();\n\n }", "function buildYear(){\r\n\tyear = Object.create(d); //so year is an object like Date, that we passed to this with 'd'\r\n\tyear.currentYear = d.getFullYear(); //just trying to make things quicker to get at\r\n\tyear.thisMonthNumber = d.getMonth();\r\n\r\n //month and day names.\r\n\tyear.monthNames = [\r\n\t\t\t\t\"January\",\r\n\t\t\t\t\"February\",\r\n\t\t\t\t\"March\",\r\n\t\t\t\t\"April\",\r\n\t\t\t\t\"May\",\r\n\t\t\t\t\"June\",\r\n\t\t\t\t\"July\",\r\n\t\t\t\t\"August\",\r\n\t\t\t\t\"September\" ,\r\n\t\t\t\t\"October\",\r\n\t\t\t\t\"November\",\r\n\t\t\t\t\"December\"\r\n\t\t\t],\r\n\tyear.dayNames = [\r\n\t\t\t\t\"Monday\",\r\n\t\t\t\t\"Tuesday\",\r\n\t\t\t\t\"Wednesday\",\r\n\t\t\t\t\"Thursday\",\r\n\t\t\t\t\"Friday\",\r\n\t\t\t\t\"Saturday\",\r\n\t\t\t\t\"Sunday\"\r\n\t\t\t],\r\n\r\n\tyear.currentDay = d.getDay(); //a number 0 -6\r\n\tyear.workingMonth = workingMonth;\r\n\tyear.workingDayName = workingDayName;\r\n\tyear.workingDayNum = workingDayNum;\r\n\tyear.workingDate = workingDate;\r\n\tyear.workingHour = workingHour;\r\n\tyear.daysInMonths = getDaysInMonths();//an array with each month's number of days.\r\n\r\n\tyear.weekdays = new Array(7);\r\n\t\tyear.weekdays[0] = \"Monday\";\r\n\t\tyear.weekdays[1] = \"Tuesday\";\r\n\t\tyear.weekdays[2] = \"Wednesday\";\r\n\t\tyear.weekdays[3] = \"Thursday\";\r\n\t\tyear.weekdays[4] = \"Friday\";\r\n\t\tyear.weekdays[5] = \"Saturday\";\r\n\t\tyear.weekdays[6]= \"Sunday\";\r\n\r\n\tyear.printYear = function(){\r\n\r\n\t\t$.each( year.monthNames, function( key, value ) {\r\n\t\t $(\"#rightBar\").append( \"<div id='\"+key + \"' class='mNamesRight'>\" + value.toUpperCase() + \"</div>\");\r\n\t\t $('#'+key).on(\"click\",dayBoxes);\r\n\t\t});\r\n\t};\r\n\r\n\r\n\treturn year\r\n}", "function createDemoEvents() {\n // Date for the calendar events (dummy data)\n var date = new Date();\n var d = date.getDate(),\n m = date.getMonth(),\n y = date.getFullYear();\n\n return [\n {\n title: 'All Day Event',\n start: new Date(y, m, 1),\n backgroundColor: '#f56954', //red \n borderColor: '#f56954' //red\n },\n {\n title: 'Long Event',\n start: new Date(y, m, d - 5),\n end: new Date(y, m, d - 2),\n backgroundColor: '#f39c12', //yellow\n borderColor: '#f39c12' //yellow\n },\n {\n title: 'Meeting',\n start: new Date(y, m, d, 10, 30),\n allDay: false,\n backgroundColor: '#0073b7', //Blue\n borderColor: '#0073b7' //Blue\n },\n {\n title: 'Lunch',\n start: new Date(y, m, d, 12, 0),\n end: new Date(y, m, d, 14, 0),\n allDay: false,\n backgroundColor: '#00c0ef', //Info (aqua)\n borderColor: '#00c0ef' //Info (aqua)\n },\n {\n title: 'Birthday Party',\n start: new Date(y, m, d + 1, 19, 0),\n end: new Date(y, m, d + 1, 22, 30),\n allDay: false,\n backgroundColor: '#00a65a', //Success (green)\n borderColor: '#00a65a' //Success (green)\n },\n {\n title: 'Open Google',\n start: new Date(y, m, 28),\n end: new Date(y, m, 29),\n url: '//google.com/',\n backgroundColor: '#3c8dbc', //Primary (light-blue)\n borderColor: '#3c8dbc' //Primary (light-blue)\n }\n ];\n }", "function utilities(){\n var day,month;\n var utilitiesArray = [];\n \n for(var i = 2010,k=0; i <=2016; i++,k++){\n utilitiesArray[k] = {};\n for(var j = 1; j<=12; j++){\n day = randomDayInMonth(i,j); \n utilitiesArray[k][j] = day;\n }\n }\n return utilitiesArray;\n}", "function generateEvents(evntJson){\n\t\tfor (var i = 0; i < evntJson.length; i++) {\n\t\t\t//if(evntJson[i].ID === \"6\"){\n\t\t\teventList.push({\n\t\t\t\ttitle: evntJson[i].NAME,\n\t\t\t\tstart: evntJson[i].DATE \n\t\t\t});\n\t\t\t//}\n\t\t}\n\t\t\tcreateCalender();\n\t\t\tconsole.log(eventList);\t\t\t\n\t\t}", "function calendar() {\n var monthNames = [\"Январь\", \"Февраль\", \"Март\", \"Апрель\", \"Май\", \"Июнь\", \"Июль\", \"Август\", \"Сентябрь\", \"Октябрь\", \"Ноябрь\", \"Декабрь\"];\n\n var dayNames = [\"Пн\", \"Вт\", \"Ср\", \"Чт\", \"Пт\", \"Сб\", \"Вс\"];\n\n var events = [\n {\n date: \"8/3/2013\",\n title: 'Двойной заказ',\n link: '',\n linkTarget: '_blank',\n color: '',\n //content: 'Два заказа, один на выезде, другой в городе ',\n class: 'tripleOutdore',\n displayMonthController: true,\n displayYearController: true,\n nMonths: 6\n }\n ];\n\n $('#calendari_lateral1').bic_calendar({\n //list of events in array\n events: events,\n //enable select\n enableSelect: true,\n //enable multi-select\n multiSelect: false,\n //set day names\n dayNames: dayNames,\n //set month names\n monthNames: monthNames,\n //show dayNames\n showDays: true,\n //show month controller\n displayMonthController: true,\n //show year controller\n displayYearController: false,\n //set ajax call\n reqAjax: {\n type: 'get',\n url: './js/someJSON/events.json' // /js/someJSON/events.json //http://bic.cat/bic_calendar/index.php\n }\n });\n }", "function calanderBuild(calanderElement,startElement,endElement,object){\ncalanderElement.empty();\nvar end = assumptions.completeReturns[0].length - 1;\ncalander.months=['Jan','Feb','Mar', 'Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'];\n\n\nstartYear=moment(assumptions.completeReturns[0][end]).format(\"YYYY\")/1;\nendYear=moment(assumptions.completeReturns[0][0]).format(\"YYYY\")/1;\n\n\ndropdown=\"<select class='calanderDropDown'>\"\n\nfor(i=startYear;i<=endYear;i++){\ndropdown +=\"<option>\"+i+\"</option>\"\n\n}\ndropdown +=\"</select>\"\nvar calanderTable = \"<table class='calander'><th colspan='4'>\"+dropdown+\"</th><tr><td id='Jan'>Jan</td><td id='Feb'>Feb</td><td id='Mar'>Mar</td><td id='Apr'>Apr</td></tr><tr><td id='May'>May</td><td id='Jun'>Jun</td><td id='Jul'>Jul</td><td id='Aug'>Aug</td></tr><tr><td id='Sep'>Sep</td><td id='Oct'>Oct</td><td id='Nov'>Nov</td><td id='Dec'>Dec</td></tr></table>\"\n\n\ncalanderElement.append(calanderTable);\ncalanderElement.css('display','none');\n$('.calander').draggable();\n\n//build calander applicable to start date\nstartElement.bind( \"click\", function() {\n\ncalander.start=true;\ncalanderElement.css('display','block');\nyear=moment(this.text).format(\"YYYY\");\nfor(i=0;i<calander.months.length;i++){\n$('#' + calander.months[i]).removeClass('inactiveMonth');\n$('#' + calander.months[i]).addClass('activeMonth');\n}\n\n\n$('.calanderDropDown').val(year);\nlastYear=moment(assumptions.completeReturns[0][0]).format(\"YYYY\");\nfirstYear=moment(assumptions.completeReturns[0][assumptions.completeReturns[0].length-1]).format(\"YYYY\");\nlastMonth=moment(assumptions.completeReturns[0][0]).format(\"M\");\nfirstMonth=moment(assumptions.completeReturns[0][assumptions.completeReturns[0].length-1]).format(\"M\");\n\nstartMonthsGrey=[];\nendMonthsGrey=[];\nfor(i=0;i<12;i++){\nif(firstMonth/1>i+1){\nstartMonthsGrey[i]=calander.months[i];\n}\n}\nfor(i=12;i>0;i--){\nif(i>lastMonth/1){\nendMonthsGrey[12-i]=calander.months[i-1];\n}\n}\n\nif(year==firstYear){\nfor(i=0;i<startMonthsGrey.length;i++){\n$('#' + startMonthsGrey[i]).addClass('inactiveMonth');\n$('#' + startMonthsGrey[i]).removeClass('activeMonth');\n}\n}\nif(year==lastYear){\nfor(i=0;i<endMonthsGrey.length;i++){\n$('#' + endMonthsGrey[i]).addClass('inactiveMonth');\n$('#' + endMonthsGrey[i]).removeClass('activeMonth');\n}\n}\n\n\n\n//set up months per year choice chosen, once month is chosen magic will actually happen\n$('.calanderDropDown').bind(\"change\",function(){\nfor(i=0;i<calander.months.length;i++){\n$('#' + calander.months[i]).removeClass('inactiveMonth');\n$('#' + calander.months[i]).addClass('activeMonth');\n}\n\nif($('.calanderDropDown').val()==firstYear){\nfor(i=0;i<startMonthsGrey.length;i++){\n$('#' + startMonthsGrey[i]).addClass('inactiveMonth');\n$('#' + startMonthsGrey[i]).removeClass('activeMonth');\n}\n}\nelse if($('.calanderDropDown').val()==lastYear){\nfor(i=0;i<endMonthsGrey.length;i++){\n$('#' + endMonthsGrey[i]).addClass('inactiveMonth');\n$('#' + endMonthsGrey[i]).removeClass('activeMonth');\n}\n}\nelse{}\n})\n\n});\n\n\n//build calander applicable to end date\nendElement.bind( \"click\", function() {\ncalander.start=false;\ncalanderElement.css('display','block');\nyear=moment(this.text).format(\"YYYY\");\nfor(i=0;i<calander.months.length;i++){\n$('#' + calander.months[i]).removeClass('inactiveMonth');\n$('#' + calander.months[i]).addClass('activeMonth');\n}\n\n\n$('.calanderDropDown').val(year);\nlastYear=moment(assumptions.completeReturns[0][0]).format(\"YYYY\");\nfirstYear=moment(assumptions.completeReturns[0][assumptions.completeReturns[0].length-1]).format(\"YYYY\");\nlastMonth=moment(assumptions.completeReturns[0][0]).format(\"M\");\nfirstMonth=moment(assumptions.completeReturns[0][assumptions.completeReturns[0].length-1]).format(\"M\");\n\nstartMonthsGrey=[];\nendMonthsGrey=[];\nfor(i=0;i<12;i++){\nif(firstMonth/1>i+1){\nstartMonthsGrey[i]=calander.months[i];\n}\n}\nfor(i=12;i>0;i--){\nif(i>lastMonth/1){\nendMonthsGrey[12-i]=calander.months[i-1];\n}\n}\n\nif(year==firstYear){\nfor(i=0;i<startMonthsGrey.length;i++){\n$('#' + startMonthsGrey[i]).addClass('inactiveMonth');\n$('#' + startMonthsGrey[i]).removeClass('activeMonth');\n}\n}\nif(year==lastYear){\nfor(i=0;i<endMonthsGrey.length;i++){\n$('#' + endMonthsGrey[i]).addClass('inactiveMonth');\n$('#' + endMonthsGrey[i]).removeClass('activeMonth');\n}\n}\n\n\n$('.calanderDropDown').bind(\"change\",function(){\nfor(i=0;i<calander.months.length;i++){\n$('#' + calander.months[i]).removeClass('inactiveMonth');\n$('#' + calander.months[i]).addClass('activeMonth');\n}\n\nif($('.calanderDropDown').val()==firstYear){\nfor(i=0;i<startMonthsGrey.length;i++){\n$('#' + startMonthsGrey[i]).addClass('inactiveMonth');\n$('#' + startMonthsGrey[i]).removeClass('activeMonth');\n}\n}\nelse if($('.calanderDropDown').val()==lastYear){\nfor(i=0;i<endMonthsGrey.length;i++){\n\n$('#' + endMonthsGrey[i]).addClass('inactiveMonth');\n$('#' + endMonthsGrey[i]).removeClass('activeMonth');\n}\n}\nelse{}\n})\n\n\n});\n//when month is chosen sets date and recalculates using assumptions.js function customReturn()\n$('.calander td').click(function(){\nmonth = this.innerText;\nyear = $('.calanderDropDown').val();\ncompleteReturnsPosition=\"\";\ndate=\"\";\nnewReturnArray=[];\n\n\nstart=\"\";\nend=\"\";\n\nif(this.className==\"activeMonth\"){\nfor(i=0;i<assumptions.completeReturns[0].length;i++){\nif(month == moment(assumptions.completeReturns[0][i]).format('MMM') && year == moment(assumptions.completeReturns[0][i]).format('YYYY')){\ncompleteReturnsPosition = i;\ndate = assumptions.completeReturns[0][i];\n};\n/* console.log(moment(assumptions.completeReturns[0][i]).format('MMM')) */\n}\n\n/* if(calander.start){\nif(completeReturnsPosition == assumptions.completeReturns[0].length-1){}\nelse{\ncalander.startDate=assumptions.completeReturns[0][completeReturnsPosition];\n\n}\n}\nelse{\nif(completeReturnsPosition == 0){}\nelse{\ncalander.endDate=assumptions.completeReturns[0][completeReturnsPosition];\n\n}\n\n} */\nif(calander.start){\ncalander.startDate = date;\n}\nelse{calander.endDate = date}\nfor(i=0;i<assumptions.completeReturns[0].length;i++){\nif(assumptions.completeReturns[0][i]==calander.startDate){\nstart = i;\n}\nif(assumptions.completeReturns[0][i]==calander.endDate){\nend = i;\n}\n\n}\n//if start date is greater than end date it does nothing\nif(start <= end){}\nelse{\nfor(i=0;i<assumptions.completeReturns.length;i++){\nnewReturnArray.push(assumptions.completeReturns[i].slice(end,start+1))\n}\n\n//found in assumptions.js\npresentAssumptions(newReturnArray);\n\n}\n\n\n}\n\n})\n\n}", "function createCalendar(calDate) {\r\n var calendarHTML = \"<table id= 'calendar_table'>\";\r\n calendarHTML += calCaption(calDate);\r\n calendarHTML += calWeekdayRow();\r\n calendarHTML += calDays(calDate);\r\n calendarHTML += \"</table\"; \r\n return calendarHTML;\r\n\r\n}", "function addWeekToArray()\n{\n selectedSlotsArray.push([]);\n for (let i=0; i<=839; i++)\n { \n selectedSlotsArray[week].push(false); \n } \n daysPassedArray.push([]);\n for (let i=0; i<=7; i++)\n { \n daysPassedArray[week].push(false); \n } \n}", "function createCalendar() {\r\n\t\tlet grid = document.getElementById(\"calendar\");\r\n\t\tgrid.style.display = \"block\";\r\n\t\tlet x = 0;\r\n\t\tlet y = 0;\r\n\t\t//creates the boxes for the weekdays\r\n\t\tfor(let i = 0; i <= 6; i++){\r\n\t\t\tlet newDiv = document.createElement(\"div\");\r\n\t\t\tnewDiv.classList.add(\"days\");\r\n\t\t\t//positions the square\r\n\t\t\tnewDiv.style.left = x + 'px';\r\n\t\t\tnewDiv.style.top = y + 'px';\r\n\t\t\tlet day = document.createElement(\"p\");\r\n\t\t\tif (i==0){day.innerHTML = \"Sunday\";}\r\n\t\t\tif (i==1){day.innerHTML = \"Monday\";}\r\n\t\t\tif (i==2){day.innerHTML = \"Tuesday\";}\r\n\t\t\tif (i==3){day.innerHTML = \"Wednesday\";}\r\n\t\t\tif (i==4){day.innerHTML = \"Thursday\";}\r\n\t\t\tif (i==5){day.innerHTML = \"Friday\";}\r\n\t\t\tif (i==6){day.innerHTML = \"Saturday\";}\r\n\t\t\tday.classList.add(\"weekdays\");\r\n\t\t\tnewDiv.appendChild(day);\r\n\t\t\tx = x + 110;\r\n\t\t\tgrid.appendChild(newDiv);\r\n\t\t}\r\n\r\n\t\tx = 0;\r\n\t\ty = 30;\r\n\t\t//creates the calendar boxes\r\n\t\tfor(let i = 1; i <= 35; i++){\r\n\t\t\t//creates the div and assigns its class\r\n\t\t\tlet newDiv = document.createElement(\"div\");\r\n\t\t\tnewDiv.classList.add(\"boxes\");\r\n\t\t\t//positions the box\r\n\t\t\tnewDiv.style.left = x + 'px';\r\n\t\t\tnewDiv.style.top = y + 'px';\r\n\t\t\tx = x + 110;\r\n\t\t\tif(x == 770) {\r\n\t\t\t\tx = 0;\r\n\t\t\t\ty = y + 80;\r\n\t\t\t}\r\n\t\t\t//sets the number in every square\r\n\t\t\tif (i-3 > 0 && i-3 < 32){\r\n\t\t\t\tlet number = document.createElement(\"p\");\r\n\t\t\t\tnumber.innerHTML = i-3;\r\n\t\t\t\tnumber.classList.add(\"numbers\");\r\n\t\t\t\tnewDiv.appendChild(number);\r\n\t\t\t\tlet name = i-3;\r\n\t\t\t\tnewDiv.id = name;\r\n\t\t\t}\r\n\t\t\t//adds the div to the grid\r\n\t\t\tgrid.appendChild(newDiv);\r\n\t\t}\r\n\t}", "function onLoad(){\r\n\r\n\t var d = new Date();\r\n\t var month_name = ['January','February','March','April','May','June','July','August','September','October','November','December'];\r\n\t var month = d.getMonth(); //0-11\r\n\t var year = d.getFullYear(); //2017\r\n\t var first_date = month_name[month] + \" \" + 1 + \" \" + year;\r\n\t //Nov 1 2017\r\n\t var tmp = new Date(first_date).toDateString();\r\n\t //Wed Nov 01 2017 ...\r\n\t var first_day = tmp.substring(0, 3); //Wed\r\n\t var day_name = ['Sun','Mon','Tue','Wed','Thu','Fri','Sat'];\r\n\t var day_no = day_name.indexOf(first_day); //1\r\n\t var days = new Date(year, month+1, 0).getDate(); //30\r\n\t //Wed Nov 01 2017 ...\r\n\t var calendar = get_calendar(day_no, days);\r\n\t document.getElementById(\"calendar-month-year\").innerHTML = month_name[month]+\" \"+year;\r\n\t document.getElementById(\"calendar-dates\").appendChild(calendar);\r\n\t}", "function fillCalendar(appointments){\n let calendar = document.getElementsByClassName(\"calendar_day\");\n\n let year = selectedDate.getFullYear();\n let month = selectedDate.getMonth();\n\n let monthName = CALENDAR_MONTH_NAMES[month];\n document.getElementById(\"calendar_month_display\").innerText = `${monthName} ${year}`;\n\n let endDate = new Date(Date.UTC(year, month+1));\n let date = new Date(Date.UTC(year, month));\n let index = (date.getDay() + 6) % 7;\n \n // clear days outside range\n for(let i=0;i<index;i++){\n calendar[i].children[0].innerText = \"\";\n calendar[i].children[1].innerHTML = \"\";\n calendar[i].setAttribute(\"aria-disabled\", \"true\");\n }\n\n // fill in days + apointments\n while (date < endDate) {\n calendar[index].children[0].innerText = date.getDate() + \".\";\n calendar[index].children[1].innerHTML = \"\";\n\n for(let i=0;i<appointments.length;i++){\n if(date.getUTCDate() == appointments[i].day){\n let appointment = document.createElement(\"div\");\n appointment.innerText = `${appointments[i].lecturer}: ${appointments[i].name}`;\n appointment.setAttribute(\"aria-id\", appointments[i].id);\n appointment.setAttribute(\"aria-name\", appointments[i].name);\n appointment.setAttribute(\"aria-location\", appointments[i].location);\n appointment.setAttribute(\"aria-start\", appointments[i].start);\n appointment.setAttribute(\"aria-end\", appointments[i].end);\n appointment.setAttribute(\"aria-status\", appointments[i].status);\n appointment.setAttribute(\"aria-lecturer\", appointments[i].lecturer);\n appointment.setAttribute(\"aria-type\", appointments[i].type);\n appointment.setAttribute(\"onclick\", \"show_popup(this)\");\n\n calendar[index].children[1].appendChild(appointment);\n }\n }\n calendar[index].setAttribute(\"aria-disabled\", \"false\");\n\n index += 1;\n date.setUTCDate(date.getUTCDate() + 1);\n }\n \n // clear days outside range\n for(let i=index;i<calendar.length;i++){\n calendar[i].children[0].innerText = \"\";\n calendar[i].children[1].innerHTML = \"\";\n calendar[i].setAttribute(\"aria-disabled\", \"true\");\n }\n}", "_createWeekCells() {\n const daysInMonth = this._dateAdapter.getNumDaysInMonth(this.activeDate);\n const dateNames = this._dateAdapter.getDateNames();\n this._weeks = [[]];\n for (let i = 0, cell = this._firstWeekOffset; i < daysInMonth; i++, cell++) {\n if (cell == DAYS_PER_WEEK) {\n this._weeks.push([]);\n cell = 0;\n }\n const date = this._dateAdapter.createDate(this._dateAdapter.getYear(this.activeDate), this._dateAdapter.getMonth(this.activeDate), i + 1);\n const enabled = this._shouldEnableDate(date);\n const ariaLabel = this._dateAdapter.format(date, this._dateFormats.display.dateA11yLabel);\n const cellClasses = this.dateClass ? this.dateClass(date, 'month') : undefined;\n this._weeks[this._weeks.length - 1].push(new MatCalendarCell(i + 1, dateNames[i], ariaLabel, enabled, cellClasses, this._getCellCompareValue(date), date));\n }\n }", "_createWeekCells() {\n const daysInMonth = this._dateAdapter.getNumDaysInMonth(this.activeDate);\n const dateNames = this._dateAdapter.getDateNames();\n this._weeks = [[]];\n for (let i = 0, cell = this._firstWeekOffset; i < daysInMonth; i++, cell++) {\n if (cell == DAYS_PER_WEEK) {\n this._weeks.push([]);\n cell = 0;\n }\n const date = this._dateAdapter.createDate(this._dateAdapter.getYear(this.activeDate), this._dateAdapter.getMonth(this.activeDate), i + 1);\n const enabled = this._shouldEnableDate(date);\n const ariaLabel = this._dateAdapter.format(date, this._dateFormats.display.dateA11yLabel);\n const cellClasses = this.dateClass ? this.dateClass(date, 'month') : undefined;\n this._weeks[this._weeks.length - 1].push(new MatCalendarCell(i + 1, dateNames[i], ariaLabel, enabled, cellClasses, this._getCellCompareValue(date), date));\n }\n }", "function addDates() {\n var month = months.indexOf($('.date-month').text());\n var year = parseInt($('.date-year').text());\n var day = new Date(year, month, 1).getDay();\n var maxDays = new Date(year, month+1, 0).getDate();\n var row = 1;\n dates = [];\n counts = new Array(maxDays).fill(0);\n \n for (var i=1; i<=maxDays; i++) {\n dates.push([row, day]);\n addDate(row, day, i);\n removeShade(row, day);\n if (day === 6) {\n day = 0;\n row++;\n }\n else {\n day++;\n }\n }\n addTomatoCounts();\n}", "function setCalendar() {\n\t//console.log('push calendar');\n\tvisitedPages.push(['calendar', setCalendar]);\n\tdrawCalendar(getRightNow());\n}", "function makeMonthArray() {\n this.length=12;\n this[1] = \"Jan.\"; this[2] = \"Feb.\"; this[3] = \"March\";\n this[4] = \"April\"; this[5] = \"May\"; this[6] = \"June\";\n this[7] = \"July\"; this[8] = \"Aug.\"; this[9] = \"Sept.\";\n this[10] = \"Oct.\"; this[11] = \"Nov.\"; this[12] = \"Dec.\";\n return this;\n}", "function data_for_datatables(){\n var obj_date_datables=[], range_title='';\n if(typeof Const.year !='undefined' && Const.year!=null && Const.year != get_current_date().year){\n range_title = config_moments('undefined', ''+Const.year+'-12-02', ''+Const.year+'-12-31').diff_days;\n\n obj_date_datables={\n config_data:{day:undefined,\n data_i:''+Const.year+'-12-02',\n data_f:''+Const.year+'-12-31',\n },\n title:range_title,\n };\n\n } else {\n range_title = moment(new Date()).format('YYYY');\n obj_date_datables={\n config_data:{day:undefined,\n data_i:String(get_current_date().year+'-01-01'),//01/01/2015\n data_f:undefined\n },\n title:range_title,\n };\n }\n\n return obj_date_datables;\n}", "function getAllDays() {\n for (var x = 0; x < self.dates.length; x++) {\n for (var z in self.dates[x]) {\n self.allDays.push(self.dates[x][z]);\n }\n }\n }", "createCalendarMarkup() {\n let cY = this.currYear,\n cM = this.currMonth;\n let lastDay = new Date(cY, cM + 1, 0).getDate(),\n firstDay = new Date(cY, cM, 1).getDay(),\n lastWeekBlanks = 6 - new Date(cY, cM, lastDay).getDay();\n\n //create array of html markup for current year and month;\n let calHtml = [\n ...Array(firstDay + lastDay + lastWeekBlanks + 1).keys(),\n ].map((elem, i) => {\n let dayOfTheWeek = new Date(cY, cM, i - firstDay).getDay();\n\n //add empty calendar square for first and last week of the month\n if (i <= firstDay || i >= firstDay + lastDay + 1) {\n return (elem = `<td>${\"\"}</td>`);\n } else {\n //if the day of the week is sunday prepend a new row\n elem =\n dayOfTheWeek === 0\n ? `</tr><tr><td>${i - firstDay}</td>`\n : `<td>${i - firstDay}</td>`;\n return elem;\n }\n });\n calHtml.shift();\n return calHtml.join(\"\");\n }", "function makeCalendarComponents() {\n const calendar = document.createElement('div');\n calendar.classList.add('calendar');\n calendar.textContent = 'Loading data...';\n\n const script = document.createElement('script');\n script.innerHTML = `new GitHubCalendar(\".calendar\", \"ljh-c\", { responsive: true })`;\n\n return [calendar, script];\n}", "function insertDaysToCalendar() {\n calendar.innerHTML = \"\";\n \n var startingDay = dayOfTheWeekInTheMonth(now.yyyy, now.mm);\n var daysInMonth = daysInTheMonth(now.yyyy, now.mm); \n \n var monthLabel = document.createElement('div');\n monthLabel.className = \"month-label\";\n monthLabel.innerHTML = monthName[now.mm] + \" <small>\" + now.yyyy + \"</small>\";\n calendar.appendChild(monthLabel);\n \n var calendarContainer = document.createElement('div');\n calendarContainer.className = \"calendar-container\";\n \n var totalDaysToRender = (startingDay + daysInMonth) % 7;\n \n totalDaysToRender = !!totalDaysToRender ? 7 - totalDaysToRender + daysInMonth : totalDaysToRender + daysInMonth; \n \n var day = 0;\n \n for(var i=1 - startingDay, max=totalDaysToRender; i<=max; i++) {\n var dateToWrite, cn = false;\n if(i < 1 || i > daysInMonth) {\n dateToWrite = \"\";\n cn = \"skip\";\n } else {\n dateToWrite = i;\n } \n calendarContainer.appendChild(makeDays(dateToWrite, day % 7, cn));\n day++;\n }\n \n calendar.appendChild(calendarContainer);\n moreCalender(monthLabel);\n }", "function populate_calendar_days() {\n // Clear the calendar (if not empty)\n var calendar_element = document.getElementById('calendar');\n calendar_element.innerHTML = \"\";\n\n // Setup number of days, day index, calendar square count, etc.\n var number_of_days = days_in_month(calendar_date.getMonth(), calendar_date.getFullYear());\n\n // Used for keeping track of the days in the month\n var day = 1;\n\n // What day of the week does the first day land on?\n var first_day = first_day_of_month(calendar_date.getFullYear(), calendar_date.getMonth()).getDay();\n\n // Determine the number of weeks (rows) in the calendar\n var row_count = (((first_day == 5 || first_day == 6) && (number_of_days == 31)) || ((first_day == 6) && (number_of_days >= 30)) ? 6 : 5);\n\n // The calendar square index (which square is it currently on?)\n var calendar_square_index = 0;\n\n // Dynamically build the squares/days\n for (var i = 0; i < row_count; i++) {\n // Create a new week (container) element\n var calendar_week_element = document.createElement(\"tr\");\n calendar_week_element.classList.add(\"calendar_body_container\");\n\n // Loop through the days of that week and add them to the week\n for (var j = 0; j < 7; j++) {\n // Create a new day\n var calendar_day_element = document.createElement(\"td\");\n calendar_day_element.classList.add(\"calendar_body_item\");\n\n // Will the calendar_day_element will hold data?\n if (calendar_square_index >= first_day && day <= number_of_days) {\n // Create and setup the DOM elements that will hold meal data for that day\n var calendar_day_number_element = document.createElement(\"div\");\n var calendar_day_data_container_element = document.createElement(\"div\");\n\n // Setup calendar_day_data_day_element\n calendar_day_number_element.classList.add(\"calendar_day_number_element\");\n calendar_day_number_element.innerHTML = day;\n\n // Setup calendar_day_data_container_element\n calendar_day_data_container_element.id = \"calendar_day_data_container_element_\" + day;\n calendar_day_data_container_element.classList.add(\"calendar_day_data_container_element\");\n calendar_day_data_container_element.setAttribute(\"ondrop\", \"drop_meal(event)\");\n calendar_day_data_container_element.setAttribute(\"ondragover\", \"allow_meal_drop(event)\")\n calendar_day_data_container_element.setAttribute(\"data-day\", day);\n calendar_day_data_container_element.setAttribute(\"data-is-container\", true);\n\n // Add the data div to the element\n calendar_day_element.appendChild(calendar_day_number_element);\n calendar_day_element.appendChild(calendar_day_data_container_element);\n\n // Increment the day\n day++;\n }\n\n // Add the day to the week\n calendar_week_element.appendChild(calendar_day_element);\n\n // Increment which square it is on\n calendar_square_index++;\n }\n\n // Add the week to the calendar\n calendar_element.appendChild(calendar_week_element);\n }\n\n // Now populate the month with any meal data\n get_meal_plan_for_current_month();\n}", "constructor() {\n this.monday = [\n {'00:00': []},\n {'01:00': []},\n {'02:00': []},\n {'03:00': []},\n {'04:00': []},\n {'05:00': []},\n {'06:00': []},\n {'07:00': []},\n {'08:00': []},\n {'09:00': []},\n {'10:00': []},\n {'11:00': []},\n {'12:00': []},\n {'13:00': []},\n {'14:00': []},\n {'15:00': []},\n {'16:00': []},\n {'17:00': []},\n {'18:00': []},\n {'19:00': []},\n {'20:00': []},\n {'21:00': []},\n {'22:00': []},\n {'23:00': []},\n ];\n this.tuesday = [\n {'00:00': []},\n {'01:00': []},\n {'02:00': []},\n {'03:00': []},\n {'04:00': []},\n {'05:00': []},\n {'06:00': []},\n {'07:00': []},\n {'08:00': []},\n {'09:00': []},\n {'10:00': []},\n {'11:00': []},\n {'12:00': []},\n {'13:00': []},\n {'14:00': []},\n {'15:00': []},\n {'16:00': []},\n {'17:00': []},\n {'18:00': []},\n {'19:00': []},\n {'20:00': []},\n {'21:00': []},\n {'22:00': []},\n {'23:00': []},\n ];\n this.wednesday = [\n {'00:00': []},\n {'01:00': []},\n {'02:00': []},\n {'03:00': []},\n {'04:00': []},\n {'05:00': []},\n {'06:00': []},\n {'07:00': []},\n {'08:00': []},\n {'09:00': []},\n {'10:00': []},\n {'11:00': []},\n {'12:00': []},\n {'13:00': []},\n {'14:00': []},\n {'15:00': []},\n {'16:00': []},\n {'17:00': []},\n {'18:00': []},\n {'19:00': []},\n {'20:00': []},\n {'21:00': []},\n {'22:00': []},\n {'23:00': []},\n ];\n this.thursday = [\n {'00:00': []},\n {'01:00': []},\n {'02:00': []},\n {'03:00': []},\n {'04:00': []},\n {'05:00': []},\n {'06:00': []},\n {'07:00': []},\n {'08:00': []},\n {'09:00': []},\n {'10:00': []},\n {'11:00': []},\n {'12:00': []},\n {'13:00': []},\n {'14:00': []},\n {'15:00': []},\n {'16:00': []},\n {'17:00': []},\n {'18:00': []},\n {'19:00': []},\n {'20:00': []},\n {'21:00': []},\n {'22:00': []},\n {'23:00': []},\n ];\n this.friday = [\n {'00:00': []},\n {'01:00': []},\n {'02:00': []},\n {'03:00': []},\n {'04:00': []},\n {'05:00': []},\n {'06:00': []},\n {'07:00': []},\n {'08:00': []},\n {'09:00': []},\n {'10:00': []},\n {'11:00': []},\n {'12:00': []},\n {'13:00': []},\n {'14:00': []},\n {'15:00': []},\n {'16:00': []},\n {'17:00': []},\n {'18:00': []},\n {'19:00': []},\n {'20:00': []},\n {'21:00': []},\n {'22:00': []},\n {'23:00': []},\n ];\n this.saturday = [\n {'00:00': []},\n {'01:00': []},\n {'02:00': []},\n {'03:00': []},\n {'04:00': []},\n {'05:00': []},\n {'06:00': []},\n {'07:00': []},\n {'08:00': []},\n {'09:00': []},\n {'10:00': []},\n {'11:00': []},\n {'12:00': []},\n {'13:00': []},\n {'14:00': []},\n {'15:00': []},\n {'16:00': []},\n {'17:00': []},\n {'18:00': []},\n {'19:00': []},\n {'20:00': []},\n {'21:00': []},\n {'22:00': []},\n {'23:00': []},\n ];\n this.sunday = [\n {'00:00': []},\n {'01:00': []},\n {'02:00': []},\n {'03:00': []},\n {'04:00': []},\n {'05:00': []},\n {'06:00': []},\n {'07:00': []},\n {'08:00': []},\n {'09:00': []},\n {'10:00': []},\n {'11:00': []},\n {'12:00': []},\n {'13:00': []},\n {'14:00': []},\n {'15:00': []},\n {'16:00': []},\n {'17:00': []},\n {'18:00': []},\n {'19:00': []},\n {'20:00': []},\n {'21:00': []},\n {'22:00': []},\n {'23:00': []},\n ]\n this.hours = [\n '00:00',\n '01:00',\n '02:00',\n '03:00',\n '04:00',\n '05:00',\n '06:00',\n '07:00',\n '08:00',\n '09:00',\n '10:00',\n '11:00',\n '12:00',\n '13:00',\n '14:00',\n '15:00',\n '16:00',\n '17:00',\n '18:00',\n '19:00',\n '20:00',\n '21:00',\n '22:00',\n '23:00',\n ];\n this.days = ['monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday', 'sunday'];\n this.getEmployeeTotalHours = this.getEmployeeTotalHours.bind(this);\n this.removeEmployee = this.removeEmployee.bind(this);\n this.clearAllEmployees = this.clearAllEmployees.bind(this);\n this.clearEmployee = this.clearEmployee.bind(this);\n this.addEmployee = this.addEmployee.bind(this);\n this.clearHiddenHours = this.clearHiddenHours.bind(this);\n this.addBulkEmployees = this.addBulkEmployees.bind(this);\n\n }", "function init_calendar() {\r\n\tcalendarSizeAjust();\r\n}", "function populateList(daysCurrentMonth){\n debugger;\n for(i=0;i<daysCurrentMonth;i++){\n if(i<10 && date.getMonth()<10 ){\n var stringDate = date.getFullYear() + '-' + 0 + (date.getMonth()+1) + '-' + '0' + (i+1).toString();\n\n } else if(i<10){\n var stringDate = date.getFullYear() + '-' + (date.getMonth()+1) + '-' + 0 + (i+1).toString() ;\n }\n else if(date.getMonth()<10){\n var stringDate = date.getFullYear() + '-' + '0' + (date.getMonth()+1) + '-' + (i+1).toString() ;\n\n }\n else{\n var stringDate = date.getFullYear() + '-' + (date.getMonth()+1) + '-' + (i+1).toString();\n }\n\n var link = document.createElement(\"a\");\n\n setDate(link,stringDate);\n\n var item = document.createElement(\"li\");\n // item.classList.add('class'+(date.getMonth()+1).toString());\n item.classList.add('date');\n\n if(i==today.getDate()-1 && today.getMonth()==date.getMonth()){\n item.style.background = '#1abc9c';\n item.style.color = 'whitesmoke';\n item.style.padding = '5px';\n }\n\n var card = document.getElementsByClassName(stringDate);\n\n if(card.length != 0){\n item.style.background = '#07eb9b';\n item.style.color = 'white';\n item.style.padding = '5px';\n }\n item.innerText = (i+1).toString();\n\n link.appendChild(item);\n calendarDiv.appendChild(link);\n }\n}", "function createCalendar(calDate) {\r\n let calendarHTML = \"<table id='calendarTable'>\";\r\n calendarHTML += calCaption(calDate);\r\n calendarHTML += calWeekdayRow();\r\n calendarHTML += calDays(calDate);\r\n calendarHTML += \"</table>\";\r\n return calendarHTML;\r\n}", "function Calendar_calData()\n{\nvar vDate = new Date();\nvDate.setDate( 1 );\nvDate.setMonth( this.gMonth );\nvDate.setFullYear( this.gYear );\nvar vFirstDay = ( vDate.getDay() + 7 - Calendar.firstDow ) % 7\nvar vDay = 1;\nvar vLastDay = this.getDaysOfMonth( this.gMonth, this.gYear );\nvar vOnLastDay = false;\nvar vCode = \"\";\nvar vLastMonth = (this.gMonth > 0 ? this.gMonth - 1 : 11 )\n//alert (\"Tekushtia mesec: \"+vDate.getMonth());\nvar vLastMonthYear = ( this.gMonth > 0 ? this.gYear : this.gYear - 1 )\nvar vLastMonthLastDay = this.getDaysOfMonth( vLastMonth, vLastMonthYear )\nvar vParaDay = vLastMonthLastDay - vFirstDay + 1\nvar isWeekend = false\nvar bgColor = \"\"\nvar vClass = \"\"\nvCode += \"<tr>\";\n// Place out-of-month days in the blanks...\nfor( i = 0; i < vFirstDay; i++ )\n{\nisWeekend = this.isWeekend( i )\nbgColor = ( isWeekend ? Calendar.paraWeekendBgColor : Calendar.paraWeekdayBgColor )\nvClass = ( isWeekend ? \"para-weekend\" : \"para-weekday\" )\nvCode += \"<td bgcolor='\" + bgColor + \"'>\" +\n\"<span class='\" + vClass + \"'>\" + vParaDay + \"</span>\" + \"</td>\";\nvParaDay += 1\n}\n// Write rest of the 1st week\nfor( j = vFirstDay; j < 7; j++ )\n{\nisWeekend = this.isWeekend( j )\nisToday = ( vDay == this.gNowDay && this.gMonth == this.gNowMonth && this.gYear == this.gNowYear )\nbgColor = ( isWeekend ? Calendar.weekendBgColor : Calendar.weekdayBgColor )\n//vClass = ( isToday ? \"today\" : isWeekend ? \"weekend\" : \"weekday\" )\nif ( (vDay < this.gNowDay && this.gMonth == this.gNowMonth && this.gYear == this.gNowYear)\n|| (vDay > this.gNowDay && this.gMonth == this.gNowMonth && this.gYear == (this.gNowYear +1 ) ) )\n{\nvClass = ( isWeekend ? \"para-weekend\" : \"para-weekday\" );\nvCode += \"<td width='14%' bgcolor='\" + bgColor + \"'>\" + \"<span class='\" + vClass + \"'>\" + vDay + \"</span>\" + \"</td>\";\n} else\n{\nvClass = ( isToday ? \"today\" : isWeekend ? \"weekend\" : \"weekday\" );\nvCode = vCode + \"<td width='14%' bgcolor='\" + bgColor + \"'>\" +\n\"<a href=\\\"JavaScript:self.opener.Calendar_select( \" + vDay + \" )\\\" \" + \"class='\" + vClass + \"' \" + \">\" + vDay + \"</a>\" + \"</td>\";\n}\nvDay = vDay + 1;\n}\nvCode = vCode + \"</tr>\";\n// Write the rest of the weeks\nfor( k = 2; k < 7; k++ )\n{\nvCode = vCode + \"<tr>\";\nfor( j = 0; j < 7; j++ )\n{\nisWeekend = this.isWeekend( j )\nisToday = ( vDay == this.gNowDay && this.gMonth == this.gNowMonth && this.gYear == this.gNowYear )\nbgColor = ( isWeekend ? Calendar.weekendBgColor : Calendar.weekdayBgColor )\n//vClass = ( isToday ? \"today\" : isWeekend ? \"weekend\" : \"weekday\" )\nif ( (vDay < this.gNowDay && this.gMonth == this.gNowMonth && this.gYear == this.gNowYear)\n|| (vDay > this.gNowDay && this.gMonth == this.gNowMonth && this.gYear == (this.gNowYear +1 ) ) )\n{\nvClass = ( isWeekend ? \"para-weekend\" : \"para-weekday\" );\nvCode += \"<td width='14%' bgcolor='\" + bgColor + \"'>\" + \"<span class='\" + vClass + \"'>\" + vDay + \"</span>\" + \"</td>\";\n} else\n{\nvClass = ( isToday ? \"today\" : isWeekend ? \"weekend\" : \"weekday\" );\nvCode = vCode + \"<td width='14%' bgcolor='\" + bgColor + \"'>\" +\n\"<a href=\\\"JavaScript:self.opener.Calendar_select( \" + vDay + \" )\\\" \" + \"class='\" + vClass + \"' \" + \">\" + vDay + \"</a>\" + \"</td>\";\n}\nvDay=vDay + 1;\nif( vDay > vLastDay ) {\nvOnLastDay = true;\nbreak;\n}\n}\nif( j == 6 )\nvCode = vCode + \"</tr>\";\nif( vOnLastDay )\nbreak;\n}\n// Fill up the rest of last week days in following month...\nfor( m = 1; m < ( 7 - j ); m++ ) \n{\nif( this.gYearly )\nvCode = vCode + \"<td width='14%'\" + this.writeWeekendString( j + m ) + \">\" +\n\"<span class='text'>i??</span></td>\";\nelse\n{\nisWeekend = this.isWeekend( m + j )\nbgColor = ( isWeekend ? Calendar.paraWeekendBgColor : Calendar.paraWeekdayBgColor )\nvClass = ( isWeekend ? \"para-weekend\" : \"para-weekday\" )\nvCode += \"<td width='14%' bgcolor='\" + bgColor + \"'>\" +\n\"<span class='\" + vClass + \"'>\" + m + \"</span>\" +\n\"</td>\";\n}\n}\nreturn vCode;\n}", "formatEventDates(aEventDates) {\n let oFormattedEventDates = {};\n let iCurrentYear = null;\n let iCurrentMonth = null;\n aEventDates.forEach((oDate, iIndex) => {\n let iFullYear = oDate.getFullYear();\n let iMonth = oDate.getMonth();\n if (iFullYear > iCurrentYear || iCurrentYear === null) {\n iCurrentYear = iFullYear;\n oFormattedEventDates[iFullYear] = {};\n iCurrentMonth = null;\n }\n if (iMonth > iCurrentMonth || iCurrentMonth === null) {\n iCurrentMonth = iMonth;\n oFormattedEventDates[iFullYear][iMonth] = [];\n }\n oFormattedEventDates[iFullYear][iMonth].push(oDate);\n })\n return oFormattedEventDates;\n }", "function createShiftTableObject() {\n let allTableData = [];\n for (var i = 0; i < dateArr.length; i++) {\n allTableData.push({\n date: dateArr[i],\n shifttRD: shiftFromMod(daysDiff(dateArr[i]), \"RD\"),\n shiftSM: shiftFromMod(daysDiff(dateArr[i]), \"SM\"),\n shiftDW: shiftFromMod(daysDiff(dateArr[i]), \"DW\"),\n shiftJW: shiftFromMod(daysDiff(dateArr[i]), \"JW\")\n });\n }\n return allTableData;\n}", "generateWeekArray(weekDataSet){\n\n\t\tlet prevDate='', weekArray=[], diff=0, currentDate\t;\n\n\t\tweekDataSet.map( (data, index) => {\n\t\t\tif(index==0){\n\t\t\t\tcurrentDate=data.date;\n\t\t\t\tdiff=this.getDiff(data);\n\t\t\t}\n\t\t\telse if(data.date==currentDate)\n\t\t\t\tdiff+=this.getDiff(data);\n\t\t\telse{\n\t\t\t\tweekArray.push({date: currentDate, diff: diff});\n\t\t\t\tcurrentDate=data.date;\n\t\t\t\tdiff=this.getDiff(data);\n\t\t\t}\n\t\t});\n\n\t\treturn weekArray;\n\n\t}", "function returnCalendar(resultsArray, mealsArray) {\n const week = [];\n let counter = 1;\n let i;\n for (i = 0; i < resultsArray.length; i += 1) {\n if (resultsArray[i].feasible === true) {\n week.push({ name: `Day ${counter}`, id: counter, meals: mealsArray[i] });\n counter += 1;\n }\n }\n\n // Initiate the first meal of the first day as the active one\n if (week.length > 0) {\n week[0].meals[0].active = true;\n }\n\n return week;\n}", "function createVariablesDefault(){\n let view = calendar.view;\n let _dates;\n if(moment().isBetween(view.activeStart, view.activeEnd,'day') || moment().isSame(view.activeStart,'day') || moment().isSame(view.activeEnd,'day')){\n _dates = createDateArray(view.activeStart, view.activeEnd);\n }\n else{\n _dates = createDateArray(moment(view.activeStart).add(1,'days'), view.activeEnd);\n }\n let _allEventsInView = calendar.getEvents().filter(e=>moment(e.start).isAfter(view.activeStart) || moment(e.end).isAfter(view.activeStart));\n let _employes = calendar.getResources().filter(r => r.id.includes('emp'));\n\n return [_dates,_allEventsInView,_employes];\n}", "buildCalendar(fromDate) {\n var plugin = this; // Create the table structure\n\n var body = document.createElement('table');\n body.classList.add('new');\n var thead = document.createElement('thead');\n var tbody = document.createElement('tbody'); //set current year and month\n\n var y = fromDate.getFullYear(),\n m = fromDate.getMonth(); //set first day of the month\n\n var firstDay = new Date(y, m, 1); //set last day of the month\n\n var lastDay = new Date(y, m + 1, 0); //set start day of weeks\n\n var startDayOfWeek = firstDay.getDay();\n\n if (this.settings.fixedStartDay !== false) {\n // Backward compatibility\n startDayOfWeek = this.settings.fixedStartDay ? 1 : this.settings.fixedStartDay; // If first day of month is different of startDayOfWeek\n\n while (firstDay.getDay() !== startDayOfWeek) {\n firstDay.setDate(firstDay.getDate() - 1);\n } // If last day of month is different of startDayOfWeek + 7\n\n\n while (lastDay.getDay() !== (startDayOfWeek + 7) % 7) {\n lastDay.setDate(lastDay.getDate() + 1);\n }\n } //Header day in a week ( (x to x + 7) % 7 to start the week by monday if x = 1)\n\n\n for (var i = startDayOfWeek; i < startDayOfWeek + 7; i++) {\n var td = document.createElement('td');\n td.innerHTML = this.settings.days[i % 7].substring(0, 3);\n thead.append(td);\n } //For firstDay to lastDay\n\n\n for (var day = firstDay; day <= lastDay; day.setDate(day.getDate())) {\n var tr = document.createElement('tr'); //For each row\n\n for (var i = 0; i < 7; i++) {\n console.log('dfd');\n var td = document.createElement('td');\n td.innerHTML = '<div class=\"day day-' + day.getDate() + '\" data-date=\"' + day.toISOString() + '\">' + day.getDate() + '</div>';\n var $day = td.querySelector('.day'); //if today is this day\n\n if (day.toDateString() === new Date().toDateString()) {\n $day.classList.add(\"today\");\n } //if day is not in this month\n\n\n if (day.getMonth() != fromDate.getMonth()) {\n $day.classList.add(\"wrong-month\");\n } // filter today's events\n\n\n day.setHours(12, 0, 0); // var todayEvents = this.getDateEvents(day);\n // if (todayEvents.length && this.settings.displayEvent) {\n // $day.classList.add(\"has-event\");\n // }\n // // associate some data available from the onDayCreate callback\n // $day.dataset.todayEvents = todayEvents;\n // simplify further customization\n\n this.settings.onDayCreate($day, day.getDate(), m, y);\n tr.append(td);\n day.setDate(day.getDate() + 1);\n }\n\n tbody.append(tr);\n }\n\n body.append(thead);\n body.append(tbody);\n return body;\n }", "function createRepeatDatesFromForm() {\n //'every Interval periods for Occurencess\n var StartDate = document.getElementById(\"startDate\").value;\n var EndDate = document.getElementById(\"endDate\").value;\n // Init Date Arrays\n stDate.length = 0;\n enDate.length = 0;\n\n var Period = $('#repeatType', iPage).val(); // every x days\n var Interval = $('#repeatEveryType', iPage).val(); //every 5 x\n var Occurrences = $('#occurrenceSType', iPage).val(); //for x days\n var nOccur = Number(Occurrences);\n var nInter = Number(Interval);\n var diff = dateDiff(EndDate, StartDate);\n\n var mtglen = diff / 1000 / 60; //difference in minutes\n\n if (Period == \"Days\") {\n\n var tempD;\n var sum;\n for (x = 0; x < nOccur; x++) {\n tempD = addDays(StartDate, x * Interval);\n stDate.push(sbDateFormat(tempD));\n enDate.push(sbDateFormat(addMinutes(tempD, mtglen))); // n is minutes\n }\n }\n\n if (Period == \"Weeks\") {\n for (x = 0; x < nOccur; x++) {\n tempD = addDays(StartDate, x * Interval * 7);\n stDate.push(sbDateFormat(tempD));\n enDate.push(sbDateFormat(addMinutes(tempD, mtglen)));\n }\n }\n\n if (Period == \"MonthsOpt1\" || Period == \"MonthsOpt2\" || Period == \"MonthsOpt3\") {\n for (x = 0; x < nOccur; x++) {\n\n //if based on day number\n if (Period == \"MonthsOpt2\") {\n tempD = addMonths(StartDate, x * Interval, false);\n if (tempD != '') {\n stDate.push(sbDateFormat(tempD));\n enDate.push(sbDateFormat(addMinutes(tempD, mtglen)));\n }\n } else {\n if (Period == \"MonthsOpt1\") {\n // we find the day of the week\n tempD = get_sameWeekandDay(StartDate, addMonths(StartDate, x * Interval, true));\n if (tempD != '') {\n stDate.push(sbDateFormat(tempD));\n enDate.push(sbDateFormat(addMinutes(tempD, mtglen)));\n }\n } else {\n // from end of month MonthsOpt3\n tempD = get_sameWeekandDayRev(StartDate, addMonths(StartDate, x * Interval, true));\n if (tempD != '') {\n stDate.push(sbDateFormat(tempD));\n enDate.push(sbDateFormat(addMinutes(tempD, mtglen)));\n }\n }\n }\n }\n }\n}", "updateCalendar() {\n /*\n get the correct month\n number the calendar\n get future events\n * show the events\n highlight current date\n */\n\n this.updateMonth();\n this.updateYear();\n this.numberCalendar();\n this.highlightToday();\n this.updateEvents();\n }", "function getDaysArray (start, end) {\n for(var dt=new Date(start); dt<=end; dt.setDate(dt.getDate()+1)){\n groundTruthCopy.push({date: new Date(dt), y: -999});\n }\n }", "function calendarDate() {\n //Need to be able to handle when dateOffset > than weekDays array \n //calendarDateOffset = dateOffset;\n $(\"#calendar-date\").empty();\n $(\"#calendar-date\").append( (weekDays[d.getUTCDay() + dateOffset]) + \" , \" + (months[d.getUTCMonth()]) + \" \" + (d.getUTCDate() + dateOffset) );\n}", "makeArray(d) {\n var da = new Date(d);\n return [da.getUTCFullYear(), da.getUTCMonth() + 1, da.getUTCDate(), 0, 0, 0, 0];\n }", "function buildEventsList() {\n\t\t\n\t\teventsList.length = 0;\n\n\t\tvar t = 0;\n\t\t\n\t\tfor(var i = 0; i < numRows; i++) {\n\n\t\t\taddEvent(t, that.EVENT_ROW_PLAYED, { row: i });\n\n\t\t\tfor(var j = 0; j < numColumns; j++) {\n\t\t\t\t\n\t\t\t\tvar cell = cells[i][j];\n\n\t\t\t\tif(cell.transposed !== null) {\n\t\t\t\t\taddEvent(t, that.EVENT_NOTE_ON, { voice: j, note: cell.transposed });\n\t\t\t\t\t// Also adding an automatic note off event, a row later\n\t\t\t\t\taddEvent(t + secondsPerRow * 0.5, that.EVENT_NOTE_OFF, { voice: j });\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tt += secondsPerRow;\n\t\t}\n\n\t\taddEvent(t, that.EVENT_END_PLAYED);\n\n\t\teventsList.sort(function(a, b) {\n\t\t\treturn a.timestamp - b.timestamp;\n\t\t});\n\n\t\tupdateNextEventPosition();\n\n\t}", "addCalendar(calendar) {\n if(!this.calendars.includes(calendar.getYear()) && !this.getCalendars.includes(calendar.getMonth())) {\n this.calendars.push(calendar);\n }\n }", "function createDates($scope){\n $scope.years = [];\n $scope.months = [];\n $scope.days = [];\n \n for (var i = 1; i <= 31; i++) {\n $scope.days.push(i);\n }\n \n for (var i = 1; i <= 12; i++) {\n $scope.months.push(i);\n }\n \n for (var i = 2017; i < 2080; i++) {\n $scope.years.push(i);\n }\n}", "function showCalendar(month, year, event) {\n\n let today = new Date();\n let firstDay = new Date(year, month).getDay();\n let totalDays = 32 - new Date(year, month, 32).getDate();\n // Calendar container with monthly numbers of days\n let calendarCont = document.querySelector('.month-num');\n // 'month - year' in selection of previous and nest \n let monthYear = document.querySelector('.month-year');\n let viewedMonth = monthsArr[month]; // test\n console.log(viewedMonth);\n monthYear.innerHTML = `${monthsArr[month]} ${year}`;\n calendarCont.innerHTML = \"\";\n // scheduled events for a specific month of the year\n let theseEvents = event.filter(even => even.date.getFullYear() == year && even.date.getMonth() == month);\n console.log(theseEvents); // test\n\n let date = 1;\n\n for (let i = 0; i < 6; i++) {\n let week = document.createElement('div');\n week.classList.add('weeks');\n\n for (let j = 0; j < 7; j++) {\n\n if (i == 0 && j < firstDay) {\n let emptyCell = document.createElement('div');\n emptyCell.classList.add('empty');\n week.appendChild(emptyCell);\n\n } else if (date <= totalDays) {\n let numCell = document.createElement('div');\n numCell.classList.add('num');\n\n if (date == today.getDate() && month == today.getMonth() && year == today.getFullYear()) {\n numCell.classList.add('today');\n };\n\n let numCellEvent = \"\";\n\n let w = window.innerWidth;\n let eventPlan = document.querySelector('.event-plan');\n let leftSideBlue = document.querySelector('.blue');\n let rightSideRed = document.querySelector('.red');\n\n if (theseEvents.length) {\n let todayEvent = theseEvents.filter(eve => eve.date.getDate() == date);\n console.log(todayEvent); // test\n\n if (todayEvent.length && w > 992) {\n numCell.classList.add('event');\n\n todayEvent.forEach(ev => {\n numCellEvent += `<div class=\"eve\" style=\"border-left:4px solid ${ev.bgColor}\"><div>${ev.title}</div><div>${ev.time}</div><div>${ev.day}</div></div><span style=\"color:white !important\">${date}</span>`;\n numCell.style.backgroundColor = ev.bgColor;\n numCell.style.color = ev.color;\n });\n };\n\n // extra for tablet and mobile start \n\n if (todayEvent.length && w < 993) {\n numCell.classList.remove('event');\n\n todayEvent.forEach(ev => {\n console.log(todayEvent); // test\n if (ev.date.getMonth() == monthsArr.indexOf(viewedMonth)) {\n console.log(monthsArr.indexOf(viewedMonth)); // test 4 i ne se menuva, juni vo 5\n eventPlan.style.display = 'block';\n console.log(ev.date.getMonth()); // test 4\n\n if (ev.bgColor == 'blue') {\n leftSideBlue.innerHTML += `<div class=\"left-event\">\n <p class=\"date\">${ev.date.getDate()}/${ev.date.getMonth()}/${ev.date.getFullYear()}</p>\n <h5 class=\"title\">${ev.title}</h5>\n <p class=\"hours\">${ev.time}ч</p>\n </div>`;\n numCell.style.backgroundColor = ev.bgColor;\n numCell.style.color = ev.color;\n }\n\n if (ev.bgColor == 'red') {\n rightSideRed.innerHTML += `<div class=\"right-event\">\n <p class=\"date\">${ev.date.getDate()}/${ev.date.getMonth()}/${ev.date.getFullYear()}</p>\n <h5 class=\"title\">${ev.title}</h5>\n <p class=\"hours\">${ev.time}ч</p>\n </div>`;\n numCell.style.backgroundColor = ev.bgColor;\n numCell.style.color = ev.color;\n }\n\n if (ev.bgColor == 'orange') {\n leftSideBlue.innerHTML += `<div class=\"left-event-orange\">\n <p class=\"date\">${ev.date.getDate()}/${ev.date.getMonth()}/${ev.date.getFullYear()}</p>\n <h5 class=\"title\">${ev.title}</h5>\n <p class=\"hours\">${ev.time}ч</p>\n </div>`;\n numCell.style.backgroundColor = ev.bgColor;\n numCell.style.color = ev.color;\n }\n\n }\n\n });\n\n };\n\n } else if (!theseEvents.length) { // ova raboti \n leftSideBlue.innerHTML = '';\n rightSideRed.innerHTML = '';\n eventPlan.style.display = 'none';\n };\n // extra for tablet and mobile ends here\n\n numCell.innerHTML = (numCellEvent == \"\") ?\n `<span>${date}</span>` : numCellEvent;\n\n week.appendChild(numCell);\n\n date++;\n\n } else if (date > totalDays) {\n let emptyCell = document.createElement('div');\n emptyCell.classList.add('empty');\n week.appendChild(emptyCell);\n };\n\n };\n\n calendarCont.appendChild(week);\n };\n\n}", "buildSchedules() {\r\n this.scheduledEvents = this.hardEvents.slice(0); //gets all hardEvents\r\n this.constraints.forEach(function(constraint) {\r\n scheduledEvents.push(constraint);\r\n })\r\n\r\n\r\n var rankedFlexEvents = this.flexEvents.sort(function(a, b) {\r\n return a.rank - b.rank;\r\n });\r\n\r\n var rootNode = new node(this.scheduledEvents);\r\n var tree = new Tree(rootNode);\r\n var lastLevelNodes = rootNode;\r\n rankedFlexEvents.forEach(function(event) {\r\n fitFlexedEvents(lastLevelNodes, tree, event);\r\n })\r\n }", "function initCalendar() {\n var firstDayOfMonth = new Date(currentDateTime.getFullYear(), currentDateTime.getMonth(), 1);\n var lastDayOfMonth = new Date(currentDateTime.getFullYear(), currentDateTime.getMonth() + 1, 0);\n\n // Set headline content\n headline.innerHTML = formatDate(currentDateTime, 'headline');\n\n // Create elements for calendar\n var table = document.createElement('table')\n var thead = document.createElement('thead');\n var headRow = document.createElement('tr');\n\n // Fill header row with weekdays\n weekdays.forEach(function (weekDay) {\n var cell = document.createElement('th');\n cell.innerHTML = weekDay;\n headRow.appendChild(cell);\n });\n\n var tbody = document.createElement('tbody');\n\n // Calculate the first rendered day of the current view.\n // We always begin with a sunday, which can be before first day of month\n var firstDayOfCalendar = new Date(firstDayOfMonth);\n while (firstDayOfCalendar.getDay() != 0) {\n firstDayOfCalendar.setDate(firstDayOfCalendar.getDate() - 1);\n }\n\n // Fill the calendar month with elements\n var currentRenderDate = new Date(firstDayOfCalendar);\n var i = 0;\n var row = document.createElement('tr');\n var current = formatDate(currentDateTime, 'date');\n var cell;\n\n while (currentRenderDate <= lastDayOfMonth) {\n if (i == 7) {\n i = 0;\n tbody.appendChild(row);\n row = document.createElement('tr');\n }\n var currentString = formatDate(currentRenderDate, 'date');\n\n cell = document.createElement('td');\n cell.innerHTML = currentRenderDate.getDate().toString();\n // This is the selected date. Mark it\n if (currentString == current) {\n addClass(cell, 'selected');\n }\n // The day is not in the current month. Mark it\n if (currentRenderDate.getMonth() != lastDayOfMonth.getMonth()) {\n addClass(cell, 'outerMonth');\n }\n cell.setAttribute('data-date' , currentString);\n cell.addEventListener('click', onDateSelect);\n\n row.appendChild(cell);\n\n // Prepare next step\n currentRenderDate.setDate(currentRenderDate.getDate() + 1);\n i++;\n }\n\n // Each row should have the same amount of cells.\n // Create empty cells if needed.\n for (i; i < 7; i++) {\n cell = document.createElement('td');\n cell.innerHTML = '&nbsp;';\n row.appendChild(cell);\n }\n tbody.appendChild(row);\n\n thead.appendChild(headRow);\n table.appendChild(thead);\n table.appendChild(tbody);\n\n // Clear calendar and add new table\n calendar.innerHTML = '';\n calendar.appendChild(table);\n }", "function createShiftListTableObject() {\n let allTableData = [];\n for (var i = 0; i < dateArr.length; i++) {\n allTableData.push({\n date: dateArr[i],\n shifttRD: shiftFromMod(daysDiff(dateArr[i]), \"RD\"),\n shiftSM: shiftFromMod(daysDiff(dateArr[i]), \"SM\"),\n listSM: listFromMod(daysDiff(dateArr[i]), \"SM\"),\n shiftDW: shiftFromMod(daysDiff(dateArr[i]), \"DW\"),\n listDW: listFromMod(daysDiff(dateArr[i]), \"DW\"),\n shiftJW: shiftFromMod(daysDiff(dateArr[i]), \"JW\"),\n listJW: listFromMod(daysDiff(dateArr[i]), \"JW\")\n });\n }\n return allTableData;\n}", "function processCalendar(data) {\n\n const vCal = parser.fromString(data).VCALENDAR.VEVENT;\n let events = { speaker: [], host: [], booth: [], attendee: [] };\n\n vCal.forEach((vEvent) => {\n\n // The event description contains VCAL encoded JSON, which needs fixing up \n let details = decodeDescription(vEvent.DESCRIPTION);\n\n // Decode the JSON\n try {\n details = JSON.parse(details);\n } catch(e) {\n details = {\n malformedJson: true,\n originalData: details\n };\n }\n\n // Build and store the event info in the right event list\n let event = {\n start : getDatum(vEvent.DTSTART.value).slice(0,8),\n name : getDatum(vEvent.SUMMARY),\n location : getDatum(vEvent.LOCATION),\n role : getDatum(details.role),\n type : getDatum(details.type),\n };\n events[event.role].push(event);\n\n });\n\n // Sort the lists of events\n const sortByStartDate = (a,b) => a.start - b.start;\n events.speaker.sort(sortByStartDate);\n events.host.sort(sortByStartDate);\n events.booth.sort(sortByStartDate);\n events.attendee.sort(sortByStartDate);\n\n // Remove past events\n if(!argv.historical) {\n let today = new Date();\n today = today.getFullYear().toString() + (today.getMonth()+1).toString().padStart(2, '0') + today.getDate().toString().padStart(2, '0');\n const filterByStartDate = (a) => a.start > today;\n events.speaker = events.speaker.filter(filterByStartDate);\n events.host = events.host.filter(filterByStartDate);\n events.booth = events.booth.filter(filterByStartDate);\n events.attendee = events.attendee.filter(filterByStartDate);\n }\n\n // Render events\n if(argv.json) {\n console.log(JSON.stringify({\n events: events,\n about: {\n job: 'Ben Dechrai is a Developer Advocate working at Auth0',\n website: 'https://ben.sc/',\n twitter: 'https://ben.sc/twitter',\n github : 'https://ben.sc/github',\n youtube: 'https://ben.sc/youtube',\n linkedin: 'https://ben.sc/linkedin'\n }\n }));\n } else {\n renderBox(events);\n }\n\n}", "function generateics(sop, cal){\n var startdate = toDate(sop.begin);\n var enddate = toDate(sop.end);\n defaultoffset(startdate, enddate);\n checkbehind(startdate, enddate);\n var input = {subject:sop.subject, description:\"\", location:sop.location, start: startdate, end: enddate, recurrence: sop.recurrence};\n cal.addEvent(input.subject, input.description, input.location, input.start.toLocaleString(), input.end.toLocaleString()); \n\n var terminate = 52;\n var i=0;\n while(i<terminate && input.recurrence!=\"\"){\n if(input.recurrence == \"DAILY\"){\n input.start.setDate(input.start.getDate()+1);\n input.end.setDate(input.end.getDate()+1);\n } else if(input.recurrence == \"WEEKLY\"){\n input.start.setDate(input.start.getDate()+7);\n input.end.setDate(input.end.getDate()+7);\n } else if(input.recurrence == \"MONTHLY\"){\n input.start.setMonth(input.start.getMonth()+1);\n input.end.setMonth(input.end.getMonth()+1);\n } else if(input.recurrence == \"YEARLY\"){\n input.start.setFullYear(input.start.getFullYear()+1);\n input.end.setFullYear(input.end.getFullYear()+1);\n } \n\n cal.addEvent(input.subject, input.description, input.location, input.start.toString(), input.end.toString()); \n i++;\n }\n return cal;\n }", "function createRowsCalendar(){\r\n var numDias=arrayDias[document.getElementById(\"month\").selectedIndex-1];\r\n var html; \r\n var numDiaAdd=1;\r\n $( \".fc-row \" ).remove(); \r\n for (var i = 1; i <= 6; i++) { \r\n html=\"\"; \r\n html+=\" <div class='fc-row fc-week fc-widget-content' style='height: 80px;'>\";\r\n //se crean los encabezados para los calendarios\r\n html+=\" <div class='fc-bg'>\";\r\n html+=\" <table> <tbody> <tr>\";\r\n for (var j = 0; j < 6; j++) { \r\n html+=\" <td class='fc-day fc-widget-content fc-sun fc-other-month fc-past' ></td>\";\r\n }\r\n html+=\" </tr> </tbody> </table> </div> \";\r\n //termino de encabezados para el calendario\r\n\r\n //inicia la creacion de valores para el calendario\r\n html+=\" <div class='fc-content-skeleton'> \";\r\n html+=\" <table> \";\r\n html+=\" <tbody> <tr> \";\r\n for (var j = 0; j < 6; j++) { \r\n if(numDiaAdd<=numDias){\r\n html+=\" <td id='td_\"+numDiaAdd+\"' class='fc-day-number fc-sun fc-today fc-state-highlight'>\"+numDiaAdd;\r\n html+=\"<a id='btnadd_\"+numDiaAdd+\"' class='fc-day-grid-event fc-event fc-start fc-end fc-draggable' style='background-color:#fff;border-color:#fff'>\";\r\n html+=\"<div class='fc-content'>\"; \r\n html+=\"<button class='btn btn-primary' data-toggle='tooltip' data-placement='top' title='Crear visita' onclick='showModalCreate(\\\"\"+numDiaAdd+\"\\\",\\\"\"+$(\"#month\").val()+\"\\\",\\\"\"+$(\"#year\").val()+\"\\\");'> <i class='fa fa-plus-square'></i> </button>\" \r\n html+=\"</div></a>\";\r\n\r\n html+=\"<a id='btnadd2_\"+numDiaAdd+\"' class='fc-day-grid-event fc-event fc-start fc-end fc-draggable' style='background-color:#00a65a;border-color:#fff'>\";\r\n html+=\"<div class='fc-content'>\"; \r\n html+=getNameDay(numDiaAdd,$(\"#month\").val(),$(\"#year\").val()); \r\n html+=\"</div></a>\";\r\n\r\n html+=\"</td>\";\r\n }else {\r\n html+=\" <td class='fc-day-number fc-sun fc-today fc-state-highlight'></td>\";\r\n }\r\n \r\n numDiaAdd++;\r\n }\r\n html+=\" </tr> </tbody> </table> </div> \"; \r\n $( \"#containerCalendar\" ).append(html); \r\n } \r\n }", "function generateCalendar(date) {\n\n\t$('#monthyear p:nth-child(2)').html('').append(calendarMonth + \" \" + calendarYear);\n\n\t// Unbind the old click listeners\n\t$('#monthyear i:nth-child(1)').unbind();\n\t$('#monthyear i:nth-child(3)').unbind();\n\n\tsetUpCalendar(date);\n}", "function doCalendar()\n{\n myCalendar = new dhtmlXCalendarObject([\"txtFechaIni\", \"txtFechaFin\"]);\n\n\n}", "function renderCalendar() {\r\n calendar.innerHTML = '';\r\n var dateCounter = new Date(pickerElement.value);\r\n var month = dateCounter.getMonth();\r\n\r\n dateCounter.setDate(1);\r\n\r\n while (dateCounter.getMonth() === month) {\r\n var dayObject = document.createElement('SPAN');\r\n dayObject.classList.add('vjsdate-day' + dateCounter.getDate());\r\n if (dateCounter < startDate || dateCounter > endDate) dayObject.classList.add('vjsdate-day-disabled');\r\n dayObject.innerHTML = dateCounter.getDate();\r\n calendar.appendChild(dayObject);\r\n if (new Date(pickerElement.value).getDate() === dateCounter.getDate()) dayObject.classList.add('vjsdate-day-selected');\r\n\r\n if (parseInt(dayObject.innerHTML) == 1) {\r\n /*If we are the first date, we need to make N spacers for Nth day of the week*/\r\n for (i = 0; i < dateCounter.getDay(); i++) {\r\n var daySpacer = document.createElement('SPAN');\r\n daySpacer.classList.add('vjsdate-day');\r\n dayObject.parentElement.insertBefore(daySpacer, dayObject);\r\n }\r\n }\r\n dateCounter.setDate(dateCounter.getDate() + 1);\r\n }\r\n }", "function makeCalender() {\n let dayTrack = 1;\n let monthTrack = 1;\n let weekDay;\n\n for (let i = 0; i < 366; i++) {\n weekDay = getDayOfTheWeek(2020, monthTrack, dayTrack);\n console.log(dayTrack + \"-\" + monthTrack + \n \"-2020 is a \" + weekDay);\n if (dayTrack == maxDayPerMonth[monthTrack]) {\n dayTrack = 1;\n monthTrack += 1;\n } else {\n dayTrack += 1;\n }\n }\n}", "renderEventsCard(date, events) {\n eventsByDate = [];\n for (let i = 0; i < events.length; i++) {\n if (events[i].start.date === date) {\n eventsByDate.push(\n <ConcertCard event={events[i]} navigation={this.props.navigation} />\n );\n }\n }\n return eventsByDate;\n }", "function createDateArray(start,end){\n let\n dateArray = [],\n dt = new Date(start);\n\n while (moment(dt).dayOfYear() <= moment(end).dayOfYear()) {\n dateArray.push(new Date(dt));\n dt.setDate(dt.getDate() + 1);\n }\n return dateArray;\n}", "function parseSched() {\n var schedule = {};\n var days = document.getElementsByClassName('current-day');\n\n // Here we'd iteratre through each day..\n\n var todaysDate = new Date();\n var dd = todaysDate.getDate();\n var mm = todaysDate.getMonth()+1; //January is 0!\n var yyyy = todaysDate.getFullYear();\n\n if(dd<10) {\n dd='0'+dd\n } \n\n if(mm<10) {\n mm='0'+mm\n } \n\n todaysDate = yyyy + \"/\" + mm+'/'+dd;\n\n var dates = [todaysDate];\n var datesMenu = document.getElementsByClassName('daytue');\n for (date in datesMenu) { \n if (parseInt(date)) { \n dates.push(datesMenu[date].getAttribute('data-ldate')) \n }\n };\n\n // var daysData = doc /ument.\n\n for (dateIndex in dates) {\n var day = days[dateIndex];\n var thisDate = dates[dateIndex]\n if (day != null) {\n console.log(\"day is ... \" + day )\n shows = day.getElementsByClassName('data');\n schedule[thisDate] = [];\n\n // now we'd iterate through the shows.\n for (i in shows) {\n show = {};\n s = shows[i];\n if (s.constructor.name == \"HTMLDivElement\") {\n console.log(\"Day: \" + day + \" - s is \" + s + \" A type...\" + s.constructor.name);\n minute = s.getElementsByClassName('minute')[0].innerHTML;\n hour = s.getElementsByClassName('hour')[0].innerHTML;\n dayhalf = s.getElementsByClassName('dayhalf')[0].innerHTML;\n if (dayhalf == \"pm\") {\n hour = (parseInt(hour) + 12);\n }\n show['airtime'] = new Date(hour + \":\" + minute + \":00 \" + thisDate); \n show['series'] = s.getElementsByClassName('name')[0].getElementsByTagName('span')[1].innerHTML.trim();\n show['episode'] = s.getElementsByClassName('name')[0].getElementsByTagName('span')[1].innerHTML.trim();\n schedule[thisDate].push(show);\n }\n }\n }\n }\n\n return schedule\n}", "function createCalendar(calDate) {\r\n var calendarHTML = \"<table id = 'calendar_table'>\";\r\n calendarHTML += calCaption(calDate);\r\n calendarHTML += \"</table>\";\r\n return calendarHTML;\r\n}", "function pushInfo(cb){\n datesArr.push(day);\n countsArr.push(count);\n cb();\n }", "function buildYearRent(start) {\n this.start = start;\n\n var yearRent = [];\n var compDate;\n for (var i = 0; i < 12; i++) {\n // if statement for first month.. then increment compare data...\n if (i == 0) {\n compDate = new Date(this.start);\n }\n else {\n compDate = compDate.add(1).month();\n }\n console.log(\"compDate:\" + compDate);\n\n yearRent[i] = getRent(compDate, tenants)\n }\n return yearRent;\n}", "_init() {\n this._todayYear = this._dateAdapter.getYear(this._dateAdapter.today());\n // We want a range years such that we maximize the number of\n // enabled dates visible at once. This prevents issues where the minimum year\n // is the last item of a page OR the maximum year is the first item of a page.\n // The offset from the active year to the \"slot\" for the starting year is the\n // *actual* first rendered year in the multi-year view.\n const activeYear = this._dateAdapter.getYear(this._activeDate);\n const minYearOfPage = activeYear - getActiveOffset(this._dateAdapter, this.activeDate, this.minDate, this.maxDate);\n this._years = [];\n for (let i = 0, row = []; i < yearsPerPage; i++) {\n row.push(minYearOfPage + i);\n if (row.length == yearsPerRow) {\n this._years.push(row.map(year => this._createCellForYear(year)));\n row = [];\n }\n }\n this._changeDetectorRef.markForCheck();\n }", "_init() {\n this._todayYear = this._dateAdapter.getYear(this._dateAdapter.today());\n // We want a range years such that we maximize the number of\n // enabled dates visible at once. This prevents issues where the minimum year\n // is the last item of a page OR the maximum year is the first item of a page.\n // The offset from the active year to the \"slot\" for the starting year is the\n // *actual* first rendered year in the multi-year view.\n const activeYear = this._dateAdapter.getYear(this._activeDate);\n const minYearOfPage = activeYear - getActiveOffset(this._dateAdapter, this.activeDate, this.minDate, this.maxDate);\n this._years = [];\n for (let i = 0, row = []; i < yearsPerPage; i++) {\n row.push(minYearOfPage + i);\n if (row.length == yearsPerRow) {\n this._years.push(row.map(year => this._createCellForYear(year)));\n row = [];\n }\n }\n this._changeDetectorRef.markForCheck();\n }", "function initDayOfMonth() {\n let dayOfCurrentMonth; //define array day in current month\n let dayOfPrevMonth; //definde array day in prevent month\n let dayOfNextMounth; //definde array day in next month\n let countDay = 0; //initialize value index of day in array current month\n let countNextDay = 0; //initialize value index of day in array current next month\n\n dayOfCurrentMonth = getDaysOfMonth(currentYear, currentMonth);\n if (currentMonth === 0) {\n dayOfPrevMonth = getDaysOfMonth(currentYear - 1, 11);\n } else {\n dayOfPrevMonth = getDaysOfMonth(currentYear, currentMonth - 1);\n }\n dayOfPrevMonth.splice(0, dayOfPrevMonth.length - 6);\n\n if (currentMonth === 11) {\n dayOfNextMounth = getDaysOfMonth(currentYear + 1, 0);\n } else {\n dayOfNextMounth = getDaysOfMonth(currentYear, currentMonth + 1);\n }\n\n let listClassCss;\n for (let tr = 0; tr < 6; tr++) {\n let dataColum = \"\";\n for (let th = 0; th < ARR_DAY_OF_WEEKS.length; th++) {\n if (dayOfCurrentMonth[countDay] != undefined ||\n dayOfCurrentMonth[countDay] != null) {\n if (dayOfCurrentMonth[countDay].getDay() === th) {\n let date = dayOfCurrentMonth[countDay];\n listClassCss = \"date-num\";\n if (date.getDate() === now.getDate() &&\n date.getMonth() === now.getMonth() &&\n date.getFullYear() === now.getFullYear()) {\n listClassCss += \" current-date\";\n }\n dataColum += `<td class='${listClassCss}' onclick='selectDay(event,${date.getDate()},${date.getMonth()},${date.getFullYear()})'>${dayOfCurrentMonth[countDay].getDate()}</td>`;\n countDay++;\n } else {\n dayOfPrevMonth.forEach(date => {\n if (date.getDay() === th) {\n dataColum += `<td class='date-num date-prev' onclick='selectDay(event, ${date.getDate()}, ${date.getMonth()}, ${date.getFullYear()})'>${date.getDate()}</td>`;\n return;\n }\n });\n }\n } else {\n let date = dayOfNextMounth[countNextDay];\n dataColum += `<td class='date-num date-next' onclick='selectDay(event, ${date.getDate()}, ${date.getMonth()}, ${date.getFullYear()})'>${dayOfNextMounth[countNextDay].getDate()}</td>`;\n countNextDay++;\n }\n }\n bodyDate.append(`<tr>${dataColum}</tr>`);\n }\n trDates = $('.date-num');\n}", "getYYMM() {\n /* set years for dorpdown */\n var myDate = new Date();\n let fromYear = myDate.getFullYear() + 1;\n let toYear = fromYear + 60;\n for (let loop = fromYear; loop <= toYear; ++loop) {\n this.cardValidDateSetup.validYY.push(loop);\n }\n /* set month for dropdown */\n for (let loop = 1; loop <= 12; ++loop) {\n this.cardValidDateSetup.validMM.push(loop);\n }\n console.log('this.cardValidDateSetup');\n console.log(this.cardValidDateSetup);\n }", "get data() {\n\n // verify valid source provided\n if (this.dataSource && Object.keys(this.dataSource).length > 0) {\n\n let activityTypesMerged = [];\n\n // loop through keys\n for (const key in this.dataSource) {\n\n // push all activity objects into single array\n activityTypesMerged = activityTypesMerged.concat(this.dataSource[key]);\n\n }\n\n // aggregate collab/push days\n this.dataAggregateDays = rollup(activityTypesMerged,\n v => v.length,\n d => moment(d.date).format(\"YYYY-MM-DD\"),\n d => d.type\n );\n\n let dateEnd = moment(this.dateEnd);\n let dateStart = moment(this.dateStart);\n\n let weeks = [];\n\n // get list of first date of months\n while (dateStart < dateEnd) {\n\n // capture actual date iso string since moment mutates values\n let dateWeek = dateStart.format(\"YYYY-W\");\n\n // update list\n weeks.push(dateWeek);\n\n // iterate the date value\n dateStart.add(1, \"week\");\n\n }\n\n // because the time range may/may not be an entire year\n // we need to map index to iso week so we can reference the position later\n this.weekIndicies = weeks;\n\n // extract years\n this.years = [...new Set(this.weekIndicies.map(d => d.split(\"-\")[0]))];\n\n // get weekday values\n let weekdays = moment.weekdays();\n\n // shift so monday is the first day of the week\n weekdays.push(weekdays.shift());\n\n // update self\n this.weekdays = weekdays;\n\n let months = [];\n\n dateEnd = moment(this.dateEnd);\n dateStart = moment(this.dateStart);\n\n // get list of first date of months\n while (dateStart < dateEnd) {\n months.push(dateStart.format(\"YYYY-MM-DD\"))\n dateStart.add(1, \"month\")\n }\n\n // update self\n this.months = months;\n this.dataCells = this.activityTypes.map(d => this.extractActivity(d)).flat();\n\n }\n\n }", "function ClsCommuntityDetail() {\n\n const getActByCommunityId = async (id) => {\n let response = await fetch(serverURL.getActByCommunityId + id);\n if (!response.ok) {\n return { result: 0, msg: \"連線錯誤\" };\n }\n\n try {\n let result = await response.json();\n return result;\n } catch (ex) {\n console.log(ex);\n return { result: 0, msg: \"連線回傳錯誤\" };\n }\n }\n\n const data2calenderData = (data) => {\n return data.map(item => {\n let result = {};\n result.title = item.fActName;\n result.url = `#activity/detail/${item.fId}`;\n result.start = item.fActivityDate.split(\" \")[0].split(\"/\").join(\"-\");\n result.end = item.fActivityEndDate.split(\" \")[0].split(\"/\").join(\"-\");\n\n return result;\n })\n }\n\n //calendar\n const calenderRander = async (array) => {\n var calendarEl = document.getElementById(\"calendar\");\n let fetchActData = await getActByCommunityId(this.cumDetailId);\n console.log(\"object\");\n console.log(fetchActData);\n\n let activityData = [];\n if (fetchActData.result) {\n activityData = data2calenderData(fetchActData.data);\n }\n\n let calendarFakeData = [\n {\n title: \"All Day Event\",\n start: \"2020-09-01\",\n },\n {\n title: \"Long Event\",\n start: \"2020-09-07\",\n end: \"2020-09-10\",\n },\n {\n groupId: 999,\n title: \"Repeating Event\",\n start: \"2020-09-09T16:00:00\",\n },\n {\n groupId: 999,\n title: \"Repeating Event\",\n start: \"2020-09-16T16:00:00\",\n },\n {\n title: \"Conference\",\n start: \"2020-09-11\",\n end: \"2020-09-13\",\n },\n {\n title: \"Meeting\",\n start: \"2020-09-12T10:30:00\",\n end: \"2020-09-12T12:30:00\",\n },\n {\n title: \"Lunch\",\n start: \"2020-09-12T12:00:00\",\n },\n {\n title: \"Meeting\",\n start: \"2020-09-12T14:30:00\",\n },\n {\n title: \"Happy Hour\",\n start: \"2020-09-12T17:30:00\",\n },\n {\n title: \"Dinner\",\n start: \"2020-09-12T20:00:00\",\n },\n {\n title: \"Birthday Party\",\n start: \"2020-09-13T07:00:00\",\n },\n {\n title: \"Click for Google\",\n url: \"#123\",\n start: \"2020-09-28\",\n },\n ]\n\n var calendar = new FullCalendar.Calendar(calendarEl, {\n initialDate: (new Date).toJSON(\"zh-TW\").split(\"T\")[0],\n editable: true,\n selectable: true,\n businessHours: true,\n dayMaxEvents: true, // allow \"more\" link when too many events\n events: activityData,\n });\n\n calendar.render();\n };\n\n //轉換頁面\n const switchPage = function (id) {\n document.querySelectorAll(\".GroupDetailPage\").forEach((i) => {\n i.classList.add(\"hide\");\n });\n\n document.querySelector(`#${id}`).classList.remove(\"hide\");\n if (id === \"GroupDetailPage_Event\") {\n calenderRander();\n }\n };\n\n //nav bar 轉換\n const switchFocusLink = function (el) {\n document.querySelectorAll(\".GroupLink\").forEach((i) => {\n i.classList.remove(\"GroupLinkFocus\");\n i.classList.add(\"a:visited\");\n });\n // el.classList.remove(\"a:visited\");\n el.classList.add(\"GroupLinkFocus\");\n };\n\n let nodeList = document.querySelectorAll(\".GroupLink\");\n // console.log(nodeList);\n\n //click 事件綁定兩件事\n nodeList.forEach((i) => {\n i.addEventListener(\"click\", (e) => {\n let tid = e.currentTarget.getAttribute(\"value\");\n // console.log(e.currentTarget, tid);\n switchPage(tid);\n switchFocusLink(e.currentTarget);\n });\n });\n\n //社團_活動切換\n let pastEvent = document.getElementById(\"pastEvent\");\n let commingEvent = document.getElementById(\"commingEvent\");\n\n pastEvent.addEventListener(\"click\", function () {\n // console.log(document.querySelector(\".comingEvent\"));\n document.querySelector(\".comingEvent\").classList.add(\"hide\");\n document.querySelector(\".pastEvent\").classList.remove(\"hide\");\n });\n\n commingEvent.addEventListener(\"click\", function () {\n document.querySelector(\".pastEvent\").classList.add(\"hide\");\n document.querySelector(\".comingEvent\").classList.remove(\"hide\");\n });\n\n // 成員管理員切換\n let allMemLink = document.querySelector(\"#allMember\");\n let rankingMemLink = document.querySelector(\"#rankingMember\");\n // console.log(allMemLink,rankingMemLink);\n\n allMemLink.addEventListener(\"click\", function () {\n // console.log(1);\n document.querySelector(\".allMember\").classList.remove(\"hide\");\n document.querySelector(\".rankingMember\").classList.add(\"hide\");\n });\n\n rankingMemLink.addEventListener(\"click\", function () {\n document.querySelector(\".allMember\").classList.add(\"hide\");\n document.querySelector(\".rankingMember\").classList.remove(\"hide\");\n });\n\n //hover\n //社團活動左邊切換\n\n // function whenMouseOut(event){\n // event.target.classList.remove(\"LC\");\n // event.target.classList.add(\"LO\");\n // }\n\n // console.log(document.querySelectorAll(\".LO\"));\n document.querySelectorAll(\".LO\").forEach((i) => {\n // i.addEventListener(\"mouseover\",function(event){\n // // console.log(112);\n\n // console.log(event.target.classList.remove(\"LO\"));\n // event.target.classList.add(\"LC\");\n // })\n\n // i.addEventListener(\"mouseout\",whenMouseOut)\n\n i.addEventListener(\"click\", function (event) {\n // console.log(i); <<< DOM element\n\n document.querySelectorAll(\".LO\").forEach((i) => {\n i.classList.remove(\"LC\");\n });\n\n // console.log(event.target);\n event.target.classList.add(\"LC\");\n // i.removeEventListener(\"mouseout\",whenMouseOut);\n });\n });\n\n\n // *照片牆---------------------------------------------\n const CommunityOfPictures = async (id) => {\n\n //有幾條col\n const myPhotoFlowCols = [\n \"photo_flow_col_1\",\n \"photo_flow_col_2\",\n \"photo_flow_col_3\",\n \"photo_flow_col_4\",\n \"photo_flow_col_5\",\n ]\n\n myPhotoFlowCols.map(item => {\n document.querySelector(`#${item}`).innerHTML = \"\";\n })\n\n\n // let photoFlowData;\n let photoFlowData1 = [];\n\n\n try {\n let response = await fetch(\n serverURL.community + \"communitypicture/\" + id,\n {\n method: \"GET\", // http request method\n // 以下跟身分認證有關,後端要使用session 要帶這幾項\n cache: \"no-cache\",\n credentials: \"include\",\n }\n );\n let result = await response.json();\n\n let picture_data = result.data.recordset;\n\n\n\n for (let i = 0; i < picture_data.length; i++) {\n\n if (picture_data[i].fImgPaths == null) continue;\n let imgpath_arr = picture_data[i].fImgPaths.split(\",,\");\n\n if (imgpath_arr.length > 1) {\n for (let j = 0; j < imgpath_arr.length; j++) {\n let obj = {\n fId: picture_data[i].fId,\n fImgPaths: imgpath_arr[j],\n fContent: picture_data[i].fContent,\n };\n photoFlowData1.push(obj);\n }\n } else {\n photoFlowData1.push(picture_data[i]);\n }\n }\n\n console.groupEnd(\"------------------\");\n\n\n } catch (err) {\n console.log(err);\n }\n\n\n\n\n //文字樣板\n const data2PhotoFlowCard = obj => {\n let result = \"\";\n let t = obj.fContent.substring(0, 4);\n result += `<a class=\"photo_flow_card_link\" href=\"${obj.fId}\"><div class=\"photo_flow_card\">\n <img class=\"photo_flow_card_img\" src=\"http://localhost:3050/${obj.fImgPaths}\" alt=\"\">\n <div class=\"photo_flow_card_wrapper\">\n <div class=\"photo_flow_card_msg\">${t}</div>\n </div>\n </div></a>`\n return result;\n }\n\n //判斷哪條col最短\n const whoIsShortest = (array) => {\n let result;\n array.map((e) => {\n if (!result || (document.querySelector(`#${e}`).offsetHeight < result.offsetHeight)) {\n result = document.querySelector(`#${e}`);\n }\n })\n // console.log(result.offsetHeight, result);\n return result;\n }\n const loadingPhotoFlow = async function loop() {\n for (let i = 0; i < photoFlowData1.length; i++) {\n await new Promise(resolve => {\n whoIsShortest(myPhotoFlowCols).innerHTML += data2PhotoFlowCard(photoFlowData1[i]);\n setTimeout(resolve, 10)\n });\n }\n //製作圖片跳轉文章\n let community_picturecard = document.querySelectorAll(\".photo_flow_card_link\")\n for (let i = 0; i < community_picturecard.length; i++) {\n community_picturecard[i].addEventListener(\"click\", function (e) {\n e.preventDefault();\n //觸發點擊文章\n $('#Group_navlink_Post').trigger('click');\n let Target_postId = community_picturecard[i].href.split(\"/\")[3]\n let CommunityOfPosts = document.querySelectorAll(\".PostIdLink_Community\")\n let Target_Top;\n\n for (let i = 0; i < CommunityOfPosts.length; i++) {\n console.log(\"CommunityOfPosts[i].href:\", CommunityOfPosts[i].href);\n if (CommunityOfPosts[i].href.split(\"st/\")[1] == Target_postId) {\n Target_Top = CommunityOfPosts[i].parentNode.offsetTop;\n console.log(Target_Top);\n $('html, body').scrollTop(Target_Top)\n }\n }\n })\n }\n }\n let isPhotoFlowLoaded = 0;\n document\n .querySelector(\"#Group_navlink_Picture\")\n .addEventListener(\"click\", () => {\n if (!isPhotoFlowLoaded) {\n loadingPhotoFlow();\n\n isPhotoFlowLoaded = 1;\n }\n });\n\n\n\n\n };\n\n\n //文章發文\n\n // document.querySelector(\"LeaveMessage\").addEventListener('focus', function () {\n\n // })\n\n // -------------------------------------------------\n // 文字樣板\n\n // ----------------------------------------------Ajax----------------------------------------------------//\n\n // 開放或私密 用社團16(私密)做測試\n // 開啟特定社團頁面(社團id)\n // 顯示狀態按鈕顯示管理button\n // 是否為管理員,顯示編輯社團\n\n // 判斷是否私密,私密的話進一步判斷否為會員\n // --會員的話都顯示\n // 不是的話顯示私密HTML\n const renderPageLoading = () => {\n // 初始化社團基本資料\n document.querySelector(\"#CommunityPic\").src = \"./img/whiteImg.png\"\n document.querySelector(\"#CommunityName\").innerHTML = \"Loading ...\";\n document.querySelector(\"#CommunityNumberOfPeople\").innerHTML = \"0\";\n document.querySelector(\"#NumOfMem\").innerHTML = `(0)`;\n document.querySelector(\"#CommunityAboutUs\").innerHTML = \"Loading ...\";\n }\n\n\n const renderPage = async (id) => {\n try {\n let response = await fetch(serverURL.community + id, {\n method: \"GET\", // http request method\n //token\n headers: {\n Authorization: localStorage.getItem(\"Cycle link token\"),\n },\n cache: \"no-cache\",\n credentials: \"include\",\n });\n\n // 含有從token拿的fId\n let result = await response.json();\n\n // 錯誤處理:沒有回傳資料導回原頁面\n // console.log(result);\n if (!result.result) {\n //# >>> 前端路由導向\n alert(result.msg)\n window.location.hash = \"#community\";\n return;\n }\n\n // 社團基本資料\n document.querySelector(\"#CommunityPic\").src =\n serverURL.root + \"/\" + result.data[0].fImgPath;\n document.querySelector(\"#CommunityName\").innerHTML = result.data[0].fName;\n document.querySelector(\"#CommunityNumberOfPeople\").innerHTML =\n result.data[0].totalNumber;\n\n if (!result.data[0].totalNumber) {\n document.querySelector(\"#NumOfMem\").innerHTML = `(0)`;\n } else {\n document.querySelector(\n \"#NumOfMem\"\n ).innerHTML = `(${result.data[0].totalNumber})`;\n }\n document.querySelector(\"#CommunityStatus\").innerHTML =\n result.data[0].fSatusName;\n document.querySelector(\"#CommunityAboutUs\").innerHTML =\n result.data[0].fInfo;\n // console.log(\"+++++++++++++++++++++++++++\");\n // console.log(result.data);\n\n // console.log(\"%c +++++++++++++\", \"color: green\");\n // console.log(result.data[0]);\n\n\n\n // 使用者身分\n // ----從result取出訪者身分\n // ----抓三個btnElement把CLS屬性設隱藏\n // ----sitch 打開要得btn\n let user = result.data[0].user;\n // console.log(\"+++++++++++++++++++++++++++++++++++++++***************************************\");\n // console.log(user);\n\n // 狀態按鈕\n document.querySelector(\"#ApplyBtn\").classList.add(\"hide\");\n document.querySelector(\"#ManagerBtn\").classList.add(\"hide\");\n document.querySelector(\"#MemberBtn\").classList.add(\"hide\");\n document.querySelector(\"#PendingBtn\").classList.add(\"hide\");\n // console.log(user);\n // 管理員 社員 非社員(含訪客) 待審核會員\n switch (user) {\n case \"管理員\":\n document.querySelector(\"#ManagerBtn\").classList.remove(\"hide\");\n break;\n case \"社員\":\n document.querySelector(\"#MemberBtn\").classList.remove(\"hide\");\n break;\n case \"非社員\":\n document.querySelector(\"#ApplyBtn\").classList.remove(\"hide\");\n break;\n case \"待審核會員\":\n document.querySelector(\"#PendingBtn\").classList.remove(\"hide\");\n break;\n }\n\n // DropDown Menu 藏起來\n // 編輯按鈕藏起來\n document.getElementById(\"leaveCommunityBtn\").classList.add(\"hide\");\n document.getElementById(\"community_edit\").classList.add(\"hide\");\n // document.querySelectorAll(\".DropDownMenu\").forEach((o) => {\n // o.classList.add(\"hide\");\n // })\n // document.querySelectorAll(\".settingIcon\").forEach((o) => {\n // o.classList.add(\"hide\");\n // })\n\n\n // DropDown Menu 是管理員的話打開\n if (user == \"管理員\") {\n document.querySelector(\"#community_edit\").classList.remove(\"hide\");\n // document.querySelectorAll(\".settingIcon\").forEach((o) => {\n // o.classList.remove(\"hide\");\n // o.addEventListener(\"click\",(e)=>{\n // console.log(e.target.dataset.openName);\n // console.log([...document.querySelector(`#${e.target.dataset.openName}`).classList].includes(\"hide\"));\n // if([...document.querySelector(`#${e.target.dataset.openName}`).classList].includes(\"hide\")){\n // document.querySelector(`#${e.target.dataset.openName}`).classList.remove(\"hide\");\n // }\n // else{\n // document.querySelector(`#${e.target.dataset.openName}`).classList.add(\"hide\");\n // }\n // })\n // })\n }\n\n\n if (result.data[0].fSatusName == \"私密\") {\n\n // 判斷是否為會員\n if (user == \"非社員\") {\n document.querySelector(\"#CommunityMember\").classList.add(\"hide\");\n document.querySelector(\"#DiscussionLeft\").classList.add(\"hide\");\n document.querySelectorAll(\".CommunityMemberNone\").forEach((o) => { o.classList.remove(\"hide\"); })\n document.querySelector(\".DiscussionRight\").classList.add(\"hide\");\n document.querySelector(\".photo_flow_container\").classList.add(\"hide\");\n document.querySelector(\".BottomRightSearchList\").classList.add(\"hide\")\n }\n }\n else {\n document.querySelectorAll(\".CommunityMemberNone\").forEach((o) => { o.classList.add(\"hide\"); })\n document.querySelector(\"#CommunityMember\").classList.remove(\"hide\");\n document.querySelector(\"#DiscussionLeft\").classList.remove(\"hide\");\n document.querySelector(\".DiscussionRight\").classList.remove(\"hide\");\n document.querySelector(\".photo_flow_container\").classList.remove(\"hide\");\n document.querySelector(\".BottomRightSearchList\").classList.remove(\"hide\")\n }\n\n\n } catch (err) {\n console.log(err);\n }\n };\n const renderPageManager = async (id) => {\n try {\n let response = await fetch(serverURL.communityManager + id, {\n method: \"GET\", // http request method\n // 以下跟身分認證有關,後端要使用session 要帶這幾項\n cache: \"no-cache\",\n credentials: \"include\",\n });\n\n let result = await response.json();\n // console.log(\"+++++++++++++++++++++++++++\");\n // console.log(result.data);\n\n let MemberContainer = document.querySelector(\"#MemberTemplate\");\n MemberContainer.innerHTML = \"\";\n document.querySelector(\".managerCommunity\").innerHTML = \"\";\n\n if (result.result) {\n\n result.data.map((item) => {\n MemberContainer.innerHTML += data2manageImg(item);\n // console.log(item);\n\n document.querySelector(\".managerCommunity\").innerHTML += data2manageImg(item);\n\n });\n\n\n\n // document.querySelector(\".managerCommunity\").innerHTML = `${result.data[0]}`;\n }\n\n // document.querySelector(\"#CommunityManager\").innerHTML = result.data[0].fName;\n } catch (err) {\n console.error(err);\n }\n };\n const renderPageMember = async (id) => {\n try {\n // console.log(`${serverURL.communityMember}${id}`);\n let response = await fetch(`${serverURL.communityMember}${id}`, {\n cache: \"no-cache\",\n headers: {\n Authorization: localStorage.getItem(\"Cycle link token\"),\n },\n });\n\n let result = await response.json();\n // console.log(\"+++++++++++++++++++++++++++++++++++++++!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\");\n // console.log(result.data);\n\n // console.log(result.data);\n\n //----------------------------------成員---------------------------------------\n\n document.querySelector(\"#MemberPageTemplateContainer\").innerHTML = \"\";\n document.querySelector(\"#MemberPageTemplateContainerM\").innerHTML = \"\";\n\n if (result.result) {\n result.data.forEach((items) => {\n if (items.ifManager == 0) {\n if (items.fAccessRightId == 2) {\n document.querySelector(\n \"#MemberPageTemplateContainer\"\n ).innerHTML += data2memCard(items);\n }\n } else {\n document.querySelector(\n \"#MemberPageTemplateContainerM\"\n ).innerHTML += data2memCard(items);\n }\n });\n }\n\n // //如果按了filter\n // document.querySelector(\"#memberFilter\").addEventListener(\"click\",(e)=>{\n // e.preventDefault();\n // result.data.sort(function (a, b) {\n // let run1 = a.fJoinDate.split()[0] < b.fJoinDate.split()[0]\n\n\n // let run2 = a.fJoinDate.split()[1] < b.fJoinDate.split()[1]\n\n // });\n // })\n\n // result.data.forEach(\n // (o)=>{\n // console.log(o);\n // }\n // )\n\n //----------------------------------介紹---------------------------------------\n // 處理待審核!!!!!\n // let responsePendingId = await fetch(`${serverURL.communityMember}${id}`, {\n // cache: \"no-cache\",\n // headers: {\n // Authorization: localStorage.getItem(\"Cycle link token\"),\n // },\n // });\n\n // let result = await response.json();\n // console.log(\"+++++++++++++++++++++++++++++++++++++++!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\");\n // console.log(result.data);\n\n let MemberContainer = document.querySelector(\"#CommunityMember\");\n MemberContainer.innerHTML = \"\";\n // console.log(result);\n if (result.result) {\n result.data.map((item) => {\n\n if (item.fAccessRightId == 2 || item.fAccessRightId == 3) {\n MemberContainer.innerHTML += data2memImg(item);\n }\n // console.log(item);\n });\n }\n\n //顯示處理\n if (result.data.length < 4) {\n document\n .querySelector(\"#CommunityMember\")\n .classList.remove(\"Group_FlexJustifyContentSB\");\n document\n .querySelector(\"#GroupMemberPicLessThan4\")\n .classList.add(\"GroupMemberPicLessThan4\");\n }\n } catch (err) {\n console.log(err);\n }\n\n\n };\n\n // 修改社團\n // \b編輯按鈕Onclick\n // 導向編輯社團頁面\n // 撈資料放進資料\n // 抓到fCommunityId放進去formdata\n let fCommunityId;\n document.querySelector(\"#community_edit\").addEventListener(\"click\", async () => {\n // console.group(\"修改社團\");\n try {\n // 導向社團編輯頁面\n // -----# >>> 前端路由導向\n window.location.hash = \"#create-community\";\n // 更改頁面DOM處理\n // 更改頁面名稱\n document.querySelector(\"#UpdatePageName\").innerHTML = \"修改社團\";\n document.querySelector(\"#approveCommunityTitle\").innerHTML = \"成員修改\";\n document.querySelector(\"#memTitle\").innerHTML = \"刪除成員\";\n // 打開審核頁\n document.querySelector(\"#approveMember\").classList.remove(\"hide\");\n document.querySelector(\"#approveMemberSide\").classList.remove(\"hide\");\n // 藏起next pre done btn\n document\n .querySelector(\"#create_community_btn_next\")\n .classList.add(\"hide\");\n document\n .querySelector(\"#create_community_btn_pre\")\n .classList.add(\"hide\");\n document\n .querySelector(\"#create_community_btn_done\")\n .classList.add(\"hide\");\n\n // 打開detail managerBlcok Blcok\n document.querySelector(\"#detailBlock\").style.display = \"block\";\n document.querySelector(\"#managerBlcok\").style.display = \"block\";\n\n // 抓到fCommunityId放進去formdata\n fCommunityId = this.cumDetailId;\n console.log(\"%c\" + fCommunityId, \"color:blue;font-size:20px;\");\n console.log(\"resultAccessRight+++++++++++\");\n\n // fetch舊資料_社團基本資料\n let response = await fetch(serverURL.community + fCommunityId, {\n method: \"GET\", // http request method\n //token\n headers: {\n Authorization: localStorage.getItem(\"Cycle link token\"),\n },\n cache: \"no-cache\",\n credentials: \"include\",\n });\n // console.log(\"resultAccessRight+++++++++++\");\n\n let result = await response.json();\n // console.log(result.data[0]);\n // {fId: 6\n // fImgPath: \"img/community/01.jpg\"\n // fInfo: \"這裡是一個提供所有社會大眾、服務性社團、志工團隊、志工運用單位相互交流的平台!\"\n // fName: \"北部地區志工活動資訊交流站\"\n // fSatusName: \"開放\"\n // fStatusId: 1\n // totalNumber: 2\n // user: \"非社員\"}\n // console.log(response);\n\n // 把舊資料放入前端頁面_社團基本資料\n document.querySelector(\"#create_community_text\").innerHTML =\n result.data[0].fInfo;\n document.querySelector(\"#create_community_name\").value =\n result.data[0].fName;\n document.querySelector(\"#selectStatus\").value =\n result.data[0].fStatusId + \"\";\n document.querySelector(\"#communityImg\").src = serverURL.root + \"/\" + result.data[0].fImgPath;\n\n // fetch舊資料_管理員基本資料\n let responseManager = await fetch(\n serverURL.communityManager + fCommunityId,\n {\n method: \"GET\", // http request method\n //token\n headers: {\n Authorization: localStorage.getItem(\"Cycle link token\"),\n },\n cache: \"no-cache\",\n credentials: \"include\",\n }\n );\n\n let resultManager = await responseManager.json();\n // console.log(resultMember.data);\n // 1: {\n // fId: 9,\n // fName: \"黑白熊\",\n // fPhotoPath: \"img/member/id5.png\"\n // }\n\n // console.log(\"resultManager+++++++++++++++++\");\n // console.log(resultManager);\n\n // 把舊資料放入前端頁面_管理員基本資料\n // 管理員管理員\n // 去除管理員\n let ManagerContainer = document.querySelector(\"#ManagerContainer\");\n let ManagerRemoveContainer = document.querySelector(\"#re\");\n\n ManagerContainer.innerHTML = \"\";\n ManagerRemoveContainer.innerHTML = \"\";\n if (resultManager.result) {\n resultManager.data.forEach((items) => {\n console.log(items);\n // console.log(\n // \"-----------------------------------!!!!!!!!!!!!!!!!!!\"\n // );\n ManagerContainer.innerHTML += modifiedManager(items);\n\n if (resultManager.data.length > 1) {\n ManagerRemoveContainer.innerHTML += modifiedRemoveManagerThis(\n items\n );\n }\n });\n } else {\n console.log(\"假資料錯誤,沒有管理員\");\n }\n\n // fetch_社團id搜尋待審核會員\n let responseAccessRight = await fetch(\n serverURL.communityMemberAccessRight + fCommunityId,\n {\n method: \"GET\", // http request method\n //token\n headers: {\n Authorization: localStorage.getItem(\"Cycle link token\"),\n },\n cache: \"no-cache\",\n credentials: \"include\",\n }\n );\n let resultAccessRight = await responseAccessRight.json();\n // console.log(responseAccessRight);\n\n //把舊資料放入前端頁面_待審核會員資料\n let penddingMemberContainer = document.querySelector(\n \"#penddingMemberContainer\"\n );\n penddingMemberContainer.innerHTML = \"\";\n if (resultAccessRight.result) {\n resultAccessRight.data.forEach((o, i) => {\n if (resultAccessRight.data[i].fAccessRightId == 1) {\n penddingMemberContainer.innerHTML += modifiedRemoveManager(o);\n }\n });\n } else {\n console.log(\"沒有待審核社員\");\n }\n\n // fetch舊資料_社員基本資料\n let responseMember = await fetch(\n serverURL.communityMember + fCommunityId,\n {\n method: \"GET\", // http request method\n //token\n headers: {\n Authorization: localStorage.getItem(\"Cycle link token\"),\n },\n cache: \"no-cache\",\n credentials: \"include\",\n }\n );\n let resultMember = await responseMember.json();\n // resultMember會員帶的資料\n // console.log(resultMember);\n // fJoinDate: \"2020/7/18\"\n // fMemberId: 10\n // fName: \"過激貓\"\n // fPhotoPath: \"img/member/id6.png\"\n // ifManager: 0\n\n // 把舊資料放入前端頁面_社員基本資料\n // 用How to Save the World by 2030 社團測試\n // 新增管理員\n // 刪除成員\n let AddManagerContainer = document.querySelector(\"#addManager\");\n let deletMemberContainer = document.querySelector(\"#deletMem\");\n AddManagerContainer.innerHTML = \"\";\n deletMemberContainer.innerHTML = \"\";\n if (resultMember.result) {\n // console.log(resultAccessRight.data);\n resultMember.data.forEach((o) => {\n //不是管理員\n if (o.ifManager == 0) {\n // console.log(o);\n // console.log(\"+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\");\n // console.log(resultMember.data);\n // is Normal member\n let isNormalMember = true;\n if (resultAccessRight.result == 1) {\n for (let x of resultAccessRight.data) {\n if (o.fMemberId == x.fMemberId) {\n isNormalMember = false;\n break;\n }\n }\n }\n\n if (isNormalMember) {\n // 新增管理員\n // 刪除管理員\n\n AddManagerContainer.innerHTML += modifiedAddManager(o);\n deletMemberContainer.innerHTML += modifiedRemoveManager(o);\n }\n }\n });\n } else {\n console.log(\"假資料錯誤,沒有社員\");\n }\n } catch (err) {\n console.log(err);\n }\n // console.groupEnd(\"修改社團\");\n\n });\n\n // 處理使用者輸入Null值\n // document.querySelector(\"#create_community_name\").addEventListener(\"input\", () => {\n // if (!document.querySelector(\"#create_community_name\").value) {\n // // done Btn 失靈 放棄\n // // document.querySelector(\"#create_community_btn_done\").disabled = true;\n // document.querySelector(\"#fakeDoneBtn\").addEventListener(\"click\", () => {\n // alert(\"請輸入社團名稱!\");\n // });\n // } else {\n // // document.querySelector(\"#create_community_btn_done\").disabled = false;\n // console.log(\"NOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO\");\n // }\n // });\n\n // 完成按鈕Onclik\n // 放進資料\n // 送出資料\n // 通知使用者修改資料成功\n // 刷新頁面\n document.querySelector(\"#fakeDoneBtn\").addEventListener(\"click\", async () => {\n try {\n // 頁面拿到新的社團資料\n let form = document.querySelector(\"#formOfCreate\"); // form element\n let formData = new FormData(form); // FormData\n formData.append(\"fCommunityId\", fCommunityId);\n // 頁面拿到新的會員資料\n let formMem = document.querySelector(\"#formPending\");\n let formDataMem = new FormData(formMem);\n formDataMem.append(\"fCommunityId\", fCommunityId);\n //** */ fetch_修改tCommunity資料\n let responseput = await fetch(\"http://localhost:3050/community/\", {\n method: \"PUT\",\n // Adding body or contents to send\n body: formData,\n // Adding headers to the request\n headers: {\n // formdata 不是用這種解析方式\n // \"Content-type\": \"application/json; charset=UTF-8\",\n Authorization: localStorage.getItem(\"Cycle link token\"),\n },\n cache: \"no-cache\",\n credentials: \"include\",\n });\n let resultput = await responseput.json();\n // 錯誤處理:沒有回傳資料導回原頁面\n\n if (!resultput.result) {\n console.log(resultput);\n }\n\n // 如果有身份被修改\n // fetch_修改tMemberList\n //** */ 1.修改審核會員\n let responseAccessRight = await fetch(\n serverURL.communityMember + fCommunityId,\n {\n method: \"PUT\",\n // Adding body or contents to send\n body: formDataMem,\n // Adding headers to the request\n headers: {\n // formdata 不是用這種解析方式\n // \"Content-type\": \"application/json; charset=UTF-8\",\n Authorization: localStorage.getItem(\"Cycle link token\"),\n },\n cache: \"no-cache\",\n credentials: \"include\",\n }\n );\n let resultAccessRight = await responseAccessRight.json();\n\n if (!resultAccessRight.result) {\n console.log(resultAccessRight.result);\n }\n\n //** */ 2.社團剔除社員\n // 頁面拿到新的剔除社員資料\n let formDel = document.querySelector(\"#formDelMember\"); // form element\n let formDataDel = new FormData(formDel);\n formDataDel.append(\"fCommunityId\", fCommunityId);\n let responseDeleteMem = await fetch(\n serverURL.communityMemberAccessRight,\n {\n method: \"Delete\",\n // Adding body or contents to send\n body: formDataDel,\n // Adding headers to the request\n headers: {\n // formdata 不是用這種解析方式\n // \"Content-type\": \"application/json; charset=UTF-8\",\n Authorization: localStorage.getItem(\"Cycle link token\"),\n },\n cache: \"no-cache\",\n credentials: \"include\",\n }\n );\n let resultDeleteMem = await responseDeleteMem.json();\n\n // console.log(resultDeleteMem);\n if (!resultDeleteMem.result) {\n console.log(resultDeleteMem);\n }\n\n //** */ 3.修改增加管理員\n\n // 寫錯方向\n // let selectedMem = document.querySelector(\".js_checkBoxClass\");\n // console.log(selectedMem.value);\n // let promoted;\n // // console.log(selectedMem.checked );\n // if(selectedMem.checked){\n // promoted = selectedMem.value;\n // }\n // // console.log(promoted);\n let formAddManager = document.querySelector(\"#formAddManager\");\n let formDataAdd = new FormData(formAddManager);\n formDataAdd.append(\"fCommunityId\", fCommunityId);\n\n let responseAddManager = await fetch(\n serverURL.communityMemberAccessRight,\n {\n method: \"PUT\",\n // Adding body or contents to send\n body: formDataAdd,\n // Adding headers to the request\n headers: {\n // formdata 不是用這種解析方式\n // \"Content-type\": \"application/json; charset=UTF-8\",\n Authorization: localStorage.getItem(\"Cycle link token\"),\n },\n cache: \"no-cache\",\n credentials: \"include\",\n }\n );\n let resultAddManager = await responseAddManager.json();\n\n console.log(resultAddManager);\n if (!resultAddManager.result) {\n console.log(resultAddManager);\n }\n\n //** */ 修改去除管理員\n\n let formRemoveManager = document.querySelector(\"#formDelManager\");\n let formDataRemove = new FormData(formRemoveManager);\n formDataRemove.append(\"fCommunityId\", fCommunityId);\n\n let responseRemoveManager = await fetch(\n serverURL.communityMemberAccessRight,\n {\n method: \"PUT\",\n // Adding body or contents to send\n body: formDataRemove,\n // Adding headers to the request\n headers: {\n // formdata 不是用這種解析方式\n // \"Content-type\": \"application/json; charset=UTF-8\",\n Authorization: localStorage.getItem(\"Cycle link token\"),\n },\n cache: \"no-cache\",\n credentials: \"include\",\n }\n );\n let resultRemoveManager = await responseRemoveManager.json();\n\n console.log(resultRemoveManager);\n if (!resultRemoveManager.result) {\n console.log(resultRemoveManager);\n }\n\n alert(\"資料修改成功!\");\n //刷新頁面\n window.location.hash = `#community/detail/${fCommunityId}`;\n } catch (err) {\n console.log(err);\n }\n });\n\n // 還原社團編輯頁面\n document.querySelector(\"#changeBack\").addEventListener(\"click\", () => {\n document.querySelector(\"#UpdatePageName\").innerHTML = \"創建社團\";\n document.querySelector(\"#approveCommunityTitle\").innerHTML = \"詳細資料\";\n document.querySelector(\"#memTitle\").innerHTML =\n \"社團成員&nbsp;(&nbsp;6&nbsp;)\";\n\n // 關閉審核頁\n document.querySelector(\"#approveMember\").classList.add(\"hide\");\n document.querySelector(\"#approveMemberSide\").classList.add(\"hide\");\n // next pre done btn打開\n document\n .querySelector(\"#create_community_btn_next\")\n .classList.remove(\"hide\");\n document\n .querySelector(\"#create_community_btn_pre\")\n .classList.remove(\"hide\");\n document\n .querySelector(\"#create_community_btn_done\")\n .classList.remove(\"hide\");\n // 關掉 managerBlcok detail Blcok\n document.querySelector(\"#detailBlock\").style.display = \"none\";\n document.querySelector(\"#managerBlcok\").style.display = \"none\";\n });\n\n // 加入社團請求 by使用者id,社團id \n document.querySelector(\"#ApplyBtn\").addEventListener(\"click\", async () => {\n try {\n\n let fCommunityId = this.cumDetailId;\n console.log(fCommunityId);\n\n document.querySelector(\"#PendingBtn\").classList.remove(\"hide\");\n document.querySelector(\"#ApplyBtn\").classList.add(\"hide\");\n\n let response = await fetch(\n serverURL.communityMemberAccessRight,\n {\n method: \"POST\",\n // Adding body or contents to send \n\n // Adding headers to the request\n headers: {\n // formdata 不是用這種解析方式\n \"Content-type\": \"application/x-www-form-urlencoded; charset=UTF-8\",\n Authorization: localStorage.getItem(\"Cycle link token\"),\n },\n credentials: 'include',\n body: `fCommunityId=${fCommunityId}`,\n cache: \"no-cache\",\n credentials: \"include\",\n }\n );\n\n let result = await response.json();\n\n console.log(result);\n\n if (!result.result) {\n console.log(result);\n }\n\n alert(\"加入社團審核\");\n\n } catch (err) {\n console.log(err);\n }\n });\n\n // 退出社團 continue 無法Click 有bug\n // 按待審核與我是社員按鈕顯示退出社團\n document.querySelectorAll(\".js_forLeave_btn\").forEach((o) => {\n o.addEventListener(\"click\", () => {\n document.querySelector(\".js_leaveDropDown\").classList.toggle(\"hide\");\n })\n })\n // 按下按鈕退出社團\n // console.log(document.querySelector(\"#leaveCommunityBtn\"));\n document.querySelector(\".js_leaveDropDown\").addEventListener(\"click\", async () => {\n try {\n\n if (confirm(\"確定要退出社團?\") == true) {\n let fCommunityId = this.cumDetailId;\n\n let responseDeleteMem = await fetch(\n serverURL.communityMember,\n {\n method: \"Delete\",\n headers: {\n \"Content-type\": \"application/json; charset=UTF-8\",\n Authorization: localStorage.getItem(\"Cycle link token\"),\n },\n credentials: \"include\",\n body: JSON.stringify({ fCommunityId: fCommunityId }),\n cache: \"no-cache\",\n }\n );\n let resultDeleteMem = await responseDeleteMem.json();\n\n // console.log(resultDeleteMem);\n if (!resultDeleteMem.result) {\n console.log(resultDeleteMem);\n return;\n }\n\n\n alert(\"退出社團成功!\");\n location.reload();\n }\n document.querySelector(\".js_leaveDropDown\").classList.add(\"hide\");\n\n } catch (err) {\n console.log(err);\n }\n\n })\n\n const activeAwait = async () => {\n try {\n // fetch 接兩個參數 ( \"請求網址\", { 參數物件,可省略 } )\n // *用變數接 fetch 結果 ,要用await等。\n let response = await fetch(serverURL.active, {\n method: \"GET\", // http request method \n headers: { // http headers\n 'Content-Type': 'application/json' // 請求的資料類型\n },\n // 以下跟身分認證有關,後端要使用session 要帶這幾項\n cache: 'no-cache',\n credentials: 'include',\n });\n // 用變數接 fetch結果的資料內容, 要用await等。\n let result = await response.json();\n display_active_community(result.data);\n // getactid();\n } catch (err) {\n console.log(err);\n // 錯誤處理\n }\n }\n activeAwait();\n const actcommunity = document.getElementById(\"actcommunity\");\n const display_active_community = (o) => {\n\n // console.group(\"----------------\");\n actcommunity.innerHTML = \"\";\n // console.log(\"o:\", o);\n o.map(\n (e, index) => {\n\n\n {\n actcommunity.innerHTML += htmlcommunitydetial(e);\n }\n\n }\n )\n // console.groupEnd(\"----------------\");\n\n }\n\n\n\n\n\n // 介紹分頁-- 管理員頭像的文字樣板\n const data2manageImg = (o) => {\n // console.log(o.fPhotoPath);\n return `\n <div class=\"FlexContainer groupManagerMarginTop\">\n <div class=\"GroupRightInfo FlexContainer GroupRightInfoText\">\n <div class=\"activity_detail_info_img_circle\">\n <div class=\"activity_detail_info_img_div\">\n <a href=\"#personal-page/${o.fId}\">\n <img src=\"${serverURL.root}/${o.fPhotoPath}\" class=\"activity_detail_info_img\">\n </a>\n </div>\n </div>\n <a id=\"CommunityManager\" href=\"#personal-page/${o.fId}\" class=\"GroupHolderName\">${o.fName}</a>\n </div>\n <img data-user-id=${o.fId} class=\"lets-talk\" src=\"./img/icon_chat.svg\" width=\"20\">\n </div>`;\n };\n\n // 介紹分頁-- 會員頭像的文字樣板\n // 照片路徑存取後端資料夾\n const data2memImg = (o) => {\n return ` <div id=\"GroupMemberPicLessThan4\" class=\"activity_detail_info_img_circle GroupMemberPic GroupMemberPicLessThan4\">\n <div class=\"activity_detail_info_img_div\">\n <a href=\"#personal-page/${o.fMemberId}\">\n <img class=\"activity_detail_info_img GoupRightInfoPhoto\" src=\"${serverURL.root}/${o.fPhotoPath}\"\n width=\"30\">\n </a>\n </div>\n </div>`;\n };\n\n // 成員分頁-- 會員卡的文字樣板\n const data2memCard = (o) => {\n return ` <div\n class=\"BottomRightMemberCard FlexContainer GroupEventMemberCard Group_FlexJustifyContentSB \">\n <div class=\"FlexContainer\">\n <a href=\"#personal-page/${o.fMemberId}\" class=\"DivForImg\">\n <div class=\"activity_detail_info_img_circle\">\n <div class=\"activity_detail_info_img_div\">\n <img src=${serverURL.root}/${o.fPhotoPath}\n class=\"activity_detail_info_img\">\n </div>\n </div>\n </a>\n <div class=\"GroupMemberCardInfo\">\n <a href=\"#personal-page/${o.fMemberId}\">${o.fName}</a>\n <div class=\"FlexContainer\">\n <div>${o.fJoinDate}</div>\n <div>&nbsp;&nbsp;&nbsp;&nbsp;加入此社團</div>\n </div>\n </div>\n </div>\n <a>\n <img data-user-id=${o.fMemberId} class=\"lets-talk\" class=\"Size20IconMarginRight\" src=\"./img/icon_chat.svg\"\n width=\"20\">\n </a>\n </div>`;\n };\n\n // 修改社團--管理員文字樣板\n const modifiedManager = (o) => {\n return ` <div class=\"create_community_check\">\n <img src = \"${serverURL.root}/${o.fPhotoPath}\" \n style = \"border-radius: 50%; width:50px\" />\n <p style=\"white-space:nowrap\">${o.fName}</p>\n </div>`;\n };\n\n // 修改社團--刪除管理員文字樣板\n // 修改社團--刪除會員文字樣板\n // 修改社團--審核會員文字樣板\n const modifiedRemoveManager = (o) => {\n // console.log(o);\n return `<div class=\"create_community_flex\">\n <input name=\"fId\" type=\"checkbox\" value=${o.fMemberId} style=\"align-self: center;\" />\n <div class=\"create_community_check\">\n <img src =\"${serverURL.root}/${o.fPhotoPath}\"\n style = \"border-radius: 50%; width:50px\"/>\n <p>${o.fName} </p>\n </div>`;\n };\n\n const modifiedRemoveManagerThis = (o) => {\n // console.log(o);\n return `<div class=\"create_community_flex\">\n <input name=\"fId\" type=\"checkbox\" value=${o.fId} style=\"align-self: center;\" />\n <div class=\"create_community_check\">\n <img src =\"${serverURL.root}/${o.fPhotoPath}\"\n style = \"border-radius: 50%; width:50px\"/>\n <p>${o.fName} </p>\n </div>`;\n };\n\n // 修改社團--增加管理員文字樣版\n const modifiedAddManager = (o) => {\n // console.log(o);\n return `<div class=\"create_community_flex\">\n <input class=\"js_checkBoxClass\" name=\"fId\" type=\"checkbox\" value=${o.fMemberId} style=\"align-self: center;\" />\n <div class=\"create_community_check\">\n <img src =\"${serverURL.root}/${o.fPhotoPath}\"\n style = \"border-radius: 50%; width:50px\"/>\n <p>${o.fName} </p>\n </div>`;\n };\n\n //todo 活動傳資料到社團\n const htmlcommunitydetial = (o) => {\n // console.log(\"test1\",o);\n return `\n <div class=\"card\">\n <div class=\"communityCard\">\n <img src=\"http://localhost:3050/${o.fImgPath}\" alt=\"\" style=\"width:100%\">\n </div>\n <div class=\"GroupBottomCardTime\">${o.fActivityDate}</div>\n <div class=\"GroupBottomCardEventName\">${o.fActName}</div>\n <div class=\"FlexContainer\">\n <div><img class=\"Icon20Color\" src=\"./img/icon_gps.svg\" width=\"20\"></div>\n <div class=\"GroupBottomCardLocation \">${o.fActLocation}</div>\n </div>\n <div class=\"GroupBottomCardDD\">${o.fIntroduction}</div>\n \n \b<button class=\"GroupCardBtn\">\n <a href=\"#activity/detail/${o.fId}\">參加 </a>\n </button>\n \n </div>`\n }\n\n\n // 活動樣板\n // const htmlcommunitydetial = (o) => {\n\n // return ` \n // <div class=\"\">\n // <a href=\"#activity/detail/${o.fId}\" class=\"activecard\">\n // <div class=\"active_card_container\">\n // <div class=\"active_card\" >\n // <div class=\"addlike\">\n // <i class=\"fas fa-heart fa-lg active_card_heart \"></i>\n // </div>\n // <div class=\"active_card_div\">\n // <img src=\"http://localhost:3050/${o.fImgPath}\" alt=\"\" class=\"active_card_img\">\n // </div>\n\n // <div class=\"active_card_info\">\n // <p>${o.fActivityDate}</p>\n // <p class=\"active_card_title\">${o.fActName}</p>\n\n // <div class=\"active_card_location_div\">\n // <img src=\"img/929497.svg\" class=\"active_card_location\">\n // <p>${o.fActLocation}</p>\n // </div>\n // </div>\n // </div>\n // </div>\n // </a>\n // </div>`;\n // // if(o.fJoinTypeId == 0)\n // // {\n // // return ` \n // // <div class=\"\">\n // // <a href=\"#activity/detail/${o.fId}\" class=\"activecard\">\n // // <div class=\"active_card_container\">\n // // <div class=\"active_card\" >\n // // <div class=\"addlike\">\n // // <i class=\"fas fa-heart fa-lg active_card_heart actlikecolor \"></i>\n // // </div>\n // // <div class=\"active_card_div\">\n // // <img src=\"${o.fImgPath}\" alt=\"\" class=\"active_card_img\">\n // // </div>\n\n // // <div class=\"active_card_info\">\n // // <p>${o.fActivityDate}</p>\n // // <p class=\"active_card_title\">${o.fActName}</p>\n\n // // <div class=\"active_card_location_div\">\n // // <img src=\"img/929497.svg\" class=\"active_card_location\">\n // // <p>${o.fActLocation}</p>\n // // </div>\n // // </div>\n // // </div>\n // // </div>\n // // </a>\n // // </div>`;\n // // }\n // // else{\n // }\n\n\n\n // this 指的是 ClsCommuntityDetail\n this.renderMainCommunityInfo = renderPage;\n this.renderManagerListInfo = renderPageManager;\n this.renderMemberListInfo = renderPageMember;\n this.CommunityOfPictures = CommunityOfPictures;\n this.renderPageLoading = renderPageLoading;\n}", "function vCalendar() {\n this.vEvents = new Array();\n this.properties = new PropertyMap();\n}", "function getDateArray(start, end) {\n\t\tvar arr = new Array();\n\n\t\twhile (start <= end) {\n\t\t\tarr.push(new Date(start));\n\t\t\tstart.setDate(start.getDate() + 1);\n\t\t}\n\t\t\n\t\treturn arr;\n\t}", "function createDynamicCalendar( startWeek, curMonth, day ){\n\t\tvar calendarContent = \"<table class='T_calendar'><tr><th class=''>日</th><th>一</th><th>二</th><th>三</th><th>四</th><th>五</th><th class=''>六</th></tr>\";\n\t\tvar curMonthLen = monthLen[curMonth],\n\t\t\tprevMonthLen = monthLen[(12+curMonth-1)%12];\n\n\t\t//日历的第一行特别处理\n\t\t// startWeek 0-6 对应星期日到星期六\n\t\tcalendarContent += \"<tr>\";\n\t\tfor( var i=(prevMonthLen - startWeek+1); i<=prevMonthLen; i++ ){\n\t\t\tcalendarContent += \"<td class='disable'>\"+i+\"</td>\";\n\t\t}\n\t\tfor( var i=startWeek; i<7; i++ ){\n\t\t\tif( ( i+1-startWeek ) != day ){\t\t\t\t\n\t\t\t\tcalendarContent += \"<td class='enable'>\"+(i+1-startWeek)+\"</td>\";\n\t\t\t}else{\n\t\t\t\tcalendarContent += \"<td class='cur_day enable'>\"+(i+1-startWeek)+\"</td>\";\n\t\t\t}\n\t\t}\n\t\tcalendarContent += \"</tr>\";\n\n\t\t// 填充日历的2-6行\n\t\t// startWeek are 0-6 0 represent for sunday\n\t\tfor( var i = 0; i<5; i++ ){\n\t\t\tcalendarContent += \"<tr>\";\n\t\t\tvar startIndex = ( ( 7-startWeek )%7 != 0 ) ? (7-startWeek)%7+1 : 8;\n\t\t\tfor( var j = startIndex; j<( startIndex+7 ); j++ ){\n\t\t\t\tif( (j+i*7) <= curMonthLen ){\n\t\t\t\t\tif( (j+i*7) != day ){\n\t\t\t\t\t\tcalendarContent += \"<td class='enable'>\"+(j+i*7)+\"</td>\";\n\t\t\t\t\t}else{\t\n\t\t\t\t\t\tcalendarContent += \"<td class='cur_day enable'>\"+(j+i*7)+\"</td>\";\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\tcalendarContent += \"<td class='disable'>\"+( (j+i*7)%curMonthLen )+\"</td>\";\n\t\t\t\t}\n\t\t\t}\n\t\t\tcalendarContent += \"</tr>\";\n\t\t}\n\t\tcalendarContent += \"</table>\";\n\t\treturn calendarContent;\n\t}", "function eo_generate_dates_by_rule(a,b,c){eo_occurrences_by_rule=new Array;eo_viewing_month=[a,b];schedule=$(\"#HWSEventInput_Req\").val();frequency=parseInt($(\"#HWSEvent_freq\").val());start=$(\"#from_date\").datepicker(\"getDate\");end=$(\"#recend\").datepicker(\"getDate\");b=b-1;month_start=new Date(a,b,1);nxt_mon=new Date(a,b+1,1);month_end=new Date(nxt_mon-1);if(end<month_start||start>month_end){return}switch(schedule){case\"once\":case\"custom\":formateddate=$.datepicker.formatDate(\"yy-mm-dd\",start);eo_occurrences_by_rule.push(formateddate);return;break;case\"daily\":if(start<month_start){count_days=Math.abs((month_start-start)/(1e3*60*60*24))-1;count_days=count_days%frequency}else{count_days=parseInt(start.getDate())}skip=frequency;streams=new Array;start_stream=new Date(month_start);start_stream.setDate(month_start.getDate()+(count_days-1));streams.push(start_stream);break;case\"weekly\":month_start_day=month_start.getDay();selected=$(\"#dayofweekrepeat :checkbox:checked\");var d=new Array(\"SU\",\"MO\",\"TU\",\"WE\",\"TH\",\"FR\",\"SA\");streams=new Array;selected.each(function(a){a=d.indexOf($(this).val());start_stream=new Date(start);start_stream.setDate(start.getDate()+(a-start.getDay()+7)%7);if(start_stream<month_start){count_days=Math.abs((month_start-start)/(1e3*60*60*24));count_days=count_days-count_days%(frequency*7);start_stream.setDate(start_stream.getDate()+count_days)}streams.push(start_stream)});skip=7*frequency;break;case\"monthly\":month_difference=(a-start.getFullYear())*12+b-(start.getMonth()+1);if(month_difference%frequency!=0){return}meta=$('input[name=\"eo_input[schedule_meta]\"]:checked').val();if(meta==\"BYMONTHDAY=\"){day=start.getDate();daysinmonth=month_end.getDate();if(day<=daysinmonth){pointer=new Date(a,b,day)}}else{n=Math.ceil(start.getDate()/7);occurrence_day=start.getDay();if(n>=5){month_end_day=month_end.getDay();occurence_date=month_end.getDate()+(occurrence_day-month_end_day-7)%7}else{month_start_day=month_start.getDay();offset=(occurrence_day-month_start_day+7)%7;occurence_date=offset+(n-1)*7+1}pointer=new Date(month_start);pointer.setDate(occurence_date)}if(pointer<=end){formateddate=$.datepicker.formatDate(\"yy-mm-dd\",pointer);eo_occurrences_by_rule.push(formateddate)}return;break;case\"yearly\":year_difference=a-start.getFullYear();if(year_difference%frequency!=0){return}dateCheck=new Date(a,start.getMonth(),start.getDate());if(b==start.getMonth()&&dateCheck.getMonth()==start.getMonth()){pointer=new Date(start);pointer.setYear(a);if(pointer<=end){formateddate=$.datepicker.formatDate(\"yy-mm-dd\",pointer);eo_occurrences_by_rule.push(formateddate)}}return;break;default:return;break}for(x in streams){pointer=new Date(streams[x]);while(pointer<=month_end&&pointer<=end){formateddate=$.datepicker.formatDate(\"yy-mm-dd\",pointer);eo_occurrences_by_rule.push(formateddate);pointer.setDate(pointer.getDate()+skip)}}}" ]
[ "0.71836436", "0.7157168", "0.69721913", "0.67158526", "0.6659444", "0.6658404", "0.6619664", "0.65990007", "0.6590704", "0.6581579", "0.6548451", "0.6483488", "0.6477152", "0.6459985", "0.64313257", "0.6424336", "0.6384324", "0.63710535", "0.6348234", "0.6305048", "0.624175", "0.6177929", "0.61765516", "0.6156055", "0.61342067", "0.6079149", "0.60789293", "0.60495967", "0.604608", "0.60231656", "0.6021903", "0.601504", "0.60135657", "0.5991909", "0.59740543", "0.5962535", "0.59468526", "0.5935125", "0.58984154", "0.5892255", "0.58777857", "0.58707285", "0.5867941", "0.58625185", "0.58625185", "0.5857936", "0.58545303", "0.5849488", "0.58420974", "0.58345085", "0.5826824", "0.580429", "0.57895005", "0.578632", "0.5769146", "0.5767828", "0.57636696", "0.5761275", "0.57601994", "0.5757615", "0.57518494", "0.57479423", "0.5745063", "0.57450473", "0.5732344", "0.57272744", "0.57263166", "0.57251847", "0.57114625", "0.571115", "0.57035786", "0.5703379", "0.5699708", "0.56869906", "0.56855357", "0.56824744", "0.56789464", "0.5674134", "0.5672272", "0.5671007", "0.566938", "0.56649864", "0.56618357", "0.56617904", "0.5655473", "0.565155", "0.56483245", "0.5647077", "0.5644179", "0.5641929", "0.5639279", "0.5639279", "0.56338406", "0.56316566", "0.563113", "0.5628686", "0.5626198", "0.5624571", "0.56224024", "0.5605199" ]
0.7292485
0
functions to work with the linked list instert node into list
insertvalueToList(value) { let newNode = new Node(value) if (this.length == 0) { this.head = newNode this.tail = newNode this.pointer = newNode this.length = 1; return; } if (newNode.value > this.head.value) { // the new value is now the highest value newNode.next = this.head; // the new node is inserted to the list at the head - new acting head node this.head = newNode; } else { // then the node has to go somewhere in the list this.pointer = this.head; while (true) { if (this.pointer.next) { if (newNode.value < this.pointer.next.value) { // then move pointer this.pointer = this.pointer.next } else { // this is where the node belongs newNode.next = this.pointer.next; // two different nodes point to 'pointer.next' this.pointer.next = newNode; this.length++; break; } } else { // then the node goes at the end this.pointer.next = newNode; this.tail = newNode; this.length++; break; } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "insert(index, val) {\n\n //if index is less than zero or greater than the length return false;\n if (index < 0 || index > this.length) return false;\n //if index is equal to the length of the list call push(val)\n if (index === this.length) {\n this.push(val);\n return true;\n }\n //if index is equal to zero call unshift(val)\n else if (index === 0) {\n this.unshift(val);\n return true;\n }\n else {\n //creating new node with the value\n let node = new Node(val);\n let pre = this.get(index - 1); // getting previous elemnt \n node.next = pre.next;// setting new node next property to the previous element next property\n pre.next = node; //setting previous element next property to new node\n this.length++; //incrementing the length by 1\n return true;\n }\n\n }", "function prepareLI() {\n var nod = $(this);\n if (tree.options.undraggable) {\n nod.mousedown(preventDefault);\n } else {\n nod.draggable(draggableOptions());\n nod[0].undraggable = nod.hasClass(\"undraggable\");\n }\n var a = $(this.getElementsByTagName(\"a\")[0]);\n if (tree.options.unclickable) {\n nod.addClass(\"unclickable\");\n a.click(preventDefault);\n } else {\n a.click(obj.events.click);\n }\n\n if (tree.options.oninsert) {\n tree.options.oninsert.call(new node(nod), a);\n }\n }", "insertNode(val) {\n let node = new Node(val);\n if (!this.head) {\n this.head = node;\n // this.listLength++;\n return this;\n }\n\n for (var itr = this.head; itr.next; itr = itr.next);\n itr.next = node;\n // this.listLength++;\n return this;\n }", "insert(index,value){\n//check parameters\nif(index >= this.length){\n return this.append(value)\n}\nconst newNode ={\n value:value,\n next:null\n}\nconst leader =this.tracerseToIndex(index-1)\nconst holdingPointer = leader.next\nleader.next =newNode\nnewNode.next =holdingPointer\nthis.length++;\nreturn this.printList\n}", "function insertNodeBefore(){\r\n value = document.getElementById('element').value;\r\n var newElement = document.getElementById('newElement').value;\r\n if(value && newElement) {\r\n\r\n array = getArray();\r\n if (array.length) {\r\n array.forEach(function (node, idx) {\r\n if (value == node.element) {\r\n index = idx;\r\n }\r\n });\r\n if (index !== -1) {\r\n array.splice(index, 0, new Node(newElement, array[index + 1]));\r\n setArray(array);\r\n arrayStatus(true, 'Linked List: ');\r\n }\r\n }\r\n else {\r\n alert('Linked List not exists \\n create first..');\r\n }\r\n }\r\n else {\r\n alert('field must be fill..');\r\n }\r\n}", "insertHeadNode(data){\n this.head = new Node(data, this.head); //the this.head in the argument list is the this.head = null from the constructor of class LinkList. If the LinkList is empty then this.head = null is passed to the constructor of Node(data, next) as the parameter for next so next becomes (or stays) as null.\n this.size++;\n}", "add(element) {\n //create a new node w given element\n let newNode = new Node(element);\n //a place keeper\n let current;\n //if list is empty\n if (this.head === null) this.head = newNode\n //if list has head...\n else {\n //assign the place keeper to head\n current = this.head\n //if the node.next points to another node\n while (current.next) {\n //move placekeeperforward to assign it the value of the next node\n //then repeat the step above\n current = current.next;\n }\n //after the while loop finds the last node\n //(current.next === null) assign the value of that nodes next to be the newNode\n current.next = newNode;\n }\n this.size++;\n }", "insert_beg(newnode) {\r\n let temp = this.head\r\n this.head = newnode\r\n this.head.next = temp\r\n }", "unshift(val) {\n //create a new node using value passed to the function\n let newHead = new Node(val);\n //if there is no head property on the list, set the head and tail to be the newly created node\n if (!this.head) {\n this.head = newHead;\n this.tail = this.head;\n }\n //otherwise...\n else {\n //set newly created node's next property to be the current head property on the list (ie the newly created node should be pointing to the current head)\n newHead.next = this.head;\n //then set the head property on the list to be the newly created node\n this.head = newHead;\n }\n //increment the length of the list by 1\n this.length++;\n //return the linked list\n return list;\n\n }", "function ListNode(){}", "insert(value){\n let node = new Node(value);\n node.next = this.head;\n this.head = node;\n }", "function prepend(new_node_val, input_list) {\n // Your code here\n var list = {\n rest: input_list,\n value: new_node_val\n }\n return list;\n}", "insertStart(data) {\n let node = new Node(data);\n node.next = this.head;\n this.head = node;\n }", "function Listnode(value){\n this.value = value;\n this.next = null;\n}", "push(val) {\n //create a new node by node class and store it\n let newnode = new Node(val)\n //if there is node { EMPTY-list}\n if (!this.head) {\n //point the head to the newly created node\n this.head = newnode;\n //and point the tail to same node\n this.tail = this.head;\n /* like this\n [] ----> if list have no element then\n add a new node to the list [23] \n head=23 and tail=23 // both are points to the same node\n */\n }\n //if there is a node { list have elements }\n else {\n //set the tail.next points the newly created node \n this.tail.next = newnode;\n // and set the tail to the new node\n this.tail = newnode;\n /* like this\n 23 34 ----> if list have element then\n head=23 and tail=34 // both are points to the same node\n */\n }\n //increament the length by 1\n this.length++;\n //return the list by this \n return this;\n }", "insertAt(data, index){\n // check if index is out of range\n if(index > 0 && index > this.size){\n // return false\n return;\n }\n // create a new node\n const node = new Node(data);\n // we need two variables to hold the current and previous node\n let current; \n let previous;\n\n // assign head to current variable\n current = this.head;\n\n // check if index is 0 \n if(index === 0){\n // if so then the existing head should be next to the node\n node.next = this.head;\n // if so then add created node as the head of the linked list\n this.head = node;\n }\n else {\n // set current to head\n current = this.head;\n // create a variable to count\n let count = 0;\n\n // iterate to the right position\n while(count < index){\n // increase the count\n count++;\n previous = current;\n current = current.next;\n }\n // when you find right position add the new node there between previous and current\n node.next = current;\n previous.next = node;\n }\n // increase the linked list size\n this.size++;\n }", "addToBack(nodes){ // does not return anything\n var runner=this.head\n while(runner){\n if(runner.next==null){\n runner.next=nodes;\n }\n else runner=runner.next;\n }\n }", "preppend(newData) {\n let newNode = new Node(newData);\n\n if (this.head === null) {\n this.head = newNode;\n this.tail = newNode;\n } else {\n newNode.next = this.head;\n this.head.prev = newNode;\n this.head = newNode;\n }\n return this; //returning the updated list\n }", "prepend(value){\nconst newNode = new Node(value);\n//// {\n// value:value,\n// next:null\n// }\nnewNode.next = this.head;\nthis.head = newNode;\nthis.length++;\n\n\n}", "prepend(target, node) {\n if (this.head == null) {\n return \"empty list\";\n }\n let runner = this.head;\n while (this.node != null) {\n if (runner.next != target) {\n runner = this.next;\n } else {\n let runner2 = runner.next;\n runner.next = node;\n node.prev = runner;\n node.next = runner2;\n runner2.prev = node;\n }\n }\n return DLList;\n }", "insertAtBeginningOfList(data) {\n let temp = DLinkNode(data);\n if (!this.start) {\n this.start = temp;\n return this.start;\n }\n let p = this.start;\n p.prev = temp;\n temp.next = p;\n this.start = temp;\n return this.start;\n }", "appendNode(data){\n if(this.head === null){\n this.head = new Node(data);\n }\n let currentNode = this.head;\n while(currentNode.next !== null){\n currentNode = currentNode.next;\n }\n currentNode.next = new Node(data);\n }", "insertAt(data,index){\n // primero validamos que el indice sea un numero valido dentro de la lista\n if(index < 0 || index > this.size){\n return null;\n }\n // creamos el nuevo nodo llamando a la clase node\n const newNode = new node(data);\n // guardamos los datos de la cabeza en current y inicializamos previous\n let current = this.head;\n let previous;\n // si el indice es igual a 0 significa que el nuevo nodo debe estar al principio de todo\n if(index === 0){\n newNode.next = current;\n this.head = newNode;\n }else{\n // el siguiente siclo hace avanzar al nodo indicado dependiendo el indice escrito\n for(let i = 0;i < index; i++){\n previous = current;\n current = current.next;\n }\n newNode.next = current;\n previous.next = newNode;\n }\n this.size++;\n }", "_addElement(el){\n let node = new Node(el);\n let current;\n if(this.head === null){\n this.head = node;\n }else{\n current = this.head;\n while(current.next){\n current = current.next;\n }\n current.next=node;\n }\n this.size++;\n }", "buildOneTwoThree(){\n let newNode = new Node(1)\n this.head = newNode;\n this.head.next = new Node(2);\n this.head.next.next = new Node(3);\n this.head.next.next.next = null;\n return this.head;\n }", "addatFirst(data){\n this.head = new Node(data, this.head);\n this.size++\n }", "prepend(data) {\n //if the list is empty\n if (!this.head) {\n this.head = this.tail = new Node(data);\n } else {\n let oldHead = this.head;\n this.head = new Node(data);\n oldHead.prev = this.head;\n this.head.next = oldHead;\n }\n }", "insertAt(position,item){\n \n if(this.head === null){\n this.insertFirst(item);\n }\n \n let ticker = 0;\n let currNode = this.head;\n let nextNode = this.head;\n \n while ((nextNode !== null) && (ticker !== position)) {\n //save the previous node \n currNode = nextNode;\n nextNode = currNode.next;\n ticker++;\n }\n \n currNode.next = new _Node(item,nextNode);\n \n }", "createLoop(ll) {\n let ptr = ll.head;\n while (ptr.next != null) {\n ptr = ptr.next;\n }\n ptr.next = ll.head.next;\n\n }", "append(data) {\n console.log(\"append\", data);\n const node = new Node(data);\n if (this.head === null) {\n this.head = node;\n return;\n }\n let current = this.head;\n while (current.next !== null) {\n current = current.next;\n }\n current.next = node;\n }", "append(newVal) {\r\n // check if the list exists\r\n // traverse to the end\r\n\r\n // O(n)\r\n // end of the list: currentNode.next = null\r\n\r\n let currentNode = this.head;\r\n\r\n // what if list is empty\r\n if (!currentNode) {\r\n this.head = new Node(newVal);\r\n return;\r\n }\r\n\r\n // while (null.next)\r\n while (currentNode.next) {\r\n // not null\r\n currentNode = currentNode.next;\r\n }\r\n\r\n\r\n let newNode = new Node(newVal);\r\n // currentNode is the end of the list\r\n currentNode.next = newNode;\r\n }", "add(element, pvid, pcid) {\n // creates a new node\n let node = new Node(element, pvid, pcid);\n let current;\n if (this.head == null) this.head = node;\n else {\n current = this.head;\n while (current.next) {\n current = current.next;\n }\n // adds node\n current.next = node;\n }\n this.size++;\n console.log(\"NODE \" + element + \" was created\");\n }", "insertTailNode(data){\n //find the end of the list\n let current = this.head; //start at beginning of list\n let previous = null;\n while(current){\n previous = current;\n current = current.next; //moves current through the list until current is null (at the end of the list) which stops the while loop\n }\n //after while loop, previous is the last node in the list\n let tail = new Node(data, null); //use data to create the node to add\n previous.next = tail; //add the node at the end of the list\n this.size++; //increment list size\n}", "insert(index, value) {\n //if index is less than zero or greater than the length of the list, return false\n if (index < 0 || index > this.length) return false;\n //if the index is the same as the length of the list, use push method to add a new node to the end of the list\n // double bang (double negation)\n if (index === this.length) return !!this.push(value);\n //if the index is 0, use the unshift method to add a new node to the beginning of the list\n if (index === 0) return !!this.unshift(value);\n //otherwise, using the get method, access the node at (index - 1) meaning we are getting the index\n //at the position left of where we are adding the new node\n const previousNode = this.get(index - 1);\n //instanstiate a new Node\n const newNode = new Node(value);\n //set that new Node's next property to the old node that previousNode was pointing to\n //(can also create intermediate variable that holds the value of previousNode.next and set newNode.next to it)\n newNode.next = previousNode.next\n //then set previousNode's next property to the new Node\n previousNode.next = newNode;\n //increment the length of the list\n this.length++\n //return true\n return true;\n }", "unshift(val) {\n // Accepts a value.\n // Create a newNode.\n let newNode = new Node(val);\n // check if there is head\n if(!this.head) {\n // Set newNode as head and tail \n this.head = newNode;\n this.tail = newNode;\n }\n else {\n // set newNode next to head.\n newNode.next = this.head;\n // set head prev to newNode.\n this.head.prev = newNode;\n // Set newNode as head. \n this.head = newNode;\n }\n // Increment the length. \n this.length++;\n // return the list. \n return list;\n }", "function insertNext(list, value) {\n\n const list2 = new LinkedList(value);\n list2.next = list.next;\n list.next = list2;\n\n}", "insertAtInd(data, index){\n if(index > 0 && index > this.size){\n return\n }\n if(index === 0){\n this.head = new Node(data, this.head)\n return\n\n }\n const node = new Node(data);\n let current,previous;\n current = this.head;\n let count = 0;\n while(count < index){\n previous = current;\n current = current.next;\n count++;\n\n }\n node.next = current;\n previous.next = node\n this.size++\n }", "unshift(val) {\n //create a new node with the value passed in\n let newNode = new Node(val);\n //if the length is 0\n if (this.length === 0) {\n //set the head to be the new node\n this.head = newNode;\n this.tail = newNode;\n }\n //else,\n else {\n //set the previous property on the head to be the new node \n this.head.prev = newNode;\n //set the next property on the new node to be the head property\n newNode.next = this.head;\n //update the head to be the new node\n this.head = newNode\n }\n //increment length\n this.length++;\n //return list\n return this;\n }", "function LList() {\n this.head = new Node(\"head\");\n this.find = find;\n this.insert = insert;\n this.display = display;\n this.remove = remove;\n this.findLast = findLast;\n this.dispReverse = dispReverse;\n}", "addToFront(value){\n var new_node = new ListNode(value);\n\n if (this.head == null) {\n this.head = new_node;\n this.tail = new_node;\n }\n\n else {\n new_node.next = this.head;\n this.head = new_node;\n }\n }", "insert(data) {\n const node = new Node(data, this.head);\n this.head = node;\n }", "add(data){\n // se crea el elemento desde la clase node\n const newNode = new node(data,null);\n // si la cabeza tiene un valor de nulo esta toma el valor del nuevo nodo\n if(!this.head){\n this.head = newNode;\n // si ya tiene datos comenzamos a recorrer la lista desde head\n }else{\n // guardamos el valor actual de head en current\n let current = this.head;\n // mientras exista un valor dentro del nuevo nodo.next este ciclo se repetira\n while(current.next){\n current = current.next;\n };\n // al salir del ciclo le asignamos el valor del nuevo nodo al ultimo nodo.next\n current.next = newNode;\n }\n // incrementamos el tamaño de la lista\n this.size++;\n }", "function createLinkedList(head, node){\n if(head === null) {\n return node;\n } else {\n let iterator = head;\n while(iterator && iterator.next){\n iterator = iterator.next;\n };\n iterator.next = node;\n return head;\n }\n}", "addToHead(value) {\n let currentHead = this.head;\n let newHead = new ListNode(value);\n \n // check if this is first node\n if (!currentHead) {\n this.head = newHead;\n this.tail = newHead;\n return;\n }\n \n // otherwise, link appropriately\n this.head = newHead;\n currentHead.prev = newHead;\n newHead.next = currentHead;\n }", "unshift(val) {\n // accepts a value\n // create a new node.\n let newHead = new Node(val);\n // if no head set head and tail to be new node. \n if(!this.head) {\n this.head = newHead;\n this.tail = newHead;\n }\n else{\n // set the new node next prop to the current head prop\n newHead.next = this.head; \n // set the head prop on the list to be the new node\n this.head = newHead;\n }\n\n\n // incremenet the length by 1. \n this.length++;\n // return the linked list.\n return this;\n }", "add(element)\r\n {\r\n let node = new Node(element); //creates new node\r\n let current; //to store current node\r\n //if this list is empty add the element & make it head\r\n if(this.head === null)\r\n {\r\n this.head = node;\r\n }\r\n else \r\n {\r\n current = this.head;\r\n //iterate through end of list\r\n while(current.next){\r\n current = current.next;\r\n }\r\n\r\n // add node\r\n current.next = node;\r\n }\r\n this.size++;\r\n }", "prepend(value) {\n // if list is empty\n if (!this.head) {\n this.head = new Node(value);\n }\n let oldHead = this.head;\n this.head = new Node(value);\n this.head.next = oldHead;\n }", "replace(index, value) {\n // if list is empty return with an error\n if(this.isEmpty()) return console.error('list is empty');\n // make a new node\n const newNode = new Node(value);\n\n // handle case if the index is the head \n if(index === 0) {\n newNode.next = this.head.next;\n this.head = newNode;\n return\n }\n\n // find the node before the index\n let currentNode = this.get(index - 1);\n // return if no node at that index is found\n if(currentNode === null) return null;\n // if we are at the end of the list, update the tail\n if(this.size === index) {\n currentNode.next = newNode;\n this.tail = newNode;\n } else {\n newNode.next = currentNode.next.next;\n currentNode.next = newNode;\n }\n return\n }", "insertAt(element, index){\n // fail safe to prevent adding element where\n // specified index is greater than size of list\n if (index > 0 && index > this.size){\n return false;\n } \n else {\n // creates a new node\n var node = new Node(element)\n var curr, prev;\n\n //whatever list head is at this moment\n curr = this.head;\n\n // add the element to the first index\n if (index == 0){\n\n //create pointer to next node which is null\n node.next = null;\n\n //head of node is specified element\n this.head = node;\n\n } else {\n \n curr = this.head;\n var iterate = 0;\n\n // iterate over list to find\n // the position to insert\n\n while (iterate < index){\n iterate++;\n prev = curr;\n curr = curr.next;\n }\n // adding an element\n node.next = curr;\n prev.next = node;\n }\n this.size++;\n }\n }", "insertFirst(item) {\n //create a new node item, point the head to that node \n this.head = new _Node(item, this.head);\n }", "insertFirst(data){\n this.head = new Node(data, this.head);\n }", "add(element) {\n // create a new Node\n let node = new Node(element);\n if(this.head == null) {\n this.head = node;\n } \n else {\n let current = this.head;\n // iterate to the end of the list\n while(current.next) {\n current = current.next\n }\n current.next = node;\n }\n this.size++;\n }", "push(data){\n let newNode = new Node(data);\n newNode.next = this.head;\n this.head = newNode;\n }", "addNodeAtStart(data) {\n let node = new Node(data);\n node.next = this.head;\n this.head = node;\n }", "addAt(index, data) {\n var node = new Node(data);\n\n if (index < 0 || index > this.size) {\n console.log(\"this index \" + index + \"th position is not from current list position 0 to \" + this. size);\n this.size--;\n }else if (index == 0) {\n this.addStart(data);\n this.size--;\n }else if (index == this.size) {\n this.add(data);\n this.size--;\n }else {\n var temp = this.head;\n for (var i = 0; i < index - 1; i++) {\n temp = temp.next;\n }\n\n //updating new nodes pointer to next node\n node.next = temp.next;\n //updating previous node's pointer to new node\n temp.next = node;\n }\n this.size++;\n }", "append(item){\n // add new item to end of list\n var node = new Node(item);\n var current;\n // if 1st item in LL -> make it the head...\n if (this.head === null){\n this.head = node;\n } else {\n // start at front of LL...\n current = this.head;\n // need to find last item so loop until find the very last item...\n // while(current.next){\n while(current.next !== null){\n current = current.next\n }\n // once at the last item (there is no next item) -> make the next item the node\n current.next = node;\n }\n this.length++;\n }", "insertAtEndOfList(data) {\n let temp = DLinkNode(data);\n if (!this.start) {\n this.start = temp;\n return this.start;\n }\n let p = this.start;\n while (p.next) {\n p = p.next;\n }\n temp.prev = p;\n p.next = temp;\n return this.start;\n }", "insertAt(data, index) {\n //if the index is out of range\n if (index > 0 && index > this.size) {\n return;\n }\n //if it's the first index\n if (index === 0) {\n this.head = new Node(data, this.head);\n return;\n }\n const node = new Node(data);\n let current, previous;\n\n //set current to first\n current = this.head;\n let count = 0;\n\n while (count < index) {\n previous = current; //The node before the index\n count++;\n current = current.next; //The node after teh index\n }\n\n node.next = current;\n previous.next = node;\n this.size++;\n }", "insert(data)\n { \n let newnode=new NODE(data);\n //console.log(newnode);\n if(this.rear===null && this.front===null)\n {\n this.rear=newnode;\n this.front=newnode;\n }\n else\n {\n newnode.prev=this.rear;\n this.rear.next=newnode;\n this.rear=newnode;\n }\n }", "insert_end(newnode) {\r\n let temp = this.head\r\n if (temp == null) {\r\n this.head = newnode\r\n } else {\r\n while (temp.next != null) {\r\n temp = temp.next\r\n }\r\n temp.next = newnode\r\n }\r\n }", "function ListNode(val) {\n this.val = val;\n this.next = null;\n}", "adicionarElemento(elemento){\n\n let item = new Item(elemento);\n let current = null;\n \n if(this.head === null){\n this.head = item;\n }else{\n\n current = this.head;\n\n //percorre o item atual (current) enquanto ele for verdadeiro.\n while(current.next){\n current = current.next;\n }\n\n current.next = item;\n }\n\n this.length++;\n\n }", "unshift(value) { // inserts a node at beginning of Doubly Linked List\n let node = new Node(value)\n\n if (this.length === 0) {\n this.head = node\n this.tail = node\n } else {\n this.head.prev = node\n node.next = this.head\n this.head = node\n }\n\n this.length++\n return this\n }", "addDataToFront(data) { // 10\n var newNode = new Node(data); // create a new node with the data\n newNode.next = this.head; // set the new node's next to the head\n this.head = node; // move the head to the new node\n }", "addNodeAtIndex(index, data) {\n let node = new Node(data);\n if (!this.head) {\n this.head = node;\n return;\n } else if (index === 0) {\n node.next = this.head;\n this.head = node;\n return;\n }\n let next = this.getNodeAt(index - 1);\n if (next) {\n node.next = next.next;\n next.next = node;\n }\n }", "setNode(pos, val){\r\n let curr = this.head;\r\n\r\n for(let i = 0; i < this.length; i++){\r\n if(i === pos){\r\n curr.val = val;\r\n }else{\r\n curr = curr.next;\r\n }\r\n }\r\n return undefined;\r\n }", "addToFront(node) {\n node.next = this.head; // set the new node's next to the head\n this.head = node; // move the head to the new node\n }", "insert(value) {\n this.head = new Node(value, this.head);\n }", "insertBefore(newItem, nextItem) {\n if (!this.head) {\n return null;\n }\n\n if (this.head.value === nextItem) {\n this.insertFirst(newItem);\n }\n\n let currNode = this.head;\n let previousNode = this.head;\n\n while (currNode !== null && currNode.value !== nextItem) {\n previousNode = currNode;\n currNode = currNode.next;\n }\n\n if (currNode === null) {\n console.log(\"Item not found\");\n return null;\n }\n let newNode = new _Node(newItem, previousNode.next);\n previousNode.next = newNode;\n }", "insert(value) {\n //update tail when you insert new value \n const node = {value, next:null };\n this.tail.next = node;\n this.tail = node;\n }", "function LinkedList() {\n\n\n//Create an append function\n//create a new node\n//create a variable current to track current element\n//check if the list is empty (head is null)\n//if head is null, assign node to head\n//else, assign head to current\n//while current.next exists, assign current.next to current\n//then, the final current.next = node\n//increment the length\n\n\n//create an insert method that takes a position and element as args\n//check for out of bounds position by comparing against 0 and length\n//create a new node with element\n//assign the head to a variable current to track\n//create a previos var to track the last element\n//create an index variable and set to 0\n//check if the position is equal to 0, if so set node.next to current, and head to node\n//else iterate over list while the incremented index is < position\n//set the previous to the current variable, and current to current.next\n//then set node.next to the current, and previous.next to the node\n//then increment length\n//return true\n//else return false\n\n\n\n//create a removeAt method that takes a position args\n//check for out of bounds position by checking against -1 and length\n//set current variable to head\n//create previous var for tracking and index var set to 0\n//check if position is 0, if so, set head to current.next\n//else iterate over list while incremented index < position\n//set previous to current and current to current.next\n//then set previous.next to current.next\n//then decrement length\n//return the current.element (element that was removed)\n\n}", "addStart(data) {\n var node = new Node(data);\n node.next = this.head;\n this.head = node;\n this.size++;\n }", "constructor(linkedList) {\n this.ln = linkedList;\n this.curr = null;\n this.first = true;\n }", "insert(data) {\n let newNode = new Node(data);\n newNode.next = null;\n if (this.head == null) {\n this.head = newNode;\n this.size++;\n } else {\n let node = this.head;\n while (node.next) {\n node = node.next;\n }\n node.next = newNode;\n }\n this.size++;\n }", "function insertNode(target, param) {\n var ref = param.before || param.after;\n var pnode = getParentNode(target, ref);\n var li;\n if (pnode) {\n appendNodes(target, {\n parent: pnode.target,\n data: [param.data]\n });\n li = $(pnode.target).next().children('li:last');\n } else {\n appendNodes(target, {\n parent: null,\n data: [param.data]\n });\n li = $(target).children('li:last');\n }\n if (param.before) {\n li.insertBefore($(ref).parent());\n } else {\n li.insertAfter($(ref).parent());\n }\n }", "append(data) {\n //if list is empty\n\n if (!this.tail) {\n this.head = this.tail = new Node(data);\n } else {\n let oldTail = this.tail;\n this.tail = new Node(data);\n oldTail.next = this.tail;\n this.tail.prev = oldTail;\n }\n }", "function inertStartNode() {\n let startNode = document.querySelector(\".start-node\").id;\n let splittedNode = startNode.split(\"-\")\n nodesList.push([parseInt(splittedNode[0]), parseInt(splittedNode[1])]);\n let newNode = new Node(startNode)\n newNode.setX()\n newNode.setY()\n newNode.updateType('start-node')\n newNode.setDistance(0)\n availableNodes.push(newNode)\n }", "addNode(element){\n // create a new node with value in element\n var node = new Node(element);\n var current;\n\n // if the list is empty, then add an element and make it 'head'\n if (this.head == null)\n this.head = node;\n\n // if list is not empty\n else{\n current = this.head;\n\n // iterate through the list (till the end of the list)\n while(current.next)\n // iterate (update current node to be next node)\n current = current.next;\n\n // once you've reached the end of the list, you\n // can add the node to the next of the current node\n current.next = node;\n }\n \n // increase the size of the linked list\n this.size++;\n }", "insertHead(val) {\n let node = new Node(val);\n node.next = this.head;\n this.head = node;\n // this.listLength++;\n return this;\n }", "push(element) {\n var node = new Node(element);\n //console.log('node', node);\n if (!this.head) {\n this.head = node;\n } else {\n var current = this.head;\n while (current.next) {\n current = current.next;\n }\n current.next = node;\n }\n }", "function linkedListGenerator () {\n var head = null;\n var tail = null;\n var length = 0;\n\n\n //private variables go here, below is public and returns public\n var newLinkedList = {\n //variables here are 'local' and exist only for duration of instance\n getHead: function () {\n\n return head;\n },\n\n getTail: function () {\n\n return tail;\n },\n\n add: function (x) {\n //using if and else to check if 'head' has a value since we're creating 'nodes', else == have to recreate a node if head is null\n var node = {\n value: x,\n next: null\n };\n if (head === null) {\n head = node;\n tail = node;\n length++;\n } else {\n tail.next = {\n value: x,\n next: null\n };\n length++;\n tail = tail.next;\n }\n //why out of scope? had to move var node outside if\n return node;\n },\n\n get: function (index) {\n\n var currentNode = {\n value: index,\n next: null\n };\n\n //for loop not the best option, since don't really have an index\n //stepping over: head.next; current.next; tail.next\n //step1: if current exists, set it\n //step2: determine target, e.g. if target is equal to i return current\n if (index >= head && index <= tail) {\n currentNode = head;\n\n while (currentNode++ < index) {\n currentNode = currentNode.next;\n }\n return currentNode.value;\n } else {\n return false;\n }\n },\n\n\n remove: function () {\n\n },\n\n insert: function () {\n //similar to 'add' take the current thing and add next to it\n //use 'get ()' and minus/add to determine where to move\n },\n };\n return newLinkedList;\n}", "insertAfter(item, prev) {\n let newNode = new _Node(item, null, null);\n let currNode = this.head;\n if(this.head === null) {\n this.head = newNode;\n }\n if(this.tail === null) {\n this.tail = newNode;\n }\n while (currNode.value !== prev) {\n currNode = currNode.next;\n }\n newNode.prev = currNode;\n newNode.next = currNode.next;\n currNode.next.prev = newNode;\n currNode.prev = newNode;\n console.log(newNode);\n }", "prepend(value) {\n let node = new ListNode(value);\n node.next = this.root; \n this.root = node;\n this.length++;\n }", "insert(index, value) {\n if (index >= this.length) {\n return this.append(value);\n }\n let newNode = { value: value, next: null, prev: null };\n let currentNode = this.getNode(index);\n let previousNode = this.getNode(index - 1);\n newNode.next = currentNode;\n newNode.prev = currentNode.prev;\n previousNode.next = newNode;\n currentNode.prev = newNode;\n this.length += 1;\n return this.printList();\n }", "add(data){\n let newNode = new Node(data);\n let currentNode = this.head;\n if(currentNode == null){\n this.head = newNode;\n }\n else{\n while(currentNode.next != null){\n currentNode = currentNode.next;\n }\n currentNode.next = newNode;\n }\n this.size ++;\n }", "insertFirst(data){\n // its head is a new node so it takes data and it takes a pointer\n this.head = new Node(data, this.head);\n // as we create a node we increase the size of the linked list\n this.size++;\n\n }", "copyList(node=this.head){\n let newLinkedList = new LinkedList();\n newLinkedList.head = node;\n let currentCopyNode = newLinkedList.head;\n let currentNode = this.head;\n while(currentNode.next !== null){\n currentCopyNode.next = currentNode.next;\n currentNode = currentNode.next;\n currentCopyNode = currentCopyNode.next;\n }\n return newLinkedList;\n }", "insert(index,value){\n // check params\n if(index>=this.length){\n return this.append(value);\n }\n\n const newNode = new Node(value);\n const leader = this.traverseToIndex(index-1);\n newNode.next = leader.next;\n leader.next = newNode;\n this.length++;\n\n}", "prepend(data) {\n console.log(\"prepend\", data);\n const node = new Node(data);\n if (this.head === null) {\n return (this.head = null);\n }\n node.next = this.head;\n this.head = node;\n }", "traversal() {\n //get the head node {which is the first node} and set it as current node\n let currentnode = this.head;\n //loop untill the current node is true if there is no current node exit the loop\n while (currentnode) {\n //print the value of the current node \n console.log(currentnode.val);\n //update the current node to the currentnodes next-node pointer [which is first nodes pointer to second node]\n currentnode = currentnode.next;\n }\n //return the list\n return this\n }", "add(data){\n // create new node and set its connections to the head\n let node = new Node(data,this.head, this.head.prev);\n this.head.next.prev = node;\n this.head.next = node;\n //Connect the current head to the new node\n this._size++;\n }", "_ensureLLElement(element) {\r\n let e = element;\r\n if (element instanceof LinkedListNode) {\r\n e.next = undefined;\r\n e.list = this;\r\n } else {\r\n e = new LinkedListNode(element, this, undefined);\r\n }\r\n return e;\r\n }", "function exposeSiblingNodes(exposing_nodes) {\n var d = document;\n var listNode = $element.find('.dataList')[0];\n\n // clear existing list\n while (listNode.firstChild) {\n listNode.removeChild(listNode.firstChild);\n }\n\n exposing_nodes.forEach(function (node) {\n var listElementNode = d.createElement(\"LI\");\n listElementNode.dataset.mit_tooltip = node.id;\n var imgNode = d.createElement('img');\n imgNode.src = node.img_url;\n imgNode.alt = node.id + ', ' + node.position + ', ' + node.company.name;\n imgNode.onclick = function () {\n handleMouseClickNode(node);\n };\n imgNode.addEventListener(\"mouseover\", function () {\n mouse_events.handleMouseOverNode(node, divTooltip, svg);\n });\n imgNode.addEventListener(\"mouseout\", function () {\n mouse_events.handleMouseOutNode(node, divTooltip, svg);\n });\n\n listElementNode.appendChild(imgNode);\n listNode.appendChild(listElementNode);\n })\n }", "function create(){\r\n var arraySize = parseInt(document.getElementById('arraySize').value);\r\n if(arraySize) {\r\n for(var i=0; i<arraySize; i++){\r\n array[i] = new Node(null, null);\r\n }\r\n for(var j=0; j<arraySize-1; j++){\r\n array[j].element = Math.round(Math.random() * 10);\r\n array[j].next = array[j+1];\r\n }\r\n array[arraySize-1].element = Math.round(Math.random() * 10);\r\n setArray(array);\r\n arrayStatus(true, 'Linked List created:');\r\n }\r\n else {\r\n alert('field must be fill..');\r\n }\r\n}", "generateList(number) {\n let tmpNode = new Node(0, Math.random());\n this.list = new ListItem(tmpNode);\n let p1 = this.list;\n for (let i = 1; i < number; i++) {\n tmpNode = new Node(i, Math.random());\n p1.next = new ListItem(tmpNode);\n p1 = p1.next;\n p1.key = tmpNode;\n }\n }", "addToFront(value) {\n var new_node = new ListNode(value);\n\n // if nothing is in the list\n if (this.head == null && this.tail == null) {\n this.head = new_node;\n this.tail = new_node;\n }\n\n else {\n new_node.next = this.head;\n this.head = new_node;\n }\n }", "function cloneNext(ll) {\n var curll = ll;\n while(curll) {\n curll.next = new Node(curll.value, curll.next);\n curll = curll.next.next;\n }\n\n return ll;\n\n}", "insert(value){\n if (this.head === null){\n this.head = new Node(value);\n }\n }", "function updateElement(){\r\n value = document.getElementById('element').value;\r\n var newElement = document.getElementById('newElement').value;\r\n if(value && newElement) {\r\n array = getArray();\r\n if (array.length) {\r\n array.forEach(function (node, idx) {\r\n if (value == node.element) {\r\n index = idx;\r\n }\r\n });\r\n if (index !== -1) {\r\n array.splice(index, 1, new Node(newElement, array[index + 1]));\r\n setArray(array);\r\n arrayStatus(true, 'Linked List: ');\r\n }\r\n }\r\n else {\r\n alert('Linked List not exists \\n create first..')\r\n }\r\n }\r\nelse {\r\n alert('field must be fill..');\r\n }\r\n}", "addBefore(node, data) {\n let currentNode = this.head;\n \n // if list is empty or if the first node is the \n // specified node, call addHead function\n if (currentNode === null || currentNode.data === node) {\n this.addHead(data);\n return;\n }\n \n // traverse through list until the specified\n // node is found. When found, add insert new\n // node and update next properties of the \n // surrounding nodes\n while (currentNode !== null) {\n let nextNode = currentNode.getNext();\n if (nextNode.data === node) {\n let newNode = new Node(data);\n newNode.setNext(nextNode);\n currentNode.setNext(newNode);\n newNode.setColor(this.chooseColor());\n break;\n }\n currentNode = currentNode.getNext();\n } \n this.printMessage('addBefore', data, node);\n }", "addToFront (newNode) {\n\n // check if it's empty\n if (head == null) {\n head = newNode;\n tail = newNode;\n \n } else {\n let temp = head;\n newNode.next = temp;\n head = newNode;\n\n }\n\n }" ]
[ "0.6367616", "0.63442177", "0.63405275", "0.62677336", "0.62351674", "0.6233125", "0.62290007", "0.62147605", "0.6210884", "0.619933", "0.61899394", "0.61769485", "0.61632425", "0.61616254", "0.6146706", "0.6121456", "0.6110628", "0.6109532", "0.6100239", "0.6091059", "0.6053228", "0.60513484", "0.60370606", "0.6031693", "0.6024573", "0.60046834", "0.5996841", "0.5995068", "0.59927213", "0.59783465", "0.59727955", "0.59522283", "0.59428906", "0.5921459", "0.59178656", "0.59116286", "0.589569", "0.5890927", "0.588287", "0.58771974", "0.5867316", "0.58562297", "0.58543605", "0.5849351", "0.5847764", "0.58404887", "0.5837012", "0.5835465", "0.5826821", "0.582426", "0.58222777", "0.58109444", "0.5793259", "0.57916415", "0.57863045", "0.5784877", "0.5783727", "0.5781657", "0.5778435", "0.5776369", "0.57760954", "0.5775029", "0.5774702", "0.5768402", "0.5763654", "0.57623", "0.5762154", "0.5758471", "0.5745109", "0.5744945", "0.5735702", "0.57341087", "0.57328427", "0.5726629", "0.5725376", "0.5723754", "0.57184887", "0.57174546", "0.57111067", "0.5708395", "0.57075936", "0.57050586", "0.569631", "0.5696289", "0.56927145", "0.5688786", "0.56834304", "0.56830883", "0.5682499", "0.56794506", "0.5678157", "0.5675102", "0.5674629", "0.5674436", "0.56693923", "0.56676763", "0.5667375", "0.5664067", "0.56591743", "0.5657239", "0.5654925" ]
0.0
-1
output the whole list
print() { this.pointer = this.head; while (true) { console.log(this.pointer.value) if (this.pointer.next) { this.pointer = this.pointer.next; } else { break; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "print() {\n let s = \"\"\n this.list.forEach((e) => {\n s += \"[\" + e[0] + \", \" + e[1] + \") \"\n })\n console.log(s.trim())\n }", "function printList(inputList){\n console.log(inputList.join(\" | \"));\n}", "function printList( list ) {\n var listHTML = '<ol>';\n for (var i = 0; i < list.length; i += 1) {\n listHTML += '<li>' + list[i] + '</li>';\n }\n listHTML += '</ol>';\n print(listHTML);\n }", "function updateList(){\n\tdocument.getElementById('output').innerHTML = list.print();\n}", "function displayList() {\n var output = \"\";\n console.clear();\n console.log(\"%cVotre Liste des courses contient \" + shoppingList.length + \" produit(s)\\n\" +\n \"------------------------------------------------------------\", 'color:red;font-size:18px;font-weight:bold');\n\n for (var index = 0; index < shoppingList.length; index++) {\n output += '\\t- ' + shoppingList[index] + '\\n';\n }\n\n console.log('%c' + output, 'color:blue');\n}", "function showItems(arr) {\r\n document.write('your to list has :\\n');\r\n for (let i = 0; i < arr.length; i++) {\r\n document.write(`${arr[i]} \\n`);\r\n }\r\n}", "print() {\n return console.log(\n \"Display: \" + this.list.map(num => [num]).join(\" \")\n );\n }", "printList() { }", "function outputAllItems(items) {\n for (const item of items) {\n console.log(item);\n }\n}", "printList() {\n if (this.isEmpty()) {\n console.log(\"Empty List\");\n return false;\n } else {\n let temp = this.head;\n while (temp != null) {\n process.stdout.write(String(temp.data));\n process.stdout.write(\" -> \");\n temp = temp.nextElement;\n }\n console.log(\"null\");\n return true;\n }\n }", "printList() {\n let currentNode = this.head;\n let output = \"<head> \";\n\n //iterate through the list\n while (currentNode !== null) {\n //concate node data to output list\n output += currentNode.data + \" \";\n currentNode = currentNode.getNextNode();\n }\n\n output = output + \"<tail>\";\n console.log(output);\n }", "function writeList(list) {\n writeInt(list.length);\n for (var i = 0; i < list.length; i++) {\n writeInt(list[i]);\n }\n }", "print (list) {\n var result = [];\n var currentNode = list.head;\n while (currentNode) {\n result.push(currentNode.val);\n currentNode=currentNode.next;\n }\n return result;\n }", "printList() {\r\n\t\tlet curr = this.head;\r\n\t\tlet string = \"\";\r\n\r\n\t\twhile (curr) {\r\n\t\t\tstring += curr.element + \" \";\r\n\t\t\tcurr = curr.next;\r\n\t\t}\r\n\t\tconsole.log(string);\r\n\t}", "printList() {\n let currentNode = this.head; // Set currentNode to the head\n let output = '<head> '; // Output message\n while (currentNode !== null) { // Run while there isn't a currentNode\n output += currentNode.data + ' '; // Add data of currentNode to the message\n currentNode = currentNode.getNextNode(); // Set currentNode to the following Node\n }\n output += '<tail>';\n console.log(output); // Output list data\n }", "printList() {\n var curr = _head;\n var str = \"\";\n while (curr) {\n str += curr.element + \" \";\n curr = curr.next;\n }\n console.log(str);\n }", "function display(list) {\n let currentNode = list.head;\n let output = \"\";\n \n if (!list.head) {\n return null;\n }\n while (currentNode.next !== null) {\n output += currentNode.value + \" \";\n currentNode = currentNode.next;\n }\n output += currentNode.value;\n console.log(output);\n }", "function printList(arrayList){\r\n // Pulisce la lista, prima di stamparla\r\n $('.todo-list').text('');\r\n // Preparo template di Handelbars\r\n var source = $('#todo-template').html();\r\n var template = Handlebars.compile(source);\r\n for (var i = 0; i < arrayList.length; i++) {\r\n context = {\r\n listItem: arrayList[i].text,\r\n itemId: arrayList[i].id\r\n };\r\n var html = template(context);\r\n $('.todo-list').append(html);\r\n };\r\n }", "display(list) {\n const listObj = list.head;\n console.log(JSON.stringify(listObj));\n \n }", "function writeNumbers(numbers){\n\tnumbers.forEach((element,index)=>{\n\tdocument.write(\"<li>\"+element+\"</li>\");\n\t})\n}", "printList() {\n var curr = this.head;\n var str = \"\";\n while (curr) {\n str += curr.data + \"-->\";\n curr = curr.next;\n }\n console.log(str);\n }", "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 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 outputItems() {\n let html = '';\n const output = document.getElementById('text'); /* Points to h1 tag */\n\n for (let x = 0; x < values.length; x++) {\n html += (x + 1) + '. ' + values[x] + '<br>'; /* Output index value + corresponding item for each iteration */\n }\n output.innerHTML = html;\n }", "function gotList(thelist) {\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}", "printList() \n { \n let curr = this.#_head; \n let str = \"[ \"; \n while (curr!=null) { \n str += curr.data.Value+ \", \"; //.Value \n curr = curr.next; \n } \n str+=\"]\"\n console.log(str); \n }", "function arrayOutput(a) {\n\t\tfor (var i=0; i<a.length; i++) {\n\t\t\tdocument.writeln(a[i]+'<br>');\n\t\t}\n\t}", "printList() {\n let curr = this.head;\n let str = \"\";\n while (curr) {\n str += curr.element + \" \";\n curr = curr.next;\n }\n console.log(str);\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}", "printList(){\n // initialize current as the head node of the list\n var current = this.head;\n // empty string\n var string = \"\";\n \n // iterating through the list (till the end of the list)\n while(current){\n // append the value of current element to the string\n string += current.element + \" \";\n current = current.next;\n }\n console.log(string);\n }", "function printList() {\n let i = 0;\n while (i < todos.length) {\n printTodo(todos[i]);\n i = i + 1;\n }\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}", "printList1() {\n var curr = this.head;\n var str = \"\";\n while (curr) {\n str += curr.data + \" \";\n curr = curr.next;\n }\n return str;\n }", "function output () {\n\tif (++processed < file_list.length){\n\t\treturn; // still more jobs todo.\n\t}\n\t\t// DO OUTPUT\n\t\tvar s/*eparater*/ = \", \";\n\t\tconsole.log(\"Generation, Average, Best, Worst\");\n\t\tgens.forEach(function (gen, index) {\n\t\t\tgen.average /= file_list.length;\n\t\t\tgen.best /= file_list.length;\n\t\t\tgen.worst /= file_list.length;\n\t\t\tconsole.log(index +s+ gen.average +s+ gen.best +s+ gen.worst);\n\t\t});\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}", "print_list() {\n let result = \"\";\n let temp = this;\n while (temp !== null) {\n result += temp.value + \" \"\n temp = temp.next;\n }\n console.log(result);\n }", "printList() \n { \n var curr = this.head; \n var str = \"\"; \n while (curr) { \n str += curr.element + \" \"; \n curr = curr.next; \n } \n console.log(str); \n }", "printListPretty() {\n \tconst array = [];\n \tlet currentNode = this.head;\n \twhile(currentNode !== null) {\n \t\tarray.push(currentNode.value);\n \t\tcurrentNode = currentNode.next;\n \t}\n \treturn array.join('->');\n }", "printList() {\n let current = this.head;\n while (current) {\n console.log(current.data + \" \");\n current = current.next;\n }\n }", "function listAll() {\n var str = \"\";\n for (i in starterCheer) {\n str += `${i} ` + starterCheer[i] + \"\\n\";\n }\n return str;\n}", "displayAllThings (allThings) {\n\n let outputAll = '<h3> Available Things: </h3>';\n for (let i = 0; i< allThings.length; i++) {\n\n _name = allThings[i].Thing_name\n _uid = allThings[i].Thing_UID\n _status = allThings[i].Thing_status\n\n outputAll +=\n ` <ul>\n <li> <b>---- Thing ${i+1} </b> </li>\n <li> <b> Thing- Name </b>: ${_name} </li>\n <li> <b>Thing- UID </b>: ${_uid} </li> \n <li> <b>Thing- Status </b>: ${_status} </li> \n </ul> \n `\n } \n document.getElementById ('outputAll').innerHTML = outputAll;\n }", "function BOT_printSimpleList(l,empty,prolog) {\r\n\tif(l.length == 0) return (empty); \r\n\tvar s = prolog;\r\n\tfor(var i in l) { s = s + l[i] + \"; \" }\r\n\treturn s;\r\n}", "function outputUsers(users){\n userlist.innerHTML = `\n ${users.map(user => `<li>${user.username}</li>`).join(\"\")}\n `\n}", "print(){\n var str = \"\";\n for(var i = 0; i < this.items.length; i++){\n str += this.items[i].element + \" \";\n }\n return str; \n }", "function outputUsers(users){\n userList.innerHTML=`\n ${users.map(user => `<li>${user.username}</li>`).join(\"\")}`;\n}", "printList() {\n let curr = this.head, str = \"\"\n while(curr) {\n str += curr.value + (curr.next && \" -> \")\n curr = curr.next\n }\n console.log(str)\n }", "function printListItems(list, config, indentation, depth, refs, printer) {\n var result = '';if (list.length) {\n result += config.spacingOuter;var indentationNext = indentation + config.indent;for (var i = 0; i < list.length; i++) {\n result += indentationNext + printer(list[i], config, indentationNext, depth, refs);if (i < list.length - 1) {\n result += ',' + config.spacingInner;\n } else if (!config.min) {\n result += ',';\n }\n }result += config.spacingOuter + indentation;\n }return result;\n } // Return properties of an object", "function gotList(thelist) {\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}", "function printList (arr) {\n console.log('***********')\n arr.forEach(function (item) {\n console.log(item)\n })\n console.log('***********')\n}", "printList()\n{\n var curr = this.head;\n var str = \"\";\n while (curr) \n {\n str += curr.element + \" \";\n curr = curr.next;\n }\n console.log(str);\n return str\n}", "printList()\n{\n var curr = this.head;\n var str = \"\";\n while (curr) \n {\n str += curr.element + \" \";\n curr = curr.next;\n }\n console.log(str);\n return str\n}", "printList()\n{\n var curr = this.head;\n var str = \"\";\n while (curr) \n {\n str += curr.element + \" \";\n curr = curr.next;\n }\n console.log(str);\n return str\n}", "function _list() {\r\n\t\tvar len = _events.length,\r\n\t\t\ti, out = '';\r\n\t\tfor (i = 0; i < len; i += 1) {\r\n\t\t\tout += _events[i].name + ' ' + _events[i].time + '\\n';\r\n\t\t}\r\n\t\tconsole.log(out);\r\n\t}", "printList() {\n // Use template strings to make string concatenation easier\n console.log(`\\n${this.name} ( ${this.items.length} items) \\n-------------------- `);\n // Introduce arrow function\n // Use desconstruction in the function parameter list to extract\n // the values to be used.\n this.items.forEach((item) => item.printThis());\n }", "function outputUsers(users){\n userList.innerHTML=`\n ${users.map(user=>`<li>${user.username}</li>`).join('')}\n `\n}", "function showArray(elements, customText = \"\"){ \n document.write(\"<h1>Content of array \"+customText+\"</hl>\"); \n document.write(\"<ul>\"); \n elements.forEach((element, index) => { \n document.write(\"<li>\"+element+\"</li><br/>\"); \n }); \n document.write(\"</ul>\"); \n}", "print(){\n let current = this.head;\n let str = \"\";\n while(current){\n str += `${current.element} `;\n current = current.next;\n }\n return str.trim();\n }", "print() {\n let current;\n let linkliststr = '';\n if (this.head === null) {\n console.log('List Empty');\n } else {\n current = this.head;\n while (current !== null) {\n linkliststr += `${current.value}->`;\n current = current.next;\n }\n }\n console.log(linkliststr + 'null');\n }", "function outputUsers(users){\n userList.innerHTML = `\n ${users.map(user =>`\n <li>\n ${user.username}\n </li>\n `).join('')\n}`;\n}", "function outputUsers(users){\n userList.innerHTML= `\n ${users.map(user =>`<li>${user.username}</li>`).join('')}\n `;\n}", "function outputUsers(users){\n userList.innerHTML = `\n ${users.map(user => `<li>${user.username}</li>`).join('')}\n `;\n}", "show () {\n\t\tlet list = [];\n\t\tlet head = this.head;\n\t\twhile (head) {\n\t\t\tlist.push(head.data);\n\t\t\thead = head.next;\n\t\t}\n\t\treturn list;\n\t}", "function printList(portList) {\n for (var i = 0; i < portList.length; i++) {\n console.log(i + \" \" + portList[i]);\n }\n}", "function outputUsers(users) {\n userList.innerHTML = `\n ${users.map(user => `<li>${user.username}</li>`).join('')}`;\n}", "function printValues(list) {\n var str = '';\n\n function rec() {\n\n str = str + list.value + ', ';\n if (list.next) {\n list = list.next;\n rec();\n }\n }\n rec();\n\n str = str.slice(0, (str.length - 2));\n console.log(str);\n return str;\n}", "print() {\n let runner = this.head;\n let vals = \"\";\n\n while (runner) {\n vals += `${runner.data}${runner.next ? \", \" : \"\"}`;\n runner = runner.next;\n }\n console.log(vals);\n return vals;\n }", "print() {\n let cur = this.head;\n let answer = \"\";\n while (cur != null) {\n answer += cur.data + \" \";\n cur = cur.next;\n }\n console.log(answer);\n }", "function displayAll(all) {\n showAllNode.innerHTML = all.map(person => `<p>${person.name}</p>`).join(\"\")\n}", "function outputUsers(users) {\n userList.innerHTML = `\n ${users.map(user => `<li>${user.username}</li>`).join(\"\")}\n `;\n}", "function outputUsers(users) {\r\n userList.innerHTML = `\r\n ${users.map((user) => `<li>${user.username}</li>`).join(\"\")}\r\n `;\r\n}", "function outputUsers(users) {\n userList.innerHTML = `\n ${users.map(user => `<li>${user.username}</li>`).join('')}\n `;\n}", "function outputUsers(users) {\n userList.innerHTML = '';\n users.forEach(user=>{\n const li = document.createElement('li');\n li.innerText = user.username;\n userList.appendChild(li);\n });\n }", "function outputUsers(users) {\n userList.innerHTML = '';\n users.forEach(user=>{\n const li = document.createElement('li');\n li.innerText = user.username;\n userList.appendChild(li);\n });\n }", "function outputUsers(users) {\n userList.innerHTML = '';\n users.forEach(user=>{\n const li = document.createElement('li');\n li.innerText = user.username;\n userList.appendChild(li);\n });\n }", "function 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}", "function listLoop(userList) {\r\n for (let i = 0; i < userList.length; i++) {\r\n console.log(userList[i]);\r\n }\r\n}", "function list (){\n // the loop I have here is accessing my `printFamily` and then `iterating` through each object in the `family array` \n for (var i = 0; i < family.length; i++){\n printFamily(family[i]);\n }\n}", "function printshowItems() {\n seanBeanShows.forEach(function(show) {\n console.log(show);\n });\n}", "print() {\r\n // TODO: implement this\r\n if (this.rangeList) {\r\n let printArr = [];\r\n var i, \r\n length = this.rangeList.length;\r\n\r\n for ( i = 0; i < length; i++ ) {\r\n if (i % 2 === 0) {\r\n printArr.push(`[${this.rangeList[i]},`);\r\n } else {\r\n printArr.push(`${this.rangeList[i]})`)\r\n }\r\n }\r\n console.log(printArr.join(\" \"));\r\n } else {\r\n console.log(\"Range list is undefined\")\r\n }\r\n }", "function stringifyList(inputList) {\n var printList = \"\";\n printList = inputList.name + \" (\" + inputList.type + \") [\" + inputList.color + \"] - \";\n var i = 0;\n for (i = 0; i < inputList.sites.length; i += 1) {\n printList += inputList.sites[i];\n printList += \", \";\n }\n return printList;\n}", "showLists() {\n return toIndexArray(this.lists)\n .map(listIdx => (\n <p key={`p-${listIdx}`}>List #{listIdx + 1}:\n {\n ' ' + toIndexArray(this.lists[listIdx])\n .map(itemIdx => `(${this.lists[listIdx][itemIdx]}, ${this.weights[listIdx][itemIdx]})`)\n .join(', ')\n }\n </p>\n ));\n }", "function outputUsers(users) {\n userList.innerHTML = '';\n users.forEach((user) => {\n const li = document.createElement('li');\n li.innerText = user.username;\n userList.appendChild(li);\n });\n}", "function exportList() {\n\t\tvar string;\n\n\t\t//save stuff to string\n\t\t//the title\n\t\tstring = '<p>' + $('#list-title').text() + '</p>';\n\t\tstring += '<p>' +$('#list-desc').text() + '</p>';\n\n\t\t//the list items\n\t\tfor (var i = 0; i < $('.item').length; i++) {\n\t\t\tstring += '<p>' + (i + 1) + '. ' + $('.item').eq(i).find('.title-individual').text() + '<br>';\n\t\t\tstring += $('.item').eq(i).find('.notes').text() + '<br>';\n\t\t\tstring += ' [ ';\n\t\t\tvar classes = $('.item').eq(i).attr('class');\n\t\t\tif (classes.indexOf(\"deleted\") != -1) {\n\t\t\t\tstring += 'archived ';\n\t\t\t}\n\t\t\tif (classes.indexOf(\"completed\") != -1) {\n\t\t\t\tstring += 'completed ';\n\t\t\t}\n\t\t\tif (classes.indexOf(\"not-completed\") != -1) {\n\t\t\t\tstring += 'not completed ';\n\t\t\t}\n\t\t\tstring += ']';\n\t\t\tstring += '</p>';\n\t\t}\n\n\t\t//now show the entire list in a popup for someone to copy and paste\n\t\t$('#export-data').html(string);\n\t\t$('.export').fadeIn(300);\n\t}", "function listLoop(userList){\n for (var i=0; i < userList.length; i++) {\n console.log(userList[0]);\n }\n}", "function display(ll) {\n console.log(JSON.stringify(ll));\n}", "function output(item, index) {\n console.log(index+':'+item);\n}", "function outputUsers(users) {\r\n userList.innerHTML = '';\r\n users.forEach((user) => {\r\n const li = document.createElement('li');\r\n li.innerText = user.username;\r\n userList.appendChild(li);\r\n });\r\n}", "function outputUsers(users) {\n const userList = document.getElementById('users');\n \n userList.innerHTML = `\n ${users.map(user => `<li>${user.username}</li>`).join('')}\n `;\n}", "print() {\n\t\tlet current = this.head;\n\t\tlet string = \"\";\n\t\twhile(current) {\n\t\t\tstring += current.element + \"->\";\n\t\t\tcurrent = current.next;\n\t\t}\n\t\tconsole.log(string);\n\t}", "print() {\n console.log(this.items);\n }", "printList() {\n let arr = [];\n let current = this.head;\n while (current) {\n arr.push(current.data);\n current = current.next;\n }\n console.log(arr);\n }", "print() {\n let current = this.head;\n while (current) {\n console.log(current.data);\n current = current.next;\n }\n }", "function outputList(head) {\n let pointer = head;\n while (true) {\n console.log(pointer.value)\n if (pointer.next) {\n pointer = pointer.next;\n } else {\n break;\n }\n }\n}", "function display(ll){\n let currNode = ll.head;\n let output = 'head->';\n while (currNode !== null){\n output += `${currNode.value}->`;\n currNode = currNode.next;\n }\n output += 'null';\n console.log(output);\n return output;\n}", "function outputUsers(users) {\n userList.innerHTML = `<ul>\n ${users.map(user => `<li>${user.username}</li>`).join('')}\n </ul>`;\n}", "printListData(){\n let current = this.head;\n while(current){\n console.log(current.data);\n current = current.next;\n }\n }", "printListData() {\n let current = this.head;\n while(current) {\n console.log(current.data);\n current = current.next;\n }\n }", "printListData() {\n let current = this.head;\n while (current) {\n console.log(current.data);\n current = current.next;\n }\n }", "function outputUsers(users){\n userList.innerHTML = `\n ${users.map(user=>`<h6>${user.username}</h6>`).join('')}\n `;\n}", "function displayList(list) {\n let currNode = list.head;\n while (currNode !== null) {\n console.log(currNode.value);\n currNode = currNode.next;\n }\n}", "function printList(portList) {\n for (var i = 0; i < portList.length; i++) {\n // Display the list the console:\n println(i + \" \" + portList[i]);\n }\n}" ]
[ "0.71806157", "0.7161504", "0.7050791", "0.6943736", "0.6901646", "0.6869288", "0.68383664", "0.6796317", "0.6777125", "0.67752", "0.67587954", "0.66958815", "0.66811985", "0.66723055", "0.6627805", "0.65750843", "0.6549527", "0.6524592", "0.6451126", "0.6438901", "0.6421504", "0.6415257", "0.6407166", "0.6406645", "0.64013994", "0.638617", "0.6385707", "0.6330872", "0.6327268", "0.6326112", "0.63239795", "0.6321138", "0.63181216", "0.6280827", "0.62668973", "0.62649775", "0.6259281", "0.624833", "0.62271917", "0.6222393", "0.6183589", "0.6134061", "0.6115724", "0.6105975", "0.6094343", "0.6078346", "0.60730517", "0.60677916", "0.6058419", "0.60523134", "0.60523134", "0.60523134", "0.6052286", "0.60342795", "0.6033552", "0.6032761", "0.60320354", "0.6029451", "0.60280406", "0.6027424", "0.6020966", "0.60079736", "0.6002568", "0.599599", "0.59956944", "0.598294", "0.59790754", "0.597888", "0.597599", "0.5973506", "0.59686375", "0.59685355", "0.59685355", "0.59685355", "0.596329", "0.5957664", "0.5940192", "0.5939809", "0.593701", "0.59353185", "0.5930432", "0.59298253", "0.5929744", "0.59247804", "0.59161174", "0.5913609", "0.59046334", "0.5903831", "0.59036195", "0.5900647", "0.589914", "0.5894111", "0.5892179", "0.5867073", "0.5860878", "0.58604217", "0.5860297", "0.58579856", "0.58553183", "0.58434165", "0.5817126" ]
0.0
-1
Keep track of the active TextEditor, because when single clicking a file from the treeview, atom.workspace.getEditor() returns undefined
subscribeToFileOpen() { return atom.workspace.onDidOpen(event => { this.activeEditor = event.item; }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _onEditorChanged() {\n\t\t_close();\n\t\tcurrentEditor = EditorManager.getCurrentFullEditor();\n\n\t\tcurrentEditor.$textNode = $(currentEditor.getRootElement()).find(\".CodeMirror-lines\");\n\t\tcurrentEditor.$textNode = $(currentEditor.$textNode.children()[0].children[3]);\n\t\tcurrentEditor.$numbersNode = $(currentEditor.getRootElement()).find(\".CodeMirror-gutter-text\");\n\n\t\t\n\t}", "function activeEditor() {\n let editor = atom.workspace.getActiveTextEditor();\n const editorView = atom.views.getView(editor);\n const className = \"vim-mode-plus-search-input-focused\";\n if (editorView.classList.contains(className)) {\n const allEditors = atom.textEditors.editorsWithMaintainedConfig;\n allEditors.forEach(e => {\n if (e.mini) {\n editor = e;\n return false;\n }\n });\n }\n return editor;\n}", "getFocusedEditor() {\n if (this.general && this.general.isFocused())\n return Promise.resolve(this.general.getModel());\n if (this.connection.isAvailable()) {\n return this.connection.access().then(editor => {\n if (editor.isFocused())\n return editor.getModel();\n else\n return this.main;\n });\n }\n else {\n return Promise.resolve(this.main);\n }\n }", "reload() {\n this.editor = atom.workspace.getActiveTextEditor();\n }", "get editor() {\n return this._editor;\n }", "get editor() {\n return this._editor;\n }", "function getCurrentEditorInstance() {\n let editor;\n const current_tool_mode =\n ss.getFromObject('editor_scratch', 'current_tool_mode');\n if (current_tool_mode === 'mesh_edit_mode') {\n return mesh_editor;\n }\n else if (current_tool_mode === 'curve_mode') {\n return mesh_editor.getCurvedDeformerLine();\n }\n else {\n throw Error('Unknown tool mode: ' + current_tool_mode);\n }\n }", "function getCurrentFullEditor() {\n // This *should* always be equivalent to DocumentManager.getCurrentDocument()._masterEditor\n return _currentEditor;\n }", "get WindowsEditor() {}", "makeActive() {\n const { activeFile, editor, switchFile } = editorManager;\n if (activeFile?.id === this.id) return;\n\n activeFile?.removeActive();\n switchFile(this.id);\n\n if (this.focused) {\n editor.focus();\n } else {\n editor.blur();\n }\n\n this.#upadteSaveIcon();\n this.#tab.classList.add('active');\n this.#tab.scrollIntoView();\n if (!this.loaded && !this.loading) {\n this.#loadText();\n }\n\n editorManager.header.subText = this.#getTitle();\n\n this.#emit('focus', createFileEvent(this));\n }", "function handleTextEditorChange(event) {\n if(isStorytellerCurrentlyActive) {\n //path to the file that is being edited\n const filePath = event.document.fileName;\n\n //if the file being edited is in the tracked st project\n if(filePath.startsWith(vscode.workspace.workspaceFolders[0].uri.fsPath) === true) {\n //go through each of the changes in this change event (there can \n //be more than one if there are multiple cursors)\n for(let i = 0;i < event.contentChanges.length;i++) {\n //get the change object\n const change = event.contentChanges[i];\n \n //if no text has been added, then this is a delete\n if(change.text.length === 0) {\n //get some data about the delete\n const numCharactersDeleted = change.rangeLength;\n const deleteTextStartLine = change.range.start.line;\n const deleteTextStartColumn = change.range.start.character;\n \n //record the deletion of text\n projectManager.handleDeletedText(filePath, deleteTextStartLine, deleteTextStartColumn, numCharactersDeleted);\n } else { //new text has been added in this change, this is an insert\n //if there was some text that was selected and replaced \n //(deleted and then added)\n if(change.rangeLength > 0) {\n //get some data about the delete\n const numCharactersDeleted = change.rangeLength;\n const deleteTextStartLine = change.range.start.line;\n const deleteTextStartColumn = change.range.start.character;\n\n //first delete the selected code (insert of new text to follow)\n projectManager.handleDeletedText(filePath, deleteTextStartLine, deleteTextStartColumn, numCharactersDeleted);\n } \n \n //get some data about the insert\n const newText = change.text;\n const newTextStartLine = change.range.start.line;\n const newTextStartColumn = change.range.start.character;\n \n //a set of all the event ids from a copy/cut\n let pastedInsertEventIds = [];\n\n //if this was a paste\n if(clipboardData.activePaste) { \n //if the new text is exactly the same as what was on our clipboard\n if(newText === clipboardData.text) {\n //store the pasted event ids\n pastedInsertEventIds = clipboardData.eventIds;\n } else { //this is a paste but it doesn't match the last storyteller copy/cut (pasted from another source)\n //create an array of strings with 'other' for the paste event ids to signify a paste from outside the editor\n pastedInsertEventIds = newText.split('').map(() => 'other');\n\n //clear out any old data\n clipboardData.text = '';\n clipboardData.eventIds = [];\n }\n\n //we handled the most current paste, set this back to false\n clipboardData.activePaste = false;\n }\n //record the insertion of new text\n projectManager.handleInsertedText(filePath, newText, newTextStartLine, newTextStartColumn, pastedInsertEventIds);\n }\n }\n }\n }\n}", "function updateEditor() {\n\t\ttextToEditor();\n\t\tpositionEditorCaret();\n\t}", "edit() {\n const { alert } = Nullthrows(this.props.dialogService);\n const { terminal } = Nullthrows(this.props.directoryService);\n const { unescape } = Nullthrows(this.props.uriService);\n\n const editor = this.env.EDITOR;\n\n if (!editor) {\n alert(`You have to define EDITOR environment variable.`);\n return;\n }\n\n const file = this.getCursor();\n const match = /^file:\\/\\/(.+)/.exec(file.uri);\n\n if (!match) {\n alert(`${file.uri} is not local.`);\n return;\n }\n\n terminal([\"-e\", editor, unescape(match[1])]);\n }", "function TextEditor(editor) {\n\tthis.editor = editor;\n\tthis.aceEditor = null;\n\tthis.state = 0;\n\tthis.xmlEditorDiv = null;\n\tthis.xmlContent = null;\n\tthis.selectedTagRange = null;\n\tthis.resetSelectedTagRange();\n\tthis.active = false;\n\tthis.tagRegex = /<(([a-zA-Z0-9\\-]+:)?([a-zA-Z0-9\\-]+))( |\\/|>|$)/;\n}", "function TextEditor() {}", "get OSXEditor() {}", "function checkActiveEditor() {\n const editor = vscode.window.activeTextEditor;\n if (!editor) {\n vscode.window.showInformationMessage('Cannot generate unit tests. No editor selected.');\n return;\n }\n if (!editor.document.fileName.endsWith('.go')) {\n vscode.window.showInformationMessage('Cannot generate unit tests. File in the editor is not a Go file.');\n return;\n }\n if (editor.document.isDirty) {\n vscode.window.showInformationMessage('File has unsaved changes. Save and try again.');\n return;\n }\n return editor;\n}", "_editorChange(e,deselect=!1){let root=this,editorChange=root.editor!==e.detail.editor,toolbarChange=root.toolbar!==e.detail.toolbar;if(deselect||editorChange||toolbarChange){let sel=window.getSelection();sel.removeAllRanges();root.editor=e.detail.editor;root.toolbar=e.detail.toolbar;if(root.observer)root.observer.disconnect();if(!deselect&&e.detail.editor){root.observer=new MutationObserver(evt=>{root.range=root.getRange()});root.observer.observe(e.detail.editor,{attributes:!1,childList:!0,subtree:!0,characterData:!1})}}}", "showEditor(path, selection) {\n if (!path) path = store.file?.path\n // TODO: selection!!!!\n try {\n navigate(new SpellLocation(path).editorUrl)\n store.compileApp()\n } catch (e) {\n store.showError(`Path '${path}' is invalid!`)\n }\n }", "get editorTextField() {\n return this.i.js;\n }", "switchToTextualEditor({openTabsCode = [], closeCurrentTabs = false}) {\n // Turn off simulator\n if (DwenguinoBlockly.simulatorState !== \"off\") {\n DwenguinoBlockly.toggleSimulator();\n $(\"#db_menu_item_simulator\").css(\"pointer-events\", \"none\");\n }\n DwenguinoBlockly.currentProgrammingContext = \"text\";\n document.getElementById(\"blocklyDiv\").style.visibility = \"hidden\";\n document.getElementById(\"db_code_pane\").style.visibility = \"visible\";\n if (closeCurrentTabs) {\n DwenguinoBlockly.textualEditor.getEditorPane().closeTabs(false);\n }\n DwenguinoBlockly.setOpenTextualEditorTabs(openTabsCode);\n DwenguinoBlockly.saveState();\n }", "clearActiveEditor() {\n this.activeEditor = void 0;\n }", "formatActiveTextEditor() {\n if ((editor = atom.workspace.getActiveTextEditor())) {\n if (editorHelper.hasElixirGrammar(editor)) {\n this.formatTextEditor(editor, editorHelper.getSelectedRange(editor));\n } else {\n atom.notifications.addInfo(\n \"Elixir Formatter only formats Elixir source code\",\n { dismissable: false }\n );\n }\n }\n }", "function selectedText(editor) {\n restoreRange(editor);\n return getSelection(editor).toString();\n }", "getProgramFromEditor() {\n return this.editorArea.getDoc().getValue()\n }", "function getSelection(editor) {\n //if (ie) return editor.doc.selection;\n return editor.$frame[0].contentWindow.getSelection();\n }", "getEditorContent() {\n if (this.settingsEngine.has('editor.content')) {\n return this.settingsEngine.get('editor.content');\n }\n\n return this.editorDefaultContent;\n }", "function onLoad(){\n\t$(\"#project_panel\").height($(window).height()*0.97);\n\tvar myTextArea = document.getElementById('myText');\n\tmyCodeMirror = CodeMirror.fromTextArea(myTextArea,{\n\t\tlineNumbers: true,\n\t mode: \"javascript\"\n\t});\n\tmyCodeMirror.setSize($(window).width() - myCodeMirror.left, $(window).height()*0.97);\n\t$(\"#context_menu\").hide();\n\t$(\"#intel_box\").hide();\n\t$(\"#new_file\").click(function(){\n\t\tvar path = full_path(selected_element);\n\t\tconsole.log(\"creating a new file in \" + path);\n\t\tnew_file(path);\n\t});\n\t$(\"#new_folder\").click(function(){\n\t\tvar path = full_path(selected_element);\n\t\tconsole.log(\"creating a new folder in \" + path);\n\t\tnew_folder(path);\n\t});\n\t$(\"#rename\").click(function(){rename();});\n\t$(\"#delete\").click(function(){remove();});\n\t$(\"#input_box\").hide();\n\t$(\"#input_box\").css({\n\t\tleft:$(window).width()/2 - $(\"#input_box\").width()/2,\n\t\ttop:$(window).height()/2 + $(\"#input_box\").height()/2\n\t});\n\t$(\"#new_proj\").click(function(){\n\t\tnew_project();\n\t});\n\t$(\"#edit_proj\").click(function(){ \n\t\t//working on it\n\t});\n\t$(\"#run_proj\").click(function(){\n\t\trun_mode();\n\t});\n\t\n\tmyCodeMirror.setOption(\"extraKeys\", {\"Up\":function(){\n\t\tif(intel_active) // logic to decide whether to move up or not\n\t\t{\n\t\t\tmove_selection(-1);\n\t\t\treturn CodeMirror.PASS;//prevent default action\n\t\t}\n\t\telse myCodeMirror.execCommand(\"goLineUp\");\n\t},\n\t\"Down\":function(){\n\t\tif(intel_active) // logic to decide whether to move up or not\n\t\t{\n\t\t\tmove_selection(1);\n\t\t\treturn CodeMirror.PASS;//prevent default action\n\t\t}\n\t\telse myCodeMirror.execCommand(\"goLineDown\");\n\t},\n\t\"Enter\":function(){\n\t\tif(intel_active) // logic to decide whether to move up or not\n\t\t{\n\t\t\treturn CodeMirror.PASS;//prevent default action\n\t\t}\n\t\telse myCodeMirror.execCommand(\"newlineAndIndent\");\n\t}});\n}", "editorTextChange(e) {\n this.props.editorTextChange( document.getElementById('editor').value );\n }", "get LinuxEditor() {}", "function focused(editor)\n\t{\n return focusObj;\n }", "getSelectedText() {\n return window.getSelection().toString();\n }", "function focusEditor() {\n if (_currentEditor) {\n _currentEditor.focus();\n }\n }", "function helloEditor2 (editor) {\n const showOpenFileDialog = true\n const currentFile = editor.document.fileName\n const currentText = editor.document.getText()\n const parenModeResult = parinfer.parenMode(currentText)\n const parenModeSucceeded = parenModeResult.success === true\n const parenModeText = parenModeResult.text\n const textDelta = util.linesDiff(currentText, parenModeText)\n const parenModeChangedFile = parenModeSucceeded && textDelta.diff !== 0\n\n if (!parenModeSucceeded && showOpenFileDialog) {\n window.showInformationMessage(parenModeFailedMsg(currentFile), 'Ok')\n .then((btn) => {\n if (btn === 'Ok') {\n editorStates.update((states) => states.set(editor, 'PAREN_MODE'))\n }\n })\n } else if (!parenModeSucceeded && !showOpenFileDialog) {\n editorStates.update((states) => states.set(editor, 'PAREN_MODE'))\n } else if (parenModeChangedFile && showOpenFileDialog) {\n window.showInformationMessage(parenModeChangedFileMsg(currentFile, textDelta.diff), 'Yes', 'No')\n .then((btn) => {\n if (btn === 'Yes') {\n editor.edit((edit) => {\n edit.replace(editorModule.getEditorRange(editor), parenModeText)\n })\n const activeState = config.useSmartMode ? 'SMART_MODE' : 'INDENT_MODE'\n editorStates.update((states) => states.set(editor, activeState))\n }\n })\n } else if (parenModeChangedFile && !showOpenFileDialog) {\n editor.edit((edit) => {\n edit.replace(editorModule.getEditorRange(editor), parenModeText)\n })\n const activeState = config.useSmartMode ? 'SMART_MODE' : 'INDENT_MODE'\n editorStates.update((states) => states.set(editor, activeState))\n } else {\n let defaultMode = workspace.getConfiguration('parinfer').get('defaultMode')\n editorStates.update((states) => states.set(editor, defaultMode))\n }\n}", "runSelection () {\n var editor = atom.workspace.getActiveTextEditor()\n\n if (editor && editor.getGrammar().scopeName === 'source.matlab') {\n if (MatlabEditor.checkSessionStatus()) {\n // Get the selected text\n var selectionText = ''\n var selections = editor.getSelections()\n\n if (selections.length !== 0) {\n for (let i = 0; i < selections.length; i++) {\n selectionText = selectionText + selections[i].getText()\n }\n\n // Create a temporary file\n MatlabEditor.tmpFileName = tmp.tmpNameSync({ prefix: 'AME_', postfix: '.m' })\n MatlabEditor.tmpFileName = MatlabEditor.cleanFileName(MatlabEditor.tmpFileName)\n fs.writeFile(MatlabEditor.tmpFileName, selectionText, (err) => {\n if (err) {\n console.log('[Atom Matlab Editor] TMP: ' + err.message)\n }\n })\n\n // Execute the file in Matlab\n var currentDate = MatlabEditor.getCurrentDate()\n\n MatlabEditor.provider.add(currentDate + ' Running selection')\n MatlabEditor.executeText(MatlabEditor.tmpFileName, '2')\n }\n } else {\n atom.notifications.addError('Unavailable Matlab Session',\n { stack: '', detail: 'Unable to connect to MATLAB session.\\nType \"matlab.engine.shareEngine(\\'AtomMatlabEngine\\')\" in your Matlab instance.', dismissable: true })\n }\n }\n }", "set WindowsEditor(value) {}", "function sympalHandleTinyMCEEvent(e)\n{\n if (e.type == 'click')\n {\n currentlyFocusedSympalEditor = $('#' + tinyMCE.activeEditor.id);\n }\n}", "isEditor(value) {\n if (!isPlainObject(value)) return false;\n var cachedIsEditor = IS_EDITOR_CACHE.get(value);\n\n if (cachedIsEditor !== undefined) {\n return cachedIsEditor;\n }\n\n var isEditor = typeof value.addMark === 'function' && typeof value.apply === 'function' && typeof value.deleteBackward === 'function' && typeof value.deleteForward === 'function' && typeof value.deleteFragment === 'function' && typeof value.insertBreak === 'function' && typeof value.insertFragment === 'function' && typeof value.insertNode === 'function' && typeof value.insertText === 'function' && typeof value.isInline === 'function' && typeof value.isVoid === 'function' && typeof value.normalizeNode === 'function' && typeof value.onChange === 'function' && typeof value.removeMark === 'function' && (value.marks === null || isPlainObject(value.marks)) && (value.selection === null || Range.isRange(value.selection)) && Node.isNodeList(value.children) && Operation.isOperationList(value.operations);\n IS_EDITOR_CACHE.set(value, isEditor);\n return isEditor;\n }", "function _onCurrentDocumentChange() {\n var doc = DocumentManager.getCurrentDocument(),\n container = _editorHolder.get(0);\n \n var perfTimerName = PerfUtils.markStart(\"EditorManager._onCurrentDocumentChange():\\t\" + (!doc || doc.file.fullPath));\n\n // Remove scroller-shadow from the current editor\n if (_currentEditor) {\n ViewUtils.removeScrollerShadow(container, _currentEditor);\n }\n \n // Update the UI to show the right editor (or nothing), and also dispose old editor if no\n // longer needed.\n if (doc) {\n _showEditor(doc);\n ViewUtils.addScrollerShadow(container, _currentEditor);\n } else {\n _showNoEditor();\n }\n\n\n PerfUtils.addMeasurement(perfTimerName);\n }", "openSelection () {\n var editor = atom.workspace.getActiveTextEditor()\n\n if (editor && editor.getGrammar().scopeName === 'source.matlab') {\n if (MatlabEditor.checkSessionStatus()) {\n // Get the selected text\n var selections = editor.getSelections()\n\n if (selections.length !== 0) {\n // Considering only the first selected token\n var selectionText = selections[0].getText()\n\n // runCommand callback\n var clbk = (code) => {\n if (code === 0 && MatlabEditor.lastOutput.slice(0, 1) !== '\\'') {\n atom.workspace.open(MatlabEditor.lastOutput.trim())\n }\n }\n\n // Execute the MATLAB command 'which' on the selected text\n MatlabEditor.runCommand('which(\\'' + selectionText + '.m\\')', clbk)\n }\n } else {\n atom.notifications.addError('Unavailable Matlab Session',\n { stack: '', detail: 'Unable to connect to MATLAB session.\\nType \"matlab.engine.shareEngine(\\'AtomMatlabEngine\\')\" in your Matlab instance.', dismissable: true })\n }\n }\n }", "function getTinymceEditorAdapter(editor) {\n var startSel=0, endSel;\n\n return {\n getText : function() { return editor.selection.getRng().startContainer.textContent; },\n getCaretPos: function() { return editor.selection.getRng().startOffset; },\n setCaret : function(start) { startSel = endSel = start; },\n selectText : function(start, end) {\n startSel = start;\n endSel = end;\n },\n replaceSelected: function(newText, insert) { \n var text = editor.selection.getRng().startContainer.textContent;\n \n if(insert || !endSel)\n endSel = startSel\n\n editor.selection.getRng().startContainer.nodeValue = text.substring(0, startSel)+newText+text.substring(endSel);\n }\n }\n }", "onEditorChange() {\n // If the handler is in standby mode, bail.\n if (this._standby) {\n return;\n }\n const editor = this.editor;\n if (!editor) {\n return;\n }\n const text = editor.model.value.text;\n const position = editor.getCursorPosition();\n const offset = Text.jsIndexToCharIndex(editor.getOffsetAt(position), text);\n const update = { content: null };\n const pending = ++this._pending;\n void this._connector\n .fetch({ offset, text })\n .then(reply => {\n // If handler has been disposed or a newer request is pending, bail.\n if (this.isDisposed || pending !== this._pending) {\n this._inspected.emit(update);\n return;\n }\n const { data } = reply;\n const mimeType = this._rendermime.preferredMimeType(data);\n if (mimeType) {\n const widget = this._rendermime.createRenderer(mimeType);\n const model = new MimeModel({ data });\n void widget.renderModel(model);\n update.content = widget;\n }\n this._inspected.emit(update);\n })\n .catch(reason => {\n // Since almost all failures are benign, fail silently.\n this._inspected.emit(update);\n });\n }", "function getTextForActiveWindow(callback) {\n var editor = vscode.window.activeTextEditor;\n if (!editor) {\n vscode.window.showErrorMessage(\"No active editor!\");\n callback(null, null);\n return;\n }\n var namespace = vscode.workspace.getConfiguration('vs-kubernetes')['vs-kubernetes.namespace'];\n if (namespace) {\n command = command + \"--namespace \" + namespace + \" \";\n }\n if (editor.selection) {\n var text = editor.document.getText(editor.selection);\n if (text.length > 0) {\n callback(text, null);\n return;\n }\n }\n if (editor.document.isUntitled) {\n var text = editor.document.getText();\n if (text.length > 0) {\n callback(text, null);\n return;\n }\n }\n if (editor.document.isDirty) {\n // TODO: I18n this?\n var confirm = \"Save\";\n var promise = vscode.window.showWarningMessage(\"You have unsaved changes!\", confirm);\n promise.then(function (value) {\n if (value && value == confirm) {\n editor.document.save().then(function (ok) {\n if (!ok) {\n vscode.window.showErrorMessage(\"Save failed.\");\n callback(null, null);\n return;\n }\n callback(null, editor.document.fileName);\n });\n }\n callback(null, null);\n });\n } else {\n callback(null, editor.document.fileName);\n }\n}", "function save() {\n editors.forEach(function (editor, index) {\n textareas[index].value = editor.querySelector('.text').innerHTML;\n });\n }", "function clickNoteEditor(e){\n self.focus_manager.setFocusObject(self.focus_manager.NOTE_EDITOR);\n }", "_onActiveEditorUpdated(type, editor) {\n\t\tthis._onElementDeselected();\n\t\tthis._designView = editor;\n\t}", "get id() { return this.editor.id; }", "function focusEditor(isFocused) {\n isFocused ? editor.focus() : editor.blur();\n}", "_editorChanged() {\n this.dispatchEvent(\n new CustomEvent(\"editor-change\", {\n bubbles: true,\n cancelable: true,\n composed: true,\n detail: this,\n })\n );\n }", "_onActiveEditorUpdated(type, editor) {\n this._designView = editor;\n }", "function editor_setmode(objname, mode) {\n var config = document.all[objname].config;\n var editor_obj = document.all[\"_\" +objname + \"_editor\"];\n\n // wait until document is fully loaded\n if (document.readyState != 'complete') {\n setTimeout(function() { editor_setmode(objname,mode) }, 25);\n return;\n }\n\n // define different editors\n var TextEdit = '<textarea ID=\"_' +objname + '_editor\" style=\"width:' +editor_obj.style.width+ '; height:' +editor_obj.style.height+ '; margin-v65333: -1px; margin-bottom: -1px;\"></textarea>';\n var RichEdit = '<iframe ID=\"_' +objname+ '_editor\" style=\"width:' +editor_obj.style.width+ '; height:' +editor_obj.style.height+ ';\"></iframe>';\n\n // src=\"' +_editor_url+ 'popups/blank.html\"\n\n //\n // Switch to TEXTEDIT mode\n //\n\n if (mode == \"textedit\" || editor_obj.tagName.toLowerCase() == 'iframe') {\n config.mode = \"textedit\";\n var editdoc = editor_obj.contentWindow.document;\n var contents = editdoc.body.createTextRange().htmlText;\n editor_obj.outerHTML = TextEdit;\n editor_obj = document.all[\"_\" +objname + \"_editor\"];\n editor_obj.value = contents;\n editor_event(objname);\n\n editor_updateToolbar(objname, \"disable\"); // disable toolbar items\n\n // set event handlers\n editor_obj.onkeydown = function() { editor_event(objname); }\n editor_obj.onkeypress = function() { editor_event(objname); }\n editor_obj.onkeyup = function() { editor_event(objname); }\n editor_obj.onmouseup = function() { editor_event(objname); }\n editor_obj.ondrop = function() { editor_event(objname, 100); } // these events fire before they occur\n editor_obj.oncut = function() { editor_event(objname, 100); }\n editor_obj.onpaste = function() { editor_event(objname, 100); }\n editor_obj.onblur = function() { editor_event(objname, -1); }\n\n editor_updateOutput(objname);\n editor_focus(editor_obj);\n }\n\n //\n // Switch to WYSIWYG mode\n //\n\n else {\n config.mode = \"wysiwyg\";\n var contents = editor_obj.value;\n if (mode == 'init') { contents = document.all[objname].value; } // on init use original textarea content\n\n // create editor\n editor_obj.outerHTML = RichEdit;\n editor_obj = document.all[\"_\" +objname + \"_editor\"];\n\n // get iframe document object\n\n // create editor contents (and default styles for editor)\n var html = \"\";\n html += '<html><head>\\n';\n if (config.stylesheet) {\n html += '<link href=\"' +config.stylesheet+ '\" rel=\"stylesheet\" type=\"text/css\">\\n';\n }\n html += '<style>\\n';\n html += 'body {' +config.bodyStyle+ '} \\n';\n for (var i in config.fontstyles) {\n var fontstyle = config.fontstyles[i];\n if (fontstyle.classStyle) {\n html += '.' +fontstyle.className+ ' {' +fontstyle.classStyle+ '}\\n';\n }\n }\n html += '</style>\\n'\n + '</head>\\n'\n + '<body contenteditable=\"true\" topmargin=1 leftmargin=1'\n\n// still working on this\n// + ' oncontextmenu=\"parent.editor_cMenu_generate(window,\\'' +vfd085+'\\');\"'\n +'>'\n +contents\n +'</body>\\n'\n +'</html>\\n';\n var v7a135 =editor_obj.contentWindow.document;\n v7a135.open();\n v7a135.write(html);\n v7a135.close();\n editor_updateToolbar(objname,\"enable\"); \n v7a135.objname =objname;\n v7a135.onkeydown =function(){editor_event(objname); }\n v7a135.onkeypress =function(){editor_event(objname); }\n v7a135.onkeyup =function(){editor_event(objname); }\n v7a135.onmouseup =function(){editor_event(objname); }\n v7a135.body.ondrop =function(){editor_event(objname,100); }\n v7a135.body.oncut =function(){editor_event(objname,100); }\n v7a135.body.onpaste =function(){editor_event(objname,100); }\n v7a135.body.onblur =function(){editor_event(objname,-1); }\n if (mode !='init'){editor_focus(v43c91);\n }\n }\n if (mode !='init'){editor_event(vfd085);\n }\n}", "setEditorState (newEditorState) {\n this.newHistoryEvent (() => {\n let graph = this.graph;\n let selectedNode = graph.selectedNode(),\n selectedEdge = graph.selectedEdge();\n let newState = this.prependInputName (newEditorState, 'editor');\n if (newState.hasOwnProperty('editorContent')) {\n\tif (selectedEdge)\n this.graph.replaceEdgeText (selectedEdge, newState.editorContent);\n\telse if (selectedNode)\n this.graph.replaceNodeText (selectedNode, newState.editorContent);\n\telse\n console.error('oops: editor content with no selected node or edge');\n }\n return extend (newState, this.graphState());\n }, { source: 'editor',\n\t selected: this.graph.selected });\n }", "async openEditor() {\n atom.workspace.open((await new _editor2.default()));\n }", "connectedCallback(){super.connectedCallback();let root=this;document.addEventListener(\"selectionchange\",e=>{root.range=root.getRange()});document.addEventListener(\"select-rich-text-editor-editor\",e=>{root._editorChange(e)});document.addEventListener(\"deselect-rich-text-editor-editor\",e=>{root._editorChange(e)})}", "isEditor(value) {\n return Object(__WEBPACK_IMPORTED_MODULE_0_is_plain_object__[\"a\" /* default */])(value) && typeof value.addMark === 'function' && typeof value.apply === 'function' && typeof value.deleteBackward === 'function' && typeof value.deleteForward === 'function' && typeof value.deleteFragment === 'function' && typeof value.insertBreak === 'function' && typeof value.insertFragment === 'function' && typeof value.insertNode === 'function' && typeof value.insertText === 'function' && typeof value.isInline === 'function' && typeof value.isVoid === 'function' && typeof value.normalizeNode === 'function' && typeof value.onChange === 'function' && typeof value.removeMark === 'function' && (value.marks === null || Object(__WEBPACK_IMPORTED_MODULE_0_is_plain_object__[\"a\" /* default */])(value.marks)) && (value.selection === null || Range.isRange(value.selection)) && Node.isNodeList(value.children) && Operation.isOperationList(value.operations);\n }", "function store_active_editor(id){\r\n\tif($.trim($('#active_editor_id').text())=='' || $.trim($('#active_editor_id').text())!=id){\r\n\t\t$('#active_editor_id').text(id);\r\n\t\treturn true;\r\n\t}else{\r\n\t\treturn false;\r\n\t}\t\r\n}", "selectionChange (event) {\n let {anchorNode, anchorOffset, focusNode, focusOffset, isCollapsed} = document.getSelection();\n let editorNode = this.DOMNodes.editor;\n\n // If the editor DOM element isn't selected, or the selection crosses outside of it, we bail.\n if (document.activeElement !== editorNode) return;\n if (!editorNode.contains(anchorNode) || !editorNode.contains(focusNode)) return;\n\n // In Firefox, \"select all\" presently sets the anchor/focus node to the containing contentEditable.\n if (anchorNode === editorNode) {\n anchorNode = editorNode.firstChild;\n anchorOffset = 0;\n focusNode = editorNode.lastChild;\n focusOffset = 0; // The last child is a fake sentinel node, we don't actually want to select it.\n }\n\n // Browsers will generally (but not always) report inner text nodes as focus/anchor nodes - we want the surrounding spans.\n if (focusNode.nodeName === \"#text\") {\n focusNode = focusNode.parentNode;\n }\n\n if (anchorNode.nodeName === \"#text\") {\n anchorNode = anchorNode.parentNode;\n }\n\n // Scroll the cursor into view if necessary.\n if (focusNode.offsetTop < editorNode.scrollTop) {\n focusNode.scrollIntoView({block: \"start\"});\n } else if (focusNode.offsetTop + 16 > editorNode.scrollTop + editorNode.clientHeight) {\n focusNode.scrollIntoView({block: \"end\"});\n } else if (focusNode.offsetLeft < editorNode.scrollLeft) {\n focusNode.scrollIntoView({inline: \"start\"});\n } else if (focusNode.offsetLeft + focusNode.clientWidth> editorNode.scrollLeft + editorNode.clientWidth) {\n focusNode.scrollIntoView({inline: \"end\"});\n }\n \n let startToken = anchorNode.token;\n let endToken = focusNode.token;\n let start = startToken.pos + anchorOffset;\n let end = endToken.pos + focusOffset;\n let backwards = false;\n if (start > end) { // If the anchorNode precedes the focusNode, we reverse the selection (we want our ranges to be ordered sensibly).\n [start, end] = [end, start];\n backwards = true;\n }\n \n this.selection = {start, end, isCollapsed, backwards};\n }", "getEditorState() {\n const { editorState } = this.state;\n return editorState;\n }", "getCodeMirror() {\n return this.editor\n }", "function addTextEditorObserver(editor, files, view) {\n // console.log(arguments);\n var onSelectorUpdate = function onSelectorUpdate(compiledSelectors) {\n // console.dir(compiledSelectors);\n var str = createOutputString(compiledSelectors);\n view.innerHTML = str;\n };\n\n addSelectionListener(editor, files, onSelectorUpdate);\n}", "function __getInst( api ) {\n\tvar ctx = api.context[0];\n\treturn ctx.oInit.editor || ctx._editor;\n}", "function getCurrentSelectionEvents() {\n //get the active editor\n const editor = vscode.window.activeTextEditor;\n\n //if there is an active text editor\n if(editor) {\n //get the editor selection (we only handle a single selection)\n const selection = editor.selection;\n\n //if there is a selection\n if(!selection.isEmpty) {\n //if there are some selected characters in the selection\n if(!selection.start.isEqual(selection.end)) {\n //name of the file where the copy occured and strip the leading part of the path \n const filePath = projectManager.pathHelper.normalizeFilePath(editor.document.fileName);\n const file = projectManager.fileSystemManager.getFileInfoFromFilePath(filePath);\n //get the storyteller events associated with the selected text\n const selectedEvents = file.getInsertEventsByPos(selection.start.line, selection.start.character, selection.end.line, selection.end.character);\n \n //clear out any old data\n clipboardData.text = \"\";\n clipboardData.eventIds = [];\n\n //go through the selected events\n for(let j = 0;j < selectedEvents.length;j++) {\n //append the individual selected characters to the clipboard data\n clipboardData.text = clipboardData.text + selectedEvents[j].character;\n \n //add the event id to the clipboard data\n clipboardData.eventIds.push(selectedEvents[j].id);\n }\n }\n }\n }\n}", "isFocused(editor) {\n return !!IS_FOCUSED.get(editor);\n }", "isFocused(editor) {\n return !!IS_FOCUSED.get(editor);\n }", "isFocused(editor) {\n return !!IS_FOCUSED.get(editor);\n }", "_showEditor() {\n const EditorCls = this.richText ? CodeMirrorWrapper : TextAreaWrapper;\n\n if (this.richText) {\n RB.DnDUploader.instance.registerDropTarget(\n this.$el, gettext('Drop to add an image'),\n this._uploadImage.bind(this));\n }\n\n this._editor = new EditorCls({\n parentEl: this.el,\n autoSize: this.options.autoSize,\n minHeight: this.options.minHeight\n });\n\n this._editor.setText(this._value);\n this._value = '';\n this._richTextDirty = false;\n this._prevClientHeight = null;\n\n this._editor.$el.on(\n 'resize',\n _.throttle(() => this.$el.triggerHandler('resize'), 250));\n\n this.listenTo(this._editor, 'change', _.throttle(() => {\n /*\n * Make sure that the editor wasn't closed before the throttled\n * handler was reached.\n */\n if (this._editor === null) {\n return;\n }\n\n const clientHeight = this._editor.getClientHeight();\n\n if (clientHeight !== this._prevClientHeight) {\n this._prevClientHeight = clientHeight;\n this.$el.triggerHandler('resize');\n }\n\n this.trigger('change');\n }, 500));\n\n this.focus();\n }", "function loadEditor() {\n var transaction = db.transaction([\"notes\"]);\n var objectStore = transaction.objectStore(\"notes\");\n var request = objectStore.get(\"settings\");\n request.onsuccess = function(event) {\n var toolbarOptions = [[{ 'header': [1, 2, 3, false] }]];\n if(request.result.tool_bar_standard_text_options) {\n toolbarOptions.push(['bold', 'italic', 'underline', 'strike']);\n }\n if(request.result.tool_bar_quotes) {\n toolbarOptions.push(['blockquote']);\n }\n if(request.result.tool_bar_code_box) {\n toolbarOptions.push(['code-block']);\n }\n if(request.result.tool_bar_list_bullets) {\n toolbarOptions.push([{ 'list': 'ordered'}, { 'list': 'bullet' }]);\n }\n if(request.result.tool_bar_super_sub) {\n toolbarOptions.push([{ 'script': 'sub'}, { 'script': 'super' }]);\n }\n if(request.result.tool_bar_images) {\n toolbarOptions.push(['image']);\n }\n if(request.result.tool_bar_link) {\n toolbarOptions.push(['link']);\n }\n if(request.result.tool_bar_clear_format) {\n toolbarOptions.push(['clean']);\n }\n toolbarOptions.push(['undo']);\n toolbarOptions.push(['redo']);\n toolbarOptions.push(['save']);\n toolbarOptions.push(['expand']);\n\n quill = new Quill('#editor-container', {\n modules: {\n imageResize: {\n modules: [ 'Resize', 'DisplaySize' ],\n displaySize: true,\n displayStyles: {\n backgroundColor: 'rgba(20, 143, 245,.5)',\n border: 'none',\n color: 'white'\n },\n handleStyles: {\n backgroundColor: 'black',\n border: 'none',\n color: \"white\"\n }\n },\n imageDrop: true,\n syntax: true,\n toolbar: toolbarOptions,\n history: {\n delay: 2000,\n maxStack: 500,\n userOnly: true\n },\n },\n placeholder: 'Compose an epic...',\n theme: 'snow' // or 'bubble'\n });\n\n // Creates the custom buttons\n var toolbar = quill.getModule('toolbar');\n toolbar.addHandler('expand', function() {\n console.log('expand')\n }\n );\n\n var toolbar = quill.getModule('toolbar');\n toolbar.addHandler('expand', function() {\n console.log('undo')\n }\n );\n\n var toolbar = quill.getModule('toolbar');\n toolbar.addHandler('save', function() {\n console.log('save')\n }\n );\n\n var toolbar = quill.getModule('toolbar');\n toolbar.addHandler('redo', function() {\n console.log('redo')\n }\n );\n\n var customButton = document.querySelector('.ql-expand');\n customButton.addEventListener('click', function() {\n expand();\n }\n );\n\n var customButton = document.querySelector('.ql-undo');\n customButton.addEventListener('click', function() {\n quill.history.undo();\n }\n );\n\n var customButton = document.querySelector('.ql-redo');\n customButton.addEventListener('click', function() {\n quill.history.redo();\n }\n );\n\n var customButton = document.querySelector('.ql-save');\n customButton.addEventListener('click', function() {\n updateNote();\n }\n );\n\n\n };\n}", "function EditorSharedStartup() {\n // Just for convenience\n gContentWindow = window.content;\n\n // Disable DNS Prefetching on the docshell - we don't need it for composer\n // type windows.\n GetCurrentEditorElement().docShell.allowDNSPrefetch = false;\n\n // Set up the mime type and register the commands.\n if (IsHTMLEditor()) {\n SetupHTMLEditorCommands();\n } else {\n SetupTextEditorCommands();\n }\n\n // add observer to be called when document is really done loading\n // and is modified\n // Note: We're really screwed if we fail to install this observer!\n try {\n var commandManager = GetCurrentCommandManager();\n commandManager.addCommandObserver(\n gEditorDocumentObserver,\n \"obs_documentCreated\"\n );\n commandManager.addCommandObserver(\n gEditorDocumentObserver,\n \"cmd_setDocumentModified\"\n );\n commandManager.addCommandObserver(\n gEditorDocumentObserver,\n \"obs_documentWillBeDestroyed\"\n );\n commandManager.addCommandObserver(\n gEditorDocumentObserver,\n \"obs_documentLocationChanged\"\n );\n\n // Until nsIControllerCommandGroup-based code is implemented,\n // we will observe just the bold command to trigger update of\n // all toolbar style items\n commandManager.addCommandObserver(gEditorDocumentObserver, \"cmd_bold\");\n } catch (e) {\n dump(e);\n }\n\n var isMac = AppConstants.platform == \"macosx\";\n\n // Set platform-specific hints for how to select cells\n // Mac uses \"Cmd\", all others use \"Ctrl\"\n var tableKey = GetString(isMac ? \"XulKeyMac\" : \"TableSelectKey\");\n var dragStr = tableKey + GetString(\"Drag\");\n var clickStr = tableKey + GetString(\"Click\");\n\n var delStr = GetString(isMac ? \"Clear\" : \"Del\");\n\n SafeSetAttribute(\"menu_SelectCell\", \"acceltext\", clickStr);\n SafeSetAttribute(\"menu_SelectRow\", \"acceltext\", dragStr);\n SafeSetAttribute(\"menu_SelectColumn\", \"acceltext\", dragStr);\n SafeSetAttribute(\"menu_SelectAllCells\", \"acceltext\", dragStr);\n // And add \"Del\" or \"Clear\"\n SafeSetAttribute(\"menu_DeleteCellContents\", \"acceltext\", delStr);\n\n // Set text for indent, outdent keybinding\n\n // hide UI that we don't have components for\n RemoveInapplicableUIElements();\n\n // Use browser colors as initial values for editor's default colors\n var BrowserColors = GetDefaultBrowserColors();\n if (BrowserColors) {\n gDefaultTextColor = BrowserColors.TextColor;\n gDefaultBackgroundColor = BrowserColors.BackgroundColor;\n }\n\n // For new window, no default last-picked colors\n gColorObj.LastTextColor = \"\";\n gColorObj.LastBackgroundColor = \"\";\n gColorObj.LastHighlightColor = \"\";\n}", "editCommand(){const richtext=this.shadowRoot.getElementById(\"richtext\"),editmode=richtext.contentDocument;editmode.designMode=\"on\"}", "resolveActiveRootDirectory() {\r\n const projectPaths = atom.project.getPaths();\r\n let activeTextEditor = atom.workspace.getActiveTextEditor();\r\n let activeProject = null;\r\n\r\n if (_.isEmpty(projectPaths) || _.isEmpty(activeTextEditor))\r\n return null;\r\n\r\n activeTextEditor = activeTextEditor.buffer.file.path;\r\n\r\n projectPaths.forEach(p => {\r\n if (activeTextEditor.startsWith(p))\r\n activeProject = p;\r\n });\r\n\r\n return activeProject;\r\n }", "nextFocus() {\n //All variables we need\n let editor = atom.workspace.getActiveTextEditor();\n let cursor = editor.getCursorScreenPosition();\n let path = editor.getPath();\n //This function return the closest next focus view to our current cursor.\n let point = this.closestNextRange(path, cursor.row, cursor.column);\n\n if (point != null) {\n //We check that a next focus view actually exists.\n editor.setCursorScreenPosition([point.line, point.character]); //We move the cursor\n }\n }", "function Editor(options) {\n this.options = options;\n window.indentUnit = options.indentUnit;\n this.parent = parent;\n this.doc = document;\n var container = this.container = this.doc.body;\n this.win = window;\n this.history = new History(container, options.undoDepth, options.undoDelay, this);\n var self = this;\n\n if (!Editor.Parser)\n throw \"No parser loaded.\";\n if (options.parserConfig && Editor.Parser.configure)\n Editor.Parser.configure(options.parserConfig);\n\n if (!options.readOnly)\n select.setCursorPos(container, {node: null, offset: 0});\n\n this.dirty = [];\n this.importCode(options.content || \"\");\n this.history.onChange = options.onChange;\n\n if (!options.readOnly) {\n if (options.continuousScanning !== false) {\n this.scanner = this.documentScanner(options.passTime);\n this.delayScanning();\n }\n\n function setEditable() {\n // In IE, designMode frames can not run any scripts, so we use\n // contentEditable instead.\n if (document.body.contentEditable != undefined && internetExplorer)\n document.body.contentEditable = \"true\";\n else\n document.designMode = \"on\";\n\n document.documentElement.style.borderWidth = \"0\";\n if (!options.textWrapping)\n container.style.whiteSpace = \"nowrap\";\n }\n\n // If setting the frame editable fails, try again when the user\n // focus it (happens when the frame is not visible on\n // initialisation, in Firefox).\n try {\n setEditable();\n }\n catch(e) {\n var focusEvent = addEventHandler(document, \"focus\", function() {\n focusEvent();\n setEditable();\n }, true);\n }\n\n addEventHandler(document, \"keydown\", method(this, \"keyDown\"));\n addEventHandler(document, \"keypress\", method(this, \"keyPress\"));\n addEventHandler(document, \"keyup\", method(this, \"keyUp\"));\n\n function cursorActivity() {self.cursorActivity(false);}\n addEventHandler(document.body, \"mouseup\", cursorActivity);\n addEventHandler(document.body, \"cut\", cursorActivity);\n\n // workaround for a gecko bug [?] where going forward and then\n // back again breaks designmode (no more cursor)\n if (gecko)\n addEventHandler(this.win, \"pagehide\", function(){self.unloaded = true;});\n\n addEventHandler(document.body, \"paste\", function(event) {\n cursorActivity();\n var text = null;\n try {\n var clipboardData = event.clipboardData || window.clipboardData;\n if (clipboardData) text = clipboardData.getData('Text');\n }\n catch(e) {}\n if (text !== null) {\n event.stop();\n self.replaceSelection(text);\n select.scrollToCursor(self.container);\n }\n });\n\n if (this.options.autoMatchParens)\n addEventHandler(document.body, \"click\", method(this, \"scheduleParenHighlight\"));\n }\n else if (!options.textWrapping) {\n container.style.whiteSpace = \"nowrap\";\n }\n }", "function save() {\n $editors.find('.text').each(function () {\n $(this).closest('.fields').find('textarea').val(this.innerHTML);\n });\n }", "function addEditorListener() {\n\t\t$('.editing .edit').on('keyup', function(e) {\n\t\t\tcheckEditPress(e);\n\t\t})\n\n\t}", "function makeEditTabActive() {\n\n // console.log(window.editor);\n\n // Now add the description\n var editorWindowTextArea = document.getElementById('note-description-editor');\n editorWindowTextArea.innerHTML = window.editor.description;\n editorWindowTextArea.value = window.editor.description;\n\n document.getElementById('editing-button').classList.add('tab-active');\n document.getElementById('preview-button').classList.remove('tab-active');\n\n document.getElementById('note-description-content').classList.add('hidden');\n document.getElementById('note-description-preview').classList.remove('hidden');\n\n // REMOVED focus\n document.getElementById('note-description-editor').focus();\n}", "handleContainerClick() {\n const { isEditorFocused } = this.state;\n if (isEditorFocused) {\n return;\n }\n this.editor.focus();\n }", "handleTextEvents(editor) {\n editor.getBuffer().onWillSave(() => {\n if (this.shouldFormatOnSave() && this.hasElixirGrammar(editor)) {\n formatter.formatTextEditor(editor);\n }\n });\n }", "function open() {\n\tdialog.showOpenDialog(\n\t\trequire(\"electron\").remote.getCurrentWindow(),\n\t\t{\n\t\t\tfilters: [\n\t\t\t\t{ name: \"BTML files\", extensions: [\"btml\"] },\n\t\t\t\t{ name: \"All Files\", extensions: [\"*\"] }\n\t\t\t]\n\t\t},\n\t\tfilenames => {\n\t\t\tif (!filenames) {\n\t\t\t\tdebug.log(\"No file selected\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tlet filename = filenames[0];\n\n\t\t\tfs.readFile(filename, \"utf-8\", (err, data) => {\n\t\t\t\tif (err) {\n\t\t\t\t\tdebug.error(\n\t\t\t\t\t\t\"An error ocurred reading the file: \" + err.message\n\t\t\t\t\t);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tpathToFileBeingEdited = filename;\n\t\t\t\t// Do stuff with open file\n\t\t\t\teditor.setText(data);\n\t\t\t\t$(\"#text-editor\").change();\n\t\t\t});\n\t\t}\n\t);\n}", "function makeEditTabActive() {\n\n // console.log(window.editor);\n\n // Now add the description\n var editorWindowTextArea = document.getElementById('note-description-editor');\n editorWindowTextArea.innerHTML = window.editor.description;\n editorWindowTextArea.value = window.editor.description;\n\n document.getElementById('editing-button').classList.add('tab-active');\n document.getElementById('preview-button').classList.remove('tab-active');\n\n document.getElementById('note-description-content').classList.add('hidden');\n document.getElementById('note-description-preview').classList.remove('hidden');\n\n $('#note-description-editor').focus();\n}", "function onEditDialogOpen(item){\r\n\t\t\r\n\t\tvar objTextarea = jQuery(\"#uc_dialog_edit_file_textarea\");\r\n\t\t\r\n\t\tif(g_codeMirror)\r\n\t\t\tg_codeMirror.toTextArea();\r\n\r\n\t\tobjTextarea.hide();\r\n\t\t\r\n\t\tvar data = {filename: item.file, path: g_activePath, pathkey: g_pathKey};\r\n\t\tg_ucAdmin.setErrorMessageID(\"uc_dialog_edit_file_error\");\r\n\t\tg_ucAdmin.setAjaxLoaderID(\"uc_dialog_edit_file_loader\");\r\n\t\tassetsAjaxRequest(\"assets_get_file_content\", data, function(response){\r\n\t\t\t\r\n\t\t\tobjTextarea.show();\r\n\t\t\tobjTextarea.val(response.content);\r\n\t\t \r\n\t\t\tvar modeName;\r\n\t\t\t\r\n\t\t\tswitch(item.type){\r\n\t\t\t\tdefault:\r\n\t\t\t\tcase \"html\":\r\n\t\t\t\t\tmodeName = \"htmlmixed\";\r\n\t\t\t\tbreak;\r\n\t\t\t\tcase \"xml\":\r\n\t\t\t\t\tmodeName = \"xml\";\r\n\t\t\t\tbreak;\r\n\t\t\t\tcase \"css\":\r\n\t\t\t\t\tmodeName = \"css\";\r\n\t\t\t\tbreak;\r\n\t\t\t\tcase \"javascript\":\r\n\t\t\t\t\tmodeName = \"javascript\";\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tvar optionsCM = {\r\n\t\t\t\t\tmode: {name: modeName },\r\n\t\t\t\t\tlineNumbers: true\r\n\t\t\t };\r\n\t\t\t\r\n\t\t\tg_codeMirror = CodeMirror.fromTextArea(objTextarea[0], optionsCM);\r\n\t\t\t\r\n\t\t});\r\n\t\t\r\n\t}", "startExternalEditor() {\n // Pause Readline to prevent stdin and stdout from being modified while the editor is showing\n this.rl.pause();\n editAsync(this.currentText, this.endExternalEditor.bind(this));\n }", "startExternalEditor() {\n // Pause Readline to prevent stdin and stdout from being modified while the editor is showing\n this.rl.pause();\n editAsync(this.currentText, this.endExternalEditor.bind(this));\n }", "function openEditor() {\n var slide = $(\"span#slideFile\").text().replace(/:\\d+$/, '');\n var link = 'edit/' + slide + \".md\";\n $.get(link);\n}", "function tf(e){if(document.getElementsByClassName)for(var t=document.getElementsByClassName(\"CodeMirror\"),a=0;a<t.length;a++){var n=t[a].CodeMirror;n&&e(n)}}", "function Editor() { }", "function Editor() { }", "getSourceFromEditor() {\n return this.getProgramFromEditor()\n }", "handleFocus() {\n this.editor().start();\n this.setState({ editing: true });\n }", "get _isTextPropertyEditor() {\n return true;\n }", "static get tag(){return\"rich-text-editor-selection\"}", "set OSXEditor(value) {}", "get editorDomElement() {\n return this._$editorElm;\n }", "function autoChange(path){\n (debug?console.log(\"__________autoChange : \" + path.split(\".\")[1]):null);\n var modelist = ace.require(\"ace/ext/modelist\");\n var mode = modelist.getModeForPath(path).mode\n editor.session.setMode(mode)\n}", "get editorHistory() {\n return this.owner.editorHistory;\n }", "function textToEditor() {\n\t\t$(editor.text_panel)\n\t\t\t.html(\"\")\n\t\t\t.append(window.TheEditor.highlighter(text_area.value));\n\t\t$(editor.text_panel)\n\t\t\t.css('minWidth', (editor.outer.clientWidth - 44) + 'px')\n\t\t\t.css('minHeight', (editor.outer.clientHeight - 4) + 'px');\n\t\t$(editor.back_panel)\n\t\t\t.css('minWidth', (editor.outer.clientWidth - 44) + 'px');\n\t}", "getEditorListeners() {\n return {\n focusout: 'onEditorFocusOut',\n focusin: 'onEditorFocusIn',\n start: 'onEditorStart',\n beforecomplete: 'onEditorBeforeComplete',\n complete: 'onEditorComplete',\n cancel: 'onEditorCancel',\n thisObj: this\n };\n }", "getEditorListeners() {\n return {\n focusout: 'onEditorFocusOut',\n focusin: 'onEditorFocusIn',\n start: 'onEditorStart',\n beforecomplete: 'onEditorBeforeComplete',\n complete: 'onEditorComplete',\n cancel: 'onEditorCancel',\n thisObj: this\n };\n }", "function withEditorPaneWindow(fcn) {\n if (window.frames[F_EDITOR_PANE] != null) {\n fcn(window.frames[F_EDITOR_PANE]);\n } else {\n // HACK: wait invoke in a setTimeout function now, hoping that it will\n // load later\n setTimeout(function() {\n //console.log(\"Had to load later\");\n fcn(window.frames[F_EDITOR_PANE]);\n }, 3000);\n }\n}", "editorContentCallback(initContent: string, filePath: string) {\n const { setEditorContent } = this.props;\n setEditorContent(initContent, filePath);\n }", "openEditor() {\n cy\n .getIframeBody('#page-composer-frame')\n .find('.gwt-Frame.window-iframe.x-noshim.x-component')\n .its('0.contentDocument.body')\n .should('not.be.empty')\n .then(cy.wrap)\n .find(\".editmodeArea .button-placeholder div:contains(Any)\").click()\n\n cy.get(\"input[placeholder='Search for types of content']\").type('rich')\n\n cy.get(\"div[data-sel-role='content-type-tree'] span:contains(Rich)\").click()\n\n cy.get(\"button[data-sel-role='content-type-dialog-create']\").click()\n\n cy.wait(2000)\n\n }" ]
[ "0.6879253", "0.66936564", "0.6544721", "0.6524527", "0.6499231", "0.6499231", "0.64954007", "0.64462477", "0.6404208", "0.63776016", "0.62949413", "0.627102", "0.6243174", "0.618155", "0.61683685", "0.61574864", "0.61540544", "0.61104655", "0.60639465", "0.60564834", "0.60511154", "0.6046187", "0.60332465", "0.60233563", "0.6014656", "0.5976138", "0.5963169", "0.5945844", "0.58819705", "0.58772826", "0.5876325", "0.58739585", "0.5866374", "0.58600247", "0.5855555", "0.5850175", "0.5849074", "0.58187383", "0.5807652", "0.58074045", "0.5795006", "0.5792574", "0.5784129", "0.577182", "0.57583433", "0.5729432", "0.5710217", "0.56939274", "0.5691218", "0.56835014", "0.56808263", "0.56804705", "0.5668027", "0.56653064", "0.5661129", "0.56371576", "0.563247", "0.562279", "0.5618742", "0.5611773", "0.56063735", "0.55959314", "0.5563449", "0.5563449", "0.5563449", "0.55628145", "0.55570585", "0.55530566", "0.5548823", "0.5541322", "0.55345505", "0.55292654", "0.5524337", "0.5524125", "0.5519556", "0.5518968", "0.55060506", "0.55011916", "0.54926896", "0.5489701", "0.5485108", "0.5485108", "0.54836375", "0.5480053", "0.5479295", "0.5479295", "0.54720354", "0.5470105", "0.54666126", "0.5459627", "0.5458868", "0.54554105", "0.5454695", "0.5448236", "0.5446105", "0.54355156", "0.54355156", "0.54351425", "0.54293406", "0.5428309" ]
0.7107289
0
Populate the sourceLinks and targetLinks for each node. Also, if the source and target are not objects, assume they are indices.
function computeNodeLinks() { var nodeHash = {}; var linkHash = {}; // remove duplicated node nodes = nodes.filter(function (node) { if (typeof nodeHash[node.id] !== 'undefined') { $.extend(nodeHash[node.id], node); return false; } nodeHash[node.id] = node; return true; }); // remove duplicated link links = links.filter(function (link) { var id1 = typeof link.source === 'string' ? link.source : link.source.id; var id2 = typeof link.target === 'string' ? link.target : link.target.id; if (typeof nodeHash[id1] === 'undefined' || typeof nodeHash[id2] === 'undefined') { return false; } var key = id1 + '_' + id2; if (typeof linkHash[key] !== 'undefined') { //$.extend(linkHash[key], link); return false; } linkHash[key] = link; return true; }); nodes.forEach(function(node) { //nodeHash[node.id] = node; node.sourceLinks = []; node.targetLinks = []; }); links.forEach(function(link) { var source = link.source, target = link.target; if (typeof source === "string") source = link.source = nodeHash[link.source]; if (typeof target === "string") target = link.target = nodeHash[link.target]; source.sourceLinks.push(link); target.targetLinks.push(link); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function computeNodeLinks() {\n nodes.forEach(function (node) {\n node.sourceLinks = [];\n node.targetLinks = [];\n });\n links.forEach(function (link) {\n var source = link.source, target = link.target;\n link.source_index = source;\n link.target_index = target;\n if (typeof source === \"number\") source = link.source = nodes[link.source];\n if (typeof target === \"number\") target = link.target = nodes[link.target];\n source.sourceLinks.push(link);/////the link in which node as souce/link\n target.targetLinks.push(link);\n });\n }", "function computeNodeLinks() {\n nodes.forEach(function(node) {\n node.sourceLinks = [];\n node.targetLinks = [];\n });\n links.forEach(function(link, i) {\n var source = link.source,\n target = link.target;\n if (typeof source === \"number\") source = link.source = nodes[link.source];\n if (typeof target === \"number\") target = link.target = nodes[link.target];\n link.originalIndex = i;\n source.sourceLinks.push(link);\n target.targetLinks.push(link);\n });\n }", "function computeNodeLinks() {\n _(nodes).each(function(node) {\n node.sourceLinks = [];\n node.targetLinks = [];\n });\n _(links).each(function(link) {\n var source = link.source,\n target = link.target;\n if (typeof source === \"number\") source = link.source = nodes[link.source];\n if (typeof target === \"number\") target = link.target = nodes[link.target];\n source.sourceLinks.push(link);\n target.targetLinks.push(link);\n });\n }", "function computeNodeLinks() {\n nodes.forEach(function(node) {\n node.sourceLinks = []\n node.targetLinks = []\n })\n links.forEach(function(link) {\n let source = link.source\n let target = link.target\n if (typeof source === 'number') source = link.source = nodes[link.source]\n if (typeof target === 'number') target = link.target = nodes[link.target]\n source.sourceLinks.push(link)\n target.targetLinks.push(link)\n })\n }", "function computeNodeLinks() {\n nodes.forEach(function(node) {\n node.sourceLinks = [];\n node.targetLinks = [];\n });\n links.forEach(function(link) {\n var source = link.source,\n target = link.target;\n if (typeof source === \"number\") source = link.source = nodes[link.source];\n if (typeof target === \"number\") target = link.target = nodes[link.target];\n source.sourceLinks.push(link);\n target.targetLinks.push(link);\n });\n }", "function computeNodeLinks() {\n nodes.forEach(function(node) {\n // Links that have this node as source.\n node.sourceLinks = [];\n // Links that have this node as target.\n node.targetLinks = [];\n });\n links.forEach(function(link) {\n var source = link.source,\n target = link.target;\n if (typeof source === 'number') source = link.source = nodes[link.source];\n if (typeof target === 'number') target = link.target = nodes[link.target];\n source.sourceLinks.push(link);\n target.targetLinks.push(link);\n });\n }", "function computeNodeLinks() {\n nodes.forEach(function(node) {\n // Links that have this node as source.\n node.sourceLinks = [];\n // Links that have this node as target.\n node.targetLinks = [];\n });\n links.forEach(function(link) {\n var source = link.source,\n target = link.target;\n if (typeof source === 'number') source = link.source = nodes[link.source];\n if (typeof target === 'number') target = link.target = nodes[link.target];\n source.sourceLinks.push(link);\n target.targetLinks.push(link);\n });\n }", "function computeNodeLinks() {\n nodes.forEach(function(node) {\n node.sourceLinks = [];\n node.targetLinks = [];\n });\n links.forEach(function(link) {\n var source = link.source,\n target = link.target;\n if (typeof source === \"number\") source = link.source = nodes[link.source];\n if (typeof target === \"number\") target = link.target = nodes[link.target];\n source.sourceLinks.push(link);\n target.targetLinks.push(link);\n });\n }", "function computeNodeLinks() {\n\t nodes.forEach(function (node) {\n\t node.sourceLinks = [];\n\t node.targetLinks = [];\n\t });\n\t links.forEach(function (link) {\n\t var source = link.source,\n\t target = link.target;\n\t if (typeof source === \"number\") source = link.source = nodes[link.source];\n\t if (typeof target === \"number\") target = link.target = nodes[link.target];\n\t source.sourceLinks.push(link);\n\t target.targetLinks.push(link);\n\t });\n\t }", "function computeNodeLinks() {\n\t nodes.forEach(function(node) {\n\t // Links that have this node as source.\n\t node.sourceLinks = [];\n\t // Links that have this node as target.\n\t node.targetLinks = [];\n\t });\n\t links.forEach(function(link) {\n\t var source = link.source,\n\t target = link.target;\n\t if (typeof source === 'number') source = link.source = nodes[link.source];\n\t if (typeof target === 'number') target = link.target = nodes[link.target];\n\t source.sourceLinks.push(link);\n\t target.targetLinks.push(link);\n\t });\n\t }", "function computeNodeLinks() {\r\n var count = 0;\r\n\r\n nodes.forEach(function(node) {\r\n \r\n node.sourceLinks = [];\r\n node.targetLinks = [];\r\n console.log(node.targetLinks);\r\n // console.log(\"success\" + count + node.name);\r\n // count++;\r\n });\r\n links.forEach(function(link) {\r\n var source = link.source,\r\n target = link.target;\r\n if (typeof source === \"number\") source = link.source = nodes[link.source];\r\n if (typeof target === \"number\") target = link.target = nodes[link.target];\r\n console.log(\"Count: \" + count + \" Source: \" + link.source);\r\n source.sourceLinks.push(link);\r\n target.targetLinks.push(link);\r\n });\r\n }", "function computeNodeLinks(graph) {\n graph.nodes.forEach(function(node, i) {\n node.index = i;\n node.sourceLinks = [];\n node.targetLinks = [];\n });\n var nodeById = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1_d3_collection__[\"a\" /* map */])(graph.nodes, id);\n graph.links.forEach(function(link, i) {\n link.index = i;\n var source = link.source, target = link.target;\n if (typeof source !== \"object\") source = link.source = find(nodeById, source);\n if (typeof target !== \"object\") target = link.target = find(nodeById, target);\n source.sourceLinks.push(link);\n target.targetLinks.push(link);\n });\n }", "function computeNodeLinks(graph) {\n graph.nodes.forEach(function(node, i) {\n node.index = i;\n node.sourceLinks = [];\n node.targetLinks = [];\n });\n var nodeById = Object(__WEBPACK_IMPORTED_MODULE_1_d3_collection__[\"a\" /* map */])(graph.nodes, id);\n graph.links.forEach(function(link, i) {\n link.index = i;\n var source = link.source, target = link.target;\n if (typeof source !== \"object\") source = link.source = find(nodeById, source);\n if (typeof target !== \"object\") target = link.target = find(nodeById, target);\n source.sourceLinks.push(link);\n target.targetLinks.push(link);\n });\n }", "function computeNodeLinks(graph) {\n graph.nodes.forEach(function (node, i) {\n node.index = i;\n node.sourceLinks = [];\n node.targetLinks = [];\n });\n var nodeById = d3Collection.map(graph.nodes, id);\n graph.links.forEach(function (link, i) {\n link.index = i;\n var source = link.source, target = link.target;\n if (typeof source !== \"object\") source = link.source = find(nodeById, source);\n if (typeof target !== \"object\") target = link.target = find(nodeById, target);\n source.sourceLinks.push(link);\n target.targetLinks.push(link);\n });\n }", "function computeNodeLinks(graph) {\n graph.nodes.forEach(function(node, i) {\n node.index = i;\n node.sourceLinks = [];\n node.targetLinks = [];\n });\n var nodeById = Object(__WEBPACK_IMPORTED_MODULE_1_d3_collection__[\"c\" /* map */])(graph.nodes, id);\n graph.links.forEach(function(link, i) {\n link.index = i;\n var source = link.source, target = link.target;\n if (typeof source !== \"object\") source = link.source = find(nodeById, source);\n if (typeof target !== \"object\") target = link.target = find(nodeById, target);\n source.sourceLinks.push(link);\n target.targetLinks.push(link);\n });\n }", "function computeNodeLinks(graph) {\n graph.nodes.forEach(function(node, i) {\n node.index = i;\n node.sourceLinks = [];\n node.targetLinks = [];\n });\n var nodeById = Object(__WEBPACK_IMPORTED_MODULE_1_d3_collection__[\"c\" /* map */])(graph.nodes, id);\n graph.links.forEach(function(link, i) {\n link.index = i;\n var source = link.source, target = link.target;\n if (typeof source !== \"object\") source = link.source = find(nodeById, source);\n if (typeof target !== \"object\") target = link.target = find(nodeById, target);\n source.sourceLinks.push(link);\n target.targetLinks.push(link);\n });\n }", "function computeNodeLinks(graph) {\n graph.nodes.forEach(function (node, i) {\n node.index = i;\n node.sourceLinks = [];\n node.targetLinks = [];\n });\n var nodeById = Object(__WEBPACK_IMPORTED_MODULE_1_d3_collection__[\"a\" /* map */])(graph.nodes, id);\n graph.links.forEach(function (link, i) {\n link.index = i;\n var source = link.source,\n target = link.target;\n if ((typeof source === \"undefined\" ? \"undefined\" : _typeof(source)) !== \"object\") source = link.source = find(nodeById, source);\n if ((typeof target === \"undefined\" ? \"undefined\" : _typeof(target)) !== \"object\") target = link.target = find(nodeById, target);\n source.sourceLinks.push(link);\n target.targetLinks.push(link);\n });\n }", "function computeNodeLinks(graph) {\n graph.nodes.forEach(function(node, i) {\n node.index = i;\n node.sourceLinks = [];\n node.targetLinks = [];\n });\n var nodeById = Object(d3_collection__WEBPACK_IMPORTED_MODULE_1__[\"map\"])(graph.nodes, id);\n graph.links.forEach(function(link, i) {\n link.index = i;\n var source = link.source, target = link.target;\n if (typeof source !== \"object\") source = link.source = find(nodeById, source);\n if (typeof target !== \"object\") target = link.target = find(nodeById, target);\n source.sourceLinks.push(link);\n target.targetLinks.push(link);\n });\n }", "function computeNodeLinks(nodes, links) {\n nodes.forEach(function(node) {\n node.sourceLinks = [];\n node.targetLinks = [];\n });\n links.forEach(function(link) {\n var source = link.source,\n target = link.target;\n nodes[source].sourceLinks.push(link);\n nodes[target].targetLinks.push(link);\n });\n }", "function update(nodes, links, sourceNode) {\n const originalNodes = allNodes;\n const originalLinks = allLinks;\n\n // update pattern: https://livebook.manning.com/book/d3js-in-action-second-edition/chapter-7/142\n const centerNode = originalNodes.filter(d => d.id === sourceNode.id)\n links = originalLinks.filter(d =>\n centerNode.includes(d.source) ||\n centerNode.includes(d.target))\n\n nodes = links.map(d => {\n return originalNodes.filter(item =>\n d.source.id.includes(item.id) ||\n d.target.id.includes(item.id))\n }).flat()\n\n nodes = nodes.reduce((acc, current) => {\n const x = acc.find(item => item.id === current.id);\n if (!x) {\n return acc.concat([current]);\n } else {\n return acc;\n }\n }, []);\n\n console.log(d3.select(\".network\").selectAll(\".node\").data(nodes));\n console.log(links)\n console.log(nodes)\n\n d3.select(\".network\").select(\".nodes\").selectAll(\".node\")\n .data(nodes)\n .join( enter => {\n const nodeEnter = enter.append(\"g\").attr(\"class\",\"node\")\n .on('click', function(d){\n update(nodes, links, d)\n nodeInfo.html(`<span class=\"node-info__label\">${d.label}</span> <a class=\"node-info__link\" href=${d.id} target=__blank>${d.id}</a>`)\n .style(\"display\", \"block\")\n })\n .on(\"mouseover\", d => {\n return tooltip.style(\"visibility\", \"visible\")\n .text(d.label)\n })\n .on(\"mousemove\", () => {\n // tt positioning: https://www.d3-graph-gallery.com/graph/interactivity_tooltip.html\n return tooltip.style(\"top\", (event.pageY-10)+\"px\").style(\"left\",(event.pageX+10)+\"px\")\n })\n .on(\"mouseout\", () => {\n return tooltip.style(\"visibility\", \"hidden\")\n })\n\n tickLink(node)\n // .attr(\"transform\", function(d) {\n // return \"translate(\" + d.x + \",\" + d.y + \")\";\n // });\n nodeEnter.append(\"circle\")\n .attr(\"r\", function(d) {\n if (d.type === \"node\") {\n return 10;\n } else {\n return 6;\n }\n })\n .attr(\"class\", d => `type-${d.type}`)\n .call(d3.drag()\n .on(\"start\", dragstarted)\n .on(\"drag\", dragged)\n .on(\"end\", dragended));\n },\n update => {\n update.select(\".node\")\n update.select(\"circle\").attr(\"r\", function(d) {\n if (d.type === \"node\") {\n return 10;\n } else {\n return 6;\n }\n }).attr(\"class\", d => `type-${d.type}`)\n .call(d3.drag()\n .on(\"start\", dragstarted)\n .on(\"drag\", dragged)\n .on(\"end\", dragended))\n })\n // exit => exit\n // .call(exit => exit.remove())\n\n d3.select(\".network\").select(\".links\").selectAll(\".link\")\n .data(links)\n .join( enter => {\n enter.append(\"line\")\n .attr(\"class\",\"link\")\n\n tickLink(link)\n // .attr(\"x1\", function(d) { return d.source.x; })\n // .attr(\"y1\", function(d) { return d.source.y; })\n // .attr(\"x2\", function(d) { return d.target.x; })\n // .attr(\"y2\", function(d) { return d.target.y; });\n },\n update => {\n update.select(\".link\")\n .attr(\"x1\", function(d) {\n return d.source.x;\n })\n\n tickLink(link)\n // .attr(\"y1\", function(d) { return d.source.y; })\n // .attr(\"x2\", function(d) { return d.target.x; })\n // .attr(\"y2\", function(d) { return d.target.y; });\n })\n\n\n // simulation\n // //.nodes(nodes)\n // .on(\"tick\", () => {\n // ticked(link, node)\n // });\n\n\n\n // simulation.force(\"link\")\n // .links(links);\n }", "function update(nodes, links, sourceNode) {\n const originalNodes = allNodes;\n const originalLinks = allLinks;\n\n // -> true if user clicked on a node\n if (sourceNode) {\n // update pattern: https://livebook.manning.com/book/d3js-in-action-second-edition/chapter-7/142\n const centerNode = originalNodes.filter(d => d.id === sourceNode.id)\n links = originalLinks.filter(d =>\n centerNode.includes(d.source) ||\n centerNode.includes(d.target))\n\n nodes = links.map(d => {\n return originalNodes.filter(item =>\n d.source.id.includes(item.id) ||\n d.target.id.includes(item.id))\n }).flat()\n\n // remove dups: https://dev.to/marinamosti/removing-duplicates-in-an-array-of-objects-in-js-with-sets-3fep\n nodes = nodes.reduce((acc, current) => {\n const x = acc.find(item => item.id === current.id);\n if (!x) {\n return acc.concat([current]);\n } else {\n return acc;\n }\n }, []);\n // -> default\n } else {\n nodes = originalNodes;\n links = originalLinks;\n }\n\n d3.select(\".network\").select(\".nodes\").selectAll(\".node\")\n .data(nodes)\n .join( enter => {\n const nodeEnter = enter.append(\"g\").attr(\"class\",\"node\")\n\n // node events\n .on('click', function(d){\n update(nodes, links, d)\n nodeInfo.html(`<span class=\"node-info__label\">${d.label}</span> <a class=\"node-info__link\" href=${d.id} target=__blank>${d.id}</a>`)\n .style(\"display\", \"block\")\n })\n .on(\"mouseover\", d => {\n return tooltip.style(\"visibility\", \"visible\")\n .text(d.label)\n })\n .on(\"mousemove\", () => {\n // tt positioning: https://www.d3-graph-gallery.com/graph/interactivity_tooltip.html\n return tooltip.style(\"top\", (event.pageY-10)+\"px\").style(\"left\",(event.pageX+10)+\"px\")\n })\n .on(\"mouseout\", () => {\n return tooltip.style(\"visibility\", \"hidden\")\n }).attr(\"transform\", function(d) {\n return \"translate(\" + d.x + \",\" + d.y + \")\";\n });\n\n // node circles\n nodeEnter.append(\"circle\")\n .attr(\"r\", function(d) {\n if (d.type === \"node\") {\n return 10;\n } else {\n return 6;\n }\n })\n .attr(\"class\", d => `type-${d.type}`)\n .call(d3.drag()\n .on(\"start\", dragstarted)\n .on(\"drag\", dragged)\n .on(\"end\", dragended));\n },\n update => {\n update.select(\"circle\").attr(\"r\", function(d) {\n if (d.type === \"node\") {\n return 10;\n } else {\n return 6;\n }\n }).attr(\"class\", d => `type-${d.type}`)\n .call(d3.drag()\n .on(\"start\", dragstarted)\n .on(\"drag\", dragged)\n .on(\"end\", dragended))\n })\n\n d3.select(\".network\").select(\".links\").selectAll(\".link\")\n .data(links)\n .join( enter => {\n enter.append(\"line\")\n .attr(\"class\",\"link\")\n .attr(\"x1\", function(d) { return d.source.x; })\n .attr(\"y1\", function(d) { return d.source.y; })\n .attr(\"x2\", function(d) { return d.target.x; })\n .attr(\"y2\", function(d) { return d.target.y; });\n },\n update => {\n update.select(\".link\")\n .attr(\"x1\", function(d) {\n return d.source.x;\n })\n .attr(\"y1\", function(d) { return d.source.y; })\n .attr(\"x2\", function(d) { return d.target.x; })\n .attr(\"y2\", function(d) { return d.target.y; });\n })\n }", "function FlattenNodesLinks(nodesObj, linksObj) {\n var nodesArr = [];\n var indices = {};\n var index = 0;\n\n // convert node object into list and record its index\n Object.keys(nodesObj).forEach(function(node) {\n nodesArr.push(nodesObj[node]);\n indices[node] = index++;\n });\n\n var linksArr = [];\n\n // iterate through each source entry\n Object.keys(linksObj).forEach(function(sourceUrlStr) {\n // iterate through each target associated with the current source url\n linksObj[sourceUrlStr].forEach(function(targetUrlStr) {\n // NOTE: these objects are serialized into JSON so object references are lost\n // d3 needs node indices for force directed layout\n linksArr.push({\n source: indices[sourceUrlStr],\n target: indices[targetUrlStr]\n });\n });\n });\n\n return {\n nodes: nodesArr,\n links: linksArr\n };\n}", "function updateLinks(source, nodes) {\n /*\n * Determine the array of links given the\n * nodes provided to the layout\n */\n var links = tree.links(nodes);\n\n /*\n * Update link paths for all new node locations\n * Select all the svg links on the page that have a valid target\n * in the links data. Links with an invalid target are those\n * where the child has been collapsed away.\n */\n var linkSelection = svgGroup.selectAll(D3V.SVG_PATH + SYNTAX.DOT + D3V.LINK)\n .data(links, function (link) {\n return id(link.target);\n });\n\n /*\n * For all links not yet drawn, build an svg path using the\n * co-ordinates of the source, ie. parent.\n */\n linkSelection.enter().insert(D3V.SVG_ELEMENT + SYNTAX.COLON + D3V.SVG_PATH, D3V.GROUP_ELEMENT)\n .attr(D3V.CSS_CLASS, D3V.LINK)\n .attr(D3V.SVG_DATA_ELEMENT, function (link) {\n var o = {\n x: source.x0,\n y: source.y0\n };\n return diagonal({\n source: o,\n target: o\n });\n });\n\n /*\n * Starts an animtion of the link's svg data element using the path generator\n */\n linkSelection.transition().duration(TRANSITION_DURATION)\n .attr(D3V.SVG_DATA_ELEMENT, diagonal);\n\n /*\n * Removal of invalid links where their targets have been collapsed away\n * Animate their removal by regenerating the link back to pointing their\n * source and target to the source, ie. parent.\n */\n linkSelection.exit().transition().duration(TRANSITION_DURATION)\n .attr(D3V.SVG_DATA_ELEMENT, function (link) {\n var o = {\n x: source.x,\n y: source.y\n };\n return diagonal({\n source: o,\n target: o\n });\n }).remove();\n }", "function genLinks(map){\n map.forEach(function(value){ // For each JSON object in the Map\n value.linksTo.forEach(function(linkKey) { // For each destination node description\n var targetAxis = findLink(value.type); // Get the axis that this axis links to\n if(targetAxis !== \"\"){\n var targetObject = nodeMaps[targetAxis].get(linkKey); // Now that we have the name of the axis to link to, get the corresponding object.\n var jsonObj = {source: value, target: targetObject}; // Construct a relationship between the linked objects\n links.push(jsonObj);\n }\n });\n });\n}", "function setLinkIndexAndNum()\n { \n for (var i = 0; i < data.links.length; i++) \n {\n if (i != 0 &&\n data.links[i].source == data.links[i-1].source &&\n data.links[i].target == data.links[i-1].target) \n {\n data.links[i].linkindex = data.links[i-1].linkindex + 1;\n }\n else \n {\n data.links[i].linkindex = 1;\n }\n // save the total number of links between two nodes\n if(mLinkNum[data.links[i].target + \",\" + data.links[i].source] !== undefined)\n {\n mLinkNum[data.links[i].target + \",\" + data.links[i].source] = data.links[i].linkindex;\n }\n else\n {\n mLinkNum[data.links[i].source + \",\" + data.links[i].target] = data.links[i].linkindex;\n }\n }\n }", "function addLinks(links) {\r\n\t\tgraph.edges =graph.edges || [];\r\n\t\tif (links!==undefined && links.length) {\r\n\t\t\tlinks.forEach(function(link, index) {\r\n\t\t\t\tvar indexOfSourceAndTarget= getIndexOfSourceAndTarget(link);\r\n\t\t\t\tif (indexOfSourceAndTarget!==undefined && indexOfSourceAndTarget.sourceIndex!==undefined && indexOfSourceAndTarget.targetIndex!==undefined) {\r\n\t\t\t\t\tlink.source =indexOfSourceAndTarget.sourceIndex;\r\n\t\t\t\t\tlink.target = indexOfSourceAndTarget.targetIndex;\r\n\t\t\t\t\tgraph.edges.push(link);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t}", "function fixLinkTargets() {\n tables['links'].forEach(function(row) {\n row.toCollectionId = row._to.slice(0,4)\n row.fromCollectionId = row._from.slice(0,4)\n delete row.toTableId\n delete row.fromTableId\n })\n}", "function setLinkIndexAndNum(){\n for (var i = 0; i < g.links.length; i++){\n if (i != 0 &&\n g.links[i].source == g.links[i-1].source &&\n g.links[i].target == g.links[i-1].target)\n {\n g.links[i].linkindex = g.links[i-1].linkindex + 1;\n }else{\n g.links[i].linkindex = 1;\n }\n // save the total number of links between two nodes\n\t\t\t//console.log(g.links[i])\n if(mLinkNum[g.links[i].target + \",\" + g.links[i].source] !== undefined){\n mLinkNum[g.links[i].target + \",\" + g.links[i].source] = g.links[i].linkindex;\n }else{\n mLinkNum[g.links[i].source + \",\" + g.links[i].target] = g.links[i].linkindex;\n }\n }\n }", "function get_links(parent, child, link){\n\n for(var i=0; i<parent.length; i++){\n if(parent[i].children.length >= 1){\n for(var j = 0; j<parent[i].children.length; j++){\n var obj = {};\n obj.source = parent[i].node[0];\n obj.target = parent[i].children[j];\n link.push(obj);\n }\n }else continue;\n }\n\n for(var i=0; i< child.length; i++){\n if(child[i].children.length >= 1){\n for(var j = 0; j<child[i].children.length; j++){\n var obj = {};\n obj.source = child[i].node[0];\n obj.target = child[i].children[j];\n link.push(obj);\n }\n }else continue;\n }\n}", "function setLinkIndexAndNum()\n {\n for (var i = 0; i < finalResult[1].length; i++)\n {\n if (i != 0 &&\n finalResult[1][i].source == finalResult[1][i - 1].source &&\n finalResult[1][i].target == finalResult[1][i - 1].target)\n {\n finalResult[1][i].linkindex = finalResult[1][i - 1].linkindex + 1;\n }\n else\n {\n finalResult[1][i].linkindex = 1;\n }\n // save the total PhoneNumberber of links between two nodes\n if (mLinkNum[finalResult[1][i].target + \",\" + finalResult[1][i].source] !== undefined)\n {\n mLinkNum[finalResult[1][i].target + \",\" + finalResult[1][i].source] = finalResult[1][i].linkindex;\n }\n else\n {\n mLinkNum[finalResult[1][i].source + \",\" + finalResult[1][i].target] = finalResult[1][i].linkindex;\n }\n }\n }", "function getD3Links(nodes) {\n var links = [];\n for (var i = 0; i< nodes.length; i++) {\n if (nodes[i].target !== undefined) {\n for (var x = 0; x< nodes[i].target.length; x++ ) {\n links.push({\n source: nodes[i],\n target: nodes[nodes[i].target[x]],\n // weight: nodes[i].weight[i] // think how to store weight in adj list\n left: false,\n right: true\n })\n }\n }\n }\n return links;\n }", "nodeParams(sourceNode, targetNode) {\n // for edges between the specified source and target\n // return element object to be passed to cy.add() for intermediary node\n return {};\n }", "function mergeInLinks(addLinks) {\r\n\t\tvar newLinks = [];\r\n\t\tvar nodeLookup = [];\r\n\t\tfor (i = 0; i < nodes.length; i++) {\r\n\t\t\tnodeLookup[nodes[i].name] = nodes[i];\r\n\t\t}\r\n\t\taddLinks.sort(function(a, b){\r\n\t\t if(a.source_name < b.source_name) return -1;\r\n\t\t if(a.source_name > b.source_name) return 1;\r\n\t\t if(a.target_name < b.target_name) return -1;\r\n\t\t if(a.target_name > b.target_name) return 1;\r\n\t\t\treturn 0;\r\n\t\t});\r\n\t\t// merging avoid duplicates\r\n\t\twhile (links.length > 0 && addLinks.length > 0) {\r\n\t\t\tif (!addLinks[0].source) {\r\n\t\t\t\taddLinks[0].source = nodeLookup[addLinks[0].source_name];\r\n\t\t\t\taddLinks[0].target = nodeLookup[addLinks[0].target_name];\r\n\t\t\t\tif(!(addLinks[0].source && addLinks[0].target)) {\r\n\t\t\t\t\tconsole.log(addLinks[0].source_name + \" or \" + addLinks[0].target_name + \" not found\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (links[0].id == addLinks[0].id) {\r\n\t\t\t\tnewLinks.push(links.shift());\r\n\t\t\t\taddLinks.shift();\r\n\t\t\t} else if (links[0].id < addLinks[0].id) {\r\n\t\t\t\tnewLinks.push(links.shift());\r\n\t\t\t} else {\r\n\t\t\t\tnewLinks.push(addLinks.shift());\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (links.length == 0) {\r\n\t\t\twhile (addLinks.length > 0) {\r\n\t\t\t\tif (!addLinks[0].source) {\r\n\t\t\t\t\taddLinks[0].source = nodeLookup[addLinks[0].source_name];\r\n\t\t\t\t\taddLinks[0].target = nodeLookup[addLinks[0].target_name];\r\n\t\t\t\t}\r\n\t\t\t\tnewLinks.push(addLinks.shift());\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (addLinks.length == 0) {\r\n\t\t\tnewLinks = newLinks.concat(links);\r\n\t\t}\r\n\t\tlinks = newLinks;\r\n\t}", "function updateLinks(key) {\n var isSource = key === 'sources';\n var neighbours = edge.get(key);\n neighbours.forEach(\n function(d) {\n // get number of time we meet d\n var neighbour_count = neighbour_counts[key][d];\n if (neighbour_count === undefined) {\n neighbour_count = 0;\n neighbour_counts[key][d] = neighbour_count;\n }\n // increment neighbour count\n neighbour_count++;\n neighbour_counts[key][d] = neighbour_count;\n // get d links\n var links_by_id = d3_edge[key][d];\n if (links_by_id === undefined) {\n links_by_id = {};\n d3_edge[key][d] = links_by_id;\n }\n // if a link is missing\n var links_by_id_length = Object.keys(links_by_id).length;\n if (links_by_id_length < neighbour_count) {\n // create it\n link = {\n isSource: isSource,\n source: isSource? d : d3_edge.id,\n target: (!isSource)? d : d3_edge.id,\n elt: edge, // save edge\n id: this.uuid(), // uuid\n view_pos: d3_graph.links.length // pos in view\n };\n // add in view\n d3_graph.links.push(link);\n d3_graph.data_by_id[link.id] = link;\n // try to inject references to sources\n var source = d3_graph.data_by_id[link.source];\n if (source !== undefined) {\n link.source = source;\n }\n // and targets\n var target = d3_graph.data_by_id[link.target];\n if (target !== undefined) {\n link.target = target;\n }\n // push link in d3_edge model\n links_by_id[link.id] = link;\n }\n },\n this\n );\n // remove useless links\n for (vertice_id in d3_edge[key]) {\n var neighbour_count = neighbour_counts[key][vertice_id];\n var index = 0; // index to start to remove links\n if (neighbour_count !== undefined) {\n index = neighbour_count;\n }\n // delete links from model\n var link_id_to_delete = Object.keys(d3_edge[key][vertice_id]).splice(index);\n link_id_to_delete.forEach(\n function(link_id) {\n var link = d3_graph.data_by_id[link_id];\n // delete from model\n delete d3_edge[key][vertice_id][link_id];\n // delete from view\n delete d3_graph.data_by_id[link_id];\n link_pos_to_delete.push(link.view_pos);\n },\n this\n );\n }\n }", "function updateLinkPorts(items, request) {\n\tfor (var i = 0; i < items.length; i++) {\n\t var shapeItem = items[i];\n\t \n\t var sourcePort = shapeItem.source[0];\n var sinkPort = shapeItem.sink[0];\n\t \n\t var sourceNode = sourcePort.parent[0];\n\t var sinkNode = sinkPort.parent[0];\n\t \n\t var sourcePoint = [topoStore.getValue(sourceNode, 'x', ''),\n\t\t\t topoStore.getValue(sourceNode, 'y', '')\n\t\t\t ];\n\t var sinkPoint = [topoStore.getValue(sinkNode, 'x', ''),\n\t\t\t topoStore.getValue(sinkNode, 'y', '')\n\t\t\t ];\n\n\t var sourceWidth = sourceNode.width[0];\n var sinkWidth = sinkNode.width[0];\n\n\t // let's get 20 points around each node...\n\t var source_points = pointsOnCircle(sourcePoint, sourceWidth, 20);\n\t var sink_points = pointsOnCircle(sinkPoint, sinkWidth, 20);\n\t \n\t // now find the closest points for the link\n\t var m_points = closestPoints(source_points, sink_points);\n\n\t topoStore.setValue(sourcePort, 'x', source_points[m_points[0]][0]);\n\t topoStore.setValue(sourcePort, 'y', source_points[m_points[0]][1]);\n\t topoStore.setValue(sinkPort, 'x', sink_points[m_points[1]][0]);\n topoStore.setValue(sinkPort, 'y', sink_points[m_points[1]][1]);\n\t \n\t node_ports[topoStore.getValue(sourceNode, 'id', '')][m_points[0]] = 1;\n\t node_ports[topoStore.getValue(sinkNode, 'id', '')][m_points[1]] = 1;\n\n\t positioned[topoStore.getValue(sourcePort, 'id', '')] = 1;\n\t positioned[topoStore.getValue(sinkPort, 'id', '')] = 1;\n\t}\n }", "function updateDistances() {\n var start, end;\n for (var i = 0, n = links.length; i < n; i++) {\n start = {x: links[i].source.x, y: links[i].source.y};\n end = {x: links[i].target.x, y: links[i].target.y};\n links[i].distance = computeDistance(start, end);\n }\n}", "function _makeNodeWorldConnections ( source_node, source_type ) {\n\n var conn, conn_source, conn_target;\n var target_type;\n\n // if there are no children/connections exit\n if (!source_node.connected) return ;\n\n // for each connection\n var l = source_node.connected.length;\n while( l-- > 0 )\n {\n conn = source_node.connected[ l ];\n conn_source = conn.source;\n conn_target = conn.target;\n\n // get the connected node, if it doesn't exist skip it\n var target_node = _GetNodeById ( conn.id );\n if (!target_node) continue;\n\n // get the node's type/template.\n target_type = _GetNodeType ( target_node.type );\n\n // set the node id, and hold a refference to its type\n target_node.id = conn.id;\n\n\n // initialize the template (compute matrix, vertices position, etc)\n _InitNodeTypeWorld ( target_type );\n\n // initialize the node's metadata and element\n _InitNodeWorld ( target_node, target_type );\n\n // apply the connected element's translation\n _ApplyWorldConnection ( target_node, target_type.connections[conn_target], \n source_node, source_type.connections[conn_source] );\n\n // add element to the dom\n EL_CAM.appendChild ( target_node.el );\n\n LEVEL.ACTIVE_MAP.push ( target_node );\n\n // iterate with the current nodes children\n _makeNodeWorldConnections ( target_node, target_type );\n }\n }", "function AddLink(link, sender) {\n var targetUrlStr = UrlHostPathname(link.target);\n\n if (blackListedUrls.has(targetUrlStr))\n return;\n\n var nodes = sessions[currentSession].nodes;\n\n // insert target node\n if (!(nodes[targetUrlStr])) {\n nodes[targetUrlStr] = {\n url: targetUrlStr,\n rawUrl: link.target,\n title: link.title,\n };\n } else {\n nodes[targetUrlStr].title = link.title;\n }\n\n // timestamp\n //if (!(nodes[targetUrlStr].timestamps)) {\n // nodes[targetUrlStr].timestamps = [];\n //}\n //nodes[targetUrlStr].timestamps.push(Date.now());\n var date = new Date();\n nodes[targetUrlStr].hours = date.getHours();\n nodes[targetUrlStr].minutes = date.getMinutes();\n\n // check that source URL is a nonempty string\n if (link.source.length > 0) {\n var sourceUrlStr = UrlHostPathname(link.source);\n\n // check for a self loop\n if (sourceUrlStr != targetUrlStr) {\n var forwardLinks = sessions[currentSession].forwardLinks;\n var backLinks = sessions[currentSession].backLinks;\n\n // insert source vertex\n if (!(nodes[sourceUrlStr])) {\n nodes[sourceUrlStr] = {\n url: sourceUrlStr,\n rawUrl: link.source\n };\n }\n\n if (!(forwardLinks[sourceUrlStr])) {\n forwardLinks[sourceUrlStr] = new Set();\n }\n if (!(backLinks[targetUrlStr])) {\n backLinks[targetUrlStr] = new Set();\n }\n\n // add vertices to the adjacency lists\n forwardLinks[sourceUrlStr].add(targetUrlStr);\n backLinks[targetUrlStr].add(sourceUrlStr);\n }\n }\n}", "function update(nodes, links) {\n\n circle = circleG.selectAll('circle').data(nodes, d=>d.id)\n\n circle.exit().remove()\n\n entered_circle = circle\n .enter().append('circle')\n .attr('r', nodeRadius)\n .attr('stroke-width', 2)\n .attr('stroke', 'mediumblue')\n .attr('fill', 'mediumblue')\n .attr('cx', function(d) {return d.x})\n .attr('cy', function(d) {return d.y})\n \n circle = circle.merge(entered_circle)\n\n circle.transition().duration(1000)\n .attr('cx', function(d) {return d.x})\n .attr('cy', function(d) {return d.y})\n .attr('id', function(d) {return \"node-\" + d.id.toString() + \"-\"})\n\n path = pathG.selectAll('path').data(links, d=>d.id)\n\n path.exit().remove()\n\n entered_path = path\n .enter().append('path')\n .attr('opacity', 1)\n .attr('stroke-linecap', 'round')\n .attr('stroke-width', '2px')\n .attr('fill', 'transparent')\n\n path = path.merge(entered_path)\n\n path.transition().duration(1000)\n .attr('id', function(d) { return \"link\" + \"-source-\" + d.source.id.toString() + \"-target-\" + d.target.id.toString() + \"-\" })\n .attr('stroke', 'mediumblue')\n .attr(\"d\", function(d) {\n var dx = d.target.x - d.source.x,\n dy = d.target.y - d.source.y,\n dr = Math.sqrt(dx * dx + dy * dy);\n\n return \"M\" + \n d.source.x + \",\" + \n d.source.y + \"L\" + \n d.target.x + \",\" + \n d.target.y\n })\n \n }", "link() {\n //this.models\n //this.sequences\n //this.genericTopLevels\n //this.ranges\n //this.cuts\n //this.genericLocations\n\n this.moduleDefinitions.forEach(function(moduleDefinition) {\n moduleDefinition.link();\n });\n \n this.modules.forEach(function(module) {\n module.link();\n });\n \n this.mappings.forEach(function(mapping) {\n mapping.link();\n });\n\n this.sequenceAnnotations.forEach(function(sequenceAnnotation) {\n sequenceAnnotation.link();\n });\n\n this.sequenceConstraints.forEach(function(sequenceConstraint) {\n sequenceConstraint.link();\n });\n\n this.componentDefinitions.forEach(function(componentDefinition) {\n componentDefinition.link();\n });\n\n this.functionalComponents.forEach(function(functionalComponent) {\n functionalComponent.link();\n });\n\n this.components.forEach(function(component) {\n component.link();\n });\n\n this.interactions.forEach(function(interaction) {\n interaction.link();\n });\n\n this.participations.forEach(function(participation) {\n participation.link();\n });\n\n this.collections.forEach(function(collection) {\n collection.link();\n });\n\n this.implementations.forEach(function(implementation) {\n implementation.link();\n });\n\n\t\t// All classes that inherit from Top Level (Identified) must be linked to link members of Top Level i.e.: attachments\n\t\tthis.attachments.forEach(function(attachment) {\n\t\t\tattachment.link();\n\t\t});\n\n\t\tthis.sequences.forEach(function(sequence) {\n\t\t\tsequence.link();\n\t\t});\n\n\t\tthis.models.forEach(function(model) {\n\t\t\tmodel.link();\n\t\t});\n\n\t\tthis.genericTopLevels.forEach(function(genericTopLevel) {\n\t\t\tgenericTopLevel.link();\n\t\t});\n\n this.provActivities.forEach(function(activity) {\n activity.link();\n });\n\n\t\tthis.provPlans.forEach(function(provPlan) {\n\t\t\tprovPlan.link();\n\t\t});\n\n\t\tthis.provAgents.forEach(function(provAgent) {\n\t\t\tprovAgent.link();\n\t\t});\n\n\t\tthis.provAssociations.forEach(function(association) {\n\t\t\tassociation.link();\n\t\t});\n\n\t\tthis.provUsages.forEach(function(usage) {\n\t\t\tusage.link();\n\t\t});\n\n this.combinatorialDerivations.forEach(function(derivation) {\n derivation.link();\n });\n\n this.variableComponents.forEach(function(component) {\n component.link();\n });\n }", "get nodesAndLinks() {\n const links = this.aggregatedByLink;\n if (links === null ) {\n return { links: [], nodes: [], totals: [], timeSeries: [] }\n }\n\n // Links\n links.forEach((d, i) => !d.id && (d.id = `link-${i}`)); // assign ids to links\n // Note that the visualization expects the 'weight' property. // links.forEach(d => d['weight'] = d[COLUMN_WEIGHT]);\n links.forEach((d) => { if (d.source !== d.target) d.directed = \"yes\"; });\n\n // Nodes (link source or target after top-n filtering, so only for visible links)\n const nodes = new Set();\n links.forEach(link => { nodes.add(link.source); nodes.add(link.target); });\n\n // Totals and time series\n const totals = this.aggregatedByNode;\n const timeSeries = this.timeSeriesData;\n\n return {\n links,\n nodes: [...nodes], // list of country codes used as either source or target\n totals,\n timeSeries,\n minLinkWeight: this.minLinkWeight,\n maxLinkWeight: this.maxLinkWeight,\n minTotalWeight: this.minTotalWeight,\n maxTotalWeight: this.maxTotalWeight\n };\n }", "function resetData() {\n var nodeIds = nodes.map(function (node) {\n return node.id\n })\n baseNodes.forEach(function (node) {\n if (nodeIds.indexOf(node.id) === -1) {\n nodes.push(node)\n }\n })\n links = baseLinks\n}", "function Link(source, target, indexes) {\n // d3 references the links by the index of the object it's linking to\n // hence why we store references both to the objets themselves \n // and also and the indexes in the graph object.\n this.source = indexes.source;\n this.target = indexes.target;\n this.sourceObject = source;\n this.targetObject = target;\n this.id = source + \"-\" + target;\n this.coords = {};\n return this;\n}", "function rebuild(nodes, links) {\n var temp_nodes = nodes.slice()\n var temp_links = links.slice()\n computeNodeLinks(temp_nodes, temp_links)\n computeNodeBreadths(temp_nodes, temp_links)\n for (var i = 0; i < temp_links.length; i++) {\n \t// console.log(temp_links[i]);\n var source = temp_links[i].source\n var target = temp_links[i].target\n var source_x = nodes[source].x\n var target_x = nodes[target].x\n var dx = target_x - source_x\n // Put in intermediate steps\n for (var j = dx; 1 < j; j--) {\n var intermediate = nodes.length\n var tempNode = {\n sankeyID: intermediate,\n name: \"intermediate\",\n // runTime: nodes[i].runTime\n }\n // console.log(tempNode)\n nodes.push(tempNode)\n links.push({\n source: intermediate,\n target: (j == dx ? target : intermediate-1),\n value: links[i].value\n })\n if (j == dx) {\n links[i].original_target = target\n links[i].last_leg_source = intermediate\n }\n links[i].target = intermediate\n }\n }\n\n return {\n nodes: nodes,\n links: links\n }\n }", "function packageConnections_lp(nodes) \n{\n\tvar map = {};\n\tvar connections = [];\n\n\t// Compute a map from name to node.\n\tnodes.forEach\n\t(\n\t\tfunction(d) \n\t\t{\n map[d.name] = d;\n// console.log(\"d:\",d,\"map[d.name]\",map[d.name]);\n\t\t}\n\t);\n\n\t// For each connection, construct a link from the source to target node.\n\tnodes.forEach\n\t(\n\t\tfunction(d) \n\t\t{\n\t\t\tif (d.connections) \n\t\t\t\td.connections.forEach\n\t\t\t\t(\n\t\t\t\t\tfunction(i) \n\t\t\t\t\t{\n connections.push({source: map[d.name], target: map[i]});\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t}\n\t);\n\treturn connections;\n}", "function addLinks(transitions, sourceNode) {\n for ( var j = 0; j < transitions.length; j++ ) {\n var transition = transitions[j];\n var targetNode = idMap[transition.target];\n \n if( targetNode === undefined ) {\n console.log('warning: transition found that targets a non-existent state: ' + transition.target);\n } else {\n // Calculate the angle for this transition to be rendered on the state's orbit\n //var _theta = ((360 / transitions.length) * j) * (Math.PI/180);\n\n var link = {\n source: sourceNode,\n target: targetNode,\n //theta: _theta,\n name: transition.name,\n numTransitions: node.get('transitions').length\n };\n links.push(link); \n\n // Store the calculated angle in this transition object so we can draw the orbiting sphere from the point that the path starts.\n //transition.theta = _theta;\n transition.source = sourceNode.get('id');\n\n // Change the nodeTypes of the target node to indicate that it is not an orphan\n targetNode.nodeType = 'linked';\n }\n } \n }", "_setupLinks() {\n\t\tthis.$links = this.$control.find( '.link' );\n\n\t\tthis._bindLinked();\n\t}", "__addConnectionTargets(connection) {\n if (this.source !== null || this.source !== undefined) {\n connection.addConnectionTarget(this.source);\n }\n\n for (let i in this.sinks) {\n console.log(\"Sinks: \", this.sinks);\n connection.addConnectionTarget(this.sinks[i]);\n }\n }", "function verifyAllNodesAreConnected(range){\n\t\tglobalData.links = globalData.links.filter((link) => { // For delete links which are from a node to the same\n\t\t\treturn link.source !== link.target\n\t\t})\n\t\tlet complement = { // unadded items complement used for verifying all nodes are connected\n\t\t\tcsources: arrayRange(0, range-1, 1),// A container of all available numbers\n\t\t\tctargets: arrayRange(0, range-1, 1),// A container of all available numbers\n\t\t}\n\t\tlet sources = globalData.links.map(function(link){\n\t\t\treturn link.source\n\t\t})\n\t\tlet targets = globalData.links.map(function(link){\n\t\t\treturn link.target\n\t\t})\n\t\tsources.map(function(index){complement.csources.splice(index, 1)})\n\t\ttargets.map(function(index){complement.ctargets.splice(index, 1)})\n\t\tcomplement.csources.map(function(source){\n\t\t\tglobalData.links.push({\n\t\t\t\tsource: source,\n\t\t\t\ttarget:~~d3.randomUniform(range)()\n\t\t\t})\n\t\t})\n\t\tcomplement.ctargets.map(function(target){\n\t\t\tglobalData.links.push({\n\t\t\t\tsource: ~~d3.randomUniform(range)(),\n\t\t\t\ttarget: target\n\t\t\t})\n\t\t})\n\t\tglobalData.links = globalData.links.filter((link) => { // For delete links which are from a node to the same\n\t\t\treturn link.source !== link.target\n\t\t})\n\t\tglobalData.links = [...new Set(globalData.links.flat(1))] // For getting uniques arrays \n\t}", "function sortLinks()\n { \n data.links.sort(function(a,b) {\n if (a.source > b.source) \n {\n return 1;\n }\n else if (a.source < b.source) \n {\n return -1;\n }\n else \n {\n if (a.target > b.target) \n {\n return 1;\n }\n if (a.target < b.target) \n {\n return -1;\n }\n else \n {\n return 0;\n }\n }\n });\n }", "function linkage(nodes) {\n return d3.merge(nodes.map(function(parent) {\n return (parent.children || []).map(function(child) {\n return {\n source: parent,\n target: child\n };\n });\n }));\n}", "initialize() {\n for (const ds of this.dataSources) {\n ds.visit((node) => node.initialize());\n }\n }", "function convertNode(n, extraFields, subobjects) {\n var node = {};\n node.id = n.id;\n node.type = n.type;\n for (var d in n._def.defaults) {\n var defval = n._def.defaults[d].value;\n if (n[d] != defval) {\n node[d] = n[d];\n } else if (defval !== \"\" && defval !== undefined && defval !== null) {\n // include only if not empty\n node[d] = defval;\n }\n }\n if (extraFields) {\n extraFields.forEach(function(d) {\n if (d in n) {\n node[d] = n[d];\n }\n });\n }\n if (subobjects) {\n subobjects.forEach(function(d) {\n var o = n[d];\n node[d] = {};\n for (var dd in o) {\n node[d][dd] = o[dd];\n }\n });\n }\n node.x = n.x;\n node.y = n.y;\n node.z = n.z;\n node.wires = [];\n for(var i=0;i<n.outputs;i++) {\n node.wires.push([]);\n }\n var wires = links.filter(function(d){return d.source === n});\n for (var i in wires) {\n var w = wires[i];\n\n // TODO: loop over link properties\n var obj = {task: w.target.id};\n if (w.sourcePort in node.wires) {\n node.wires[w.sourcePort].push(obj);\n } else {\n node.wires[w.sourcePort] = [obj];\n }\n obj.sourcePort = w.sourcePort;\n obj.targetPort = w.targetPort;\n if (w.hasOwnProperty(\"protocol\")) {\n obj.protocol = w.protocol;\n }\n }\n return node;\n }", "function buildAdjacencyGraph() {\n var g = dagre.graph();\n var nextId = 0;\n\n // Get the node id for the type (\"source\" or \"target\") or throw if we\n // haven't seen the node.\n function safeGetNodeId(type, edge) {\n var nodeId = edge[type].dagre.id;\n if (!g.hasNode(nodeId)) {\n throw new Error(type + \" node for '\" + e + \"' not in node list\");\n }\n return nodeId;\n }\n\n // Tag each node so that we can properly represent relationships when\n // we add edges. Also copy relevant dimension information.\n config.nodes.forEach(function(u) {\n var id = \"id\" in u ? u.id : \"_N\" + nextId++;\n u.dagre = { id: id, width: u.width, height: u.height };\n g.addNode(id, u.dagre);\n });\n\n config.edges.forEach(function(e) {\n var source = safeGetNodeId(\"source\", e);\n var target = safeGetNodeId(\"target\", e);\n\n e.dagre = { points: [] };\n\n // Track edges that aren't self loops - layout does nothing for self\n // loops, so they can be skipped.\n if (source !== target) {\n var id = \"id\" in e ? e.id : \"_E\" + nextId++;\n e.dagre.id = id;\n e.dagre.minLen = e.minLen || 1;\n e.dagre.width = e.width || 0;\n e.dagre.height = e.height || 0;\n g.addEdge(id, source, target, e.dagre);\n }\n });\n\n return g;\n }", "function createAllLinksArray () {\n var sourceName, targetName;\n for (i = 0; i < allConcentrations.length; i=i+1) {\n for (j = 0; j < courseTypes.length; j=j+1) {\n for (k = 0; k < allConcentrations[i].data[courseTypes[j]].length; k=k+1) {\n sourceName = allConcentrations[i].name;\n targetName = allConcentrations[i].data[courseTypes[j]][k].code;\n allLinks.push({\"source\": sourceName, \"target\": targetName});\n }\n }\n }\n console.log({\"links\": allLinks});\n}", "function insertLinks(data) {\n for (var i = 0, n = data.length; i < n; i++) {\n // find nodes by id\n var node1 = -1;\n var node2 = -1;\n for (var j = 0, m = nodes.length; j < m; j++) {\n if (data[i]['idNo1'] == nodes[j].dbId)\n node1 = nodes[j];\n if (data[i]['idNo2'] == nodes[j].dbId)\n node2 = nodes[j];\n if (node1 != -1 && node2 != -1)\n break;\n }\n // add link\n links.push({\n source: node1,\n target: node2,\n distance: data[i]['comprimento']\n });\n }\n}", "function groupLinks(graph)\n{\n var links = [];\n var groups = {};\n\n graph.links.forEach(function(l)\n {\n if(!groups[l.source])\n groups[l.source] = [];\n if(groups[l.source].indexOf(l.target) == -1)\n groups[l.source].push(l.target);\n });\n\n for(var g in groups)\n {\n var sourceNodes = graph.nodes.filter(function(n) { return n.group == g});\n var targetNodes = graph.nodes.filter(function(n) { return groups[g].indexOf(n.group) >= 0});\n\n sourceNodes.forEach(function(s)\n {\n var linkCounter = targetNodes.length;\n var index = 0;\n var label_name = \"\";\n targetNodes.forEach(function(t)\n {\n if(s.labels[index]) {\n label_name = s.labels[index++];\n } else {\n index = 0\n label_name = s.labels[index++];\n }\n links.push({source : s, target : t, label : label_name});\n });\n });\n }\n\n graph.links = links;\n return graph;\n}", "function addEdgeOnto(src,tgt){\n if(src>=0 && src<node_dataOnto.length){\n if(tgt>=0 && tgt<node_dataOnto.length){\n if(-1==indexOfLinkOnto(src,tgt)){\n link_dataOnto.push({source: node_dataOnto[src],target: node_dataOnto[tgt]});\n refreshGraphOnto(node_dataOnto,link_dataOnto);\n }\n }\n }\n}", "function calculate_link_positions(scenes) {\n scenes.forEach(function(scene) {\n\tfor (var i = 0; i < scene.out_links.length; i++) {\n\t scene.out_links[i].y0 = -1;\n\t}\n\n\tfor (var i = 0; i < scene.in_links.length; i++) {\n\t // These are links incoming to the node, so we're setting the \n\t // co-cordinates for the last point on the link path\n\t if (scene.in_links[i].y1 == -1) {\n\t\tscene.in_links[i].y1 = (link_width + link_gap)*i + scene.y + 0.5*link_width;\n\t }\n\t // TODO: Make this more efficient\n\t for (var j = 0; j < scene.out_links.length; j++) { \n\t\tif (scene.out_links[j].char_id == scene.in_links[i].char_id) {\n\t\t scene.out_links[j].y0 = scene.in_links[i].y1;\n\t\t break;\n\t\t}\n\t }\n\t scene.in_links[i].x1 = scene.x + 0.5*scene.width;\n\t}\n\n\tfor (var i = 0; i < scene.out_links.length; i++) {\n\t if (scene.out_links[i].y0 == -1) {\n\t\t//console.log(\"start not set yet\");\n\t\tscene.out_links[i].y0 = (link_width + link_gap)*i + scene.y + 0.5*link_width;\n\t }\n\t scene.out_links[i].x0 = scene.x + 0.5*scene.width;\n\t}\n });\n}", "function d3_layout_hierarchyLinks(nodes) {\n return d3.merge(nodes.map(function(parent) {\n return (parent.children || []).map(function(child) {\n return {source: parent, target: child};\n });\n }));\n}", "function d3_layout_hierarchyLinks(nodes) {\n return d3.merge(nodes.map(function(parent) {\n return (parent.children || []).map(function(child) {\n return {source: parent, target: child};\n });\n }));\n}", "function d3_layout_hierarchyLinks(nodes) {\n return d3.merge(nodes.map(function(parent) {\n return (parent.children || []).map(function(child) {\n return {source: parent, target: child};\n });\n }));\n}", "function d3_layout_hierarchyLinks(nodes) {\n return d3.merge(nodes.map(function(parent) {\n return (parent.children || []).map(function(child) {\n return {source: parent, target: child};\n });\n }));\n}", "function buildLinkData(link_ary) {\n link_ary.forEach(function (link) {\n link.source = nodeById.get(link.source);\n link.target = nodeById.get(link.target);\n link.n = Number(link.n)\n\n if (link.sentiment == \"1\") {\n link.source.out_pos += link.n\n } else {\n link.source.out_neg += link.n\n }\n // node = nodeById.get(link.target);\n if (link.sentiment == \"1\") {\n link.target.in_pos += link.n\n } else {\n link.target.in_neg += link.n\n }\n link.source.adj_src.push(link);\n link.target.adj_trgt.push(link);\n });\n}", "function nodeDrag(d, i) {\n console.log();\n var x = d3.event.x\n var y = d3.event.y\n\n vertical.style(\"stroke\", \"gray\");\n horizontal.style(\"stroke\", \"gray\");\n\n var xGrid, yGrid;\n var modX = x % resolution\n if (modX >= 3) {\n xGrid = x + (resolution - modX)\n }\n else {\n xGrid = x - modX\n }\n \n var modY = y % resolution\n if (modY >= 3) {\n yGrid = y + (resolution - modY)\n }\n else {\n yGrid = y - modY\n }\n\n d3.select(this).attr(\"x\", xGrid).attr(\"y\", yGrid);\n nodes[i].x = xGrid;\n nodes[i].y = yGrid;\n\n\n link.each(function(l, li) {\n if (l.source == i) {\n d3.select(this).attr(\"x1\", xGrid).attr(\"y1\", yGrid);\n } else if (l.target == i) {\n d3.select(this).attr(\"x2\", xGrid).attr(\"y2\", yGrid);\n }\n });\n }", "function setupLinkedNode (linkedElements, contextObj, targetRecordset, ix, keyingValue) {\n let currentWidgetNodes, currentLinkedNodes, nInfo, currentContextDef, j, keyField, k, nodeId,\n curVal, replacedNode, typeAttr, children, wInfo, nameTable\n let idValuesForFieldName = {}\n let linkInfoArray, nameTableKey, nameNumber, nameAttr, curTarget\n\n currentContextDef = contextObj.getContextDef()\n try {\n currentWidgetNodes = linkedElements.widgetNode\n currentLinkedNodes = linkedElements.linkedNode\n keyField = contextObj.getKeyField()\n if (targetRecordset[ix] && (targetRecordset[ix][keyField] || targetRecordset[ix][keyField] === 0)) {\n for (k = 0; k < currentLinkedNodes.length; k++) {\n // for each linked element\n nodeId = currentLinkedNodes[k].getAttribute('id')\n replacedNode = INTERMediator.setIdValue(currentLinkedNodes[k])\n typeAttr = replacedNode.getAttribute('type')\n if (typeAttr === 'checkbox' || typeAttr === 'radio') {\n children = replacedNode.parentNode.childNodes\n for (i = 0; i < children.length; i++) {\n if (children[i].nodeType === 1 && children[i].tagName === 'LABEL' &&\n nodeId === children[i].getAttribute('for')) {\n children[i].setAttribute('for', replacedNode.getAttribute('id'))\n break\n }\n }\n }\n }\n for (k = 0; k < currentWidgetNodes.length; k++) {\n wInfo = INTERMediatorLib.getWidgetInfo(currentWidgetNodes[k])\n if (wInfo[0]) {\n IMParts_Catalog[wInfo[0]].instanciate(currentWidgetNodes[k])\n if (imPartsShouldFinished.indexOf(IMParts_Catalog[wInfo[0]]) < 0) {\n imPartsShouldFinished.push(IMParts_Catalog[wInfo[0]])\n }\n }\n }\n }\n } catch (ex) {\n if (ex.message === '_im_auth_required_') {\n throw ex\n } else {\n INTERMediatorLog.setErrorMessage(ex, 'EXCEPTION-101')\n }\n }\n\n nameTable = {}\n for (k = 0; k < currentLinkedNodes.length; k++) {\n try {\n nodeId = currentLinkedNodes[k].getAttribute('id')\n if (INTERMediatorLib.isWidgetElement(currentLinkedNodes[k])) {\n nodeId = currentLinkedNodes[k]._im_getComponentId()\n // INTERMediator.widgetElementIds.push(nodeId)\n }\n // get the tag name of the element\n typeAttr = currentLinkedNodes[k].getAttribute('type')\n // type attribute\n linkInfoArray = INTERMediatorLib.getLinkedElementInfo(currentLinkedNodes[k])\n // info array for it set the name attribute of radio button\n // should be different for each group\n if (typeAttr === 'radio') { // set the value to radio button\n nameTableKey = linkInfoArray.join('|')\n if (!nameTable[nameTableKey]) {\n nameTable[nameTableKey] = nameAttrCounter\n nameAttrCounter++\n }\n nameNumber = nameTable[nameTableKey]\n nameAttr = currentLinkedNodes[k].getAttribute('name')\n if (nameAttr) {\n currentLinkedNodes[k].setAttribute('name', nameAttr + '-' + nameNumber)\n } else {\n currentLinkedNodes[k].setAttribute('name', 'IM-R-' + nameNumber)\n }\n }\n for (j = 0; j < linkInfoArray.length; j++) {\n nInfo = INTERMediatorLib.getNodeInfoArray(linkInfoArray[j])\n curVal = targetRecordset[ix][nInfo.field]\n if (!INTERMediator.isDBDataPreferable || curVal) {\n IMLibCalc.updateCalculationInfo(contextObj, keyingValue, nodeId, nInfo, targetRecordset[ix])\n }\n if (nInfo.table === currentContextDef.name) {\n curTarget = nInfo.target\n if (IMLibElement.setValueToIMNode(currentLinkedNodes[k], curTarget, curVal)) {\n postSetFields.push({'id': nodeId, 'value': curVal})\n }\n contextObj.setValue(keyingValue, nInfo.field, curVal, nodeId, curTarget)\n if (idValuesForFieldName[nInfo.field] === undefined) {\n idValuesForFieldName[nInfo.field] = []\n }\n idValuesForFieldName[nInfo.field].push(nodeId)\n }\n }\n } catch (ex) {\n if (ex.message === '_im_auth_required_') {\n throw ex\n } else {\n INTERMediatorLog.setErrorMessage(ex, 'EXCEPTION-27')\n }\n }\n }\n return idValuesForFieldName\n }", "function computeNodeValues() {\n nodes.forEach(function(node) {\n node.value = Math.max(\n d3Array.sum(node.sourceLinks, value),\n d3Array.sum(node.targetLinks, value)\n );\n });\n }", "function Links() {\n this.list = [];\n this.count = 0;\n this.ambiguousIndex = 0;\n this.ambiguousCount = 0;\n this.internalCount = 0;\n this.externalCount = 0;\n }", "function renameLinks(graph)\n{\n var links = [];\n var i = 0;\n if(graph.hasOwnProperty('links'))\n {\n graph.links.forEach(function(l)\n {\n var sourceNode = graph.nodes.filter(function(n) { return n.group === l.source; })[0];\n var targetNode = graph.nodes.filter(function(n) { return n.group === l.target; })[0];\n\n links.push({source: sourceNode.group, target: targetNode.group, value: l.value, label : l.label});\n });\n }\n graph.links = links;\n return graph;\n}", "function link_forward() {\n for (igen=0; igen < ngens-1; igen++) {\n\t if (igen == 0) {\n\t iList1.push(iselect); // This is the number in the comm_id list\n\t nodeList1.push(comm_name[iselect]) // This is the name of the individual nodes \n\t moneyList1.push(0.); \n\t }\n // empty these again\n \tiList2=[];\n\t nodeList2=[];\n\t moneyList2=[];\n \tmakeGen();\n \n // Now group and annotate the individual links\n\t node1_link=[];\n\t node2_link=[];\n\t money_link=[];\n\t tooltip=[];\n\t money_val=[];\n\t tip_str=[];\n\t tooltip_head=[];\n\n\t for (i=0; i < name1_arr.length; i++) {\n\t val1=comm_group[name1_arr[i]];\n\t type1=comm_type[name1_arr[i]];\n\t val2=comm_group[name2_arr[i]];\n\t type2=comm_type[name2_arr[i]];\n if (isLoop(val1,type1,val2,type2) == false) {\n \n if (val1=='PAC') val1='PAC'+igen.toString();\n if (val2=='PAC') val2='PAC'+(igen+1).toString();\n j2=i_comm_name[name2_arr[i]];\n\t\t id=-1;\n\t\t for (j=0; j < node1_link.length; j++) {\n\t\t if ((node1_link[j]==val1) && (node2_link[j]==val2)) id=j;\n\t\t }\n \t\t if (id >=0) {\n\t \t money_link[id]+=money_arr[i];\n\t\t if (money_arr[i] > min_label) {\n\t\t if (money_arr[i] > min_label){\n\t\t money_val[id].push(money_arr[i]);\n\t\t tip_str[id].push('&nbsp;<a onclick=\"doSelected('+j2+')\" href=\"#\">'+name2_arr[i].substring(0,40)+'</a><i> $'+parseInt(money_arr[i]).toLocaleString()+'</i><br>');\n \t\t\t \n\t\t }\n\t\t }\n\t\t \n\t\t } else {\n\t\t node1_link.push(val1);\n\t\t node2_link.push(val2);\n\t\t money_link.push(money_arr[i]);\n\t\t tooltip_head.push('<b>'+val1+'->'+val2);\n\t\t \n \t\t tooltip.push('<div style=\"text-align:left; font-size: 10px; font-family: garamond;\">');\n\t\t money_val.push([money_arr[i]]); \n\t\t tip_str.push(['&nbsp;<a onclick=\"doSelected('+j2+')\" href=\"#\">'+name2_arr[i]+'</a><i> $'+parseInt(money_arr[i]).toLocaleString()+'</i><br>']);\n\t\t }\n\t\t \n\t\t // Do we put the money into a candidate account as well?\n\t\t if (type2 == 'candidates') {\n\t\t name2=name2_arr[i];\n\t\t i2=i_comm_name[name2];\n\t\t k=i_cand_id[comm_cand_id[i2]];\n\t\t myrace=cand_race[k];\n\t\t if (myrace===undefined) myrace='none';\n\t\t if ((myrace.includes('SEN') == false)&&(myrace.includes('PRES')==false)) {\n\t\t if (cand_party[k] == \"DEM\") {\n\t\t if (myrace in dem_money_house) {\n\t\t dem_money_house[myrace]+=money_arr[i];\n\t\t } else {\n\t\t dem_money_house[myrace]=money_arr[i];\n\t\t }\n\t\t \n\t\t } else if (cand_party[k]== \"REP\") {\n\t\t if (myrace in rep_money_house) {\n\t\t rep_money_house[myrace]+=money_arr[i];\n\t\t } else {\n\t\t rep_money_house[myrace]=money_arr[i];\n\t\t }\n\t\t }\n \t\t //console.log(val2,name2,k,cand_name[k],cand_race[k]);\n\t\t }\n\t\t }\n\t\t \n }\n\t }\t \n\t \n\t for (j=0; j < node1_link.length; j++) {\n\t tooltip_head[j]+=' ($'+parseInt(money_link[j]).toLocaleString()+')</b><br>';\n\t \n\t \n\t tmparr=sortWithIndices(money_val[j]);\n\t nk=money_val[j].length;\n\t for (k=0; k < nk; k++) {\n\t k1=tmparr.sortIndices[nk-k-1];\n\t tooltip[j]+=tip_str[j][k1];\n\t }\n\t \n\t \n\t tooltip[j]+=\"</div>\";\n\t data.addRow([node1_link[j],node2_link[j],money_link[j],tooltip_head[j]+tooltip[j]]);\n\t }\n\t iList1=iList2.slice();\n nodeList1=nodeList2.slice();\n \tmoneyList1=moneyList2.slice();\n }\n title_str=comm_name[iselect]+' $'+totalAmt.toLocaleString();\n document.getElementById(\"chart_title\").innerHTML=title_str;\n\n options = {\n\t width: 900,\n\t tooltip: {isHtml: true},\n\t sankey: {\n node: { label: { fontName: 'Garamond',\n fontSize: 14,\n color: '#871b47',\n bold: true } } },\n };\n\n \n // Instantiate and draw our chart, passing in some options.\n chart = new google.visualization.Sankey(document.getElementById('chart_div'));\n chart.draw(data, options);\n \n if (doMap == true) {\n map_allInvisible();\n map_changeColorScheme('red_blue');\n moneymax=0.\n for (key in dem_money_house) {\n money=dem_money_house[key];\n if (key in rep_money_house) {\n money+=rep_money_house[key];\n }\n if (money > moneymax) moneymax=money;\n }\n for (key in rep_money_house) {\n money=rep_money_house[key];\n if (money > moneymax) moneymax=money;\n }\n console.log(moneymax);\n \n for (key in dem_money_house) {\n dmoney=dem_money_house[key];\n if (key in rep_money_house) {\n rmoney=rep_money_house[key];\n } else {\n rmoney=0.\n }\n if (key in map_bounds) { // really should be a function\n wgt=Math.sqrt((dmoney+rmoney)/moneymax);\n val=(dmoney)/(dmoney+rmoney);\n map_setVal(key,val);\n map_setWeight(key,wgt);\n map_changeVisible(key,true);\n }\n }\n for (key in rep_money_house) {\n rmoney=rep_money_house[key];\n if ((key in dem_money_house) == false) {\n if (key in map_bounds) {\n val=0.;\n wgt=Math.sqrt(rmoney/moneymax);\n map_setVal(key,val);\n map_setWeight(key,wgt); \n map_changeVisible(key,true);\n }\n }\n }\n \n }\n \n \n \n}", "function clearLinks(grid) {\n for (let y = 0; y < grid.length; y++) {\n for (let x = 0; x < grid[0].length; x++) {\n grid[y][x].linked = false;\n grid[y][x].links = [];\n }\n }\n}", "setupLinks() {\n for (let link in this.links) {\n this.links[link].addEventListener(\"click\", (e) => {\n let linkID = e.target.id;\n let viewToShow = linkID.slice(0, -5);\n let pointerToShow = `${viewToShow}-pointer`;\n this.showView(viewToShow);\n this.showPointer(pointerToShow);\n });\n\n // Events mouseover and mouseout simulates a hover effect for links.\n this.links[link].addEventListener(\"mouseover\", (e) => {\n let linkID = e.target.id;\n let pointerToShow = `${linkID.slice(0, -5)}-pointer`;\n this.showPointer(pointerToShow);\n });\n\n this.links[link].addEventListener(\"mouseout\", (e) => {\n for (let view in this.views) {\n if (this.views[view].classList != \"hidden\") {\n let activeView = `${this.views[view].id}-pointer`;\n this.showPointer(activeView);\n }\n }\n });\n }\n }", "function setHighlights(d) {\n let index = null\n if (clicked_node == null) {\n index = d.index;\n } else {\n index = d3.select(clicked_node).datum().index;\n }\n\n let high_map = { 'in': 'target', 'out': 'source' }\n\n\n links = link_layer\n .selectAll('.link')\n nodes = node_layer\n .selectAll('.node')\n if (link_highlight_type == \"both\") {\n highlight_links = links\n .filter(function (d) {\n return d.source.index == index || d.target.index == index;\n });\n\n highlight_nodes = nodes\n .filter((d) => neigh(index, d.index) || neigh(d.index, index));\n } else {\n highlight_links = links\n .filter(function (d) {\n return d[high_map[link_highlight_type]].index == index;\n });\n if (link_highlight_type == 'in') {\n highlight_nodes = nodes\n .filter((d) => neigh(d.index, index));\n } else {\n highlight_nodes = nodes\n .filter((d) => neigh(index, d.index));\n }\n }\n\n // Insert Elements into Highlight Layer\n cloneElements(highlight_links, '#highlight-layer', function (d) {\n d.style('stroke-width', function (f) {\n return Number(d3.select(this).style('stroke-width')) + 0.2\n })\n .style('stroke', getLinkColor[link_sent_state])\n .on('mouseover', highlightedLinkOver)\n .on('mousemove', () => link_tooltip.style(\"top\", (d3.event.pageY - 10) + \"px\").style(\"left\", (d3.event.pageX + 10) + \"px\"))\n .on('mouseout', function () { link_tooltip.style('visibility', 'hidden'); d3.select(this).style(\"stroke\", \"#aaa\") })\n })\n\n cloneElements(highlight_nodes, '#highlight-layer');\n\n highlight_layer.selectAll('.node')\n .style('fill', highlight_node_color_primary)\n\n link_layer.style('opacity', 0.1)\n node_layer.style('opacity', 0.5)\n}", "function computeLinkDepths() {\n nodes.forEach(function(node) {\n node.sourceLinks.sort(ascendingTargetDepth);\n node.targetLinks.sort(ascendingSourceDepth);\n });\n nodes.forEach(function(node) {\n var sy = 0, ty = 0;\n node.sourceLinks.forEach(function(link) {\n link.sy = sy;\n sy += link.dy;\n });\n node.targetLinks.forEach(function(link) {\n link.ty = ty;\n ty += link.dy;\n });\n });\n\n function ascendingSourceDepth(a, b) {\n return a.source.y - b.source.y;\n }\n\n function ascendingTargetDepth(a, b) {\n return a.target.y - b.target.y;\n }\n }", "function computeLinkDepths() {\n nodes.forEach(function(node) {\n node.sourceLinks.sort(ascendingTargetDepth);\n node.targetLinks.sort(ascendingSourceDepth);\n });\n nodes.forEach(function(node) {\n var sy = 0, ty = 0;\n node.sourceLinks.forEach(function(link) {\n link.sy = sy;\n sy += link.dy;\n });\n node.targetLinks.forEach(function(link) {\n link.ty = ty;\n ty += link.dy;\n });\n });\n\n function ascendingSourceDepth(a, b) {\n return a.source.y - b.source.y;\n }\n\n function ascendingTargetDepth(a, b) {\n return a.target.y - b.target.y;\n }\n }", "function computeNodeValues() {\n _(nodes).each(function(node) {\n node.value = Math.max(\n d3.sum(node.sourceLinks, value),\n d3.sum(node.targetLinks, value)\n );\n });\n }", "packageRoutes(nodes) {\n var map = {};\n var routes = [];\n\n // Compute a map from name to node.\n nodes.forEach(function(d) {\n map[d.data.name] = d;\n });\n\n // For each route, construct a link from the source to target node.\n nodes.forEach(function(d) {\n if (d.data.routes) d.data.routes.forEach(function(i) {\n routes.push(map[d.data.name].path(map[i]));\n });\n });\n return routes;\n }", "function createLink(currentIndex, nextIndex) {\n\tvar link = {};\n\tlink.source = currentIndex;\n\tlink.target = nextIndex;\n\treturn link;\n}", "\n (\n from_n, //:- Node.Facet.id_n\n to_n, //:- Node.Facet.id_n\n facet_c=null //:- Facet\n )\n {\n const link_c = new Link( from_n, to_n, facet_c )\n this.node_a[from_n].link__v( link_c )\n //?? this.link_a.push( link_c )\n }", "function prepareData(data) {\n const graph = {};\n graph.nodes = data.nodes;\n graph.links = data.links.map(d => {\n d.strength = 0.5;\n d.distance = 500;\n d.source = d.source && d.source.x ? d.source : data.nodes.find(o => o.id === d.source);\n d.target = d.target && d.target.x ? d.target : data.nodes.find(o => o.id === d.target);\n return d\n });\n return graph;\n}", "function computeLinkDepths() {\n\t nodes.forEach(function(node) {\n\t node.sourceLinks.sort(ascendingTargetDepth);\n\t node.targetLinks.sort(ascendingSourceDepth);\n\t });\n\t nodes.forEach(function(node) {\n\t var sy = 0, ty = 0;\n\t node.sourceLinks.forEach(function(link) {\n\t link.sy = sy;\n\t sy += link.dy;\n\t });\n\t node.targetLinks.forEach(function(link) {\n\t link.ty = ty;\n\t ty += link.dy;\n\t });\n\t });\n\n\t function ascendingSourceDepth(a, b) {\n\t return a.source.y - b.source.y;\n\t }\n\n\t function ascendingTargetDepth(a, b) {\n\t return a.target.y - b.target.y;\n\t }\n\t }", "function updateAttributes(nodes, links) {\n var ROOT_IDs = nodes.filter(function (d) {\n return d.root !== undefined;\n }).map(function (d) {\n return d.id;\n });\n var parentIDs = [];\n var childIDs = [];\n nodes.map(function (el) {\n var connections = links.filter(function (d) {\n return d.start_id === el.id;\n }).map(function (d) {\n return d.end_id;\n });\n\n if (connections.length === 0) {\n childIDs.push(el.id); // a child node has no other nodes extending from it\n } else if (ROOT_IDs.indexOf(el.id) === -1) {\n parentIDs.push(el.id); // everyone else is a parent node if not a cluster root or child node (a node is only considered to be a parent node if it has other nodes extending from it)\n }\n }); // set up accessors\n\n var root = function root(d) {\n return ROOT_IDs.indexOf(d.id) !== -1;\n };\n\n var parent = function parent(d) {\n return parentIDs.indexOf(d.id) !== -1;\n };\n\n var rootparent = function rootparent(d) {\n return parentIDs.concat(ROOT_IDs).indexOf(d.id) !== -1;\n };\n\n var child = function child(d) {\n return childIDs.indexOf(d.id) !== -1;\n };\n\n var berects = function berects() {}; // choose node types to be rendered as rectangles\n\n\n var accessors = {\n root: root,\n parent: parent,\n child: child,\n rootparent: rootparent,\n berects: berects\n };\n\n function findType(d) {\n if (root(d)) {\n return \"root\";\n } else if (parent(d)) {\n return \"parent\";\n } else if (child(d)) {\n return \"children\";\n }\n }\n\n nodes.forEach(function (d) {\n d.type = findType(d);\n });\n links.forEach(function (d) {\n d.type = nodes.find(function (el) {\n return el.id === d.start_id;\n }).type;\n });\n nodes.forEach(function (d) {\n d.radius = graphEle.radiusAccessor(d);\n d.color = graphEle.nodeColorAccessor(d);\n d.strokeColor = graphEle.nodeColorAccessor(d);\n d.opacity = graphEle.nodeOpacityAccessor(d);\n d.strokeWidth = graphEle.nodeStrokeWidth;\n });\n links.forEach(function (d) {\n d.strokeColor = graphEle.linkColorAccessor(d);\n d.strokeWidth = graphEle.linkWidthAccessor(d);\n d.opacity = graphEle.linkOpacityAccessor(d);\n d.strength = graphEle.strengthAccessor(d);\n });\n return {\n nodes: nodes,\n links: links,\n accessors: accessors\n };\n } //updateAttributes: update attribute values assigned to nodes and edges", "function _default(nodes, edges, seriesModel, directed, beforeLink) {\n // ??? TODO\n // support dataset?\n var graph = new Graph(directed);\n\n for (var i = 0; i < nodes.length; i++) {\n graph.addNode(zrUtil.retrieve( // Id, name, dataIndex\n nodes[i].id, nodes[i].name, i), i);\n }\n\n var linkNameList = [];\n var validEdges = [];\n var linkCount = 0;\n\n for (var i = 0; i < edges.length; i++) {\n var link = edges[i];\n var source = link.source;\n var target = link.target; // addEdge may fail when source or target not exists\n\n if (graph.addEdge(source, target, linkCount)) {\n validEdges.push(link);\n linkNameList.push(zrUtil.retrieve(link.id, source + ' > ' + target));\n linkCount++;\n }\n }\n\n var coordSys = seriesModel.get('coordinateSystem');\n var nodeData;\n\n if (coordSys === 'cartesian2d' || coordSys === 'polar') {\n nodeData = createListFromArray(nodes, seriesModel);\n } else {\n var coordSysCtor = CoordinateSystem.get(coordSys);\n var coordDimensions = coordSysCtor && coordSysCtor.type !== 'view' ? coordSysCtor.dimensions || [] : []; // FIXME: Some geo do not need `value` dimenson, whereas `calendar` needs\n // `value` dimension, but graph need `value` dimension. It's better to\n // uniform this behavior.\n\n if (zrUtil.indexOf(coordDimensions, 'value') < 0) {\n coordDimensions.concat(['value']);\n }\n\n var dimensionNames = createDimensions(nodes, {\n coordDimensions: coordDimensions\n });\n nodeData = new List(dimensionNames, seriesModel);\n nodeData.initData(nodes);\n }\n\n var edgeData = new List(['value'], seriesModel);\n edgeData.initData(validEdges, linkNameList);\n beforeLink && beforeLink(nodeData, edgeData);\n linkList({\n mainData: nodeData,\n struct: graph,\n structAttr: 'graph',\n datas: {\n node: nodeData,\n edge: edgeData\n },\n datasAttr: {\n node: 'data',\n edge: 'edgeData'\n }\n }); // Update dataIndex of nodes and edges because invalid edge may be removed\n\n graph.update();\n return graph;\n}", "function _default(nodes, edges, seriesModel, directed, beforeLink) {\n // ??? TODO\n // support dataset?\n var graph = new Graph(directed);\n\n for (var i = 0; i < nodes.length; i++) {\n graph.addNode(zrUtil.retrieve( // Id, name, dataIndex\n nodes[i].id, nodes[i].name, i), i);\n }\n\n var linkNameList = [];\n var validEdges = [];\n var linkCount = 0;\n\n for (var i = 0; i < edges.length; i++) {\n var link = edges[i];\n var source = link.source;\n var target = link.target; // addEdge may fail when source or target not exists\n\n if (graph.addEdge(source, target, linkCount)) {\n validEdges.push(link);\n linkNameList.push(zrUtil.retrieve(link.id, source + ' > ' + target));\n linkCount++;\n }\n }\n\n var coordSys = seriesModel.get('coordinateSystem');\n var nodeData;\n\n if (coordSys === 'cartesian2d' || coordSys === 'polar') {\n nodeData = createListFromArray(nodes, seriesModel);\n } else {\n var coordSysCtor = CoordinateSystem.get(coordSys);\n var coordDimensions = coordSysCtor && coordSysCtor.type !== 'view' ? coordSysCtor.dimensions || [] : []; // FIXME: Some geo do not need `value` dimenson, whereas `calendar` needs\n // `value` dimension, but graph need `value` dimension. It's better to\n // uniform this behavior.\n\n if (zrUtil.indexOf(coordDimensions, 'value') < 0) {\n coordDimensions.concat(['value']);\n }\n\n var dimensionNames = createDimensions(nodes, {\n coordDimensions: coordDimensions\n });\n nodeData = new List(dimensionNames, seriesModel);\n nodeData.initData(nodes);\n }\n\n var edgeData = new List(['value'], seriesModel);\n edgeData.initData(validEdges, linkNameList);\n beforeLink && beforeLink(nodeData, edgeData);\n linkList({\n mainData: nodeData,\n struct: graph,\n structAttr: 'graph',\n datas: {\n node: nodeData,\n edge: edgeData\n },\n datasAttr: {\n node: 'data',\n edge: 'edgeData'\n }\n }); // Update dataIndex of nodes and edges because invalid edge may be removed\n\n graph.update();\n return graph;\n}", "function _default(nodes, edges, seriesModel, directed, beforeLink) {\n // ??? TODO\n // support dataset?\n var graph = new Graph(directed);\n\n for (var i = 0; i < nodes.length; i++) {\n graph.addNode(zrUtil.retrieve( // Id, name, dataIndex\n nodes[i].id, nodes[i].name, i), i);\n }\n\n var linkNameList = [];\n var validEdges = [];\n var linkCount = 0;\n\n for (var i = 0; i < edges.length; i++) {\n var link = edges[i];\n var source = link.source;\n var target = link.target; // addEdge may fail when source or target not exists\n\n if (graph.addEdge(source, target, linkCount)) {\n validEdges.push(link);\n linkNameList.push(zrUtil.retrieve(link.id, source + ' > ' + target));\n linkCount++;\n }\n }\n\n var coordSys = seriesModel.get('coordinateSystem');\n var nodeData;\n\n if (coordSys === 'cartesian2d' || coordSys === 'polar') {\n nodeData = createListFromArray(nodes, seriesModel);\n } else {\n var coordSysCtor = CoordinateSystem.get(coordSys);\n var coordDimensions = coordSysCtor && coordSysCtor.type !== 'view' ? coordSysCtor.dimensions || [] : []; // FIXME: Some geo do not need `value` dimenson, whereas `calendar` needs\n // `value` dimension, but graph need `value` dimension. It's better to\n // uniform this behavior.\n\n if (zrUtil.indexOf(coordDimensions, 'value') < 0) {\n coordDimensions.concat(['value']);\n }\n\n var dimensionNames = createDimensions(nodes, {\n coordDimensions: coordDimensions\n });\n nodeData = new List(dimensionNames, seriesModel);\n nodeData.initData(nodes);\n }\n\n var edgeData = new List(['value'], seriesModel);\n edgeData.initData(validEdges, linkNameList);\n beforeLink && beforeLink(nodeData, edgeData);\n linkList({\n mainData: nodeData,\n struct: graph,\n structAttr: 'graph',\n datas: {\n node: nodeData,\n edge: edgeData\n },\n datasAttr: {\n node: 'data',\n edge: 'edgeData'\n }\n }); // Update dataIndex of nodes and edges because invalid edge may be removed\n\n graph.update();\n return graph;\n}", "function computeNodeValues() {\n nodes.forEach(function(node) {\n node.value = Math.max(\n d3.sum(node.sourceLinks, value),\n d3.sum(node.targetLinks, value)\n );\n });\n }", "getLinksToUpdateInfo() {\n\t\tconst newLinks = [];\n\t\tconst oldLinks = [];\n\t\tconst allCurrentLinks = this.apiPipeline.getLinks();\n\n\t\tallCurrentLinks.forEach((link) => {\n\t\t\tif (!this.isLinkToBeDeleted(link, this.linksToDelete)) {\n\t\t\t\tconst src = this.isSourceToBeDeleted(link);\n\t\t\t\tconst trg = this.isTargetToBeDeleted(link);\n\n\t\t\t\tif (src || trg) {\n\t\t\t\t\tconst newLink = Object.assign({}, link);\n\t\t\t\t\tif (src) {\n\t\t\t\t\t\tdelete newLink.srcNodeId;\n\t\t\t\t\t\tdelete newLink.srcNodePortId;\n\t\t\t\t\t\tnewLink.srcPos = CanvasUtils.getSrcPos(link, this.apiPipeline);\n\t\t\t\t\t}\n\t\t\t\t\tif (trg) {\n\t\t\t\t\t\tdelete newLink.trgNodeId;\n\t\t\t\t\t\tdelete newLink.trgNodePortId;\n\t\t\t\t\t\tnewLink.trgPos = CanvasUtils.getTrgPos(link, this.apiPipeline);\n\t\t\t\t\t}\n\t\t\t\t\tnewLinks.push(newLink);\n\t\t\t\t\toldLinks.push(link);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\treturn { newLinks, oldLinks };\n\t}", "function getAdjlist(undirected) {\n var alist = {};\n\n // add all nodes/links\n for (var i = 0; i < links.length; i++) {\n var lnk = links[i];\n var src = lnk.source, tgt = lnk.target;\n var srcId = lnk.source.id, tgtId = lnk.target.id;\n if (!alist.hasOwnProperty(srcId))\n alist[srcId] = [];\n if (!alist.hasOwnProperty(tgtId))\n alist[tgtId] = [];\n if (typeof undirected != \"undefined\") {\n alist[srcId].push(tgt);\n alist[tgtId].push(src);\n } else {\n if (alist[srcId].indexOf(tgt) == -1 && lnk.right) // if src doesn't already have tgt in its list and lnk points from src to tgt\n alist[srcId].push(tgt);\n if (alist[tgtId].indexOf(src) == -1 && lnk.left) // if lnk points from target to source (both ways allowed)\n alist[tgtId].push(src);\n }\n }\n\n // add all loops\n for (var j = 0; j < nodes.length; j++) {\n var n = nodes[j];\n var nid = nodes[j].id;\n if (!alist.hasOwnProperty(nid))\n alist[nid] = [];\n if (n.reflexive)\n alist[nid].push(n);\n }\n\n // sort the individual arrays\n for (var nd in alist) {\n if (alist.hasOwnProperty(nd))\n alist[nd].sort(function (a, b) { return a.id - b.id });\n }\n\n // convert the node references in arrays to conventional id representation\n alist.toNumList = function () {\n var numList = {}; // create a copy; no modification on original\n for (var nd in this)\n if (nd !== \"toNumList\" && this.hasOwnProperty(nd)) {\n numList[nd] = [];\n for (var x = 0; x < this[nd].length; x++)\n numList[nd][x] = this[nd][x].id;\n }\n return numList;\n };\n return alist;\n}", "setPersons() {\n var objectPersons = {\"nodes\": [], \"links\": []},\n tempNodes = [],\n tempLinks = [];\n\n this.dataAll[\"nodes\"].forEach(function(node) {\n if (node[\"id\"].includes(\"Channing, William Ellery\") ||\n (node[\"id\"].includes(\", \") && ! (node[\"id\"].includes(\"Channing\") || node[\"id\"].includes(\"Ellery,\") || node[\"id\"].includes(\"White,\"))) ||\n node[\"id\"].includes(\"Dr. Sprague\") || node[\"id\"].includes(\"Ware\") || node[\"id\"].includes(\"[Unknown]\")) {\n tempNodes.push(node);\n }\n });\n\n this.dataAll[\"links\"].forEach(function(link) {\n\n // Exclude Ellery family members\n if (! (link[\"source\"].includes(\"Ellery,\") || link[\"target\"].includes(\"Ellery,\"))) {\n // Exclude letters from Channings to Channings\n if (! (link[\"source\"].includes(\"Channing\") && link[\"target\"].includes(\"Channing\"))) {\n // Only include persons\n if ((link[\"source\"].includes(\", \") || link[\"source\"].includes(\"Dr. Sprague\") ||\n link[\"source\"].includes(\"Ware\") || link[\"source\"].includes(\"[Unknown]\")) &&\n (link[\"target\"].includes(\", \") || link[\"target\"].includes(\"Dr. Sprague\") ||\n link[\"target\"].includes(\"Ware\") || link[\"target\"].includes(\"[Unknown]\"))) {\n // If a Channing is part of the letter communication, only accept the node if\n // it is William Ellery Channing himself (letters from Channing to Channing are already dropped here)\n if ( (link[\"source\"].includes(\"Channing,\") || link[\"target\"].includes(\"Channing,\"))\n && (link[\"source\"].includes(\"Channing, William Ellery\") || link[\"target\"].includes(\"Channing, William Ellery\")) ) {\n tempLinks.push(link);\n }\n\n // If no Channing is present, push as well\n if ( !(link[\"source\"].includes(\"Channing,\") || link[\"target\"].includes(\"Channing,\")) ) {\n tempLinks.push(link);\n }\n }\n }\n }\n });\n\n objectPersons[\"nodes\"] = tempNodes;\n objectPersons[\"links\"] = tempLinks;\n\n return objectPersons;\n }", "function setupLinks() {\n\tfor(let i = 0; i < 11; i++) {\n\t\tif(i == 10) { \n\t\t\tlinks[i] = createA('/resilience-repository/about.html', proj_names[i]);\n\t\t}\n\t\telse {\n\t\t\tlinks[i] = createA('/resilience-repository/projects/proj'+i+'.html', proj_names[i]);\n\t\t}\n\t}\n}", "function computeNodeValues() {\n nodes.forEach(function(node) {\n node.value = Math.max(\n d3.sum(node.sourceLinks, value),\n d3.sum(node.targetLinks, value));\n });\n }", "initializeNodeIndex() {\n for (let i = 0; i < this.n * this.m; ++i)\n this.node_index[i] = i;\n }", "function computeNodeValues() {\n nodes.forEach(function(node) {\n node.value = Math.max(\n d3.sum(node.sourceLinks, value),\n d3.sum(node.targetLinks, value)\n )\n })\n }", "function computeNodeValues() {\r\n nodes.forEach(function(node) {\r\n node.value = Math.max(\r\n d3.sum(node.sourceLinks, value),\r\n d3.sum(node.targetLinks, value)\r\n );\r\n });\r\n }", "function buildAdjacencyGraph() {\n var g = new Digraph();\n var nextId = 0;\n\n // Get the node id for the type (\"source\" or \"target\") or throw if we\n // haven't seen the node.\n function safeGetNodeId(type, edge) {\n var nodeId;\n if (type in edge) {\n nodeId = edge[type].dagre.id;\n } else {\n if (!(type + \"Id\" in edge)) {\n throw new Error(\"Edge must have either a \" + type + \" or \" + type + \"Id attribute\");\n }\n nodeId = edge[type + \"Id\"];\n edge[type] = g.node(nodeId);\n }\n\n if (!g.hasNode(nodeId)) {\n throw new Error(type + \" node for '\" + e + \"' not in node list\");\n }\n return nodeId;\n }\n\n // Tag each node so that we can properly represent relationships when\n // we add edges. Also copy relevant dimension information.\n config.nodes.forEach(function(u) {\n var id = \"id\" in u ? u.id : \"_N\" + nextId++;\n u.dagre = { id: id, width: u.width, height: u.height };\n g.addNode(id, u.dagre);\n });\n\n config.edges.forEach(function(e) {\n var source = safeGetNodeId(\"source\", e);\n var target = safeGetNodeId(\"target\", e);\n\n e.dagre = { points: [] };\n\n // Track edges that aren't self loops - layout does nothing for self\n // loops, so they can be skipped.\n if (source !== target) {\n var id = \"id\" in e ? e.id : \"_E\" + nextId++;\n e.dagre.id = id;\n e.dagre.minLen = e.minLen || 1;\n e.dagre.width = e.width || 0;\n e.dagre.height = e.height || 0;\n g.addEdge(id, source, target, e.dagre);\n }\n });\n\n return g;\n }", "function computeNodeValues() {\n nodes.forEach(function(node) {\n node.value = Math.max(\n d3.sum(node.sourceLinks, value),\n d3.sum(node.targetLinks, value)\n );\n });\n }", "function computeNodeValues() {\n nodes.forEach(function(node) {\n node.value = Math.max(\n d3.sum(node.sourceLinks, value),\n d3.sum(node.targetLinks, value)\n );\n });\n }", "function getTargetIds() {\r\n var targetId, i;\r\n for (i = 0; i < aSources.length; i += 1) {\r\n targetId = aSources[i].getAttribute('data-accordion-target');\r\n if (aTargetIds.hasOwnProperty(targetId)) {\r\n aTargetIds[targetId].sources.push(aSources[i]);\r\n } else {\r\n aTargetIds[targetId] = {\r\n sources: [aSources[i]]\r\n };\r\n }\r\n }\r\n }", "function checkConnectionBetweenProps(target1, target2, excludedNodes) {\n var _Object = Object(_getsubnodes__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(target1, excludedNodes.subNodes),\n subNodes1 = _Object.subNodes,\n prevNodeMap1 = _Object.prevNodeMap;\n\n var _Object2 = Object(_getsubnodes__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(target2, excludedNodes.subNodes),\n subNodes2 = _Object2.subNodes,\n prevNodeMap2 = _Object2.prevNodeMap;\n\n var _iterator504 = _createForOfIteratorHelper(subNodes1),\n _step504;\n\n try {\n for (_iterator504.s(); !(_step504 = _iterator504.n()).done;) {\n var sharedNode = _step504.value;\n\n if (subNodes2.has(sharedNode)) {\n var connection = [];\n connection.push(sharedNode);\n var node = prevNodeMap1.get(sharedNode);\n\n while (node && node !== target1) {\n connection.push(node);\n node = prevNodeMap1.get(node);\n }\n\n node = prevNodeMap2.get(sharedNode);\n\n while (node && node !== target2) {\n connection.unshift(node);\n node = prevNodeMap2.get(node);\n }\n\n console.log('--------');\n console.log({\n target1: target1\n });\n console.log({\n sharedNode: sharedNode\n });\n console.log({\n target2: target2\n });\n console.log({\n connection: connection\n });\n return true;\n }\n }\n } catch (err) {\n _iterator504.e(err);\n } finally {\n _iterator504.f();\n }\n\n return false;\n }", "function computeNodeValues() {\n\t nodes.forEach(function(node) {\n\t node.value = Math.max(\n\t d3.sum(node.sourceLinks, value),\n\t d3.sum(node.targetLinks, value)\n\t );\n\t });\n\t }" ]
[ "0.7977855", "0.79253113", "0.78906596", "0.7886118", "0.78162855", "0.7815691", "0.7815691", "0.7770885", "0.77210164", "0.77036065", "0.7308495", "0.6941912", "0.6864947", "0.68478954", "0.6836942", "0.6836942", "0.6815989", "0.68087345", "0.6788788", "0.6512627", "0.63124037", "0.62437123", "0.61543703", "0.60972273", "0.6092163", "0.6033546", "0.6015247", "0.5951349", "0.5948167", "0.5926676", "0.59251255", "0.5751606", "0.57454306", "0.5717663", "0.56239533", "0.56044215", "0.5562871", "0.55530816", "0.55288523", "0.55247515", "0.5524484", "0.54949456", "0.545993", "0.54594773", "0.5445797", "0.5445628", "0.53499705", "0.53311604", "0.5300278", "0.52926534", "0.52877975", "0.5285243", "0.5285035", "0.52582246", "0.5220725", "0.5208665", "0.5192814", "0.51818186", "0.5176598", "0.5175646", "0.5175646", "0.5175646", "0.5175646", "0.5168918", "0.5134704", "0.5134129", "0.5131741", "0.51300144", "0.51270145", "0.5117141", "0.5093303", "0.5084679", "0.5081988", "0.5077373", "0.5077373", "0.50706446", "0.5064257", "0.50578463", "0.5056778", "0.5043022", "0.5042317", "0.5033165", "0.50323755", "0.50323755", "0.50323755", "0.501959", "0.5012448", "0.5012302", "0.5006618", "0.5003171", "0.5003048", "0.49986774", "0.4982206", "0.49771696", "0.49750936", "0.49608493", "0.49608493", "0.4950168", "0.49451706", "0.49442592" ]
0.67821574
19
Iteratively assign the breadth (xposition) for each node. Nodes are assigned the maximum breadth of incoming neighbors plus one; nodes with no incoming links are assigned breadth zero, while nodes with no outgoing links are assigned the minimum breadth.
function computeNodeLevels() { nodes.forEach(function (d) { d._linkNumber = d.sourceLinks.length + d.targetLinks.length; d._levelSetted = false; }); var x = 0; var remainingNodes, nextNodes; var boneNodes; // get bone nodes var shrink = true; remainingNodes = nodes; while (shrink) { shrink = false; nextNodes = []; remainingNodes.forEach(function(node) { if (node._linkNumber === 1) { shrink = true; node._linkNumber = 0; node.sourceLinks.forEach(function (d) { if (d.target._linkNumber > 0) { d.target._linkNumber -= 1; } }); node.targetLinks.forEach(function (d) { if (d.source._linkNumber > 0) { d.source._linkNumber -= 1; } }); } }); remainingNodes = remainingNodes.filter(function (d) { return d._linkNumber > 0; }); } boneNodes = remainingNodes; if (boneNodes.length > 0) { //有环 remainingNodes = boneNodes; x = 0; nextNodes = []; while (remainingNodes.length) { nextNodes = []; remainingNodes.forEach(function(node) { node.x = x; node.sourceLinks.forEach(function(link) { nextNodes.push(link.target); }); }); remainingNodes = nextNodes; ++x; } boneNodes.forEach(function (node) { node._isBone = true; }); boneNodes.forEach(function (node) { var parentBoneNode = []; node.targetLinks.forEach(function (d) { if (d.source._isBone) { parentBoneNode.push(d.source); } }); var childrenBoneNode = []; node.sourceLinks.forEach(function (d) { if (d.target._isBone) { childrenBoneNode.push(d.target); } }); node._parentBoneNode = parentBoneNode; node._childrenBoneNode = childrenBoneNode; }); // move down to make links to be shortest boneNodes.forEach(function (node) { var minChildrenLevel = d3.min(node._childrenBoneNode, function (d) { return d.x; }); // not parent bone node if (node._parentBoneNode.length === 0) { node.x = minChildrenLevel - 1; } // target is far away if (minChildrenLevel - node.x > 1) { if (node._childrenBoneNode.length > node._parentBoneNode.length) { // parents more than children, do nothing } else if (node._childrenBoneNode.length < node._parentBoneNode.length) { // parents less than children, move to children node.x = minChildrenLevel - 1; } else { // parents = children, do nothing; } } }); } else { //无环 if (nodes.length > 0) { nodes[0].x = 0; boneNodes = [nodes[0]]; } else { boneNodes = []; } } // 添加节点 boneNodes.forEach(function (d) { d._levelSetted = true; }); remainingNodes = boneNodes; nextNodes = []; while (remainingNodes.length) { nextNodes = []; remainingNodes.forEach(function(node) { node.sourceLinks.forEach(function(link) { var n = link.target; if (!n._levelSetted) { n.x = node.x + 1; node._levelSetted = true; nextNodes.push(n); } }); node.targetLinks.forEach(function(link) { var n = link.source; if (!n._levelSetted) { n.x = node.x - 1; node._levelSetted = true; nextNodes.push(n); } }); }); remainingNodes = nextNodes; } //调整节点的最小层为0 var minLevel = d3.min(nodes, function (d) { return d.x; }); nodes.forEach(function (d) { d.x -= minLevel; }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function computeNodeBreadths() {\n let remainingNodes = nodes\n let nextNodes\n let x = 0\n\n while (remainingNodes.length) {\n nextNodes = []\n remainingNodes.forEach(function(node) {\n node.x = x\n node.dx = nodeWidth\n node.sourceLinks.forEach(function(link) {\n if (nextNodes.indexOf(link.target) < 0) {\n nextNodes.push(link.target)\n }\n })\n })\n remainingNodes = nextNodes\n ++x\n }\n\n //\n moveSinksRight(x)\n scaleNodeBreadths((size[0] - nodeWidth) / (x - 1))\n }", "function computeNodeBreadths() {\n var remainingNodes = nodes,\n nextNodes,\n x = 0;\n\n while (remainingNodes.length) {\n nextNodes = [];\n remainingNodes.forEach(function(node) {\n node.x = x;\n node.dx = nodeWidth;\n node.sourceLinks.forEach(function(link) {\n if (nextNodes.indexOf(link.target) < 0) {\n nextNodes.push(link.target);\n }\n });\n });\n remainingNodes = nextNodes;\n ++x;\n }\n\n //\n moveSinksRight(x);\n scaleNodeBreadths((size[0] - nodeWidth) / (x - 1));\n }", "function computeNodeBreadths() {\n var remainingNodes = nodes,\n nextNodes,\n x = 0;\n\n while (remainingNodes.length) {\n nextNodes = [];\n _(remainingNodes).each(function(node) {\n node.x = x;\n node.dx = nodeWidth;\n _(node.sourceLinks).each(function(link) {\n nextNodes.push(link.target);\n });\n });\n remainingNodes = nextNodes;\n ++x;\n }\n\n //\n moveSinksRight(x);\n scaleNodeBreadths((size[0] - nodeWidth) / (x - 1));\n }", "function computeNodeBreadths() {\r\n var remainingNodes = nodes,\r\n nextNodes,\r\n x = 0;\r\n\r\n while (remainingNodes.length) {\r\n nextNodes = [];\r\n remainingNodes.forEach(function(node) {\r\n\r\n if (node.xPos)\r\n node.x = node.xPos;\r\n else\r\n node.x = x;\r\n\r\n node.dx = nodeWidth;\r\n node.sourceLinks.forEach(function(link) {\r\n nextNodes.push(link.target);\r\n });\r\n });\r\n remainingNodes = nextNodes;\r\n ++x;\r\n }\r\n\r\n //\r\n moveSinksRight(x);\r\n scaleNodeBreadths((width - nodeWidth) / (x - 1));\r\n }", "function computeNodeBreadths() {\n\t var remainingNodes = nodes,\n\t nextNodes,\n\t x = 0;\n\n\t while (remainingNodes.length) {\n\t nextNodes = [];\n\t remainingNodes.forEach(function (node) {\n\t node.x = x;\n\t node.dx = nodeWidth;\n\t node.sourceLinks.forEach(function (link) {\n\t if (nextNodes.indexOf(link.target) < 0) {\n\t nextNodes.push(link.target);\n\t }\n\t });\n\t });\n\t remainingNodes = nextNodes;\n\t ++x;\n\t } //\n\n\n\t moveSinksRight(x);\n\t scaleNodeBreadths((size[0] - nodeWidth) / (x - 1));\n\t }", "function computeNodeBreadths() {\n var remainingNodes = nodes,\n nextNodes,\n x = 0;\n\n while (remainingNodes.length) {\n nextNodes = [];\n remainingNodes.forEach(function(node) {\n node.x = x;\n node.dx = nodeWidth;\n node.sourceLinks.forEach(function(link) {\n nextNodes.push(link.target);\n });\n });\n remainingNodes = nextNodes;\n ++x;\n }\n\n //\n moveSinksRight(x);\n scaleNodeBreadths((width - nodeWidth) / (x - 1));\n }", "function computeNodeBreadths() {\n\t //\n\t var remainingNodes = nodes,\n\t nextNodes,\n\t x = 0;\n\n\t // Work from left to right.\n\t // Keep updating the breath (x-position) of nodes that are target of recently updated nodes.\n\t //\n\t while (remainingNodes.length && x < nodes.length) {\n\t nextNodes = [];\n\t remainingNodes.forEach(function(node) {\n\t node.x = x;\n\t node.dx = nodeWidth;\n\t node.sourceLinks.forEach(function(link) {\n\t if (nextNodes.indexOf(link.target) < 0) {\n\t nextNodes.push(link.target);\n\t }\n\t });\n\t });\n\t remainingNodes = nextNodes;\n\t ++x;\n\t //\n\t }\n\n\t // Optionally move pure sinks always to the right.\n\t if (sinksRight) {\n\t moveSinksRight(x);\n\t }\n\n\t scaleNodeBreadths((size[0] - nodeWidth) / (x - 1));\n\t }", "function computeNodeBreadths() {\n //\n var remainingNodes = nodes,\n nextNodes,\n x = 0;\n\n // Work from left to right.\n // Keep updating the breath (x-position) of nodes that are target of recently updated nodes.\n //\n while (remainingNodes.length && x < nodes.length) {\n nextNodes = [];\n remainingNodes.forEach(function(node) {\n node.x = x;\n node.dx = nodeWidth;\n node.sourceLinks.forEach(function(link) {\n if (nextNodes.indexOf(link.target) < 0) {\n nextNodes.push(link.target);\n }\n });\n });\n remainingNodes = nextNodes;\n ++x;\n //\n }\n\n // Optionally move pure sinks always to the right.\n if (sinksRight) {\n moveSinksRight(x);\n }\n\n scaleNodeBreadths((size[0] - nodeWidth) / (x - 1));\n }", "function computeNodeBreadths() {\n //\n var remainingNodes = nodes,\n nextNodes,\n x = 0;\n\n // Work from left to right.\n // Keep updating the breath (x-position) of nodes that are target of recently updated nodes.\n //\n while (remainingNodes.length && x < nodes.length) {\n nextNodes = [];\n remainingNodes.forEach(function(node) {\n node.x = x;\n node.dx = nodeWidth;\n node.sourceLinks.forEach(function(link) {\n if (nextNodes.indexOf(link.target) < 0) {\n nextNodes.push(link.target);\n }\n });\n });\n remainingNodes = nextNodes;\n ++x;\n //\n }\n\n // Optionally move pure sinks always to the right.\n if (sinksRight) {\n moveSinksRight(x);\n }\n\n scaleNodeBreadths((size[0] - nodeWidth) / (x - 1));\n }", "function computeNodeBreadths() {\n var remainingNodes = nodes,\n nextNodes,\n x = 0;\n \n while (remainingNodes.length) {\n nextNodes = [];\n remainingNodes.forEach(function(node) {\n node.x = x;\n node.dx = nodeWidth;\n node.sourceLinks.forEach(function(link) {\n nextNodes.push(link.target);\n });\n });\n remainingNodes = nextNodes;\n ++x;\n }\n \n //\n moveSinksRight(x);\n scaleNodeBreadths((width - nodeWidth) / (x - 1));\n }", "function computeNodeBreadths() {\n // var remainingNodes = nodes,\n // nextNodes,\n // x = 0\n\n // var test=1;\n nodes.forEach(function (node) {\n node.x = node.pos * nodeOffset;////pos is in the Json data jixiangyu\n\n //console.log(node.cluster);\n //test++;\n\n node.dx = nodeWidth;\n });\n }", "function computeNodeBreadths(nodes,links) {\n var remainingNodes = nodes.map(function(d) { return d.sankeyID })\n var nextNodes\n var x = 0\n\n // console.log(nodes);\n\n while (remainingNodes.length) {\n nextNodes = [];\n remainingNodes.forEach(function(node) {\n nodes[node].x = x;\n nodes[node].sourceLinks.forEach(function(link) {\n if (nextNodes.indexOf(link.target) < 0) {\n nextNodes.push(link.target);\n }\n });\n });\n remainingNodes = nextNodes;\n ++x;\n }\n }", "function computeNodeBreadths(root) {\n\tvar remainingNodes = root.nodes,\n\t nextNodes,\n\t x = 0;\n\t\n\twhile (remainingNodes.length) {\n\t nextNodes = [];\n\t remainingNodes.forEach(function(node) {\n\t\tnode.fixed_x = x;\n\t\tnode.sourceLinks.forEach(function(link) {\n\t\t if (nextNodes.indexOf(link.target) < 0) {\n\t\t\tnextNodes.push(link.target);\n\t\t }\n\t\t});\n\t });\n\t remainingNodes = nextNodes;\n\t ++x;\n\t}\t \n\tmoveSinksRight(x);\n\t// don't scale to the full width or the nodes go off the page\n\tscaleNodeBreadths(.87 * (width-50) / (x - 1));\n }", "breadthFirst() {\n let queue = new LinkedQueue();\n let visited = new LinkedList();\n queue.enqueue(new Point(WORLD_WIDTH - 2, WORLD_HEIGHT - 2, 0));\n let current = null;\n while (queue.length > 0) {\n current = queue.dequeue();\n let j = current.y;\n let i = current.x;\n if (this.tiles[j - 1][i] === 'F' &&\n !visited.contains(new Point(i, j - 1))) {\n queue.enqueue(new Point(i, j - 1, current.depth + 1));\n visited.add(new Point(i, j - 1));\n }\n if (this.tiles[j + 1][i] === 'F' &&\n !visited.contains(new Point(i, j + 1))) {\n queue.enqueue(new Point(i, j + 1, current.depth + 1));\n visited.add(new Point(i, j + 1));\n }\n if (this.tiles[j][i - 1] === 'F' &&\n !visited.contains(new Point(i - 1, j))) {\n queue.enqueue(new Point(i - 1, j, current.depth + 1));\n visited.add(new Point(i - 1, j));\n }\n if (this.tiles[j][i + 1] === 'F' &&\n !visited.contains(new Point(i + 1, j))) {\n queue.enqueue(new Point(i + 1, j, current.depth + 1));\n visited.add(new Point(i + 1, j));\n }\n }\n return current;\n }", "bfs() {\n // need to use a queue when we are doing breadth first searching \n let currentNode = this.root;\n let queue = [];\n let visitedNodes = [];\n // push our current value into our queue array \n queue.push(currentNode);\n // while there are still elements in our queue array\n while (queue.length) {\n // first in is the first out so we work with the oldest item\n currentNode = queue.shift();\n // push the current value into our visited Nodes array\n visitedNodes.push(currentNode.val);\n // if there is a left side that exists \n if (currentNode.left) {\n // push that into our queue to work on \n queue.push(currentNode.left);\n }\n // after the left side if a right side exists then we can push that into the queue\n if (currentNode.right) {\n // push that right value into the queue\n queue.push(currentNode.right);\n }\n }\n // return the array of nodes we have visited \n return visitedNodes;\n }", "function bfs(i,j,visited){\n var queue = [];\n var curr_node = [i,j];\n //store visited node in this bfs\n var local_visited = [[i,j]];\n var edge = [];\n var territory = 1;\n //var count = 0;\n\n while(curr_node){\n var x = curr_node[0];\n var y = curr_node[1];\n if(x != 0){\n if(contains(local_visited, [x-1,y]) == false){\n if(state.board[x-1][y] == 0){\n local_visited.push([x-1,y]);\n visited.push([x-1,y]);\n queue.push([x-1,y]);\n territory++;\n //alert(\"territory: \" +territory + \" \" +[x-1,y]);\n }\n else{\n //alert(\"edge + \" + [x-1, y]);\n edge.push(state.board[x-1][y]);\n\n }\n }\n }\n\n if(x != state.size - 1){\n if(contains(local_visited, [x+1,y]) == false){\n if(state.board[x+1][y] == 0){\n local_visited.push([x+1,y]);\n visited.push([x+1,y]);\n queue.push([x+1,y]);\n territory++;\n //alert(\"territory: \" +territory + \" \" +[x+1,y]);\n }\n else{ \n //alert(\"edge is \" + [x+1,y]);\n edge.push(state.board[x+1][y]);\n }\n }\n }\n\n if(y != 0){\n if(contains(local_visited, [x,y-1]) == false){\n if(state.board[x][y-1] == 0){\n local_visited.push([x,y-1]);\n visited.push([x,y-1]);\n queue.push([x,y-1]);\n territory++;\n //alert(\"territory: \" +territory + \" \" +[x,y-1]);\n \n }\n else{\n //alert(\"edge is \" + [x, y-1]);\n edge.push(state.board[x][y-1]);\n }\n }\n\n }\n\n if(y != state.size -1){\n if(contains(local_visited, [x,y+1]) == false){\n if(state.board[x][y+1] == 0){\n local_visited.push([x,y+1]);\n visited.push([x,y+1]);\n queue.push([x,y+1]);\n territory++;\n //alert(\"territory: \" +territory + \" \" +[x,y+1]);\n \n }\n else{\n //alert(\"edge is \" + [x, y+1]);\n edge.push(state.board[x][y+1]);\n }\n }\n }\n //count++;\n\n curr_node = queue.shift();\n }\n\n\n var i = edge.length;\n\n //check if this area is surrounded by same color tokens\n //if it is not, it is not a valid territory\n while(i--){\n if(edge[i] != edge[0]){\n territory = 0;\n break;\n }\n }\n if (territory != 0)\n\n return [territory, edge[0]];\n else{\n //alert(curr_node);\n return [territory, 0];\n }\n}", "breadth(startingNode) {\n if(!startingNode) return 'INVALID NODE';\n // Our queue class\n const queue = new Queue();\n // A set is an object that will only store unique keys.\n const visitedNodes = new Set();\n\n // let result = [];\n\n queue.enqueue(startingNode);\n visitedNodes.add(startingNode);\n // result.push(startingNode.value);\n\n while (!queue.isEmpty()) {\n // Remove the first item from the queue.\n const currentNode = queue.dequeue();\n // Get the neighbors of the current node.\n const neighbors = this.getNeighbors(currentNode);\n // Loop over all the neighbors.\n for (let neighbor of neighbors) {\n const neighborNode = neighbor.vertex;\n if (visitedNodes.has(neighborNode)) {\n // If the Set has the node that I'm looking for, continue on to the next node.\n continue;\n } else {\n // Otherwise, I haven't been there and I need to add it to the Set.\n visitedNodes.add(neighborNode);\n // Put it into the queue\n queue.enqueue(neighborNode);\n // result.push(neighborNode.value);\n }\n }\n }\n // console.log(result);\n // Return the Set, so that there is a list of all visited nodes.\n return visitedNodes.size > 0 ? visitedNodes : 'EMPTY GRAPH';\n }", "function initializeNodeDepth(nodesByBreadth, edges, height, width, nodeGap, orient) {\n var minKy = Infinity;\n util[\"k\" /* each */](nodesByBreadth, function (nodes) {\n var n = nodes.length;\n var sum = 0;\n util[\"k\" /* each */](nodes, function (node) {\n sum += node.getLayout().value;\n });\n var ky = orient === 'vertical' ? (width - (n - 1) * nodeGap) / sum : (height - (n - 1) * nodeGap) / sum;\n\n if (ky < minKy) {\n minKy = ky;\n }\n });\n util[\"k\" /* each */](nodesByBreadth, function (nodes) {\n util[\"k\" /* each */](nodes, function (node, i) {\n var nodeDy = node.getLayout().value * minKy;\n\n if (orient === 'vertical') {\n node.setLayout({\n x: i\n }, true);\n node.setLayout({\n dx: nodeDy\n }, true);\n } else {\n node.setLayout({\n y: i\n }, true);\n node.setLayout({\n dy: nodeDy\n }, true);\n }\n });\n });\n util[\"k\" /* each */](edges, function (edge) {\n var edgeDy = +edge.getValue() * minKy;\n edge.setLayout({\n dy: edgeDy\n }, true);\n });\n}", "function computeNodeBreadths(nodes, edges, nodeWidth, width, height, orient, nodeAlign) {\n\t // Used to mark whether the edge is deleted. if it is deleted,\n\t // the value is 0, otherwise it is 1.\n\t var remainEdges = []; // Storage each node's indegree.\n\t\n\t var indegreeArr = []; //Used to storage the node with indegree is equal to 0.\n\t\n\t var zeroIndegrees = [];\n\t var nextTargetNode = [];\n\t var x = 0; // let kx = 0;\n\t\n\t for (var i = 0; i < edges.length; i++) {\n\t remainEdges[i] = 1;\n\t }\n\t\n\t for (var i = 0; i < nodes.length; i++) {\n\t indegreeArr[i] = nodes[i].inEdges.length;\n\t\n\t if (indegreeArr[i] === 0) {\n\t zeroIndegrees.push(nodes[i]);\n\t }\n\t }\n\t\n\t var maxNodeDepth = -1; // Traversing nodes using topological sorting to calculate the\n\t // horizontal(if orient === 'horizontal') or vertical(if orient === 'vertical')\n\t // position of the nodes.\n\t\n\t while (zeroIndegrees.length) {\n\t for (var idx = 0; idx < zeroIndegrees.length; idx++) {\n\t var node = zeroIndegrees[idx];\n\t var item = node.hostGraph.data.getRawDataItem(node.dataIndex);\n\t var isItemDepth = item.depth != null && item.depth >= 0;\n\t\n\t if (isItemDepth && item.depth > maxNodeDepth) {\n\t maxNodeDepth = item.depth;\n\t }\n\t\n\t node.setLayout({\n\t depth: isItemDepth ? item.depth : x\n\t }, true);\n\t orient === 'vertical' ? node.setLayout({\n\t dy: nodeWidth\n\t }, true) : node.setLayout({\n\t dx: nodeWidth\n\t }, true);\n\t\n\t for (var edgeIdx = 0; edgeIdx < node.outEdges.length; edgeIdx++) {\n\t var edge = node.outEdges[edgeIdx];\n\t var indexEdge = edges.indexOf(edge);\n\t remainEdges[indexEdge] = 0;\n\t var targetNode = edge.node2;\n\t var nodeIndex = nodes.indexOf(targetNode);\n\t\n\t if (--indegreeArr[nodeIndex] === 0 && nextTargetNode.indexOf(targetNode) < 0) {\n\t nextTargetNode.push(targetNode);\n\t }\n\t }\n\t }\n\t\n\t ++x;\n\t zeroIndegrees = nextTargetNode;\n\t nextTargetNode = [];\n\t }\n\t\n\t for (var i = 0; i < remainEdges.length; i++) {\n\t if (remainEdges[i] === 1) {\n\t throw new Error('Sankey is a DAG, the original data has cycle!');\n\t }\n\t }\n\t\n\t var maxDepth = maxNodeDepth > x - 1 ? maxNodeDepth : x - 1;\n\t\n\t if (nodeAlign && nodeAlign !== 'left') {\n\t adjustNodeWithNodeAlign(nodes, nodeAlign, orient, maxDepth);\n\t }\n\t\n\t var kx = orient === 'vertical' ? (height - nodeWidth) / maxDepth : (width - nodeWidth) / maxDepth;\n\t scaleNodeBreadths(nodes, kx, orient);\n\t }", "function computeNodeBreadths(nodes, edges, nodeWidth, width, height, orient, nodeAlign) {\n // Used to mark whether the edge is deleted. if it is deleted,\n // the value is 0, otherwise it is 1.\n var remainEdges = []; // Storage each node's indegree.\n\n var indegreeArr = []; //Used to storage the node with indegree is equal to 0.\n\n var zeroIndegrees = [];\n var nextTargetNode = [];\n var x = 0; // let kx = 0;\n\n for (var i = 0; i < edges.length; i++) {\n remainEdges[i] = 1;\n }\n\n for (var i = 0; i < nodes.length; i++) {\n indegreeArr[i] = nodes[i].inEdges.length;\n\n if (indegreeArr[i] === 0) {\n zeroIndegrees.push(nodes[i]);\n }\n }\n\n var maxNodeDepth = -1; // Traversing nodes using topological sorting to calculate the\n // horizontal(if orient === 'horizontal') or vertical(if orient === 'vertical')\n // position of the nodes.\n\n while (zeroIndegrees.length) {\n for (var idx = 0; idx < zeroIndegrees.length; idx++) {\n var node = zeroIndegrees[idx];\n var item = node.hostGraph.data.getRawDataItem(node.dataIndex);\n var isItemDepth = item.depth != null && item.depth >= 0;\n\n if (isItemDepth && item.depth > maxNodeDepth) {\n maxNodeDepth = item.depth;\n }\n\n node.setLayout({\n depth: isItemDepth ? item.depth : x\n }, true);\n orient === 'vertical' ? node.setLayout({\n dy: nodeWidth\n }, true) : node.setLayout({\n dx: nodeWidth\n }, true);\n\n for (var edgeIdx = 0; edgeIdx < node.outEdges.length; edgeIdx++) {\n var edge = node.outEdges[edgeIdx];\n var indexEdge = edges.indexOf(edge);\n remainEdges[indexEdge] = 0;\n var targetNode = edge.node2;\n var nodeIndex = nodes.indexOf(targetNode);\n\n if (--indegreeArr[nodeIndex] === 0 && nextTargetNode.indexOf(targetNode) < 0) {\n nextTargetNode.push(targetNode);\n }\n }\n }\n\n ++x;\n zeroIndegrees = nextTargetNode;\n nextTargetNode = [];\n }\n\n for (var i = 0; i < remainEdges.length; i++) {\n if (remainEdges[i] === 1) {\n throw new Error('Sankey is a DAG, the original data has cycle!');\n }\n }\n\n var maxDepth = maxNodeDepth > x - 1 ? maxNodeDepth : x - 1;\n\n if (nodeAlign && nodeAlign !== 'left') {\n adjustNodeWithNodeAlign(nodes, nodeAlign, orient, maxDepth);\n }\n\n var kx = orient === 'vertical' ? (height - nodeWidth) / maxDepth : (width - nodeWidth) / maxDepth;\n scaleNodeBreadths(nodes, kx, orient);\n}", "function initializeNodeDepth(nodesByBreadth, edges, height, width, nodeGap, orient) {\n\t var minKy = Infinity;\n\t each(nodesByBreadth, function (nodes) {\n\t var n = nodes.length;\n\t var sum = 0;\n\t each(nodes, function (node) {\n\t sum += node.getLayout().value;\n\t });\n\t var ky = orient === 'vertical' ? (width - (n - 1) * nodeGap) / sum : (height - (n - 1) * nodeGap) / sum;\n\t\n\t if (ky < minKy) {\n\t minKy = ky;\n\t }\n\t });\n\t each(nodesByBreadth, function (nodes) {\n\t each(nodes, function (node, i) {\n\t var nodeDy = node.getLayout().value * minKy;\n\t\n\t if (orient === 'vertical') {\n\t node.setLayout({\n\t x: i\n\t }, true);\n\t node.setLayout({\n\t dx: nodeDy\n\t }, true);\n\t } else {\n\t node.setLayout({\n\t y: i\n\t }, true);\n\t node.setLayout({\n\t dy: nodeDy\n\t }, true);\n\t }\n\t });\n\t });\n\t each(edges, function (edge) {\n\t var edgeDy = +edge.getValue() * minKy;\n\t edge.setLayout({\n\t dy: edgeDy\n\t }, true);\n\t });\n\t }", "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 }", "function computeNodeBreadths(root) {\n // Tree depth is fixed at 4 for SS\n ky = height / 4.2;\n root.nodes.forEach(function(node) {\n node.fixed_y = node.fixed_level ? node.fixed_level+.2 : node.fixed_level;\n\t node.fixed_y *= ky;\n\t });\n }", "function bfs(graph, root) {\n\t// store distances to root node.\n\tlet nodesLen = {}\n\n\t// Initialize nodesLen object.\n\tfor (let i = 0; i < graph.length; i++) {\n\t\tnodesLen[i] = Infinity\n\t}\n\n\t// distance to itself is always 0.\n\tnodesLen[root] = 0\n\n\tconst queue = [root]\n\tlet current\n\n\t// Loop until queue is empty.\n\twhile(queue.length) {\n\t\tcurrent = queue.shift()\n\n\t\t// get all nodes connected to current node.\n\t\tconst curConnected = graph[current]\n\t\tconst neigborIdx = []\n\t\t// gets first node connected to current node.\n\t\tconst idx = curConnected.indexOf(1)\n\n\t\t// Find indecis of all neighboring nodes and push them to array.\n\t\twhile(idx !== -1) {\n\t\t\tneigborIdx.push(idx)\n\t\t\tidx = curConnected.indexOf(1, idx + 1)\n\t\t}\n\n\t\t// Loop through these connected nodes to current node.\n\t\tfor (let j = 0; j < neigborIdx.length; j++) {\n\t\t\t// Check if neighboring nodes have distance values to the current node.\n\t\t\tif (nodesLen[neigborIdx[j]] === Infinity) {\n\t\t\t\tnodesLen[neigborIdx[j]] = nodesLen[current] + 1\n\t\t\t\tqueue.push(neigborIdx[j])\n\t\t\t}\n\t\t}\n\t}\n\treturn nodesLen\n}", "breadthFirst(start) {\n let queue = [start]\n let returnArray = []\n let visited = {}\n visited[start] = true\n let currentVertex\n while (queue.length) {\n currentVertex = queue.shift()\n returnArray.push(currentVertex)\n this.adjacencyList[currentVertex].forEach(neighbor => {\n if (!visited[neighbor]) {\n visited[neighbor] = true\n queue.push(neighbor)\n }\n })\n }\n return returnArray\n }", "breadthFirstForEach(cb) {\n console.log(this);\n const queue = [];\n queue.push(this);\n for (let i = 0; i < queue.length; i++) {\n cb(queue[i].value);\n if (queue[i].left) queue.push(queue[i].left);\n if (queue[i].right) queue.push(queue[i].right);\n }\n }", "breadthFirstForEach(cb) {\n const q = new Queue();\n q.enqueue(this);\n \n while (!q.isEmpty()) {\n const node = q.dequeue();\n cb(node.value);\n if (node.left) {\n q.enqueue(node.left);\n }\n if (node.right) {\n q.enqueue(node.right);\n }\n }\n }", "breadthFirstIterative(startVertex) {\n const queue = [startVertex];\n const results = [];\n const visitedNodes = {};\n let currentVertex;\n \n visitedNodes[startVertex] = true;\n\n while(queue.length) {\n currentVertex = queue.shift();\n results.push(currentVertex);\n\n this.adjacencyList[currentVertex].forEach(\n node => {\n if(!visitedNodes[node]) {\n visitedNodes[node] = true;\n queue.push(node);\n }\n } \n );\n }\n return results;\n }", "function GraphBreadthFirstSearch(graph, root) {\n //the object to be returned\n var nodesAndDistance = {};\n //start all distances at infinity\n for (let i = 0; i < graph.length; i++) {\n //set each node in the graph's value pair to Infinity\n nodesAndDistance[i] = Infinity;\n }\n //the length to the node being passed in is always zero\n nodesAndDistance[root] = 0;\n\n //create queue to keep track of nodes to visit\n var queue = [root];\n //the current node being traversed\n var current;\n\n while (queue.length != 0) {\n //starting with root node, remove each traversed node and set to current\n current = queue.shift(); //removes the first element from an array and returns that removed element\n //get the collection of connections for the current node being traversed\n var currentConnected = graph[current];\n //will keep track of the connections to the current node\n var neighborIndexes = [];\n //get 1st connection available\n var indexOfConnection = currentConnected.indexOf(1);\n //if there is no connection (no 1 found) set index to -1\n while (indexOfConnection != -1) { //indexOf function returns -1 if none found\n //add all connections\n neighborIndexes.push(indexOfConnection);\n // go to next potential connection to check\n indexOfConnection = currentConnected.indexOf(1, indexOfConnection + 1);\n }\n //iterate through each of the connections found with the current node and find distance\n for (let j = 0; j < neighborIndexes.length; j++) {\n //if the index that does have a connection is equal to infinity\n if (nodesAndDistance[neighborIndexes[j]] == Infinity) {\n // set the distance of that node to the current node + 1\n nodesAndDistance[neighborIndexes[j]] = nodesAndDistance[current] + 1;\n //then push neighbor to queue\n queue.push(neighborIndexes[j]);\n }\n }\n }\n return nodesAndDistance;\n}", "function resolveCollisions(nodesByBreadth, nodeGap, height, width, orient) {\n var keyAttr = orient === 'vertical' ? 'x' : 'y';\n util[\"k\" /* each */](nodesByBreadth, function (nodes) {\n nodes.sort(function (a, b) {\n return a.getLayout()[keyAttr] - b.getLayout()[keyAttr];\n });\n var nodeX;\n var node;\n var dy;\n var y0 = 0;\n var n = nodes.length;\n var nodeDyAttr = orient === 'vertical' ? 'dx' : 'dy';\n\n for (var i = 0; i < n; i++) {\n node = nodes[i];\n dy = y0 - node.getLayout()[keyAttr];\n\n if (dy > 0) {\n nodeX = node.getLayout()[keyAttr] + dy;\n orient === 'vertical' ? node.setLayout({\n x: nodeX\n }, true) : node.setLayout({\n y: nodeX\n }, true);\n }\n\n y0 = node.getLayout()[keyAttr] + node.getLayout()[nodeDyAttr] + nodeGap;\n }\n\n var viewWidth = orient === 'vertical' ? width : height; // If the bottommost node goes outside the bounds, push it back up\n\n dy = y0 - nodeGap - viewWidth;\n\n if (dy > 0) {\n nodeX = node.getLayout()[keyAttr] - dy;\n orient === 'vertical' ? node.setLayout({\n x: nodeX\n }, true) : node.setLayout({\n y: nodeX\n }, true);\n y0 = nodeX;\n\n for (var i = n - 2; i >= 0; --i) {\n node = nodes[i];\n dy = node.getLayout()[keyAttr] + node.getLayout()[nodeDyAttr] + nodeGap - y0;\n\n if (dy > 0) {\n nodeX = node.getLayout()[keyAttr] - dy;\n orient === 'vertical' ? node.setLayout({\n x: nodeX\n }, true) : node.setLayout({\n y: nodeX\n }, true);\n }\n\n y0 = node.getLayout()[keyAttr];\n }\n }\n });\n}", "bfs(startingNode) {\n\n // create a visited array \n var visited = [];\n for (var i = 0; i < this.noOfVertices; i++)\n visited[i] = false;\n\n // Create an object for queue \n var q = new d3.Queue();\n\n // add the starting node to the queue \n visited[startingNode] = true;\n q.enqueue(startingNode);\n\n // loop until queue is element \n while (!q.isEmpty()) {\n // get the element from the queue \n var getQueueElement = q.dequeue();\n\n // passing the current vertex to callback funtion \n console.log(getQueueElement);\n\n // get the adjacent list for current vertex \n var get_List = this.AdjList.get(getQueueElement);\n\n // loop through the list and add the element to the \n // queue if it is not processed yet \n for (var i in get_List) {\n var neigh = get_List[i];\n\n if (!visited[neigh]) {\n visited[neigh] = true;\n q.enqueue(neigh);\n }\n }\n }\n }", "function findNeighbours_bfs(node){\n let row = node.i;\n let col = node.j;\n //Top neighbour\n if(row-1 >= 0 && col < grid[0].length){\n let top = grid[row-1][col];\n let temp = unvisited_queue.indexOf(top);\n if(temp == -1 && !top.isVisited && !top.isWall){\n top.prev = node;\n unvisited_queue.push(top);\n }\n }\n //Right Neighbour\n if(row >= 0 && col+1 < grid[0].length){\n let right = grid[row][col+1];\n let temp = unvisited_queue.indexOf(right)\n if(temp == -1 && !right.isVisited && !right.isWall){\n right.prev = node;\n unvisited_queue.push(right);\n }\n }\n //Left neighbour\n if(row >= 0 && col-1 >= 0){\n let left = grid[row][col-1];\n let temp = unvisited_queue.indexOf(left)\n if(temp == -1 && !left.isVisited && !left.isWall){\n left.prev = node;\n unvisited_queue.push(left);\n }\n }\n //Bottom neighbour\n if(row+1 < grid.length && col >= 0){\n let bottom = grid[row+1][col]\n let temp = unvisited_queue.indexOf(bottom);\n if(temp == -1 && !bottom.isVisited && !bottom.isWall){\n bottom.prev = node;\n unvisited_queue.push(bottom);\n }\n }\n \n}", "function resolveCollisions(nodesByBreadth, nodeGap, height, width, orient) {\n\t var keyAttr = orient === 'vertical' ? 'x' : 'y';\n\t each(nodesByBreadth, function (nodes) {\n\t nodes.sort(function (a, b) {\n\t return a.getLayout()[keyAttr] - b.getLayout()[keyAttr];\n\t });\n\t var nodeX;\n\t var node;\n\t var dy;\n\t var y0 = 0;\n\t var n = nodes.length;\n\t var nodeDyAttr = orient === 'vertical' ? 'dx' : 'dy';\n\t\n\t for (var i = 0; i < n; i++) {\n\t node = nodes[i];\n\t dy = y0 - node.getLayout()[keyAttr];\n\t\n\t if (dy > 0) {\n\t nodeX = node.getLayout()[keyAttr] + dy;\n\t orient === 'vertical' ? node.setLayout({\n\t x: nodeX\n\t }, true) : node.setLayout({\n\t y: nodeX\n\t }, true);\n\t }\n\t\n\t y0 = node.getLayout()[keyAttr] + node.getLayout()[nodeDyAttr] + nodeGap;\n\t }\n\t\n\t var viewWidth = orient === 'vertical' ? width : height; // If the bottommost node goes outside the bounds, push it back up\n\t\n\t dy = y0 - nodeGap - viewWidth;\n\t\n\t if (dy > 0) {\n\t nodeX = node.getLayout()[keyAttr] - dy;\n\t orient === 'vertical' ? node.setLayout({\n\t x: nodeX\n\t }, true) : node.setLayout({\n\t y: nodeX\n\t }, true);\n\t y0 = nodeX;\n\t\n\t for (var i = n - 2; i >= 0; --i) {\n\t node = nodes[i];\n\t dy = node.getLayout()[keyAttr] + node.getLayout()[nodeDyAttr] + nodeGap - y0;\n\t\n\t if (dy > 0) {\n\t nodeX = node.getLayout()[keyAttr] - dy;\n\t orient === 'vertical' ? node.setLayout({\n\t x: nodeX\n\t }, true) : node.setLayout({\n\t y: nodeX\n\t }, true);\n\t }\n\t\n\t y0 = node.getLayout()[keyAttr];\n\t }\n\t }\n\t });\n\t }", "bfs (firstNode, searchedNode) {\n const queue = [firstNode] // queue ds\n const visited = {} // obj(or Map) stores all the visited nodes\n\n while (queue.length) {\n let current = queue.shift()\n\n // we check if the current Node is visited\n if (visited[current]) {\n continue\n }\n\n // we check if the current Node is the searchedNode\n if (current === searchedNode) {\n console.log(\n `The node you are searching for was found!Node: ${searchedNode}`\n )\n return true\n }\n\n // if the node isn't visited or the node we are searching for\n // we mark it as visited\n visited[current] = true\n\n // we get all neighbours of the current node and add each node to the queue\n let neighbour = this.nodes.get(current)\n neighbour.forEach(n => queue.push(n))\n }\n\n // if theres a problem (the searchedNode doesn't exist) return false\n return false\n }", "breadthFirst() {\n\n let iteration = [];\n\n let traversal = (current, num) => {\n if (!current) {\n return null;\n }\n\n if (!iteration[num]) {\n iteration[num] = [current.value];\n } else {\n iteration[num].push(current.value);\n }\n\n traversal(current.left, num + 1);\n traversal(current.right, num + 1);\n };\n\n traversal(this.root, 0);\n\n let flattenArray = (array, result = []) => {\n\n for (let i = 0; i < array.length; i++) {\n let value = array[i];\n if (Array.isArray(value)) {\n flattenArray(value, result);\n } else {\n result[result.length] = value;\n }\n }\n\n return result;\n };\n\n return flattenArray(iteration);\n }", "function bfs(root) {\n const queue = [];\n queue.push(root);\n while (queue.length) {\n const top = queue.shift();\n console.log(top.value);\n top.left && queue.push(top.left);\n top.right && queue.push(top.right);\n }\n}", "bfs(startingNode) {\n let visited = {}\n\n for (let key of this.AdjList.keys()) {\n visited[key] = false\n }\n\n let queue = new Queue()\n visited[startingNode] = true\n queue.enqueue(startingNode)\n\n while (!queue.isEmpty()) {\n let queueElement = queue.dequeue()\n\n console.log(queueElement)\n\n let adjList = this.AdjList.get(queueElement)\n for (let i = 0; i < adjList.length; i++) {\n let newElement = adjList[i]\n if (!visited[newElement]) {\n visited[newElement] = true\n queue.enqueue(newElement)\n }\n }\n }\n }", "animateBfs(visitedNodesInOrder) {\n var currentAction = this.state.actionCount;\n for (let i = 0; i < visitedNodesInOrder.length; i++) {\n\n setTimeout(() => {\n if (currentAction > this.state.clearedActions) {\n const node = visitedNodesInOrder[i];\n if (i%3===0){\n document.getElementById(`node-${node.row}-${node.col}`).className =\n 'node animate-one-node';\n }\n else if (i%3===1){\n document.getElementById(`node-${node.row}-${node.col}`).className =\n 'node animate-two-node';\n } else {\n document.getElementById(`node-${node.row}-${node.col}`).className =\n 'node visited-node';\n } \n }\n\n }, 4 * i);\n }\n }", "breadthFirstTraversal() {\n let traversal = [];\n let queue = [];\n queue.unshift(this.root);\n while (queue.length > 0) {\n let node = queue.pop();\n traversal.push(node.value);\n if (node.left) {\n queue.unshift(node.left);\n }\n if (node.right) {\n queue.unshift(node.right);\n }\n }\n return traversal;\n }", "doBFS(){\n // Stores the graph vertices in BFS traversal order\n let bfsNodes = [];\n // Keeps the list of visited nodes to avoid duplicates and cycle\n const visited = new Set();\n // Queue to hold the adjacent nodes ofa vertex\n const queue = new Queue();\n // Enqueue the first vertex in the queue\n for (var key of this._adjacentList.keys()) {\n queue.enqueue(key);\n visited.add(key);\n break;\n }\n \n // while a queue is not empty\n while(!queue.isEmpty()){\n // dequeue a node\n const node = queue.dequeue();\n // Push to the output array\n bfsNodes.push(node);\n // get its children and put on queue\n this._adjacentList.get(node).forEach(adjacentNode => {\n // Enqueue only if node has not been visited before\n if(!visited.has(adjacentNode)){\n queue.enqueue(adjacentNode);\n // Add to visited set\n visited.add(adjacentNode);\n }\n \n });\n }\n return bfsNodes;\n }", "bfs(startingNode) {\n\n // create a visited array \n var visited = [];\n for (var i = 0; i < this.noOfVertices; i++)\n visited[i] = false;\n\n // Create an object for queue \n var q = new Queue();\n\n // add the starting node to the queue \n visited[startingNode] = true;\n q.enqueue(startingNode);\n\n // loop until queue is element \n while (!q.isEmpty()) {\n // get the element from the queue \n var getQueueElement = q.dequeue();\n\n // passing the current vertex to callback funtion \n console.log(getQueueElement);\n\n // get the adjacent list for current vertex \n var get_List = this.AdjList.get(getQueueElement);\n\n // loop through the list and add the element to the \n // queue if it is not processed yet \n for (var i in get_List) {\n var neigh = get_List[i];\n\n if (!visited[neigh]) {\n visited[neigh] = true;\n q.enqueue(neigh);\n }\n }\n }\n }", "function bfs(startNode){\r\n\r\n let q = new Queue();\r\n let visited = new Set();\r\n\r\n q.enqueue(startNode);\r\n visited.add(startNode[\"name\"]);\r\n while(q.size() > 0){\r\n let vertex = q.dequeue();\r\n for(let neighbor of vertex[\"neighbors\"]){\r\n if(!visited.has(neighbor[\"toName\"])){\r\n visited.add(neighbor[\"toName\"]);\r\n q.enqueue(large.graph.get(neighbor[\"toName\"]));\r\n }\r\n }\r\n }\r\n\r\n return visited.size;\r\n\r\n}", "function bfs() {\n\n /* Calling search the main algo written to achieve the shortest path using BFS */\n search(matrix);\n}", "function bi_bfs(matrix, queue, visited, parent) {\n\n /* Getting the front element from the queue */\n let rv = queue.shift();\n\n /* extract the 'x' and 'y' coordinate of the popped element */\n let x = parseInt(rv[0]), y = parseInt(rv[1]);\n\n /* Loop over each neighbour directions */\n for (let i = 0; i < dirs.length; i++) {\n\n /* 'newX' is the new 'x' coordinate constructed by adding either 0, -1 or +1 to the current x */\n /* 'newY' is the new 'y' coordinate constructed by adding either 0, -1 or +1 to the current y */\n let newX = x + dirs[i][0], newY = y + dirs[i][1];\n\n /* If the neighour is invalid: border or beyond border or src or destination then no need to do anything continue */\n if ( newX <= 0 || newY <= 0 || newX > rows - 2 || newY > cols - 2 || matrix[newX][newY] === 1 || matrix[newX][newY] === 2) {\n continue;\n }\n\n /* If the neighbour location is not already visited and there exist no wall then it can be part of our path */\n if (!visited.has(`${newX}:${newY}`) && matrix[newX][newY] !== 3) {\n\n /* save the parent of the neighbour coordinate to current coordinate */\n parent[`${newX}:${newY}`] = `${x}:${y}`;\n\n /* Mark the neighbour coordinate as visited by adding it into set */\n visited.add(`${newX}:${newY}`);\n\n /* Now get the element and update the color so that user can visualize progress */\n document.getElementById(`${newX}:${newY}`).style.fill = \"rgb(149, 202, 255)\";\n\n /* Mark the extra path as '7' to denote extra path in our matrix */\n matrix[newX][newY] = 7;\n\n /* After checking the corner cases: Still the neighbour is save then append in the queue to traverse in future. */\n queue.push([newX, newY]);\n }\n }\n}", "function bfs(rootNode, vertices, edges) {\n rootNode = vertices[0]\n\tqueue = []\n\taddVertexToQueue(rootNode)\n\t\t// queue = [rootNode]\n\twhile(!queue.length == 0) {\n\t\tlet firstNode = queue.shift()\n\tadjacentVertices = findAdjacent(firstNode)\n\t\tfor(vertex in adjacentVertices) {\n\t\t\tmarkDistanceAndPredecessor(vertex)\n\t\t\taddToQueue(vertex)\n\t\t}\n\t}\n}", "function bfs(n, m, edges, s) {\n let results = []; // save the calculated [Total Length] from [start node] to each of others node.\n for (let i = 1; i <= n; i++)\n results[i] = -1;\n\n let node2Level = new Map(), queue = [s], visited = [];\n results[s] = 0;\n visited[s] = true;\n node2Level.set(s, 0);\n\n while (queue.length > 0) {\n let node = queue.shift(), children = edges.filter(e => e[0] === node || e[1] === node);\n for (let i = 0; i < children.length; i++) {\n let edge = children[i], theOtherNode = (edge[0] === node ? edge[1] : edge[0]);\n let theOtherNodeIndex = theOtherNode;\n if (visited[theOtherNodeIndex] === true)\n continue;\n\n let nodeLevel = node2Level.get(node);\n results[theOtherNodeIndex] = (nodeLevel + 1) * 6;\n node2Level.set(theOtherNodeIndex, nodeLevel + 1);\n\n queue.push(theOtherNode);\n visited[theOtherNodeIndex] = true;\n }\n }\n\n results.shift();\n results = results.filter(s => s !== 0)\n\n return results;\n}", "function bfs(node) {\n var queue = [];\n queue.push(node);\n while(queue.length > 0) {\n // Pop first thing from the queue\n var n = queue.shift();\n console.log(n.name);\n // Add children to queue\n n.children.forEach(function(child) {\n queue.push(child);\n });\n }\n}", "function bfs(node) {\n let q = [];\n let level = 0;\n q.push(node);\n\n while (q.length > 0) {\n let cur = q.shift();\n console.log(cur.data);\n if (cur.left !== null || cur.right !== null) {\n level++;\n if (cur.left !== null) {\n q.push(cur.left);\n }\n if (cur.right !== null) {\n q.push(cur.right);\n }\n }\n }\n\n console.log(level);\n}", "breadthFirstSearch(start) {\n const queue = [start];\n const result = [];\n const visited = {};\n let currentVertex;\n\n visited[start] = true;\n\n while (queue.length) {\n currentVertex = queue.shift();\n result.push(currentVertex);\n\n this.adjacencyList.forEach(neighbor => {\n if (!visited[neighbor]) {\n visited[neighbor] = true;\n queue.push(neighbor);\n }\n });\n }\n return result;\n }", "function breadthFirstArray(root){\r\n let queue = [root];\r\n let checkedNodesVals = [];\r\n while(queue.length){\r\n let node = queue.shift();\r\n\r\n checkedNodesVals.push(node.val);\r\n\r\n if(node.left) queue.push(node.left);\r\n if(node.right) queue.push(node.right);\r\n }\r\n return checkedNodesVals;\r\n}", "bfs() {\n const visitedNodes = [];\n const nodeQueue = [this.root];\n\n while(nodeQueue.length){\n const currentNode = nodeQueue.shift();\n visitedNodes.push(currentNode.val);\n if(currentNode.left) nodeQueue.push(currentNode.left);\n if(currentNode.right) nodeQueue.push(currentNode.right);\n }\n return visitedNodes;\n }", "breadthFirstSearch(start) {\n const toVisitQueue = [start];\n let visited = newSet();\n visited.add(start);\n let current;\n while (toVisitQueue.length) {\n current = toVisitQueue.shift();\n // Look at all neighbors of current.\n // If we have not visited the neighbor, add it to the toVisitQueue and the visited set.\n current.adjacent.forEach(neighbor => {\n if (!visited.has(neighbor)) {\n toVisitQueue.push(neighbor);\n visited.add(neighbor);\n }\n })\n }\n const seen = [...visited].map(node => node.value);\n return seen;\n }", "breadthFirstTraverse() {\n var queue = [this]\n var result = []\n while (queue.length != 0) {\n var head = queue.shift()\n if (head.leftChild !== null)\n queue.push(head.leftChild)\n if (head.rightChild !== null)\n queue.push(head.rightChild)\n result.push(head)\n }\n return result\n }", "bfs() {\n var array = [];\n\n return Private.bfs(array, this.head);\n }", "breadthFirst() {\n let data = [];\n let queue = [];\n let current = this.root;\n queue.push(current);\n while(queue.length != 0) {\n current = queue.shift();\n data.push(current);\n if(current.left) {\n queue.push(current.left);\n }\n if(current.right) {\n queue.push(current.right);\n }\n }\n return data;\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 }", "bfs(startingNode) {\n // create a visited array \n let visited = new Map();\n for (var i = 0; i < this.noOfVertices; i++)\n visited[i] = false;\n\n // Create an object for queue \n var q = [];\n\n // add the starting node to the queue \n visited[startingNode] = true;\n q.push(startingNode);\n\n // loop until queue is element \n while (q.length > 0) {\n // get the element from the queue \n var getQueueElement = q.shift();\n\n // passing the current vertex to callback funtion \n console.log(getQueueElement);\n\n // get the adjacent list for current vertex \n var get_List = this.AdjList.get(getQueueElement);\n\n // loop through the list and add the element to the \n // queue if it is not processed yet \n for (var i in get_List) {\n console.log(`i : ${i} get_List : ${get_List[i]}`);\n var neigh = get_List[i];\n if (!visited[neigh]) {\n visited[neigh] = true;\n q.push(neigh);\n }\n\n\n }\n\n // dfs(v) \n }\n }", "function bfs(start){\n var v; //current vertex\n var i; //counter\n init_queue();\n enqueue(start);\n discovered[start] = true;\n while (empty() == false) {\n v = dequeue();\n process_vertex(v);\n processed[v] = true;\n for (var i=0; i<graph.degree[v]; i++){\n if (valid_edge(graph.edges[v][i]) == true) {\n if (discovered[graph.edges[v][i].v] == false) {\n enqueue(graph.edges[v][i].v);\n discovered[graph.edges[v][i].v] = true;\n parents[graph.edges[v][i].v] = v;\n }\n if (processed[graph.edges[v][i].v] == false)\n process_edge(v,graph.edges[v][i].v);\n }\n }\n }\n}", "breadthFirstSearch(start) {\n const toVisitQueue = [start];\n const visited = new Set(toVisitQueue);\n const out = [];\n\n while (toVisitQueue.length) {\n const currNode = toVisitQueue.shift();\n out.push(currNode.value);\n for (let neighbor of currNode.adjacent) {\n if (!visited.has(neighbor)) {\n toVisitQueue.push(neighbor);\n visited.add(neighbor);\n }\n }\n }\n return out;\n }", "initializeEdgesPerNode() {\n let row_delta = this.m;\n\n for (let i = 0; i < this.m; ++i) {\n if (i == 0 || i == this.m - 1) {\n this.edges_per_node[i] = 2;\n this.edges_per_node[(this.n - 1) * row_delta + i] = 2;\n }\n else {\n this.edges_per_node[i] = 3;\n this.edges_per_node[(this.n - 1) * row_delta + i] = 3\n }\n }\n\n for (let i = 1; i < this.n - 1; ++i) {\n this.edges_per_node[i * row_delta] = 3;\n this.edges_per_node[i * row_delta + this.m - 1] = 3;\n }\n\n for (let i = 1; i < this.n - 1; ++i) {\n for (let j = 1; j < this.m - 1; ++j) {\n this.edges_per_node[i * row_delta + j] = 4;\n }\n }\n }", "breadthFirstSearch(start) {\n let visitQueue = [start];\n let seen = new Set(visitQueue);\n let result = [];\n\n while (visitQueue.length > 0) {\n let currentNode = visitQueue.shift();\n result.push(currentNode.value);\n\n for (let neighbor of currentNode.adjacent) {\n if(!seen.has(neighbor)) {\n visitQueue.push(neighbor);\n seen.add(neighbor);\n }\n }\n }\n return result;\n }", "breadthFirstSearch(start) {\n const visited = new Set([start]);\n const values = [];\n const queue = [start];\n while (queue.length) {\n const current = queue.shift();\n values.push(current.value);\n for (let node of current.adjacent.values()) {\n if (!visited.has(node)) {\n queue.push(node);\n visited.add(node);\n }\n }\n }\n return values;\n }", "initializeNodeIndex() {\n for (let i = 0; i < this.n * this.m; ++i)\n this.node_index[i] = i;\n }", "setNodeColumn() {\n const node = this;\n if (!defined(node.options.column)) {\n // No links to this node, place it left\n if (node.linksTo.length === 0) {\n node.column = 0;\n }\n else {\n node.column = node.getFromNode().fromColumn + 1;\n }\n }\n }", "function bfs(){\n // reset edge state\n resetShortestPath();\n gatherNeighbors();\n //console.log(data.nodes);\n const source = 0;\n const target = data.nodes.length - 1;\n const queue = [source];\n\n let shortestPath = [];\n data.nodes[0].discovered = true;\n data.nodes[0].predecessor = {};\n let tail = 0;\n\n while (tail < queue.length){\n let u = queue[tail++];\n let neighbors = data.nodes[u].neighbors;\n neighbors.forEach(function(n){\n if (data.nodes[n].discovered){\n return;\n }\n data.nodes[n].discovered = true;\n if (n === target){\n let path = [n];\n while (u !== source){\n path.push(u);\n u = data.nodes[u].predecessor;\n }\n path.push(u);\n path.reverse();\n shortestPath = path;\n return;\n }\n data.nodes[n].predecessor = u;\n queue.push(n);\n })\n }\n\n return shortestPath;\n\n }", "async function bfs(){\n var hist = {};\n var q = [];\n var starting_path = [starting_point];\n q.push(starting_path);\n var dist = 1; // distance from starting point\n\n // perform bfs search\n while(q.length > 0){\n var curr_path = q.shift(); // get oldest path in queue. path: [[x1, y1], [x2, y2], ...]\n var p = curr_path[curr_path.length - 1]; // get latest point in path. p: [x, y]\n var px = p[0];\n var py = p[1];\n\n // reached goal\n if(px == end_point[0] && py == end_point[1]){\n var arr = [];\n for(var i = 0; i < curr_path.length; i++){\n var point = curr_path[i];\n var x = point[0];\n var y = point[1];\n\n // Skip start and end drawing\n if((x == starting_point[0] && y == starting_point[1]) || (x == end_point[0] && y == end_point[1])){\n continue;\n }\n arr.push([x, y]);\n }\n for(var k = 0; k < (grid / 2); k++){\n drawSolution(arr, k);\n await sleep(time_sleep);\n }\n break;\n }\n\n if(curr_path.length - 1 >= dist){\n console.log(\"stage: \" + dist);\n dist++;\n for(var k = 0; k < (grid / 2); k++){\n drawBfsStage(id, q, curr_path.length, k);\n drawSingleCircle(curr_path[curr_path.length - 1], k, blue);\n await sleep(time_sleep_fast);\n }\n // await sleep(time_sleep);\n }\n\n // Adding neighbours\n for(var dx = -1; dx < 2; dx++){\n for(var dy = -1; dy < 2; dy++){\n if(dy * dy == dx * dx){ // skip diagonal neighbours\n continue;\n }\n var x = px + (dx * grid);\n var y = py + (dy * grid);\n var s = pointToString([x, y]);\n if(s in hist || x < 0 || y < 0 || x >= canvas.width || y >= canvas.height || isWall(s)){\n continue;\n }\n hist[s] = 1;\n \n // Skip start and end drawing\n if((x == starting_point[0] && y == starting_point[1])){\n continue;\n }\n //drawRectangle(id, x, y, grid - 1, grid - 1, 'green');\n let new_path = JSON.parse(JSON.stringify(curr_path)); // deep clone\n new_path.push([x, y]); // add neighbour to current path\n q.push(new_path);\n }\n }\n }\n console.log(\"done\");\n}", "function Btnode(val){\n this.val = val;\n this.left = null;\n this.right = null;\n this.parent = null;\n this.height = function(){\n if(this.left){\n var lHeight = this.left.height();\n } else{\n var lHeight = 0;\n }\n if(this.right){\n var rHeight = this.right.height();\n } else{\n var rHeight = 0;\n }\n return 1 + Math.max(lHeight, rHeight);\n }\n}", "function scaleNodeBreadths(nodes, kx, orient) {\n\t each(nodes, function (node) {\n\t var nodeDepth = node.getLayout().depth * kx;\n\t orient === 'vertical' ? node.setLayout({\n\t y: nodeDepth\n\t }, true) : node.setLayout({\n\t x: nodeDepth\n\t }, true);\n\t });\n\t }", "static of(nodes) {\n if (nodes.length == 1)\n return nodes[0];\n let i = 0, j = nodes.length, before = 0, after = 0;\n for (;;) {\n if (i == j) {\n if (before > after * 2) {\n let split = nodes[i - 1];\n if (split.break)\n nodes.splice(--i, 1, split.left, null, split.right);\n else\n nodes.splice(--i, 1, split.left, split.right);\n j += 1 + split.break;\n before -= split.size;\n }\n else if (after > before * 2) {\n let split = nodes[j];\n if (split.break)\n nodes.splice(j, 1, split.left, null, split.right);\n else\n nodes.splice(j, 1, split.left, split.right);\n j += 2 + split.break;\n after -= split.size;\n }\n else {\n break;\n }\n }\n else if (before < after) {\n let next = nodes[i++];\n if (next)\n before += next.size;\n }\n else {\n let next = nodes[--j];\n if (next)\n after += next.size;\n }\n }\n let brk = 0;\n if (nodes[i - 1] == null) {\n brk = 1;\n i--;\n }\n else if (nodes[i] == null) {\n brk = 1;\n j++;\n }\n return new HeightMapBranch(HeightMap.of(nodes.slice(0, i)), brk, HeightMap.of(nodes.slice(j)));\n }", "bfs(startingNode, destX, destY) {\n let visited = [];\n\n for (let i = 0; i < this.noOfVertices; i++) {\n visited[i] = false;\n }\n\n let queue = [];\n visited[startingNode] = true;\n let level = 0;\n\n queue.push(new Node(0, 0, level));\n while (queue.length) {\n const element = queue.shift();\n const list = this.adjList.get(node(element.x, element.y));\n level = element.dist;\n\n if (element == node(destX, destY)) {\n return element.dist;\n }\n\n for (let i in list) {\n const neigh = list[i];\n if (!visited[neigh]) {\n visited[neigh] = true;\n const node = neigh.split(\", \")\n queue.push(new Node(node[0], node[1], level + 1));\n }\n }\n }\n return -1;\n }", "assignNeighbours(){\n\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.cols; j++) {\n\n if(this.grid[i][j].isBomb){\n this.grid[i][j].surroundingBombs = -1;\n continue;\n }\n let neighbours = MineSweeper.getNeighbours((i == 0), (i == this.rows-1), (j == 0), (j == this.cols-1));\n\n let counter = 0;\n for(let neighbour of neighbours){\n let dr = neighbour[0];\n let dc = neighbour[1];\n if(this.grid[i+dr][j+dc].isBomb){\n counter++;\n }\n }\n this.grid[i][j].surroundingBombs = counter;\n }\n }\n }", "function BFS() {\r\n queueLoop: while (queue.length) {\r\n // Get the next node in the queue\r\n let node = queue.pop();\r\n\r\n // Visit the node if it's not visited yet\r\n if (!node.visited) {\r\n node.visited = true;\r\n output.push(node);\r\n }\r\n\r\n // Visit all direct child nodes and put them in queue\r\n for (let n of node.childNodes) {\r\n if (!n.visited) {\r\n n.visited = true;\r\n output.push(n);\r\n queue.unshift(n);\r\n }\r\n }\r\n // Loop repeats and goes to the next node\r\n }\r\n}", "function node_weight(d) {\r\n d.weight = links.filter(function(l) {\r\n return l.source.index == d.index // || l.target.index == d.index \r\n }).length\r\n return d.weight\r\n }", "bfs() {\n let node = this.root;\n let queue = [];\n let visited = [];\n\n queue.push(node);\n\n while(queue.length){\n node = queue.shift();\n visited.push(node.val);\n if(node.left){\n queue.push(node.left);\n }\n if(node.right) {\n queue.push(node.right);\n }\n }\n\n return visited;\n\n }", "breadthFirstSearch(start) { \n let toVisitQueue = [start];\n let seen = new Set();\n let values = [];\n seen.add(start);\n while (toVisitQueue.length) {\n let current = toVisitQueue.shift();\n values.push(current.value);\n for (let node of current.adjacent) {\n if (!(seen.has(node))) {\n toVisitQueue.push(node);\n seen.add(node);\n }\n }\n }\n return values;\n }", "function breadthFirstSearch(graph, distanceMatrix) {\n\n $.each(graph.vertices, function () {\n\n var neigbors = [[this.label, this.number]],\n alreadyVisited = [this.label],\n tmpNeigbors = [],\n currentVertice = this,\n currentCount = 1,\n done = false;\n\n while (neigbors.length !== 0) {\n $.each(graph.adjacencyList[neigbors[0][1]].neighborsOut, function () {\n\n if (!isInArray(this[0], alreadyVisited)) {\n alreadyVisited.push(this[0]);\n distanceMatrix[currentVertice.label][this[0]] = currentCount;\n $.merge(tmpNeigbors, [this]);\n }\n\n });\n\n neigbors.splice(0, 1);\n\n if (neigbors.length === 0) {\n currentCount++;\n neigbors = tmpNeigbors;\n tmpNeigbors = [];\n }\n }\n });\n}", "function bfs (grid, startX, startY, endX, endY) {\n // matrix to track visited (maybe not needed?)\n // 0 -> unvisited\n // 1 -> visited\n const visited = Array(grid.length).fill(0).map(row => new Array(grid[0].length).fill(0));\n \n // empty queue\n let queue = [];\n \n // maybe have a list that keeps track of the visited nodes... append the current node that we are examining\n let visitedList = [];\n \n // mark source square as visited in matrix and list\n visited[startX][startY] = 1;\n visitedList.push(grid[startX][startY]);\n \n // enqueue source square\n queue.push(grid[startX][startY]);\n\n // variable to store length of longest?? path from source to destination\n let min = Number.MAX_SAFE_INTEGER;\n\n // while queue is not empty\n while (queue.length !== 0) {\n // dequeue front node \n let current = queue.shift();\n\n /*\n <Square \n col={squareIndex} \n row={rowIndex} \n key={squareIndex} \n start={start} \n end={end} \n wall={wall} \n distance=0\n onClick={(row, col) => this.handleClick(row, col)}>\n </Square>\n */\n \n // get node coordinates and distance (do we need distance?) \n let x = current.row;\n let y = current.col;\n let dist = current.distance;\n \n // if node is destination, update the distance tracking variable and return ??\n if (x === endX && y === endY) {\n min = dist;\n return visitedList;\n }\n\n // x and y possible movements\n const xMove = [-1, 0, 0, 1];\n const yMove = [0, -1, 1, 0];\n \n // check for the 4 possible movements from current cell\n for (let i = 0; i < 4; i++) {\n // check if movement is valid \n if (isValid(grid, visited, x + xMove[i], y + yMove[i])) {\n // mark the nodes as visited\n visited[x + xMove[i]][y + yMove[i]] = 1;\n\n let next = grid[x + xMove[i]][y + yMove[i]];\n \n \n // update distance \n next.distance++;\n // enqueue the node representing valid movement \n queue.push(next);\n\n visitedList.push(next);\n // updating the previous node\n next.previous = current;\n }\n }\n }\n // if path not found returns empty list\n return [];\n}", "calculateHeightH(node) {\n if (node.key === \"null\") return 0\n else {\n var left = this.calculateHeightH(node.left);\n var right = this.calculateHeightH(node.right);\n this.treedpth = Math.max(left, right) + 1;\n } \n }", "breadthFirstSearch(start) {\n const result = [];\n const searchQueue = [start];\n const seen = new Set(searchQueue);\n\n while(searchQueue.length) {\n const currNode = searchQueue.shift();\n result.push(currNode.value);\n for(let node of currNode.adjacent) {\n if(!seen.has(node)) {\n searchQueue.push(node);\n seen.add(node);\n }\n }\n }\n return result;\n }", "function BinaryHeap() {\n this.nodes = [];\n}", "bfs(startVertex) {\n let result = [];\n let visited = {};\n let queue = [startVertex];\n\n let currentVertex;\n visited[startVertex] = true;\n\n while (queue.length > 0) {\n currentVertex = queue.shift();\n result.push(currentVertex);\n\n this.adjacencyList[currentVertex].forEach(neighbour => {\n if (!visited[neighbour]) {\n queue.push(neighbour);\n visited[neighbour] = true;\n }\n });\n }\n\n return result;\n }", "function getMaxFlow()\n {\n\n Graph.instance.edges.forEach(\n function(key, edge)\n {\n edge.state.flow = 0;\n })\n\n var no_path_found = false;\n currentFlow = 0;\n while(!no_path_found)\n {\n Graph.instance.nodes.forEach(\n function(key, node)\n {\n node.state.predecessor = null;\n });\n var search_queue = [state.sourceId];\n var source = Graph.instance.nodes.get(state.sourceId);\n source.state.predecessor = {};\n while(Graph.instance.nodes.get(state.targetId).state.predecessor == null && search_queue.length > 0 )\n {\n var node_to_expand = search_queue.shift();\n var node = Graph.instance.nodes.get(node_to_expand);\n var out_edges = node.getOutEdges();\n for (var i = 0; i < out_edges.length; i++)\n {\n var edge_out = out_edges[i];\n\n if(edge_out.end.state.predecessor == null && edge_out.resources[0] > edge_out.state.flow)\n {\n search_queue.push(edge_out.end.id);\n edge_out.end.state.predecessor =\n {\n \"node\": node_to_expand,\n \"edge\": edge_out.id,\n \"residual-capacity\":edge_out.resources[0] - edge_out.state.flow,\n \"direction\": 1\n };\n }\n }\n\n var in_edges = node.getInEdges();\n for (var i = 0; i < in_edges.length; i++)\n {\n var edge_in = in_edges[i];\n\n if(edge_in.start.state.predecessor == null && edge_in.state.flow > 0)\n {\n search_queue.push(edge_in.start.id);\n edge_in.start.state.predecessor =\n {\n \"node\": node_to_expand,\n \"edge\": edge_in.id,\n \"residual-capacity\": edge_in.state.flow,\n \"direction\": -1\n };\n }\n }\n }\n\n if(Graph.instance.nodes.get(state.targetId).state.predecessor != null)\n {\n var path = [];\n var augmentation = Number.MAX_SAFE_INTEGER;\n var next_path_node = state.targetId;\n\n //gather path\n while(next_path_node != state.sourceId)\n {\n var node = Graph.instance.nodes.get(next_path_node);\n path.push(node.state.predecessor);\n augmentation = Math.min(node.state.predecessor[\"residual-capacity\"], augmentation);\n next_path_node = node.state.predecessor[\"node\"];\n }\n\n //apply path\n for (var i = 0; i < path.length; i++)\n {\n var predecessor = path[i];\n var edge = Graph.instance.edges.get(predecessor[\"edge\"]);\n edge.state.flow += predecessor[\"direction\"] * augmentation;\n\n }\n currentFlow += augmentation;\n\n\n }\n else\n no_path_found = true;\n }\n\t\tmaxFlow = currentFlow;\n Graph.instance.nodes.forEach(\n function(key, node){\n\t\t\t\tbs[node.id] = node.b;\n if(node.id == state.sourceId){\n\t\t\t\t\tnode.b = currentFlow;\n\t\t\t\t\tbOfS = node.b;\n\t\t\t\t}else if(node.id == state.targetId){\n\t\t\t\t\tnode.b = -currentFlow;\n\t\t\t\t\tbOfT = node.b;\n\t\t\t\t}else{\n\t\t\t\t\tnode.b = 0;\n\t\t\t\t}\n\t\t\t});\n\t\t\t\n\t\t\tGraph.instance.edges.forEach(\n function(key, edge)\n {\n edge.state.flow = 0;\n })\n\n var no_path_found = false;\n currentFlow = 0;\n state.current_step = STEP_MAINLOOP;\n logger.log(\"Init of maxflow.\");\n\n }", "traverseBF(fn) {\n //will give us some element within our root node, inside an array\n const arr = [this.root]\n\n //while-loop, works as long as array has something in it, is TRUTHY\n while (arr.length) {\n //remove first element out of array, with shift() method\n const node = arr.shift()\n //then take all node's children and push them into our array\n // CAN'T do node.children, would create a nested array\n // use spread operator to take all elements out, and push them into the array\n arr.push(...node.children) //TODO:For-loop, would have been more code!!!\n\n //take node AND pass in to our iterator func\n fn(node)\n }\n }", "function box_force() {\n for (var i = 0, n = nodes.length; i < n; ++i) {\n curr_node = nodes[i];\n curr_node.x = Math.max(-(width / 2), Math.min(width / 2, curr_node.x));\n curr_node.y = Math.max(-(height / 2), Math.min(height / 2, curr_node.y));\n }\n }", "function relaxLeftToRight(nodesByBreadth, alpha, orient) {\n util[\"k\" /* each */](nodesByBreadth, function (nodes) {\n util[\"k\" /* each */](nodes, function (node) {\n if (node.inEdges.length) {\n var y = sankeyLayout_sum(node.inEdges, weightedSource, orient) / sankeyLayout_sum(node.inEdges, getEdgeValue);\n\n if (isNaN(y)) {\n var len = node.inEdges.length;\n y = len ? sankeyLayout_sum(node.inEdges, centerSource, orient) / len : 0;\n }\n\n if (orient === 'vertical') {\n var nodeX = node.getLayout().x + (y - sankeyLayout_center(node, orient)) * alpha;\n node.setLayout({\n x: nodeX\n }, true);\n } else {\n var nodeY = node.getLayout().y + (y - sankeyLayout_center(node, orient)) * alpha;\n node.setLayout({\n y: nodeY\n }, true);\n }\n }\n });\n });\n}", "function BFS() {\n let queue = []\n board[0][0].dist = 0\n board[0][0].visited = true\n queue.push(board[0][0])\n\n while (queue.length != 0) {\n let currentCell = queue.pop()\n let r = currentCell.r;\n let c = currentCell.c;\n // go to all unvisited neighbors\n // up\n if (r - 1 >= 0 && !board[r][c].up && !board[r - 1][c].visited) {\n board[r - 1][c].visited = true;\n board[r - 1][c].dist = board[r][c].dist + 1\n board[r - 1][c].parentNode = board[r][c]\n queue.push(board[r - 1][c])\n if (r - 1 == 19 && c == 19) {\n return true;\n }\n }\n //down\n if (r + 1 < 20 && !board[r][c].down && !board[r + 1][c].visited) {\n board[r + 1][c].visited = true\n board[r + 1][c].dist = board[r][c].dist + 1\n board[r + 1][c].parentNode = board[r][c]\n queue.push(board[r + 1][c])\n if (r + 1 == 19 && c == 19) {\n return true;\n }\n }\n //left\n if (c - 1 >= 0 && !board[r][c].left && !board[r][c - 1].visited) {\n board[r][c - 1].visited = true\n board[r][c - 1].dist = board[r][c].dist + 1\n board[r][c - 1].parentNode = board[r][c]\n queue.push(board[r][c - 1])\n if (r == 19 && c - 1 == 19) {\n return true;\n }\n }\n //right\n if (c + 1 < 20 && !board[r][c].right && !board[r][c + 1].visited) {\n board[r][c + 1].visited = true\n board[r][c + 1].dist = board[r][c].dist + 1\n board[r][c + 1].parentNode = board[r][c]\n queue.push(board[r][c + 1])\n if (r == 19 && c + 1 == 19) {\n return true;\n }\n }\n }\n return false;\n}", "function scaleNodeBreadths(nodes, kx, orient) {\n util[\"k\" /* each */](nodes, function (node) {\n var nodeDepth = node.getLayout().depth * kx;\n orient === 'vertical' ? node.setLayout({\n y: nodeDepth\n }, true) : node.setLayout({\n x: nodeDepth\n }, true);\n });\n}", "function computeNodeDepths(iterations) {\n // Group nodes by breath.\n var nodesByBreadth = d3.nest()\n .key(function(d) { return d.x; })\n .sortKeys(d3.ascending)\n .entries(nodes)\n .map(function(d) { return d.values; });\n\n //\n initializeNodeDepth();\n resolveCollisions();\n computeLinkDepths();\n for (var alpha = 1; iterations > 0; --iterations) {\n relaxRightToLeft(alpha *= .99);\n resolveCollisions();\n computeLinkDepths();\n relaxLeftToRight(alpha);\n resolveCollisions();\n computeLinkDepths();\n }\n\n function initializeNodeDepth() {\n // Calculate vertical scaling factor.\n var ky = d3.min(nodesByBreadth, function(nodes) {\n return (size[1] - (nodes.length - 1) * nodePadding) / d3.sum(nodes, value);\n });\n\n nodesByBreadth.forEach(function(nodes) {\n nodes.forEach(function(node, i) {\n node.y = i;\n node.dy = node.value * ky;\n });\n });\n\n links.forEach(function(link) {\n link.dy = link.value * ky;\n });\n }\n\n function relaxLeftToRight(alpha) {\n nodesByBreadth.forEach(function(nodes, breadth) {\n nodes.forEach(function(node) {\n if (node.targetLinks.length) {\n // Value-weighted average of the y-position of source node centers linked to this node.\n var y = d3.sum(node.targetLinks, weightedSource) / d3.sum(node.targetLinks, value);\n node.y += (y - center(node)) * alpha;\n }\n });\n });\n\n function weightedSource(link) {\n return (link.source.y + link.sy + link.dy / 2) * link.value;\n }\n }\n\n function relaxRightToLeft(alpha) {\n nodesByBreadth.slice().reverse().forEach(function(nodes) {\n nodes.forEach(function(node) {\n if (node.sourceLinks.length) {\n // Value-weighted average of the y-positions of target nodes linked to this node.\n var y = d3.sum(node.sourceLinks, weightedTarget) / d3.sum(node.sourceLinks, value);\n node.y += (y - center(node)) * alpha;\n }\n });\n });\n\n function weightedTarget(link) {\n return (link.target.y + link.ty + link.dy / 2) * link.value;\n }\n }\n\n function resolveCollisions() {\n nodesByBreadth.forEach(function(nodes) {\n var node,\n dy,\n y0 = 0,\n n = nodes.length,\n i;\n\n // Push any overlapping nodes down.\n nodes.sort(ascendingDepth);\n for (i = 0; i < n; ++i) {\n node = nodes[i];\n dy = y0 - node.y;\n if (dy > 0) node.y += dy;\n y0 = node.y + node.dy + nodePadding;\n }\n\n // If the bottommost node goes outside the bounds, push it back up.\n dy = y0 - nodePadding - size[1];\n if (dy > 0) {\n y0 = node.y -= dy;\n\n // Push any overlapping nodes back up.\n for (i = n - 2; i >= 0; --i) {\n node = nodes[i];\n dy = node.y + node.dy + nodePadding - y0;\n if (dy > 0) node.y -= dy;\n y0 = node.y;\n }\n }\n });\n }\n\n function ascendingDepth(a, b) {\n return a.y - b.y;\n }\n }", "function computeNodeDepths(iterations) {\n // Group nodes by breath.\n var nodesByBreadth = d3.nest()\n .key(function(d) { return d.x; })\n .sortKeys(d3.ascending)\n .entries(nodes)\n .map(function(d) { return d.values; });\n\n //\n initializeNodeDepth();\n resolveCollisions();\n computeLinkDepths();\n for (var alpha = 1; iterations > 0; --iterations) {\n relaxRightToLeft(alpha *= .99);\n resolveCollisions();\n computeLinkDepths();\n relaxLeftToRight(alpha);\n resolveCollisions();\n computeLinkDepths();\n }\n\n function initializeNodeDepth() {\n // Calculate vertical scaling factor.\n var ky = d3.min(nodesByBreadth, function(nodes) {\n return (size[1] - (nodes.length - 1) * nodePadding) / d3.sum(nodes, value);\n });\n\n nodesByBreadth.forEach(function(nodes) {\n nodes.forEach(function(node, i) {\n node.y = i;\n node.dy = node.value * ky;\n });\n });\n\n links.forEach(function(link) {\n link.dy = link.value * ky;\n });\n }\n\n function relaxLeftToRight(alpha) {\n nodesByBreadth.forEach(function(nodes, breadth) {\n nodes.forEach(function(node) {\n if (node.targetLinks.length) {\n // Value-weighted average of the y-position of source node centers linked to this node.\n var y = d3.sum(node.targetLinks, weightedSource) / d3.sum(node.targetLinks, value);\n node.y += (y - center(node)) * alpha;\n }\n });\n });\n\n function weightedSource(link) {\n return (link.source.y + link.sy + link.dy / 2) * link.value;\n }\n }\n\n function relaxRightToLeft(alpha) {\n nodesByBreadth.slice().reverse().forEach(function(nodes) {\n nodes.forEach(function(node) {\n if (node.sourceLinks.length) {\n // Value-weighted average of the y-positions of target nodes linked to this node.\n var y = d3.sum(node.sourceLinks, weightedTarget) / d3.sum(node.sourceLinks, value);\n node.y += (y - center(node)) * alpha;\n }\n });\n });\n\n function weightedTarget(link) {\n return (link.target.y + link.ty + link.dy / 2) * link.value;\n }\n }\n\n function resolveCollisions() {\n nodesByBreadth.forEach(function(nodes) {\n var node,\n dy,\n y0 = 0,\n n = nodes.length,\n i;\n\n // Push any overlapping nodes down.\n nodes.sort(ascendingDepth);\n for (i = 0; i < n; ++i) {\n node = nodes[i];\n dy = y0 - node.y;\n if (dy > 0) node.y += dy;\n y0 = node.y + node.dy + nodePadding;\n }\n\n // If the bottommost node goes outside the bounds, push it back up.\n dy = y0 - nodePadding - size[1];\n if (dy > 0) {\n y0 = node.y -= dy;\n\n // Push any overlapping nodes back up.\n for (i = n - 2; i >= 0; --i) {\n node = nodes[i];\n dy = node.y + node.dy + nodePadding - y0;\n if (dy > 0) node.y -= dy;\n y0 = node.y;\n }\n }\n });\n }\n\n function ascendingDepth(a, b) {\n return a.y - b.y;\n }\n }", "function setLinkIndexAndNum(){\n for (var i = 0; i < g.links.length; i++){\n if (i != 0 &&\n g.links[i].source == g.links[i-1].source &&\n g.links[i].target == g.links[i-1].target)\n {\n g.links[i].linkindex = g.links[i-1].linkindex + 1;\n }else{\n g.links[i].linkindex = 1;\n }\n // save the total number of links between two nodes\n\t\t\t//console.log(g.links[i])\n if(mLinkNum[g.links[i].target + \",\" + g.links[i].source] !== undefined){\n mLinkNum[g.links[i].target + \",\" + g.links[i].source] = g.links[i].linkindex;\n }else{\n mLinkNum[g.links[i].source + \",\" + g.links[i].target] = g.links[i].linkindex;\n }\n }\n }", "function minNodeEntries () {\n return M/2;\n }", "updateBalance(node) {\n let hl = node.left ? this.nodes[node.left].height : -1;\n let hr = node.right ? this.nodes[node.right].height : -1;\n //node.height = 1 + Math.max(hl, hr);\n node.height = (hl > hr) ? 1 + hl : 1 + hr;\n node.balance = hr - hl;\n }", "function breadth_first_search(initial_state) {\r\n let open = []; //See push()/pop() and unshift()/shift() to operate like stack or queue\r\n //https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array\r\n //https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set\r\n\r\n /***Your code for breadth-first search here***/\r\n let closed = new Map();\r\n open.push(initial_state);\r\n closed.set(state_to_uniqueid(initial_state), {action : 0, parent : null, state : initial_state});\r\n let node = BFSloops(open, closed);\r\n\r\n /*\r\n Hint: In order to generate the solution path, you will need to augment\r\n the states to store the predecessor/parent state they were generated from\r\n and the action that generates the child state from the predecessor state.\r\n \r\n\t For example, make a wrapper object that stores the state, predecessor and action.\r\n\t Javascript objects are easy to make:\r\n\t\tlet object={\r\n\t\t\tmember_name1 : value1,\r\n\t\t\tmember_name2 : value2\r\n\t\t};\r\n \r\n Hint: Because of the way Javascript Set objects handle Javascript objects, you\r\n will need to insert (and check for) a representative value instead of the state\r\n object itself. The state_to_uniqueid function has been provided to help you with\r\n this. For example\r\n let state=...;\r\n closed.add(state_to_uniqueid(state)); //Add state to closed set\r\n if(closed.has(state_to_uniqueid(state))) { ... } //Check if state is in closed set\r\n */\r\n \r\n /***Your code to generate solution path here***/\r\n let actPath = [];\r\n let states = [];\r\n\r\n while(node.parent != null){\r\n actPath.unshift(node.action);\r\n states.unshift(node.state);\r\n node = node.parent;\r\n }\r\n\r\n return actPath.length == 0 ? null : { actions : actPath, states : states };\r\n \r\n //OR\r\n\r\n //No solution found\r\n //return null;\r\n}", "balance(node, parentPosition, side) {\n let leftSibling = this.getLeftSibling(node, side, parentPosition);\n let rightSibling = this.getRightSibling(node, side, parentPosition);\n\n// case 3: when a node has minimum number of elements and left-sibling with more than minimum number of elements\n if (leftSibling != null && leftSibling.size() > this.minElements)\n this.propagateFromLeftSibling(node, side ? parentPosition : parentPosition - 1, leftSibling);\n// case 4: when a node has minimum number of elements and right-sibling with more than minimum number of elements\n else if (rightSibling != null && rightSibling.size() > this.minElements)\n this.propagateFromRightSibling(node, side ? parentPosition + 1 : parentPosition, rightSibling);\n// case 5: when a node has minimum number of elements and left-sibling with minimum number of elements\n else if (leftSibling != null && leftSibling.size() <= this.minElements)\n this.propagateDownFromLeft(node, side ? parentPosition : parentPosition - 1, leftSibling);\n// case 6: when a node has minimum number of elements and right-sibling with minimum number of elements\n else if (rightSibling != null && rightSibling.size() <= this.minElements)\n this.propagateDownFromRight(node, side ? parentPosition + 1 : parentPosition, rightSibling);\n this.recentNode = node;\n }", "function BH() {\n this.nodes = [];\n}", "tick() {\n if (!this.finished) {\n if (this.openSet.length > 0) {\n // current is node having the lowest fScore in openSet,\n // sort openSet so lowest f-score is at end of the array, then pop it off the end\n const current = this.openSet.sort((n1, n2) => n2.f - n1.f).pop();\n this.currentNode = current;\n if (current.equals(this.grid.goalNode)) {\n // end node reached, return current which will be the goalNode and contain links to the path taken\n this.finished = true;\n this.setFinishedStatus( finishedStatus.PATH_FOUND );\n return current;\n }\n\n current.visited = true;\n this.closedSet.push(current);\n\n for (const neighbor of this.grid.neighbors( current.row, current.col ) ) {\n // don't examine neighbors that are already in the closedSet\n if (this.closedSet.find(node => node.equals(neighbor))) {\n continue;\n }\n // tempGScore is the euclidian distance from start to the neighbor through current\n const tempGScore = current.g + current.weightToNode(neighbor);\n\n if (!this.grid.isObstacleNode(current.row, current.col)) {\n if (tempGScore < neighbor.g) {\n // this path to neighbor is the best so far, record it\n neighbor.cameFrom = current;\n neighbor.g = tempGScore;\n neighbor.f = neighbor.g;\n // if neighbor not in openSet, then add it\n if (!this.openSet.find(node => node.equals(neighbor))) {\n this.openSet.push(neighbor);\n }\n }\n }\n }\n\n } else {\n // goal can not be reached, no solution exists\n this.finished = true;\n this.setFinishedStatus( finishedStatus.PATH_NOT_FOUND );\n }\n }\n }", "function generate_far_index (current_x, num_of_nodes) {\n\tlet max_x_dist = current_x;\n\tlet selected = -1;\n\tfor (var i=0; i<num_of_nodes; i++) {\n\t\tlet x_coord = god_nodes[i][0];\n\t\tif (x_coord > max_x_dist) {\n\t\t\tmax_x_dist = x_coord;\n\t\t\tselected = i;\n\t\t}\n\t}\n\treturn selected;\n}", "function initializeEdgesValues() {\n edgeValues = [\n [5, (firstNodeMid.xCord + firstNodeTop.xCord) / 2, (firstNodeMid.yCord + firstNodeTop.yCord) / 2],\n [2, (firstNodeMid.xCord + firstNodeBot.xCord) / 2, (firstNodeMid.yCord + firstNodeBot.yCord) / 2],\n [10, (firstNodeMid.xCord + secondNodeMid.xCord) / 2, (firstNodeMid.yCord + secondNodeMid.yCord) / 2],\n [7, (firstNodeTop.xCord + secondNodeTop.xCord) / 2, (firstNodeTop.yCord + secondNodeTop.yCord) / 2],\n [4, (firstNodeBot.xCord + secondNodeBot.xCord) / 2, (firstNodeBot.yCord + secondNodeBot.yCord) / 2],\n [1, (firstNodeTop.xCord + secondNodeMid.xCord) / 2, (firstNodeTop.yCord + secondNodeMid.yCord) / 2],\n [5, (firstNodeBot.xCord + secondNodeMid.xCord) / 2, (firstNodeBot.yCord + secondNodeMid.yCord) / 2],\n [6, (secondNodeMid.xCord + secondNodeTop.xCord) / 2, (secondNodeMid.yCord + secondNodeTop.yCord) / 2],\n [3, (secondNodeMid.xCord + thirdNodeMid.xCord) / 2, (secondNodeMid.yCord + thirdNodeMid.yCord) / 2],\n [11, (secondNodeMid.xCord + secondNodeBot.xCord) / 2, (secondNodeMid.yCord + secondNodeBot.yCord) / 2],\n [13, (secondNodeTop.xCord + thirdNodeMid.xCord) / 2, (secondNodeTop.yCord + thirdNodeMid.yCord) / 2],\n [9, (secondNodeBot.xCord + thirdNodeMid.xCord) / 2, (secondNodeBot.yCord + thirdNodeMid.yCord) / 2]\n ];\n}", "function computeNodeDepths(iterations) {\n\t // Group nodes by breath.\n\t var nodesByBreadth = d3.nest()\n\t .key(function(d) { return d.x; })\n\t .sortKeys(d3.ascending)\n\t .entries(nodes)\n\t .map(function(d) { return d.values; });\n\n\t //\n\t initializeNodeDepth();\n\t resolveCollisions();\n\t computeLinkDepths();\n\t for (var alpha = 1; iterations > 0; --iterations) {\n\t relaxRightToLeft(alpha *= .99);\n\t resolveCollisions();\n\t computeLinkDepths();\n\t relaxLeftToRight(alpha);\n\t resolveCollisions();\n\t computeLinkDepths();\n\t }\n\n\t function initializeNodeDepth() {\n\t // Calculate vertical scaling factor.\n\t var ky = d3.min(nodesByBreadth, function(nodes) {\n\t return (size[1] - (nodes.length - 1) * nodePadding) / d3.sum(nodes, value);\n\t });\n\n\t nodesByBreadth.forEach(function(nodes) {\n\t nodes.forEach(function(node, i) {\n\t node.y = i;\n\t node.dy = node.value * ky;\n\t });\n\t });\n\n\t links.forEach(function(link) {\n\t link.dy = link.value * ky;\n\t });\n\t }\n\n\t function relaxLeftToRight(alpha) {\n\t nodesByBreadth.forEach(function(nodes, breadth) {\n\t nodes.forEach(function(node) {\n\t if (node.targetLinks.length) {\n\t // Value-weighted average of the y-position of source node centers linked to this node.\n\t var y = d3.sum(node.targetLinks, weightedSource) / d3.sum(node.targetLinks, value);\n\t node.y += (y - center(node)) * alpha;\n\t }\n\t });\n\t });\n\n\t function weightedSource(link) {\n\t return (link.source.y + link.sy + link.dy / 2) * link.value;\n\t }\n\t }\n\n\t function relaxRightToLeft(alpha) {\n\t nodesByBreadth.slice().reverse().forEach(function(nodes) {\n\t nodes.forEach(function(node) {\n\t if (node.sourceLinks.length) {\n\t // Value-weighted average of the y-positions of target nodes linked to this node.\n\t var y = d3.sum(node.sourceLinks, weightedTarget) / d3.sum(node.sourceLinks, value);\n\t node.y += (y - center(node)) * alpha;\n\t }\n\t });\n\t });\n\n\t function weightedTarget(link) {\n\t return (link.target.y + link.ty + link.dy / 2) * link.value;\n\t }\n\t }\n\n\t function resolveCollisions() {\n\t nodesByBreadth.forEach(function(nodes) {\n\t var node,\n\t dy,\n\t y0 = 0,\n\t n = nodes.length,\n\t i;\n\n\t // Push any overlapping nodes down.\n\t nodes.sort(ascendingDepth);\n\t for (i = 0; i < n; ++i) {\n\t node = nodes[i];\n\t dy = y0 - node.y;\n\t if (dy > 0) node.y += dy;\n\t y0 = node.y + node.dy + nodePadding;\n\t }\n\n\t // If the bottommost node goes outside the bounds, push it back up.\n\t dy = y0 - nodePadding - size[1];\n\t if (dy > 0) {\n\t y0 = node.y -= dy;\n\n\t // Push any overlapping nodes back up.\n\t for (i = n - 2; i >= 0; --i) {\n\t node = nodes[i];\n\t dy = node.y + node.dy + nodePadding - y0;\n\t if (dy > 0) node.y -= dy;\n\t y0 = node.y;\n\t }\n\t }\n\t });\n\t }\n\n\t function ascendingDepth(a, b) {\n\t return a.y - b.y;\n\t }\n\t }", "breadthFirstSearch(){\n var data = [];\n var queue = [];\n\n queue.push(this.root);\n\n while(queue.length){\n var temp = queue.shift();\n data.push(temp);\n if(temp.left){\n queue.push(temp.left);\n }\n if(temp.right){\n queue.push(temp.right)\n }\n }\n return data;\n }" ]
[ "0.7134106", "0.706675", "0.70626557", "0.70609784", "0.70221484", "0.69733214", "0.6967342", "0.69643974", "0.69643974", "0.69112635", "0.68268794", "0.6628682", "0.6403013", "0.63009024", "0.61131173", "0.6045317", "0.5994476", "0.5898872", "0.58699536", "0.58485484", "0.58015746", "0.579212", "0.5785024", "0.5774325", "0.5768016", "0.57010055", "0.56802636", "0.5679878", "0.5670722", "0.56681895", "0.56604075", "0.5615848", "0.55960727", "0.55724275", "0.5560781", "0.5482321", "0.5478001", "0.54727656", "0.54568744", "0.545526", "0.54502743", "0.5442903", "0.5439773", "0.5435891", "0.54230154", "0.5411306", "0.5409729", "0.5401945", "0.53904533", "0.5386111", "0.5379283", "0.53618246", "0.5358632", "0.53565943", "0.5348352", "0.53418875", "0.5318604", "0.52844954", "0.5283201", "0.52714545", "0.52662045", "0.5265228", "0.52550787", "0.52464134", "0.523473", "0.5221183", "0.5209741", "0.51606953", "0.51422626", "0.5131886", "0.51282126", "0.51257193", "0.5120478", "0.5118157", "0.51019764", "0.50802135", "0.50796956", "0.5078758", "0.507411", "0.5071791", "0.506667", "0.5053808", "0.5043346", "0.5036893", "0.50338215", "0.5026349", "0.502549", "0.50252646", "0.50252646", "0.50119007", "0.5010548", "0.5008159", "0.50038534", "0.50008035", "0.49926364", "0.49825075", "0.49798903", "0.49550784", "0.495144", "0.4945922" ]
0.529692
57
! Get the bson type, if it exists
function y(t,e){return a(t,"_bsontype",void 0)===e}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isBsonType(obj, typename) {\n return get(obj, '_bsontype', void 0) === typename;\n}", "function isBsonType(obj, typename) {\n return get(obj, '_bsontype', void 0) === typename;\n}", "function isBsonType(obj, typename) {\n return get(obj, '_bsontype', void 0) === typename;\n}", "get type() {}", "get type () { return this._doc.type; }", "getType() {}", "get schemaInst(){\n let schemaInst = this.schemas.findOne({ \"jsonObject.properties.type.default\": { $eq: this.type } }).jsonObject;\n return schemaInst;\n }", "function type(obj, noMootools){\r\n // if not simple type, use mootools method\r\n\treturn noMootools && type_map[ toString.call(obj) ] || $type(obj);\r\n}", "function getType(typeObj){\n\n if(typeObj === Boolean ||\n typeObj === Date ||\n typeObj === String ||\n typeObj === Number){\n\n return typeObj;\n }\n\n // Mixed, simple Array, ObjectId\n\n if(typeof typeObj.name === 'string'){\n return typeObj.name;\n }\n\n //test\n if(typeof typeObj.path === 'string' && Array.isArray(typeObj.getters)){\n\n return 'virtual';\n }\n\n //now, if Array.isArray returns true, then this badboy is an array containing other models\n //or references - test\n if(Array.isArray(typeObj)){\n\n if(typeObj[0].tree){\n\n return 'ModelArray';\n }\n if(typeObj[0].ref){\n\n return 'ReferenceArray';\n }\n }\n\n //then it might be\n if(Object.keys(typeObj).length > 0){\n\n return 'Object';\n }\n\n // could not get it - it will be handled by the default clause\n return 'Mixed';\n}", "function objectType(version, type) {\n\t\tif (objectTypes[version]) {\n\t\t\treturn _.get(objectTypes[version], type);\n\t\t}\n\t\treturn null;\n\t}", "getTypeKey(){\n let type = this.get('properties.type') || this.get('type');\n if (type){\n type = TypeKey.getTypeKey(type);\n } else {\n // Use the class hierarchy if type is not defined in the data\n type = TypeKey.getTypeKey.apply(this);\n }\n return type;\n }", "function _getDataType(prop) {\n var mongooseType = prop.type || prop;\n\n if (mongooseType instanceof Array) {\n mongooseType = prop[0];\n }\n\n switch (mongooseType) {\n case String:\n return 'String';\n case Number:\n return 'Decimal';\n case Buffer:\n return 'Binary';\n case Date:\n return 'Date';\n default:\n return 'complexTypeName';\n }\n}", "getType(){return this.__type}", "getOriginalType () {\n if (!this.originalType) {\n this.originalType = this.getDoc().originalType\n }\n\n return this.originalType\n }", "function get(type) {\n \treturn type;\n}", "function 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}", "get type() {\n return this.getAsElem(0).getIf(\"type\");\n }", "get type() {\n return this.getAsElem(0).getIf(\"type\");\n }", "function getElementDefault(type) {\n \"use strict\";\n\n return eDefaultsDB.findOne({\"_id\": type});\n}", "type() {\n return this._type.name;\n }", "function GetDocumentType(system) {\n var type = \"\";\n const DocTypeToSystemMap = options.SystemMap;\n var MyIndex = -1;\n for (let i = 0; i < DocTypeToSystemMap.length; i++) {\n if (DocTypeToSystemMap[i].system == system) {\n MyIndex = i;\n break;\n }\n };\n if (MyIndex > -1) {\n type = DocTypeToSystemMap[MyIndex].type;\n }\n return type;\n}", "type(_obj) {\n return this.typeChr(_obj);\n }", "function findOrgType(type_id) {\n\tif(typeof type_id == 'object') return type_id;\n\tfor(var type = 0; type < globalOrgTypes.length; type++) {\n\t\tvar t =globalOrgTypes[type]; \n\t\tif( t.id() == type_id || t.id() == parseInt(type_id) ) \n\t\t\treturn t;\n\t}\n\treturn null;\n}", "getType() {\n return this._data.type;\n }", "get_type_id( name ){ return this.names.get( name ); }", "get type() { return this._type; }", "get type() { return this._type; }", "get type() { return this._type; }", "function detectType(dataType) {\n return typeof dataType\n}", "get typeReflection() { return exists && has(WA.Memory.type); }", "function $type(obj) {\r\n\t\tif (obj.nodeType) {\r\n\t\t\tswitch(obj.nodeType) {\r\n\t\t\t\tcase 1: return \"element\"; break;\r\n\t\t\t\tcase 3: return \"textnode\"; break;\r\n\t\t\t\tcase 9: return \"document\"; break;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (obj.item && obj.length) return \"collection\";\r\n\t\tif (obj.nodeName) return obj.nodeName;\r\n\t\tif (obj.sort) return \"array\";\r\n\t\treturn typeof(obj);\r\n\t}", "function detectType(dataType) {\n return typeof dataType;\n}", "function $type(obj) {\n if (obj == undefined) return false;\n\n if (obj.$family) return (obj.$family.name == 'number' && !isFinite(obj)) ? false : obj.$family.name;\n if (obj.nodeName){\n switch (obj.nodeType) {\n case 1: return 'element';\n case 9: return 'window';\n case 3: return (/\\S/).test(obj.nodeValue) ? 'textnode' : 'whitespace';\n }\n } else if (obj.window) {\n return 'element';\n } else if (typeof obj.length == 'number') {\n if (obj.callee) {\n return 'arguments';\n } else if (obj.item) {\n return 'collection';\n }\n }\n return typeof obj;\n}", "get type() {\n throw new Error('InternalModelMap.type is no longer available');\n }", "function retrieveType(buffer) {\n var typeId = buffer.slice(0, 4).toString('hex');\n var type = types[typeId];\n if (logger.isDebugEnabled()) logger.debug('Retrive Type \\'%s\\' with id [%s]', type.typeName, typeId);\n return type;\n}", "get type() {\n\t\treturn this.__type;\n\t}", "get type() {\n\t\treturn this.__type;\n\t}", "get type() {\n\t\treturn this.__type;\n\t}", "get type() {\n\t\treturn this.__type;\n\t}", "get type() {\n\t\treturn this.__type;\n\t}", "get type() {\n\t\treturn this.__type;\n\t}", "get type() {\n\t\treturn this.__type;\n\t}", "get type() {\n\t\treturn this.__type;\n\t}", "get type() {\n\t\treturn this.__type;\n\t}", "get type() {\n\t\treturn this.__type;\n\t}", "get type() {\n\t\treturn this.__type;\n\t}", "get type() {\n\t\treturn this.__type;\n\t}", "function boundTypeOf() {\n var val = this.valueOf(); // jshint ignore:line\n return typeOf(val);\n }", "function boundTypeOf() {\n var val = this.valueOf(); // jshint ignore:line\n return typeOf(val);\n }", "get type() {\n return this._type;\n }", "get type() {\n\t\treturn wm.get(this).type;\n\t}", "function getType(name){\n return types.filter(function(type_row){\n return type_row.name == name\n })[0].type;\n }", "getType () {\n\t\treturn this.type;\n\t}", "get type() {\n return this._type;\n }", "get type() {\n return this._type;\n }", "get type() {\n return this._type;\n }", "get type() {\n return this._type;\n }", "get documentTypeInput() {\n return this._documentType;\n }", "type() {\n return this.#type;\n }", "function getType(obj) { \n\tif (typeof obj == \"undefined\") return \"undefined\";\n\tvar funcNameRegex = /function (.{1,})\\(/;\n\tvar results = (funcNameRegex).exec((obj).constructor.toString());\n\tvar type = (results && results.length > 1) ? results[1] : \"\";\n\treturn type.toLowerCase();\n\n}", "getType (id) {\n return this.initializedTypes[JSON.stringify(id)]\n }", "function getTypeIdentifier(Repr){\n return Repr[$$type] || Repr.name || 'Anonymous';\n }", "getType() {\n\t\treturn this.type;\n\t}", "get_type(){\n return this.type;\n }", "__resolveType(obj, context, info) {\n return obj instanceof RateLimit ? 'RateLimit' : 'Book';\n }", "function _getType(type){\r\n if(type){\r\n switch(type){\r\n case 'xml':\r\n return defaultParserType;\r\n case 'saxes':\r\n case 'sax-wasm':\r\n case 'json':\r\n return type;\r\n default:\r\n return 'regexp';\r\n }\r\n }\r\n return parserType || defaultParserType;\r\n}", "function type(obj){\n\treturn Object.prototype.toString.call(obj).match(/^\\[object (.*)\\]$/)[1]\n }", "type(name) {\n var i, len, ref, v;\n ref = this.variables;\n for (i = 0, len = ref.length; i < len; i++) {\n v = ref[i];\n if (v.name === name) {\n return v.type;\n }\n }\n return null;\n }", "function getObjectType(){\n\tif(_objectType == undefined){\n\t\t \n\t\tif(document.getElementById('scriptObjectForm')){\n\t\t\t _objectType = OBJECT_TYPE_SCRIPT;\n\t\t}else if(document.getElementById('pageForm')){\n\t \t\t _objectType = OBJECT_TYPE_PAGE;\n\t\t}\n\t}\n\n\treturn _objectType;\n}", "get type() {\n if ('type' in this.sysInfo && this.sysInfo.type !== undefined)\n return this.sysInfo.type;\n if ('mic_type' in this.sysInfo && this.sysInfo.mic_type !== undefined)\n return this.sysInfo.mic_type;\n return '';\n }", "function getObjectType(cid)\n{\n\nfor (var k =0; k < session.pm[session.pm.length-1].modules.length; k++)\n{ \n if (session.pm[session.pm.length-1].modules[k].id == cid) \n {\n return session.pm[session.pm.length-1].modules[k].type;\n }\n }\n return null;\n}", "get propertyType() {}", "get type()\n {\n //Returning the type value\n return this._type;\n }", "get type()\n {\n //Returning the type value\n return this._type;\n }", "function getTypeReference(typeInfo, type) {\n return {\n kind: 'Type',\n schema: typeInfo.schema,\n type: type || typeInfo.type\n };\n}", "get type () {\n\t\treturn this._type;\n\t}", "get type () {\n\t\treturn this._type;\n\t}", "get type () {\n\t\treturn this._type;\n\t}", "get type () {\n\t\treturn this._type;\n\t}", "get type () {\n\t\treturn this._type;\n\t}", "get type () {\n\t\treturn this._type;\n\t}", "get type () {\n\t\treturn this._type;\n\t}", "get type () {\n\t\treturn this._type;\n\t}", "get type () {\n\t\treturn this._type;\n\t}", "get type () {\n\t\treturn this._type;\n\t}", "get type () {\n\t\treturn this._type;\n\t}", "get type () {\n\t\treturn this._type;\n\t}", "get type () {\n\t\treturn this._type;\n\t}", "function _typeOf(obj) {\n return {}.toString.call(obj).slice(8, -1);\n }", "function getOwnDefinition(type, field) {\n return type.hasOwnProperty(field) ? type[field] : null;\n }", "function tryGetCustomObjectType(input) {\n if (input.constructor) {\n var funcNameRegex = /function\\s+([^\\s(]+)\\s*\\(/;\n var results = funcNameRegex.exec(input.constructor.toString());\n\n if (results && results.length > 1) {\n return results[1];\n }\n }\n\n return null;\n}", "function gettype(obj) {\n var type = typeof obj;\n\n if (type !== 'object') {\n return type;\n }\n\n // inspect [[Class]] for objects\n return toString.call(obj)\n .replace(objectRegExp, '$1');\n}", "function gettype(obj) {\n var type = typeof obj;\n\n if (type !== 'object') {\n return type;\n }\n\n // inspect [[Class]] for objects\n return toString.call(obj)\n .replace(objectRegExp, '$1');\n}", "function gettype(obj) {\n var type = typeof obj;\n\n if (type !== 'object') {\n return type;\n }\n\n // inspect [[Class]] for objects\n return toString.call(obj)\n .replace(objectRegExp, '$1');\n}", "function gettype(obj) {\n var type = typeof obj;\n\n if (type !== 'object') {\n return type;\n }\n\n // inspect [[Class]] for objects\n return toString.call(obj)\n .replace(objectRegExp, '$1');\n}", "function gettype(obj) {\n var type = typeof obj;\n\n if (type !== 'object') {\n return type;\n }\n\n // inspect [[Class]] for objects\n return toString.call(obj)\n .replace(objectRegExp, '$1');\n}", "function gettype(obj) {\n var type = typeof obj;\n\n if (type !== 'object') {\n return type;\n }\n\n // inspect [[Class]] for objects\n return toString.call(obj)\n .replace(objectRegExp, '$1');\n}", "function gettype(obj) {\n var type = typeof obj;\n\n if (type !== 'object') {\n return type;\n }\n\n // inspect [[Class]] for objects\n return toString.call(obj)\n .replace(objectRegExp, '$1');\n}", "function gettype(obj) {\n var type = typeof obj;\n\n if (type !== 'object') {\n return type;\n }\n\n // inspect [[Class]] for objects\n return toString.call(obj)\n .replace(objectRegExp, '$1');\n}", "function gettype(obj) {\n var type = typeof obj;\n\n if (type !== 'object') {\n return type;\n }\n\n // inspect [[Class]] for objects\n return toString.call(obj)\n .replace(objectRegExp, '$1');\n}", "function gettype(obj) {\n var type = typeof obj;\n\n if (type !== 'object') {\n return type;\n }\n\n // inspect [[Class]] for objects\n return toString.call(obj)\n .replace(objectRegExp, '$1');\n}" ]
[ "0.665152", "0.665152", "0.665152", "0.65151536", "0.6410235", "0.63352346", "0.6325141", "0.6305704", "0.6225867", "0.6218908", "0.618438", "0.61640024", "0.6131096", "0.61008996", "0.6092149", "0.6056588", "0.59996563", "0.59996563", "0.5914181", "0.5901641", "0.5863613", "0.5815488", "0.57853276", "0.57769024", "0.57656527", "0.5753595", "0.5753595", "0.5753595", "0.57473093", "0.57155275", "0.57051855", "0.5694076", "0.5668825", "0.56644654", "0.56590873", "0.56341684", "0.56341684", "0.56341684", "0.56341684", "0.56341684", "0.56341684", "0.56341684", "0.56341684", "0.56341684", "0.56341684", "0.56341684", "0.56341684", "0.5631308", "0.5631308", "0.5619995", "0.56089616", "0.5597874", "0.55924636", "0.5590953", "0.5590953", "0.5590953", "0.5590953", "0.5590212", "0.55701303", "0.55619246", "0.5556462", "0.5556236", "0.5544308", "0.5539866", "0.5530733", "0.5525805", "0.55232203", "0.55194914", "0.55163395", "0.55153775", "0.55128795", "0.55114555", "0.5507884", "0.5507884", "0.54999274", "0.54953533", "0.54953533", "0.54953533", "0.54953533", "0.54953533", "0.54953533", "0.54953533", "0.54953533", "0.54953533", "0.54953533", "0.54953533", "0.54953533", "0.54953533", "0.5481257", "0.54806113", "0.54755396", "0.5468613", "0.5468613", "0.5468613", "0.5468613", "0.5468613", "0.5468613", "0.5468613", "0.5468613", "0.5468613", "0.5468613" ]
0.0
-1
! ignore /! ignore
function m(t,e){const n=e&&e.minimize,r={};let i,o,s;for(s in t)o=_(t[s],e),n&&void 0===o||(i||(i=!0),r[s]=o);return n?i&&r:r}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ignore() { }", "get Ignore() {}", "set Ignore(value) {}", "function ignore() {\n return null\n}", "function ignore() {\n return null;\n}", "function ignore() {\n return null\n }", "function IGNORE() {\r\n //Do not delete.\r\n }", "function skip(){\n\t\n}", "function ignore(){\n var b = readify('beta-ignoring', false)\n\n if (! b) {\n verb(\"Ignoring...\")\n var us = usernames()\n\n for (var i = 0; i < us.length; i++){\n var uname = us[i].children[0].textContent\n var users = ignoredUsers()\n var posts = ignoredPosts()\n\n try {\n if (users.indexOf(uname) !== -1){\n verb(\"Ignoring \" + uname)\n var e = us[i].parentNode\n e.style.display = \"none\"\n e.nextElementSibling.style.display = \"none\"\n e.nextElementSibling.nextElementSibling.style.display = \"none\"\n e.nextElementSibling.nextElementSibling.nextElementSibling.style.display = \"none\"\n\n } else if (posts !== null\n && usernamePost(us[i]).textContent.match(posts)) {\n verb(\"Ignoring post of \" + uname)\n var e = us[i].parentNode\n e.style.display = \"none\"\n e.nextElementSibling.style.display = \"none\"\n e.nextElementSibling.nextElementSibling.style.display = \"none\"\n e.nextElementSibling.nextElementSibling.nextElementSibling.style.display = \"none\"\n }\n\n } catch(e) {\n debu(e.toString())\n }\n }\n }\n}", "function skipHello(){saidHello=true;}", "function isIgnored$2 (self, path$$1) {\n if (!self.ignore.length)\n return false\n\n return self.ignore.some(function(item) {\n return item.matcher.match(path$$1) || !!(item.gmatcher && item.gmatcher.match(path$$1))\n })\n}", "addDefaultGitIgnore() {\n this.gitignore.exclude('# Byte-compiled / optimized / DLL files', '__pycache__/', '*.py[cod]', '*$py.class', '', '# C extensions', '*.so', '', '# Distribution / packaging', '.Python', 'build/', 'develop-eggs/', 'dist/', 'downloads/', 'eggs/', '.eggs/', 'lib/', 'lib64/', 'parts/', 'sdist/', 'var/', 'wheels/', 'share/python-wheels/', '*.egg-info/', '.installed.cfg', '*.egg', 'MANIFEST', '', '# PyInstaller', '# Usually these files are written by a python script from a template', '# before PyInstaller builds the exe, so as to inject date/other infos into it.', '*.manifest', '*.spec', '', '# Installer logs', 'pip-log.txt', 'pip-delete-this-directory.txt', '', '# Unit test / coverage reports', 'htmlcov/', '.tox/', '.nox/', '.coverage', '.coverage.*', '.cache', 'nosetests.xml', 'coverage.xml', '*.cover', '*.py,cover', '.hypothesis/', '.pytest_cache/', 'cover/', '', '# Translations', '*.mo', '*.pot', '', '# Django stuff:', '*.log', 'local_settings.py', 'db.sqlite3', 'db.sqlite3-journal', '', '# Flask stuff:', 'instance/', '.webassets-cache', '', '# Scrapy stuff:', '.scrapy', '', '# Sphinx documentation', 'docs/_build/', '', '# PyBuilder', '.pybuilder/', 'target/', '', '# Jupyter Notebook', '.ipynb_checkpoints', '', '# IPython', 'profile_default/', 'ipython_config.py', '', '# PEP 582; used by e.g. github.com/David-OConnor/pyflow', '__pypackages__/', '', '# Celery stuff', 'celerybeat-schedule', 'celerybeat.pid', '', '# SageMath parsed files', '*.sage.py', '', '# Environments', '.env', '.venv', 'env/', 'venv/', 'ENV/', 'env.bak/', 'venv.bak/', '', '# Spyder project settings', '.spyderproject', '.spyproject', '', '# Rope project settings', '.ropeproject', '', '# mkdocs documentation', '/site', '', '# mypy', '.mypy_cache/', '.dmypy.json', 'dmypy.json', '', '# Pyre type checker', '.pyre/', '', '# pytype static type analyzer', '.pytype/', '', '# Cython debug symbols', 'cython_debug/');\n }", "ignoreEvent(event) { return true; }", "function should_ignore(_testCase, testName) {\r\n\tif (_testCase[\"_should\"] == undefined) \r\n\t\t_testCase[\"_should\"] = {};\r\n\tif (_testCase[\"_should\"][\"ignore\"] == undefined) \r\n\t\t_testCase[\"_should\"][\"ignore\"] = {};\r\n\t_testCase[\"_should\"][\"ignore\"][testName] = true;\t\t\r\n}", "function shouldIgnoreFile(file){\n return /\\/_/.test(file)\n}", "function isIgnore(flags) {\n return (flags & FLAGS.IGNORE) === FLAGS.IGNORE;\n }", "function ignore(self) {\n return fold_(self, _index5.constVoid, _index5.constVoid);\n}", "function skip() {\n this.shouldSkip = true;\n}", "ignore(uri) {\n this.ignoredFileURIs.add(uri);\n console.log(`${uri} ignored`);\n }", "function Skip() { return Skip }", "function skip() {\n\t this.shouldSkip = true;\n\t}", "function skip() {\n\t this.shouldSkip = true;\n\t}", "function cfIgnore() {\n return file('.cfignore', 'node_modules \\nsrc \\npackage.json \\npackage-lock.json\\nconfig.yml \\ngulpfile.babel.js \\nREADME.md', {src: true})\n .pipe(gulp.dest('./dist/'));\n}", "function shouldIgnore(filename, ignore, only) {\n\t filename = _slash2[\"default\"](filename);\n\n\t if (only) {\n\t var _arr = only;\n\n\t for (var _i = 0; _i < _arr.length; _i++) {\n\t var pattern = _arr[_i];\n\t if (_shouldIgnore(pattern, filename)) return false;\n\t }\n\t return true;\n\t } else if (ignore.length) {\n\t var _arr2 = ignore;\n\n\t for (var _i2 = 0; _i2 < _arr2.length; _i2++) {\n\t var pattern = _arr2[_i2];\n\t if (_shouldIgnore(pattern, filename)) return true;\n\t }\n\t }\n\n\t return false;\n\t}", "function shouldIgnore(filename, ignore, only) {\n\t filename = _slash2[\"default\"](filename);\n\n\t if (only) {\n\t var _arr = only;\n\n\t for (var _i = 0; _i < _arr.length; _i++) {\n\t var pattern = _arr[_i];\n\t if (_shouldIgnore(pattern, filename)) return false;\n\t }\n\t return true;\n\t } else if (ignore.length) {\n\t var _arr2 = ignore;\n\n\t for (var _i2 = 0; _i2 < _arr2.length; _i2++) {\n\t var pattern = _arr2[_i2];\n\t if (_shouldIgnore(pattern, filename)) return true;\n\t }\n\t }\n\n\t return false;\n\t}", "function isIgnoredElement(ele) {\n return !ele.hasAttribute || ele.hasAttribute('data-ignore') || $(ele).parents(\"[data-ignore]\").length > 0;\n}", "function skipBlockComment () {\n i += 2;\n while (i < jsString.length && (curr() !== '*' || next() !== '/')) {\n i++;\n }\n i += 2;\n }", "function ignoreElements() {\n return function ignoreElementsOperatorFunction(source) {\n return source.lift(new IgnoreElementsOperator());\n };\n}", "function isIgnored (self, path) {\n\t if (!self.ignore.length)\n\t return false\n\t\n\t return self.ignore.some(function(item) {\n\t return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))\n\t })\n\t}", "function isIgnored (self, path) {\n\t if (!self.ignore.length)\n\t return false\n\t\n\t return self.ignore.some(function(item) {\n\t return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))\n\t })\n\t}", "function onIgnoreTagStripAll(){return\"\";}", "function __FIXME_SBean_assert_ignore_list() {\n\tthis._pname_ = \"assert_ignore_list\";\n\t//this.keywords:\t\tset[string]\t\n}", "function isIgnored (self, path) {\n if (!self.ignore.length)\n return false\n \n return self.ignore.some(function(item) {\n return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))\n })\n }", "skip(opSt) { return false; }", "function isIgnored$2 (self, path) {\n if (!self.ignore.length)\n return false\n\n return self.ignore.some(function(item) {\n return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))\n })\n}", "function shouldIgnore(filename, ignore, only) {\n filename = _slash2[\"default\"](filename);\n\n if (only) {\n var _arr = only;\n\n for (var _i = 0; _i < _arr.length; _i++) {\n var pattern = _arr[_i];\n if (_shouldIgnore(pattern, filename)) return false;\n }\n return true;\n } else if (ignore.length) {\n var _arr2 = ignore;\n\n for (var _i2 = 0; _i2 < _arr2.length; _i2++) {\n var pattern = _arr2[_i2];\n if (_shouldIgnore(pattern, filename)) return true;\n }\n }\n\n return false;\n}", "function applyTsIgnore(ast) {\n const fqn = getFqn(ast);\n if (fqnToIgnore[fqn]) {\n let description = \"\";\n if (_.isString(fqnToIgnore[fqn])) {\n description = fqnToIgnore[fqn];\n }\n return `// @ts-ignore - ${description}` + NL;\n } else {\n return \"\";\n }\n}", "function isIgnored(self, path) {\n if (!self.ignore.length) return false;\n return self.ignore.some(function (item) {\n return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path));\n });\n}", "function isIgnored (self, path) {\n\t if (!self.ignore.length)\n\t return false\n\n\t return self.ignore.some(function(item) {\n\t return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))\n\t })\n\t}", "function isIgnored (self, path) {\n\t if (!self.ignore.length)\n\t return false\n\n\t return self.ignore.some(function(item) {\n\t return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))\n\t })\n\t}", "async set_ignore(params) {\n var schema = {\n stub: { required: 'string', format: 'lowercase' },\n symbol: { required: 'string', format: 'uppercase' },\n ignored: { required: 'boolean' }\n }\n\n if (!(params = this.utils.validator(params, schema))) return false; \n\n var [stub, symbol, ignored] = this.utils.extract_props(params, ['stub', 'symbol', 'ignored']); \n\n var list = await this.config.get(stub + ':ignored');\n if (this.utils.is_array(list)) {\n if (!list.includes(symbol)) {\n list.push(symbol);\n this.set_ignore_list(stub, list);\n }\n }\n \n\n\n }", "function ignore(self, __trace) {\n return fold_(self, _index12.constVoid, _index12.constVoid, __trace);\n}", "function isIgnored (self, path) {\n if (!self.ignore.length)\n return false\n\n return self.ignore.some(function(item) {\n return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))\n })\n}", "function isIgnored (self, path) {\n if (!self.ignore.length)\n return false\n\n return self.ignore.some(function(item) {\n return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))\n })\n}", "function isIgnored (self, path) {\n if (!self.ignore.length)\n return false\n\n return self.ignore.some(function(item) {\n return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))\n })\n}", "function isIgnored (self, path) {\n if (!self.ignore.length)\n return false\n\n return self.ignore.some(function(item) {\n return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))\n })\n}", "function isIgnored (self, path) {\n if (!self.ignore.length)\n return false\n\n return self.ignore.some(function(item) {\n return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))\n })\n}", "function isIgnored (self, path) {\n if (!self.ignore.length)\n return false\n\n return self.ignore.some(function(item) {\n return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))\n })\n}", "function isIgnored (self, path) {\n if (!self.ignore.length)\n return false\n\n return self.ignore.some(function(item) {\n return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))\n })\n}", "function isIgnored (self, path) {\n if (!self.ignore.length)\n return false\n\n return self.ignore.some(function(item) {\n return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))\n })\n}", "function isIgnored (self, path) {\n if (!self.ignore.length)\n return false\n\n return self.ignore.some(function(item) {\n return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))\n })\n}", "function isIgnored (self, path) {\n if (!self.ignore.length)\n return false\n\n return self.ignore.some(function(item) {\n return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))\n })\n}", "function isIgnored (self, path) {\n if (!self.ignore.length)\n return false\n\n return self.ignore.some(function(item) {\n return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))\n })\n}", "function isIgnored (self, path) {\n if (!self.ignore.length)\n return false\n\n return self.ignore.some(function(item) {\n return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))\n })\n}", "function isIgnored (self, path) {\n if (!self.ignore.length)\n return false\n\n return self.ignore.some(function(item) {\n return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))\n })\n}", "function isIgnored (self, path) {\n if (!self.ignore.length)\n return false\n\n return self.ignore.some(function(item) {\n return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))\n })\n}", "function isIgnored (self, path) {\n if (!self.ignore.length)\n return false\n\n return self.ignore.some(function(item) {\n return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))\n })\n}", "function isIgnored (self, path) {\n if (!self.ignore.length)\n return false\n\n return self.ignore.some(function(item) {\n return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))\n })\n}", "function isIgnored (self, path) {\n if (!self.ignore.length)\n return false\n\n return self.ignore.some(function(item) {\n return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))\n })\n}", "function isIgnored (self, path) {\n if (!self.ignore.length)\n return false\n\n return self.ignore.some(function(item) {\n return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))\n })\n}", "function isIgnored (self, path) {\n if (!self.ignore.length)\n return false\n\n return self.ignore.some(function(item) {\n return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))\n })\n}", "function isIgnored (self, path) {\n if (!self.ignore.length)\n return false\n\n return self.ignore.some(function(item) {\n return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))\n })\n}", "function isIgnored (self, path) {\n if (!self.ignore.length)\n return false\n\n return self.ignore.some(function(item) {\n return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))\n })\n}", "function isIgnored (self, path) {\n if (!self.ignore.length)\n return false\n\n return self.ignore.some(function(item) {\n return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))\n })\n}", "function isIgnored (self, path) {\n if (!self.ignore.length)\n return false\n\n return self.ignore.some(function(item) {\n return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))\n })\n}", "function isIgnored (self, path) {\n if (!self.ignore.length)\n return false\n\n return self.ignore.some(function(item) {\n return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))\n })\n}", "function isIgnored (self, path) {\n if (!self.ignore.length)\n return false\n\n return self.ignore.some(function(item) {\n return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))\n })\n}", "function isIgnored (self, path) {\n if (!self.ignore.length)\n return false\n\n return self.ignore.some(function(item) {\n return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))\n })\n}", "function isIgnored (self, path) {\n if (!self.ignore.length)\n return false\n\n return self.ignore.some(function(item) {\n return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))\n })\n}", "function isIgnored (self, path) {\n if (!self.ignore.length)\n return false\n\n return self.ignore.some(function(item) {\n return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))\n })\n}", "function isIgnored (self, path) {\n if (!self.ignore.length)\n return false\n\n return self.ignore.some(function(item) {\n return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))\n })\n}", "function isIgnored (self, path) {\n if (!self.ignore.length)\n return false\n\n return self.ignore.some(function(item) {\n return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))\n })\n}", "function shouldIgnore(filename, ignore) {\n var relname = normalizeSlashes(filename);\n return ignore.some(function (x) { return x.test(relname); });\n}", "function isIgnored(self, path) {\n if (!self.ignore.length) return false;\n\n return self.ignore.some(function (item) {\n return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path));\n });\n}", "static continue(command, ignore = false, rest = null) {\n return new Flag(\"continue\", { command, ignore, rest });\n }", "function _shouldIgnore(pattern, filename) {\n\t if (typeof pattern === \"function\") {\n\t return pattern(filename);\n\t } else {\n\t return pattern.test(filename);\n\t }\n\t}", "function _shouldIgnore(pattern, filename) {\n\t if (typeof pattern === \"function\") {\n\t return pattern(filename);\n\t } else {\n\t return pattern.test(filename);\n\t }\n\t}", "function _shouldIgnore(pattern, filename) {\n\t if (typeof pattern === \"function\") {\n\t return pattern(filename);\n\t } else {\n\t return pattern.test(filename);\n\t }\n\t}", "function blockUnrequired(){\r\n\tset(\"V[z_vaxx_*]\",\"\");\r\n\tset(\"V[z_va01_*]\",\"\");\r\n}", "function notBlockUseCase() { console.log('Not an block use case');}", "dontWantToken () {\n\t\treturn true;\n\t}", "preset () { return false }", "function skipHello() {\n saidHello = true;\n}", "function skipHello() {\n saidHello = true;\n}", "function skipHello() {\n saidHello = true;\n}", "function skipHello() {\n saidHello = true;\n}", "function skipHello() {\n saidHello = true;\n}", "function ignoreInteractions() {\n\n if ( ignoreinteractions === false ) ignoreinteractions = true;\n else ignoreinteractions = false;\n\n // In any case we should redo Post Hoc tests!\n\n buildPostHocTests();\n\n }", "function skipHello()\n{\n saidHello = true;\n}", "shouldIgnoreFile(fileNameSplitByDot) {\n const isHidden = !fileNameSplitByDot[0];\n const hasNoExtension = fileNameSplitByDot.length === 1;\n return isHidden || hasNoExtension;\n }", "function hello2() {\n const bye = \"bye\";\n\n /**\n * For disable the es-lint on the line\n * Please put the below comment\n * now instead of the error we will have the warning for below 2\n */\n // eslint-disable-next-line\n console.log(\"this is sample \", bye);\n\n /**\n * disabling a particular rule for the eslint\n */\n // eslint-disable-next-line quotes\n console.log(\"this is sample \", 2323232);\n\n const a = 95;\n\n console.log(`vaylue for the a the `, a);\n}", "function noop() { } // tslint:disable-line:no-empty", "function Ne(e,t,a){return\"string\"==typeof t&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),Te(e,a||t.type,e,t),Le(t)||t.codemirrorIgnore}", "function skipHello() {\n saidHello = true;\n}", "function exclusionaryTests() {\n\tdanger.git.created_files\n\t\t.filter(filepath => filepath.endsWith('.test.js'))\n\t\t.map(filepath => ({filepath, content: readFile(filepath)}))\n\t\t.filter(\n\t\t\t({content}) =>\n\t\t\t\tcontent.includes('it.only') || content.includes('describe.only'),\n\t\t)\n\t\t.forEach(({filepath}) =>\n\t\t\twarn(\n\t\t\t\t`An <code>only</code> was left in ${filepath} – no other tests can run.`,\n\t\t\t),\n\t\t)\n}", "warn() {}", "function skipProv(p) {return (skip && (SKIP.indexOf(p)>=0));}", "function omit(track) {\n try {\n // return unmodified track if setting is turned off\n if (!Settings.Get().omit.switch) {\n return track;\n }\n else {\n // return unmodified track if the keyword list is empty\n if (Settings.Get().omit.keywords == '') {\n return track;\n }\n else {\n try {\n // split the keywords string at (',') and iterate through them\n Settings.Get().omit.keywords.split(',').forEach(function(keyword) {\n // if a match is found it will be replaced with an empty string\n track = track.replace(RegExp(Helper.RegExp.Escape(keyword), 'gi'), '');\n });\n // return the modified track \n return track;\n }\n // if no seperator has been found, assume there is only one keyword\n catch {\n // if a match is found it will be replaced with an empty string\n track = track.replace(RegExp(Helper.RegExp.Escape(Settings.Get().omit.keywords), 'gi'), '');\n return track;\n }\n }\n }\n }\n catch {\n return track;\n }\n}", "no_op() {}", "hacky(){\n return\n }", "function noop(){}// No operation performed." ]
[ "0.8653394", "0.7446816", "0.7386236", "0.7235458", "0.7168867", "0.7022659", "0.67721653", "0.64045095", "0.6191315", "0.6140491", "0.6120082", "0.61128414", "0.6085999", "0.6049541", "0.6046634", "0.6044394", "0.600617", "0.5982768", "0.59775823", "0.59717566", "0.59364134", "0.59364134", "0.5925819", "0.58979654", "0.58979654", "0.58317494", "0.58286434", "0.5818414", "0.5817855", "0.5817855", "0.5809285", "0.5805773", "0.5789093", "0.57853764", "0.57823586", "0.57697594", "0.5722749", "0.5711413", "0.5707052", "0.5707052", "0.5692417", "0.5683764", "0.56777996", "0.56777996", "0.56777996", "0.56777996", "0.56777996", "0.56777996", "0.56777996", "0.56777996", "0.56777996", "0.56777996", "0.56777996", "0.56777996", "0.56777996", "0.56777996", "0.56777996", "0.56777996", "0.56777996", "0.56777996", "0.56777996", "0.56777996", "0.56777996", "0.56777996", "0.56777996", "0.56777996", "0.56777996", "0.56777996", "0.56777996", "0.56777996", "0.56777996", "0.56777996", "0.56755036", "0.5653617", "0.5637577", "0.56288326", "0.56288326", "0.56288326", "0.56146294", "0.5609458", "0.56071323", "0.56024903", "0.558746", "0.558746", "0.558746", "0.558746", "0.558746", "0.5565302", "0.5562851", "0.55614054", "0.5551513", "0.5550493", "0.55414534", "0.55403996", "0.55378926", "0.55368525", "0.55207634", "0.5510348", "0.5503261", "0.54860777", "0.5483972" ]
0.0
-1
! Document exposes the NodeJS event emitter API, so you can use `on`, `once`, etc.
function M(t,e,n,r,i,o,s){const a=Object.keys(t.schema.paths),u=a.length;for(let c=0;c<u;++c){let u,l="";const f=a[c];if("_id"===f&&n)continue;const p=t.schema.paths[f],h=f.split("."),d=h.length;let y=!1,_=t._doc;for(let n=0;n<d&&null!=_;++n){const a=h[n];if(l+=(l.length?".":"")+a,!0===r){if(l in e)break}else if(!1===r&&e&&!y)if(l in e)y=!0;else if(!i[l])break;if(n===d-1){if(void 0!==_[a])break;if("function"==typeof p.defaultValue){if(!p.defaultValue.$runBeforeSetters&&o)break;if(p.defaultValue.$runBeforeSetters&&!o)break}else if(!o)continue;if(s&&s[l])break;if(e&&null!==r)if(!0===r){if(f in e)continue;void 0!==(u=p.getDefault(t,!1))&&(_[a]=u,t.$__.activePaths.default(f))}else y&&void 0!==(u=p.getDefault(t,!1))&&(_[a]=u,t.$__.activePaths.default(f));else void 0!==(u=p.getDefault(t,!1))&&(_[a]=u,t.$__.activePaths.default(f))}else _=_[a]}}}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function EventEmitter() {} // Shortcuts to improve speed and size", "function EventEmitter(){}// Shortcuts to improve speed and size", "function on (event, cb) {\n emitter.on(event, cb)\n }", "function on (event, cb) {\n emitter.on(event, cb)\n }", "function on (event, cb) {\n emitter.on(event, cb)\n }", "on(ev, fn) {\n this.emitter.on(ev, fn);\n }", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function LokiEventEmitter() {}", "function LokiEventEmitter() {}", "on(event, listener, emitter = this._defaultEmitter()) {\n emitter.on(event, listener);\n }", "function LokiEventEmitter() { }", "function EventEmitter(){}", "function EventEmitter(){}", "function EventEmitter(){\n}", "on(...args){\n let emitter = privateMembers.get(this).emitter;\n emitter.on(...args);\n }", "on(...args){\n let emitter = privateMembers.get(this).emitter;\n emitter.on(...args);\n }", "on(event, fn) {\n\t\tthis.emitter.on(event, fn);\n\t}", "function EventEmitter() { /* Nothing to set */ }", "function EventEmitter() { /* Nothing to set */ }", "function EventEmitter() { /* Nothing to set */ }", "function EventEmitter() { /* Nothing to set */ }", "function EventEmitter() { /* Nothing to set */ }", "function EventEmitter() { /* Nothing to set */ }", "function EventEmitter() { /* Nothing to set */ }", "function EventEmitter() { /* Nothing to set */ }", "function EventEmitter() { /* Nothing to set */ }", "function EventEmitter() { /* Nothing to set */ }", "function EventEmitter() { /* Nothing to set */ }", "function EventEmitter() { /* Nothing to set */ }", "function EventEmitter() { /* Nothing to set */ }", "function EventEmitter() { /* Nothing to set */ }", "function EventEmitter() { /* Nothing to set */ }", "function EventEmitter() { /* Nothing to set */ }", "function EventEmitter() { /* Nothing to set */ }", "function EventEmitter() { /* Nothing to set */ }", "function EventEmitter() { /* Nothing to set */ }", "function EventEmitter() { /* Nothing to set */ }", "function EventEmitter() { /* Nothing to set */ }", "function EventEmitter() { /* Nothing to set */ }", "function EventEmitter() { /* Nothing to set */ }", "function EventEmitter() { /* Nothing to set */ }" ]
[ "0.73722035", "0.733537", "0.72937536", "0.72937536", "0.72937536", "0.70783603", "0.699271", "0.699271", "0.699271", "0.699271", "0.699271", "0.699271", "0.699271", "0.699271", "0.699271", "0.699271", "0.699271", "0.699271", "0.699271", "0.699271", "0.699271", "0.699271", "0.699271", "0.699271", "0.699271", "0.699271", "0.699271", "0.699271", "0.699271", "0.699271", "0.699271", "0.699271", "0.699271", "0.699271", "0.699271", "0.699271", "0.699271", "0.699271", "0.699271", "0.699271", "0.699271", "0.699271", "0.699271", "0.699271", "0.699271", "0.699271", "0.699271", "0.699271", "0.699271", "0.699271", "0.699271", "0.699271", "0.699271", "0.699271", "0.699271", "0.699271", "0.699271", "0.699271", "0.699271", "0.699271", "0.699271", "0.699271", "0.699271", "0.699271", "0.699271", "0.699271", "0.699271", "0.6969994", "0.6969994", "0.6835177", "0.68325895", "0.68098533", "0.68098533", "0.6784538", "0.6688097", "0.6688097", "0.6682661", "0.666488", "0.666488", "0.666488", "0.666488", "0.666488", "0.666488", "0.666488", "0.666488", "0.666488", "0.666488", "0.666488", "0.666488", "0.666488", "0.666488", "0.666488", "0.666488", "0.666488", "0.666488", "0.666488", "0.666488", "0.666488", "0.666488", "0.666488", "0.666488" ]
0.0
-1
! ignore /! ignore
function g(t,e){const n=e.split(/\.(\d+)\.|\.(\d+)$/).filter(Boolean);if(n.length<2)return t.paths[n[0]];let r=t.path(n[0]),i=!1;if(!r)return r;let o,a=n.length-1,c=1;for(;c<n.length;++c){if(i=!1,o=n[c],c===a&&r&&!/\D/.test(o)){if(r.$isMongooseDocumentArray){const t=r;(r=new s(o,{required:u(r,"schemaOptions.required",!1)})).cast=function(e,n,r){return t.cast(e,n,r)[0]},r.$isMongooseDocumentArrayElement=!0,r.caster=t.caster,r.schema=t.schema}else r=r instanceof h.Array?r.caster:void 0;break}if(!/\D/.test(o))continue;if(!r||!r.schema){r=void 0;break}i="nested"===r.schema.pathType(o),r=r.schema.path(o)}return t.subpaths[e]=r,r?"real":i?"nested":"adhocOrUndefined"}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ignore() { }", "get Ignore() {}", "set Ignore(value) {}", "function ignore() {\n return null\n}", "function ignore() {\n return null;\n}", "function ignore() {\n return null\n }", "function IGNORE() {\r\n //Do not delete.\r\n }", "function skip(){\n\t\n}", "function ignore(){\n var b = readify('beta-ignoring', false)\n\n if (! b) {\n verb(\"Ignoring...\")\n var us = usernames()\n\n for (var i = 0; i < us.length; i++){\n var uname = us[i].children[0].textContent\n var users = ignoredUsers()\n var posts = ignoredPosts()\n\n try {\n if (users.indexOf(uname) !== -1){\n verb(\"Ignoring \" + uname)\n var e = us[i].parentNode\n e.style.display = \"none\"\n e.nextElementSibling.style.display = \"none\"\n e.nextElementSibling.nextElementSibling.style.display = \"none\"\n e.nextElementSibling.nextElementSibling.nextElementSibling.style.display = \"none\"\n\n } else if (posts !== null\n && usernamePost(us[i]).textContent.match(posts)) {\n verb(\"Ignoring post of \" + uname)\n var e = us[i].parentNode\n e.style.display = \"none\"\n e.nextElementSibling.style.display = \"none\"\n e.nextElementSibling.nextElementSibling.style.display = \"none\"\n e.nextElementSibling.nextElementSibling.nextElementSibling.style.display = \"none\"\n }\n\n } catch(e) {\n debu(e.toString())\n }\n }\n }\n}", "function skipHello(){saidHello=true;}", "function isIgnored$2 (self, path$$1) {\n if (!self.ignore.length)\n return false\n\n return self.ignore.some(function(item) {\n return item.matcher.match(path$$1) || !!(item.gmatcher && item.gmatcher.match(path$$1))\n })\n}", "addDefaultGitIgnore() {\n this.gitignore.exclude('# Byte-compiled / optimized / DLL files', '__pycache__/', '*.py[cod]', '*$py.class', '', '# C extensions', '*.so', '', '# Distribution / packaging', '.Python', 'build/', 'develop-eggs/', 'dist/', 'downloads/', 'eggs/', '.eggs/', 'lib/', 'lib64/', 'parts/', 'sdist/', 'var/', 'wheels/', 'share/python-wheels/', '*.egg-info/', '.installed.cfg', '*.egg', 'MANIFEST', '', '# PyInstaller', '# Usually these files are written by a python script from a template', '# before PyInstaller builds the exe, so as to inject date/other infos into it.', '*.manifest', '*.spec', '', '# Installer logs', 'pip-log.txt', 'pip-delete-this-directory.txt', '', '# Unit test / coverage reports', 'htmlcov/', '.tox/', '.nox/', '.coverage', '.coverage.*', '.cache', 'nosetests.xml', 'coverage.xml', '*.cover', '*.py,cover', '.hypothesis/', '.pytest_cache/', 'cover/', '', '# Translations', '*.mo', '*.pot', '', '# Django stuff:', '*.log', 'local_settings.py', 'db.sqlite3', 'db.sqlite3-journal', '', '# Flask stuff:', 'instance/', '.webassets-cache', '', '# Scrapy stuff:', '.scrapy', '', '# Sphinx documentation', 'docs/_build/', '', '# PyBuilder', '.pybuilder/', 'target/', '', '# Jupyter Notebook', '.ipynb_checkpoints', '', '# IPython', 'profile_default/', 'ipython_config.py', '', '# PEP 582; used by e.g. github.com/David-OConnor/pyflow', '__pypackages__/', '', '# Celery stuff', 'celerybeat-schedule', 'celerybeat.pid', '', '# SageMath parsed files', '*.sage.py', '', '# Environments', '.env', '.venv', 'env/', 'venv/', 'ENV/', 'env.bak/', 'venv.bak/', '', '# Spyder project settings', '.spyderproject', '.spyproject', '', '# Rope project settings', '.ropeproject', '', '# mkdocs documentation', '/site', '', '# mypy', '.mypy_cache/', '.dmypy.json', 'dmypy.json', '', '# Pyre type checker', '.pyre/', '', '# pytype static type analyzer', '.pytype/', '', '# Cython debug symbols', 'cython_debug/');\n }", "ignoreEvent(event) { return true; }", "function should_ignore(_testCase, testName) {\r\n\tif (_testCase[\"_should\"] == undefined) \r\n\t\t_testCase[\"_should\"] = {};\r\n\tif (_testCase[\"_should\"][\"ignore\"] == undefined) \r\n\t\t_testCase[\"_should\"][\"ignore\"] = {};\r\n\t_testCase[\"_should\"][\"ignore\"][testName] = true;\t\t\r\n}", "function shouldIgnoreFile(file){\n return /\\/_/.test(file)\n}", "function isIgnore(flags) {\n return (flags & FLAGS.IGNORE) === FLAGS.IGNORE;\n }", "function ignore(self) {\n return fold_(self, _index5.constVoid, _index5.constVoid);\n}", "function skip() {\n this.shouldSkip = true;\n}", "ignore(uri) {\n this.ignoredFileURIs.add(uri);\n console.log(`${uri} ignored`);\n }", "function Skip() { return Skip }", "function skip() {\n\t this.shouldSkip = true;\n\t}", "function skip() {\n\t this.shouldSkip = true;\n\t}", "function cfIgnore() {\n return file('.cfignore', 'node_modules \\nsrc \\npackage.json \\npackage-lock.json\\nconfig.yml \\ngulpfile.babel.js \\nREADME.md', {src: true})\n .pipe(gulp.dest('./dist/'));\n}", "function shouldIgnore(filename, ignore, only) {\n\t filename = _slash2[\"default\"](filename);\n\n\t if (only) {\n\t var _arr = only;\n\n\t for (var _i = 0; _i < _arr.length; _i++) {\n\t var pattern = _arr[_i];\n\t if (_shouldIgnore(pattern, filename)) return false;\n\t }\n\t return true;\n\t } else if (ignore.length) {\n\t var _arr2 = ignore;\n\n\t for (var _i2 = 0; _i2 < _arr2.length; _i2++) {\n\t var pattern = _arr2[_i2];\n\t if (_shouldIgnore(pattern, filename)) return true;\n\t }\n\t }\n\n\t return false;\n\t}", "function shouldIgnore(filename, ignore, only) {\n\t filename = _slash2[\"default\"](filename);\n\n\t if (only) {\n\t var _arr = only;\n\n\t for (var _i = 0; _i < _arr.length; _i++) {\n\t var pattern = _arr[_i];\n\t if (_shouldIgnore(pattern, filename)) return false;\n\t }\n\t return true;\n\t } else if (ignore.length) {\n\t var _arr2 = ignore;\n\n\t for (var _i2 = 0; _i2 < _arr2.length; _i2++) {\n\t var pattern = _arr2[_i2];\n\t if (_shouldIgnore(pattern, filename)) return true;\n\t }\n\t }\n\n\t return false;\n\t}", "function isIgnoredElement(ele) {\n return !ele.hasAttribute || ele.hasAttribute('data-ignore') || $(ele).parents(\"[data-ignore]\").length > 0;\n}", "function skipBlockComment () {\n i += 2;\n while (i < jsString.length && (curr() !== '*' || next() !== '/')) {\n i++;\n }\n i += 2;\n }", "function isIgnored (self, path) {\n\t if (!self.ignore.length)\n\t return false\n\t\n\t return self.ignore.some(function(item) {\n\t return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))\n\t })\n\t}", "function isIgnored (self, path) {\n\t if (!self.ignore.length)\n\t return false\n\t\n\t return self.ignore.some(function(item) {\n\t return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))\n\t })\n\t}", "function ignoreElements() {\n return function ignoreElementsOperatorFunction(source) {\n return source.lift(new IgnoreElementsOperator());\n };\n}", "function onIgnoreTagStripAll(){return\"\";}", "function __FIXME_SBean_assert_ignore_list() {\n\tthis._pname_ = \"assert_ignore_list\";\n\t//this.keywords:\t\tset[string]\t\n}", "function isIgnored (self, path) {\n if (!self.ignore.length)\n return false\n \n return self.ignore.some(function(item) {\n return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))\n })\n }", "skip(opSt) { return false; }", "function isIgnored$2 (self, path) {\n if (!self.ignore.length)\n return false\n\n return self.ignore.some(function(item) {\n return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))\n })\n}", "function shouldIgnore(filename, ignore, only) {\n filename = _slash2[\"default\"](filename);\n\n if (only) {\n var _arr = only;\n\n for (var _i = 0; _i < _arr.length; _i++) {\n var pattern = _arr[_i];\n if (_shouldIgnore(pattern, filename)) return false;\n }\n return true;\n } else if (ignore.length) {\n var _arr2 = ignore;\n\n for (var _i2 = 0; _i2 < _arr2.length; _i2++) {\n var pattern = _arr2[_i2];\n if (_shouldIgnore(pattern, filename)) return true;\n }\n }\n\n return false;\n}", "function applyTsIgnore(ast) {\n const fqn = getFqn(ast);\n if (fqnToIgnore[fqn]) {\n let description = \"\";\n if (_.isString(fqnToIgnore[fqn])) {\n description = fqnToIgnore[fqn];\n }\n return `// @ts-ignore - ${description}` + NL;\n } else {\n return \"\";\n }\n}", "function isIgnored(self, path) {\n if (!self.ignore.length) return false;\n return self.ignore.some(function (item) {\n return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path));\n });\n}", "function isIgnored (self, path) {\n\t if (!self.ignore.length)\n\t return false\n\n\t return self.ignore.some(function(item) {\n\t return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))\n\t })\n\t}", "function isIgnored (self, path) {\n\t if (!self.ignore.length)\n\t return false\n\n\t return self.ignore.some(function(item) {\n\t return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))\n\t })\n\t}", "async set_ignore(params) {\n var schema = {\n stub: { required: 'string', format: 'lowercase' },\n symbol: { required: 'string', format: 'uppercase' },\n ignored: { required: 'boolean' }\n }\n\n if (!(params = this.utils.validator(params, schema))) return false; \n\n var [stub, symbol, ignored] = this.utils.extract_props(params, ['stub', 'symbol', 'ignored']); \n\n var list = await this.config.get(stub + ':ignored');\n if (this.utils.is_array(list)) {\n if (!list.includes(symbol)) {\n list.push(symbol);\n this.set_ignore_list(stub, list);\n }\n }\n \n\n\n }", "function ignore(self, __trace) {\n return fold_(self, _index12.constVoid, _index12.constVoid, __trace);\n}", "function isIgnored (self, path) {\n if (!self.ignore.length)\n return false\n\n return self.ignore.some(function(item) {\n return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))\n })\n}", "function isIgnored (self, path) {\n if (!self.ignore.length)\n return false\n\n return self.ignore.some(function(item) {\n return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))\n })\n}", "function isIgnored (self, path) {\n if (!self.ignore.length)\n return false\n\n return self.ignore.some(function(item) {\n return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))\n })\n}", "function isIgnored (self, path) {\n if (!self.ignore.length)\n return false\n\n return self.ignore.some(function(item) {\n return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))\n })\n}", "function isIgnored (self, path) {\n if (!self.ignore.length)\n return false\n\n return self.ignore.some(function(item) {\n return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))\n })\n}", "function isIgnored (self, path) {\n if (!self.ignore.length)\n return false\n\n return self.ignore.some(function(item) {\n return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))\n })\n}", "function isIgnored (self, path) {\n if (!self.ignore.length)\n return false\n\n return self.ignore.some(function(item) {\n return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))\n })\n}", "function isIgnored (self, path) {\n if (!self.ignore.length)\n return false\n\n return self.ignore.some(function(item) {\n return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))\n })\n}", "function isIgnored (self, path) {\n if (!self.ignore.length)\n return false\n\n return self.ignore.some(function(item) {\n return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))\n })\n}", "function isIgnored (self, path) {\n if (!self.ignore.length)\n return false\n\n return self.ignore.some(function(item) {\n return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))\n })\n}", "function isIgnored (self, path) {\n if (!self.ignore.length)\n return false\n\n return self.ignore.some(function(item) {\n return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))\n })\n}", "function isIgnored (self, path) {\n if (!self.ignore.length)\n return false\n\n return self.ignore.some(function(item) {\n return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))\n })\n}", "function isIgnored (self, path) {\n if (!self.ignore.length)\n return false\n\n return self.ignore.some(function(item) {\n return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))\n })\n}", "function isIgnored (self, path) {\n if (!self.ignore.length)\n return false\n\n return self.ignore.some(function(item) {\n return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))\n })\n}", "function isIgnored (self, path) {\n if (!self.ignore.length)\n return false\n\n return self.ignore.some(function(item) {\n return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))\n })\n}", "function isIgnored (self, path) {\n if (!self.ignore.length)\n return false\n\n return self.ignore.some(function(item) {\n return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))\n })\n}", "function isIgnored (self, path) {\n if (!self.ignore.length)\n return false\n\n return self.ignore.some(function(item) {\n return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))\n })\n}", "function isIgnored (self, path) {\n if (!self.ignore.length)\n return false\n\n return self.ignore.some(function(item) {\n return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))\n })\n}", "function isIgnored (self, path) {\n if (!self.ignore.length)\n return false\n\n return self.ignore.some(function(item) {\n return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))\n })\n}", "function isIgnored (self, path) {\n if (!self.ignore.length)\n return false\n\n return self.ignore.some(function(item) {\n return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))\n })\n}", "function isIgnored (self, path) {\n if (!self.ignore.length)\n return false\n\n return self.ignore.some(function(item) {\n return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))\n })\n}", "function isIgnored (self, path) {\n if (!self.ignore.length)\n return false\n\n return self.ignore.some(function(item) {\n return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))\n })\n}", "function isIgnored (self, path) {\n if (!self.ignore.length)\n return false\n\n return self.ignore.some(function(item) {\n return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))\n })\n}", "function isIgnored (self, path) {\n if (!self.ignore.length)\n return false\n\n return self.ignore.some(function(item) {\n return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))\n })\n}", "function isIgnored (self, path) {\n if (!self.ignore.length)\n return false\n\n return self.ignore.some(function(item) {\n return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))\n })\n}", "function isIgnored (self, path) {\n if (!self.ignore.length)\n return false\n\n return self.ignore.some(function(item) {\n return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))\n })\n}", "function isIgnored (self, path) {\n if (!self.ignore.length)\n return false\n\n return self.ignore.some(function(item) {\n return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))\n })\n}", "function isIgnored (self, path) {\n if (!self.ignore.length)\n return false\n\n return self.ignore.some(function(item) {\n return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))\n })\n}", "function isIgnored (self, path) {\n if (!self.ignore.length)\n return false\n\n return self.ignore.some(function(item) {\n return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))\n })\n}", "function isIgnored (self, path) {\n if (!self.ignore.length)\n return false\n\n return self.ignore.some(function(item) {\n return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))\n })\n}", "function shouldIgnore(filename, ignore) {\n var relname = normalizeSlashes(filename);\n return ignore.some(function (x) { return x.test(relname); });\n}", "function isIgnored(self, path) {\n if (!self.ignore.length) return false;\n\n return self.ignore.some(function (item) {\n return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path));\n });\n}", "static continue(command, ignore = false, rest = null) {\n return new Flag(\"continue\", { command, ignore, rest });\n }", "function _shouldIgnore(pattern, filename) {\n\t if (typeof pattern === \"function\") {\n\t return pattern(filename);\n\t } else {\n\t return pattern.test(filename);\n\t }\n\t}", "function _shouldIgnore(pattern, filename) {\n\t if (typeof pattern === \"function\") {\n\t return pattern(filename);\n\t } else {\n\t return pattern.test(filename);\n\t }\n\t}", "function _shouldIgnore(pattern, filename) {\n\t if (typeof pattern === \"function\") {\n\t return pattern(filename);\n\t } else {\n\t return pattern.test(filename);\n\t }\n\t}", "function blockUnrequired(){\r\n\tset(\"V[z_vaxx_*]\",\"\");\r\n\tset(\"V[z_va01_*]\",\"\");\r\n}", "function notBlockUseCase() { console.log('Not an block use case');}", "dontWantToken () {\n\t\treturn true;\n\t}", "preset () { return false }", "function skipHello() {\n saidHello = true;\n}", "function skipHello() {\n saidHello = true;\n}", "function skipHello() {\n saidHello = true;\n}", "function skipHello() {\n saidHello = true;\n}", "function skipHello() {\n saidHello = true;\n}", "function ignoreInteractions() {\n\n if ( ignoreinteractions === false ) ignoreinteractions = true;\n else ignoreinteractions = false;\n\n // In any case we should redo Post Hoc tests!\n\n buildPostHocTests();\n\n }", "function skipHello()\n{\n saidHello = true;\n}", "shouldIgnoreFile(fileNameSplitByDot) {\n const isHidden = !fileNameSplitByDot[0];\n const hasNoExtension = fileNameSplitByDot.length === 1;\n return isHidden || hasNoExtension;\n }", "function hello2() {\n const bye = \"bye\";\n\n /**\n * For disable the es-lint on the line\n * Please put the below comment\n * now instead of the error we will have the warning for below 2\n */\n // eslint-disable-next-line\n console.log(\"this is sample \", bye);\n\n /**\n * disabling a particular rule for the eslint\n */\n // eslint-disable-next-line quotes\n console.log(\"this is sample \", 2323232);\n\n const a = 95;\n\n console.log(`vaylue for the a the `, a);\n}", "function noop() { } // tslint:disable-line:no-empty", "function Ne(e,t,a){return\"string\"==typeof t&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),Te(e,a||t.type,e,t),Le(t)||t.codemirrorIgnore}", "function skipHello() {\n saidHello = true;\n}", "warn() {}", "function exclusionaryTests() {\n\tdanger.git.created_files\n\t\t.filter(filepath => filepath.endsWith('.test.js'))\n\t\t.map(filepath => ({filepath, content: readFile(filepath)}))\n\t\t.filter(\n\t\t\t({content}) =>\n\t\t\t\tcontent.includes('it.only') || content.includes('describe.only'),\n\t\t)\n\t\t.forEach(({filepath}) =>\n\t\t\twarn(\n\t\t\t\t`An <code>only</code> was left in ${filepath} – no other tests can run.`,\n\t\t\t),\n\t\t)\n}", "function skipProv(p) {return (skip && (SKIP.indexOf(p)>=0));}", "function omit(track) {\n try {\n // return unmodified track if setting is turned off\n if (!Settings.Get().omit.switch) {\n return track;\n }\n else {\n // return unmodified track if the keyword list is empty\n if (Settings.Get().omit.keywords == '') {\n return track;\n }\n else {\n try {\n // split the keywords string at (',') and iterate through them\n Settings.Get().omit.keywords.split(',').forEach(function(keyword) {\n // if a match is found it will be replaced with an empty string\n track = track.replace(RegExp(Helper.RegExp.Escape(keyword), 'gi'), '');\n });\n // return the modified track \n return track;\n }\n // if no seperator has been found, assume there is only one keyword\n catch {\n // if a match is found it will be replaced with an empty string\n track = track.replace(RegExp(Helper.RegExp.Escape(Settings.Get().omit.keywords), 'gi'), '');\n return track;\n }\n }\n }\n }\n catch {\n return track;\n }\n}", "no_op() {}", "hacky(){\n return\n }", "function noop(){}// No operation performed." ]
[ "0.8652147", "0.7446572", "0.73859835", "0.7234087", "0.7167445", "0.70217335", "0.67718285", "0.6404717", "0.61901206", "0.6141006", "0.611969", "0.6112831", "0.60844624", "0.60475874", "0.60462904", "0.60432476", "0.60051274", "0.5981711", "0.5976254", "0.5972818", "0.5935619", "0.5935619", "0.5925366", "0.5894516", "0.5894516", "0.5829746", "0.58288664", "0.58171844", "0.58171844", "0.5816781", "0.5809409", "0.58062756", "0.57885814", "0.5786809", "0.5781662", "0.57662535", "0.57216376", "0.57107085", "0.5706412", "0.5706412", "0.5691542", "0.56828785", "0.56770533", "0.56770533", "0.56770533", "0.56770533", "0.56770533", "0.56770533", "0.56770533", "0.56770533", "0.56770533", "0.56770533", "0.56770533", "0.56770533", "0.56770533", "0.56770533", "0.56770533", "0.56770533", "0.56770533", "0.56770533", "0.56770533", "0.56770533", "0.56770533", "0.56770533", "0.56770533", "0.56770533", "0.56770533", "0.56770533", "0.56770533", "0.56770533", "0.56770533", "0.56770533", "0.56728107", "0.56529355", "0.56369984", "0.5626949", "0.5626949", "0.5626949", "0.56161416", "0.5609741", "0.56076837", "0.5604408", "0.5587355", "0.5587355", "0.5587355", "0.5587355", "0.5587355", "0.5564175", "0.5562831", "0.5561341", "0.5552319", "0.5551413", "0.5541745", "0.55403334", "0.55370325", "0.5536922", "0.5519766", "0.5508956", "0.5504736", "0.54877645", "0.54854244" ]
0.0
-1
! Defines the accessor named prop on the incoming prototype.
function a(t,e,a,u,c,l){r=r||n(5);const f=(u?u+".":"")+t;u=u||"",e?Object.defineProperty(a,t,{enumerable:!0,configurable:!0,get:function(){const t=this;if(this.$__.getters||(this.$__.getters={}),!this.$__.getters[f]){const n=Object.create(r.prototype,function(t){const e={};return Object.getOwnPropertyNames(t).forEach(function(n){e[n]=Object.getOwnPropertyDescriptor(t,n),e[n].get?delete e[n]:e[n].enumerable=-1===["isNew","$__","errors","_doc"].indexOf(n)}),e}(this));u||(n.$__.scope=this),n.$__.nestedPath=f,Object.defineProperty(n,"schema",{enumerable:!1,configurable:!0,writable:!1,value:a.schema}),Object.defineProperty(n,"toObject",{enumerable:!1,configurable:!0,writable:!1,value:function(){return o.clone(t.get(f,null,{virtuals:i(this,"schema.options.toObject.virtuals",null)}))}}),Object.defineProperty(n,"toJSON",{enumerable:!1,configurable:!0,writable:!1,value:function(){return t.get(f,null,{virtuals:i(t,"schema.options.toJSON.virtuals",null)})}}),Object.defineProperty(n,"$__isNested",{enumerable:!1,configurable:!0,writable:!1,value:!0}),s(e,n,f,l),this.$__.getters[f]=n}return this.$__.getters[f]},set:function(t){return t instanceof r&&(t=t.toObject({transform:!1})),(this.$__.scope||this).$set(f,t)}}):Object.defineProperty(a,t,{enumerable:!0,configurable:!0,get:function(){return this.get.call(this.$__.scope||this,f)},set:function(t){return this.$set.call(this.$__.scope||this,f,t)}})}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static createProperty(e,t=defaultPropertyDeclaration){// Do not generate an accessor if the prototype already has one, since\n// it would be lost otherwise and that would never be the user's intention;\n// Instead, we expect users to call `requestUpdate` themselves from\n// user-defined accessors. Note that if the super has an accessor we will\n// still overwrite it\nif(this._ensureClassProperties(),this._classProperties.set(e,t),t.noAccessor||this.prototype.hasOwnProperty(e))return;const n=\"symbol\"==typeof e?Symbol():`__${e}`;Object.defineProperty(this.prototype,e,{// tslint:disable-next-line:no-any no symbol in index\nget(){return this[n]},set(t){const r=this[e];this[n]=t,this._requestUpdate(e,r)},configurable:!0,enumerable:!0})}", "function attrGetter(type, name) {\nreturn Object.getOwnPropertyDescriptor(type.$$.prototype, name).get;\n}", "function prop(name){\n\t return function(obj){\n\t return obj[name];\n\t };\n\t }", "function _prop(val) { return { value: val, enumerable: true }; }", "function _prop(val) { return { value: val, enumerable: true }; }", "function prop(name){\n return function(obj){\n return obj[name];\n };\n }", "function prop(name){\n return function(obj){\n return obj[name];\n };\n }", "function prop(name){\n return function(obj){\n return obj[name];\n };\n }", "get( target, prop, receiver ){\n //console.log( \"GET\", \"target\", target, \"prop\", prop, \"rec\", receiver ); \n if( prop == \"$\" ) return this;\n \n return Reflect.get( target, prop, receiver ); //target[ prop ];\n }", "function define (prop, prototype) {\n Object.defineProperty(prototype, prop, {\n enumerable: true\n , get: function ( ) { return this.get.call(this._scope || this, prop); }\n , set: function (v) { return this.set.call(this._scope || this, prop, v); }\n });\n}", "get property(){}", "get name() {\n return this.#name;\n }", "static createProperty(name,options=defaultPropertyDeclaration){// Note, since this can be called by the `@property` decorator which\n// is called before `finalize`, we ensure storage exists for property\n// metadata.\nthis._ensureClassProperties();this._classProperties.set(name,options);// Do not generate an accessor if the prototype already has one, since\n// it would be lost otherwise and that would never be the user's intention;\n// Instead, we expect users to call `requestUpdate` themselves from\n// user-defined accessors. Note that if the super has an accessor we will\n// still overwrite it\nif(options.noAccessor||this.prototype.hasOwnProperty(name)){return}const key=\"symbol\"===typeof name?Symbol():`__${name}`;Object.defineProperty(this.prototype,name,{// tslint:disable-next-line:no-any no symbol in index\nget(){return this[key]},set(value){const oldValue=this[name];this[key]=value;this._requestUpdate(name,oldValue)},configurable:!0,enumerable:!0})}", "function accessor(proto, k) {\n\t\tif (k.length > 0 && k.charAt(0) == \"_\") {\n\t\t\tproto[k.substr(1)] = function(v) {\n\t\t\t\tif (typeof v == \"undefined\") return this[k];\n\t\t\t\tif (arguments.length > 1) {\n\t\t\t\t\tthis[k + \"_array\"] = [];\n\t\t\t\t\tfor (var i = 0; i < arguments.length; i++) {\n\t\t\t\t\t\tthis[k + \"_array\"][i] = arguments[i];\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tdelete this[k + \"_array\"];\n\t\t\t\t}\n\t\t\t\tthis[k] = v;\n\t\t\t\tthis.updated[k.substr(1)] = true;\n\t\t\t\treturn this;\n\t\t\t};\n\t\t}\n\t}", "get property() {\n return super.property;\n }", "function propertyAccessor(fld) {\r\n return function (obj) { return obj[fld]; }\r\n}", "get( target, prop, receiver ) {\n let hasProp = true, \n device = null, \n upper = prop[0].toUpperCase() + prop.slice( 1 ), // convert lowercase to camelcase\n useUpper = false\n\n // if the property is undefined...\n if( target[ prop ] === undefined && target[ upper ] === undefined && prop !== 'markup' && prop !== 'seq' && prop !== 'sequences' ) {\n //target[ prop ] = Max.namespace( prop, target )\n //target[ prop ].address = addr + ' ' + prop\n for( let __device of target.devices ) {\n if( typeof __device !== 'object' ) continue\n\n if( __device[ prop ] !== undefined ) {\n device = __device\n break\n }else if( __device[ upper ] !== undefined ) {\n device = __device\n useUpper = true\n break\n }\n }\n\n hasProp = false\n }\n\n\n let propName = useUpper ? upper : prop\n\n let property = null\n if( hasProp ) {\n property = target[ prop ]\n }else{\n if( device !== null ) {\n property = device[ propName ]\n }\n }\n\n return property \n }", "function getProp(name) {\n\treturn function (obj) {\n\t\treturn obj[name];\n\t};\n}", "function makeConflictAccessor(name) {\n var accessor = function(var_args) {\n throw new Error(\"Conflicting property: \"+name);\n };\n freeze(accessor.prototype);\n return freeze(accessor);\n }", "function property(cls, prop, descriptor) {\n\tlet proto = cls.prototype || cls\n\tassert(!(prop in proto), '{0}.{1} already exists', cls.name, prop)\n\tObject.defineProperty(proto, prop, descriptor)\n}", "get Name() {\n return this.#name;\n }", "function addProp(target, name, factory, path) {\n Reflect.defineProperty(target.prototype, name, {\n configurable: true,\n enumerable: true,\n get: function () {\n return factory(this, path);\n },\n });\n}", "function createAccessor(attr) {\n function accessor(value) {\n if (!arguments.length) { return mx[attr]; }\n mx[attr] = value;\n return choromap;\n }\n return accessor;\n }", "function atr$(obj, name, get, set, metamodel,settermm) {\nObject.defineProperty(obj, name, {get: get, set: set, configurable: true, enumerable: true});\n//if (name[0]==='$')name=name.substring(1);//names matching reserved words are prefixed with $\nobj['$prop$get'+name[0].toUpperCase()+name.substring(1)] = {get:get, set:set, $crtmm$:metamodel};\nif (settermm)set.$crtmm$=settermm;\n}", "get(property) {\n return this[property];\n }", "get name(){\n return this._name;\n }", "function storeDescriptor(proto, propName, descriptor) {\n // triggerBefore can be function, boolean, or string\n var triggerBeforeValue;\n if (typeof descriptor.triggerBefore === 'function' || typeof descriptor.triggerBefore === 'string') {\n // Directly use string or function, makeTrigger will do the rest\n triggerBeforeValue = descriptor.triggerBefore;\n }\n else if (descriptor.triggerBefore === true) {\n // Automatically set name based on descriptor.trigger\n if (typeof descriptor.trigger === 'string' && descriptor.trigger.indexOf(':') !== -1) {\n triggerBeforeValue = descriptor.trigger.replace(':', ':before');\n }\n else {\n throw new Error('Coral.register: Cannot automatically set \"before\" event name unless descriptor.trigger ' +\n 'is a string that conatins a colon');\n }\n }\n\n // Use provided setter, or make a setter that sets a \"private\" underscore-prefixed variable\n descriptor.set = descriptor.set || makeBasicSetter(propName);\n\n // Use provided getter, or make a getter that returns a \"private\" underscore-prefixed variable\n descriptor.get = descriptor.get || makeBasicGetter(propName);\n\n // Store methods\n var inheritedMethods = descriptor._methods;\n descriptor._methods = {};\n\n // store references to inherited methods in descriptor._methods\n if (inheritedMethods) {\n for (var methodName in inheritedMethods) {\n descriptor._methods[methodName] = inheritedMethods[methodName];\n }\n }\n\n descriptor._methods.triggerBefore = makeTrigger(triggerBeforeValue);\n descriptor._methods.trigger = makeTrigger(descriptor.trigger);\n descriptor._methods.transform = descriptor.transform || passThrough;\n descriptor._methods.attributeTransform = descriptor.attributeTransform || passThrough;\n descriptor._methods.reflectAttribute = makeReflect(propName, descriptor);\n descriptor._methods.queueSync = makeQueueSync(propName, descriptor);\n\n // We need to store the list of validators back on the descriptor as we modify this inside of makeValidate\n descriptor._methods.validate = makeValidate(descriptor);\n\n // Store reverse mapping of attribute -> property\n if (descriptor.attribute) {\n proto._attributes[descriptor.attribute] = propName;\n }\n else {\n // Remove the mapping in case it was overridden\n proto._attributes[descriptor.attribute] = null;\n }\n\n // Store the descriptor\n proto._properties[propName] = descriptor;\n }", "function property(name) {\n if (!name) {\n throw new Error(\"@property requires a non-empty name.\");\n }\n\n return (target, key, descriptor) => {\n validateProperty(\"property\", key, descriptor);\n mapping.getOrCreateOwn(target, key, () => ({})).property = name;\n };\n }", "function property(options){// tslint:disable-next-line:no-any decorator\nreturn(protoOrDescriptor,name)=>name!==void 0?legacyProperty(options,protoOrDescriptor,name):standardProperty(options,protoOrDescriptor)}", "static createProperty(name, options = defaultPropertyDeclaration) {\n // Note, since this can be called by the `@property` decorator which\n // is called before `finalize`, we ensure storage exists for property\n // metadata.\n this._ensureClassProperties();\n this._classProperties.set(name, options);\n // Do not generate an accessor if the prototype already has one, since\n // it would be lost otherwise and that would never be the user's intention;\n // Instead, we expect users to call `requestUpdate` themselves from\n // user-defined accessors. Note that if the super has an accessor we will\n // still overwrite it\n if (options.noAccessor || this.prototype.hasOwnProperty(name)) {\n return;\n }\n const key = typeof name === 'symbol' ? Symbol() : `__${name}`;\n Object.defineProperty(this.prototype, name, {\n // tslint:disable-next-line:no-any no symbol in index\n get() {\n return this[key];\n },\n set(value) {\n const oldValue = this[name];\n this[key] = value;\n this._requestUpdate(name, oldValue);\n },\n configurable: true,\n enumerable: true\n });\n }", "get foo() {\n return this.getAttribute('foo'); \n }", "function defineProperty(klass, propertyName, getter, setter) {\n var config = {\n enumerable: true,\n get: getter\n };\n if (setter) {\n config.set = setter;\n }\n Object.defineProperty(klass.prototype, propertyName, config);\n }", "function createSpecificAccessors(propName, isWritable, objToCreateIn) {\r\n if (isWritable) {\r\n objToCreateIn[methodNames.setPrefix + propName] = function (propertyValue) {\r\n setValueInternal(propName, propertyValue);\r\n }\r\n\r\n objToCreateIn[methodNames.appendPrefix + propName] = function (propertyValue) {\r\n appendValueInternal(propName, propertyValue);\r\n }\r\n }\r\n\r\n objToCreateIn[methodNames.getPrefix + propName] = function () {\r\n return getValueInternal(propName);\r\n }\r\n }", "defineGetterPropertyValue(prop, instance, getterHandler) {\n if (prop && getterHandler) {\n if (prop.propertyName) {\n Object.defineProperty(instance, prop.propertyName, {\n get: () => { var _a; return getterHandler(prop.propertyName, (_a = prop.metadata) !== null && _a !== void 0 ? _a : {}, instance); },\n configurable: true,\n enumerable: true,\n });\n }\n }\n }", "function defineKey(prop, subprops, prototype, prefix, keys, options) {\n var path = (prefix ? prefix + '.' : '') + prop;\n prefix = prefix || '';\n\n if (subprops) {\n Object.defineProperty(prototype, prop, {\n enumerable: true,\n configurable: true,\n get: function() {\n var _this = this;\n if (!this.$__.getters) {\n this.$__.getters = {};\n }\n\n if (!this.$__.getters[path]) {\n var nested = Object.create(Object.getPrototypeOf(this), getOwnPropertyDescriptors(this));\n\n // save scope for nested getters/setters\n if (!prefix) {\n nested.$__.scope = this;\n }\n\n // shadow inherited getters from sub-objects so\n // thing.nested.nested.nested... doesn't occur (gh-366)\n var i = 0,\n len = keys.length;\n\n for (; i < len; ++i) {\n // over-write the parents getter without triggering it\n Object.defineProperty(nested, keys[i], {\n enumerable: false, // It doesn't show up.\n writable: true, // We can set it later.\n configurable: true, // We can Object.defineProperty again.\n value: undefined // It shadows its parent.\n });\n }\n\n Object.defineProperty(nested, 'toObject', {\n enumerable: true,\n configurable: true,\n writable: false,\n value: function() {\n return _this.get(path);\n }\n });\n\n Object.defineProperty(nested, 'toJSON', {\n enumerable: true,\n configurable: true,\n writable: false,\n value: function() {\n return _this.get(path);\n }\n });\n\n Object.defineProperty(nested, '$__isNested', {\n enumerable: true,\n configurable: true,\n writable: false,\n value: true\n });\n\n compile(subprops, nested, path, options);\n this.$__.getters[path] = nested;\n }\n\n return this.$__.getters[path];\n },\n set: function(v) {\n if (v instanceof Document) {\n v = v.toObject();\n }\n return (this.$__.scope || this).set(path, v);\n }\n });\n } else {\n Object.defineProperty(prototype, prop, {\n enumerable: true,\n configurable: true,\n get: function() {\n return this.get.call(this.$__.scope || this, path);\n },\n set: function(v) {\n return this.set.call(this.$__.scope || this, path, v);\n }\n });\n }\n}", "function copySuperAttr(obj, name, suffix) {\nvar desc;\nvar o = obj;\n// It may be an inherited property, so check the prototype chain.\ndo {\nif ((desc = Object.getOwnPropertyDescriptor(o, name))) {break;}\no = o.__proto__;\n} while (o);\nif (desc) {\nObject.defineProperty(obj, name+suffix, desc);\n}\n}", "function defineKey(prop, subprops, prototype, prefix, keys, options) {\n Document = Document || __webpack_require__(12);\n var path = (prefix ? prefix + '.' : '') + prop;\n prefix = prefix || '';\n\n if (subprops) {\n Object.defineProperty(prototype, prop, {\n enumerable: true,\n configurable: true,\n get: function() {\n var _this = this;\n if (!this.$__.getters) {\n this.$__.getters = {};\n }\n\n if (!this.$__.getters[path]) {\n var nested = Object.create(Object.getPrototypeOf(this), getOwnPropertyDescriptors(this));\n\n // save scope for nested getters/setters\n if (!prefix) {\n nested.$__.scope = this;\n }\n\n // shadow inherited getters from sub-objects so\n // thing.nested.nested.nested... doesn't occur (gh-366)\n var i = 0,\n len = keys.length;\n\n for (; i < len; ++i) {\n // over-write the parents getter without triggering it\n Object.defineProperty(nested, keys[i], {\n enumerable: false, // It doesn't show up.\n writable: true, // We can set it later.\n configurable: true, // We can Object.defineProperty again.\n value: undefined // It shadows its parent.\n });\n }\n\n Object.defineProperty(nested, 'toObject', {\n enumerable: false,\n configurable: true,\n writable: false,\n value: function() {\n return utils.clone(_this.get(path), { retainKeyOrder: true });\n }\n });\n\n Object.defineProperty(nested, 'toJSON', {\n enumerable: false,\n configurable: true,\n writable: false,\n value: function() {\n return _this.get(path);\n }\n });\n\n Object.defineProperty(nested, '$__isNested', {\n enumerable: false,\n configurable: true,\n writable: false,\n value: true\n });\n\n compile(subprops, nested, path, options);\n this.$__.getters[path] = nested;\n }\n\n return this.$__.getters[path];\n },\n set: function(v) {\n if (v instanceof Document) {\n v = v.toObject({ transform: false });\n }\n return (this.$__.scope || this).set(path, v);\n }\n });\n } else {\n Object.defineProperty(prototype, prop, {\n enumerable: true,\n configurable: true,\n get: function() {\n return this.get.call(this.$__.scope || this, path);\n },\n set: function(v) {\n return this.set.call(this.$__.scope || this, path, v);\n }\n });\n }\n}", "function defineKey(prop, subprops, prototype, prefix, keys, options) {\n Document = Document || require('../../document');\n const path = (prefix ? prefix + '.' : '') + prop;\n prefix = prefix || '';\n\n if (subprops) {\n Object.defineProperty(prototype, prop, {\n enumerable: true,\n configurable: true,\n get: function() {\n const _this = this;\n if (!this.$__.getters) {\n this.$__.getters = {};\n }\n\n if (!this.$__.getters[path]) {\n const nested = Object.create(Document.prototype, getOwnPropertyDescriptors(this));\n\n // save scope for nested getters/setters\n if (!prefix) {\n nested.$__.scope = this;\n }\n nested.$__.nestedPath = path;\n\n Object.defineProperty(nested, 'schema', {\n enumerable: false,\n configurable: true,\n writable: false,\n value: prototype.schema\n });\n\n Object.defineProperty(nested, 'toObject', {\n enumerable: false,\n configurable: true,\n writable: false,\n value: function() {\n return utils.clone(_this.get(path, null, {\n virtuals: get(this, 'schema.options.toObject.virtuals', null)\n }));\n }\n });\n\n Object.defineProperty(nested, 'toJSON', {\n enumerable: false,\n configurable: true,\n writable: false,\n value: function() {\n return _this.get(path, null, {\n virtuals: get(_this, 'schema.options.toJSON.virtuals', null)\n });\n }\n });\n\n Object.defineProperty(nested, '$__isNested', {\n enumerable: false,\n configurable: true,\n writable: false,\n value: true\n });\n\n compile(subprops, nested, path, options);\n this.$__.getters[path] = nested;\n }\n\n return this.$__.getters[path];\n },\n set: function(v) {\n if (v instanceof Document) {\n v = v.toObject({ transform: false });\n }\n const doc = this.$__.scope || this;\n return doc.$set(path, v);\n }\n });\n } else {\n Object.defineProperty(prototype, prop, {\n enumerable: true,\n configurable: true,\n get: function() {\n return this[getSymbol].call(this.$__.scope || this, path);\n },\n set: function(v) {\n return this.$set.call(this.$__.scope || this, path, v);\n }\n });\n }\n}", "static define(obj) {\n for (const [name, prop] of entries(isFunction(obj) ? obj(kinds) : obj)) {\n if (this.prototype._props[name] != null)\n throw new Error(`attempted to redefine property '${this.prototype.type}.${name}'`);\n if (this.prototype[name] != null)\n throw new Error(`attempted to redefine attribute '${this.prototype.type}.${name}'`);\n Object.defineProperty(this.prototype, name, {\n // XXX: don't use tail calls in getters/setters due to https://bugs.webkit.org/show_bug.cgi?id=164306\n get() {\n const value = this.properties[name].get_value();\n return value;\n },\n set(value) {\n this.setv({ [name]: value });\n return this;\n },\n configurable: false,\n enumerable: true,\n });\n const [type, default_value, options = {}] = prop;\n const refined_prop = {\n type,\n default_value: this._fix_default(default_value, name),\n options,\n };\n const props = { ...this.prototype._props };\n props[name] = refined_prop;\n this.prototype._props = props;\n }\n }", "function defineKey(prop, subprops, prototype, prefix, keys, options) {\n Document = Document || require('../../document');\n var path = (prefix ? prefix + '.' : '') + prop;\n prefix = prefix || '';\n\n if (subprops) {\n Object.defineProperty(prototype, prop, {\n enumerable: true,\n configurable: true,\n get: function() {\n var _this = this;\n if (!this.$__.getters) {\n this.$__.getters = {};\n }\n\n if (!this.$__.getters[path]) {\n var nested = Object.create(Document.prototype, getOwnPropertyDescriptors(this));\n\n // save scope for nested getters/setters\n if (!prefix) {\n nested.$__.scope = this;\n }\n nested.$__.nestedPath = path;\n\n Object.defineProperty(nested, 'schema', {\n enumerable: false,\n configurable: true,\n writable: false,\n value: prototype.schema\n });\n\n Object.defineProperty(nested, 'toObject', {\n enumerable: false,\n configurable: true,\n writable: false,\n value: function() {\n return utils.clone(_this.get(path));\n }\n });\n\n Object.defineProperty(nested, 'toJSON', {\n enumerable: false,\n configurable: true,\n writable: false,\n value: function() {\n return _this.get(path);\n }\n });\n\n Object.defineProperty(nested, '$__isNested', {\n enumerable: false,\n configurable: true,\n writable: false,\n value: true\n });\n\n compile(subprops, nested, path, options);\n this.$__.getters[path] = nested;\n }\n\n return this.$__.getters[path];\n },\n set: function(v) {\n if (v instanceof Document) {\n v = v.toObject({ transform: false });\n }\n var doc = this.$__.scope || this;\n return doc.$set(path, v);\n }\n });\n } else {\n Object.defineProperty(prototype, prop, {\n enumerable: true,\n configurable: true,\n get: function() {\n return this.get.call(this.$__.scope || this, path);\n },\n set: function(v) {\n return this.$set.call(this.$__.scope || this, path, v);\n }\n });\n }\n}", "static get property(){}", "function proxyProperty( first, second ){\n\t return {\n\t get : function(){\n\t return this[ first ][ second ];\n\t },\n\t\n\t set : function( value ){\n\t this[ first ][ second ] = value;\n\t }\n\t }\n\t}", "_upgradeProperty(prop) {\n // https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties\n // https://developers.google.com/web/fundamentals/web-components/examples/howto-checkbox\n /* eslint no-prototype-builtins: 0 */\n if (this.hasOwnProperty(prop)) {\n const value = this[prop];\n // get rid of the property that might shadow a setter/getter\n delete this[prop];\n // this time if a setter was defined it will be properly called\n this[prop] = value;\n // if a getter was defined, it will be called from now on\n }\n }", "get name() {\n return _name.get(this);\n }", "function defineProxyPropertyWithValue(name,value){var _ref=Object.getOwnPropertyDescriptor(current,name)||{};var _ref$enumerable=_ref.enumerable;var enumerable=_ref$enumerable===undefined?false:_ref$enumerable;var _ref$writable=_ref.writable;var writable=_ref$writable===undefined?true:_ref$writable;defineProxyProperty(name,{configurable:true,enumerable:enumerable,writable:writable,value:value});}", "function defineProxyPropertyWithValue(name,value){var _ref=Object.getOwnPropertyDescriptor(current,name)||{};var _ref$enumerable=_ref.enumerable;var enumerable=_ref$enumerable===undefined?false:_ref$enumerable;var _ref$writable=_ref.writable;var writable=_ref$writable===undefined?true:_ref$writable;defineProxyProperty(name,{configurable:true,enumerable:enumerable,writable:writable,value:value});}", "function _get(e,t,n){return(_get=\"undefined\"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=_superPropBase(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(n):i.value}})(e,t,n||e)}", "function handle(that, prefix, name, value) {\n\t\tvar ctor = that.__proto__.constructor;\n\t\t// handle caches getter and setter functions for given property names.\n\t\t// Store the handlers in the constructor of each prototype, so caching\n\t\t// between different sub-prototypes that might redefine getter/setters\n\t\t// does not get mixed up:\n\t\tvar handlers = ctor.handlers = ctor.handlers || { get: {}, set: {} };\n\t\tvar list = handlers[prefix];\n\t\t// First see if there is a getter / setter for the given property\n\t\tvar fn = name == 'events' && prefix == 'set' ? that.addEvents : list[name];\n\t\tif (fn === undefined)\n\t\t\tfn = list[name] = that[prefix + name.capitalize()] || null;\n\t\t// If the passed value is an array, use it as the argument\n\t\t// list for the call.\n\t\treturn fn\n\t\t\t? fn[Base.type(value) == 'array' ? 'apply' : 'call'](that, value)\n\t\t\t: that[prefix + 'Property'](name, value);\n\t}", "get prototype() {}", "get getName(){\n return _name;\n }", "get Name(){\n return this._Name;\n }", "prop(prop) { return this.props[prop.id]; }", "function convertDataDescriptorToAccessor(obj, prop, message) {\n var descriptor = Object.getOwnPropertyDescriptor(obj, prop)\n var value = descriptor.value\n\n descriptor.get = function getter() { return value }\n\n if (descriptor.writable) {\n descriptor.set = function setter(val) { return value = val }\n }\n\n delete descriptor.value\n delete descriptor.writable\n\n Object.defineProperty(obj, prop, descriptor)\n\n return descriptor\n}", "function convertDataDescriptorToAccessor(obj, prop, message) {\n var descriptor = Object.getOwnPropertyDescriptor(obj, prop)\n var value = descriptor.value\n\n descriptor.get = function getter() { return value }\n\n if (descriptor.writable) {\n descriptor.set = function setter(val) { return value = val }\n }\n\n delete descriptor.value\n delete descriptor.writable\n\n Object.defineProperty(obj, prop, descriptor)\n\n return descriptor\n}", "function convertDataDescriptorToAccessor(obj, prop, message) {\n var descriptor = Object.getOwnPropertyDescriptor(obj, prop)\n var value = descriptor.value\n\n descriptor.get = function getter() { return value }\n\n if (descriptor.writable) {\n descriptor.set = function setter(val) { return value = val }\n }\n\n delete descriptor.value\n delete descriptor.writable\n\n Object.defineProperty(obj, prop, descriptor)\n\n return descriptor\n}", "get(obj, propertyName) {\n // this get(a trap of proxy api) takes two arguments which are provided by the proxy api\n console.log(propertyName);\n return obj[propertyName];\n }", "function convertDataDescriptorToAccessor(obj, prop, message) {\n var descriptor = Object.getOwnPropertyDescriptor(obj, prop);\n var value = descriptor.value;\n\n descriptor.get = function getter() {\n return value;\n };\n\n if (descriptor.writable) {\n descriptor.set = function setter(val) {\n return value = val;\n };\n }\n\n delete descriptor.value;\n delete descriptor.writable;\n Object.defineProperty(obj, prop, descriptor);\n return descriptor;\n}", "get name(): string { throw new Error(\"Member class not implemented\"); }", "function getOverrideDescriptor(cmp, prop, callback) {\n const descriptor = findDescriptor(cmp, prop);\n let enumerable;\n let get;\n let set; // This does not cover the override of existing descriptors at the instance level\n // and that's ok because eventually we will not need to do any of these :)\n\n if (descriptor === null || descriptor.get === undefined && descriptor.set === undefined) {\n let value = cmp[prop];\n enumerable = true;\n\n get = function () {\n return value;\n };\n\n set = function (newValue) {\n value = newValue;\n callback();\n };\n } else {\n const {\n set: originalSet,\n get: originalGet\n } = descriptor;\n enumerable = descriptor.enumerable;\n\n set = function (newValue) {\n if (originalSet) {\n originalSet.call(cmp, newValue);\n }\n\n callback();\n };\n\n get = function () {\n return originalGet ? originalGet.call(cmp) : undefined;\n };\n }\n\n return {\n set,\n get,\n enumerable,\n configurable: true\n };\n }", "get firstName() \n{ return this._firstName; \n}", "function convertDataDescriptorToAccessor (obj, prop, message) {\n var descriptor = Object.getOwnPropertyDescriptor(obj, prop)\n var value = descriptor.value\n\n descriptor.get = function getter () { return value }\n\n if (descriptor.writable) {\n descriptor.set = function setter (val) { return (value = val) }\n }\n\n delete descriptor.value\n delete descriptor.writable\n\n Object.defineProperty(obj, prop, descriptor)\n\n return descriptor\n}", "function convertDataDescriptorToAccessor (obj, prop, message) {\n var descriptor = Object.getOwnPropertyDescriptor(obj, prop)\n var value = descriptor.value\n\n descriptor.get = function getter () { return value }\n\n if (descriptor.writable) {\n descriptor.set = function setter (val) { return (value = val) }\n }\n\n delete descriptor.value\n delete descriptor.writable\n\n Object.defineProperty(obj, prop, descriptor)\n\n return descriptor\n}", "function convertDataDescriptorToAccessor (obj, prop, message) {\n var descriptor = Object.getOwnPropertyDescriptor(obj, prop)\n var value = descriptor.value\n\n descriptor.get = function getter () { return value }\n\n if (descriptor.writable) {\n descriptor.set = function setter (val) { return (value = val) }\n }\n\n delete descriptor.value\n delete descriptor.writable\n\n Object.defineProperty(obj, prop, descriptor)\n\n return descriptor\n}", "function convertDataDescriptorToAccessor (obj, prop, message) {\n var descriptor = Object.getOwnPropertyDescriptor(obj, prop)\n var value = descriptor.value\n\n descriptor.get = function getter () { return value }\n\n if (descriptor.writable) {\n descriptor.set = function setter (val) { return (value = val) }\n }\n\n delete descriptor.value\n delete descriptor.writable\n\n Object.defineProperty(obj, prop, descriptor)\n\n return descriptor\n}", "function convertDataDescriptorToAccessor (obj, prop, message) {\n var descriptor = Object.getOwnPropertyDescriptor(obj, prop)\n var value = descriptor.value\n\n descriptor.get = function getter () { return value }\n\n if (descriptor.writable) {\n descriptor.set = function setter (val) { return (value = val) }\n }\n\n delete descriptor.value\n delete descriptor.writable\n\n Object.defineProperty(obj, prop, descriptor)\n\n return descriptor\n}", "function convertDataDescriptorToAccessor (obj, prop, message) {\n var descriptor = Object.getOwnPropertyDescriptor(obj, prop)\n var value = descriptor.value\n\n descriptor.get = function getter () { return value }\n\n if (descriptor.writable) {\n descriptor.set = function setter (val) { return (value = val) }\n }\n\n delete descriptor.value\n delete descriptor.writable\n\n Object.defineProperty(obj, prop, descriptor)\n\n return descriptor\n}", "function convertDataDescriptorToAccessor (obj, prop, message) {\n var descriptor = Object.getOwnPropertyDescriptor(obj, prop)\n var value = descriptor.value\n\n descriptor.get = function getter () { return value }\n\n if (descriptor.writable) {\n descriptor.set = function setter (val) { return (value = val) }\n }\n\n delete descriptor.value\n delete descriptor.writable\n\n Object.defineProperty(obj, prop, descriptor)\n\n return descriptor\n}", "function convertDataDescriptorToAccessor (obj, prop, message) {\n var descriptor = Object.getOwnPropertyDescriptor(obj, prop)\n var value = descriptor.value\n\n descriptor.get = function getter () { return value }\n\n if (descriptor.writable) {\n descriptor.set = function setter (val) { return (value = val) }\n }\n\n delete descriptor.value\n delete descriptor.writable\n\n Object.defineProperty(obj, prop, descriptor)\n\n return descriptor\n}", "function convertDataDescriptorToAccessor (obj, prop, message) {\n var descriptor = Object.getOwnPropertyDescriptor(obj, prop)\n var value = descriptor.value\n\n descriptor.get = function getter () { return value }\n\n if (descriptor.writable) {\n descriptor.set = function setter (val) { return (value = val) }\n }\n\n delete descriptor.value\n delete descriptor.writable\n\n Object.defineProperty(obj, prop, descriptor)\n\n return descriptor\n}", "function convertDataDescriptorToAccessor (obj, prop, message) {\n var descriptor = Object.getOwnPropertyDescriptor(obj, prop)\n var value = descriptor.value\n\n descriptor.get = function getter () { return value }\n\n if (descriptor.writable) {\n descriptor.set = function setter (val) { return (value = val) }\n }\n\n delete descriptor.value\n delete descriptor.writable\n\n Object.defineProperty(obj, prop, descriptor)\n\n return descriptor\n}", "function convertDataDescriptorToAccessor (obj, prop, message) {\n var descriptor = Object.getOwnPropertyDescriptor(obj, prop)\n var value = descriptor.value\n\n descriptor.get = function getter () { return value }\n\n if (descriptor.writable) {\n descriptor.set = function setter (val) { return (value = val) }\n }\n\n delete descriptor.value\n delete descriptor.writable\n\n Object.defineProperty(obj, prop, descriptor)\n\n return descriptor\n}", "function convertDataDescriptorToAccessor (obj, prop, message) {\n var descriptor = Object.getOwnPropertyDescriptor(obj, prop)\n var value = descriptor.value\n\n descriptor.get = function getter () { return value }\n\n if (descriptor.writable) {\n descriptor.set = function setter (val) { return (value = val) }\n }\n\n delete descriptor.value\n delete descriptor.writable\n\n Object.defineProperty(obj, prop, descriptor)\n\n return descriptor\n}", "function convertDataDescriptorToAccessor (obj, prop, message) {\n var descriptor = Object.getOwnPropertyDescriptor(obj, prop)\n var value = descriptor.value\n\n descriptor.get = function getter () { return value }\n\n if (descriptor.writable) {\n descriptor.set = function setter (val) { return (value = val) }\n }\n\n delete descriptor.value\n delete descriptor.writable\n\n Object.defineProperty(obj, prop, descriptor)\n\n return descriptor\n}", "function convertDataDescriptorToAccessor (obj, prop, message) {\n var descriptor = Object.getOwnPropertyDescriptor(obj, prop)\n var value = descriptor.value\n\n descriptor.get = function getter () { return value }\n\n if (descriptor.writable) {\n descriptor.set = function setter (val) { return (value = val) }\n }\n\n delete descriptor.value\n delete descriptor.writable\n\n Object.defineProperty(obj, prop, descriptor)\n\n return descriptor\n}", "function convertDataDescriptorToAccessor (obj, prop, message) {\n var descriptor = Object.getOwnPropertyDescriptor(obj, prop)\n var value = descriptor.value\n\n descriptor.get = function getter () { return value }\n\n if (descriptor.writable) {\n descriptor.set = function setter (val) { return (value = val) }\n }\n\n delete descriptor.value\n delete descriptor.writable\n\n Object.defineProperty(obj, prop, descriptor)\n\n return descriptor\n}", "function convertDataDescriptorToAccessor (obj, prop, message) {\n var descriptor = Object.getOwnPropertyDescriptor(obj, prop)\n var value = descriptor.value\n\n descriptor.get = function getter () { return value }\n\n if (descriptor.writable) {\n descriptor.set = function setter (val) { return (value = val) }\n }\n\n delete descriptor.value\n delete descriptor.writable\n\n Object.defineProperty(obj, prop, descriptor)\n\n return descriptor\n}", "function convertDataDescriptorToAccessor (obj, prop, message) {\n var descriptor = Object.getOwnPropertyDescriptor(obj, prop)\n var value = descriptor.value\n\n descriptor.get = function getter () { return value }\n\n if (descriptor.writable) {\n descriptor.set = function setter (val) { return (value = val) }\n }\n\n delete descriptor.value\n delete descriptor.writable\n\n Object.defineProperty(obj, prop, descriptor)\n\n return descriptor\n}", "function convertDataDescriptorToAccessor (obj, prop, message) {\n var descriptor = Object.getOwnPropertyDescriptor(obj, prop)\n var value = descriptor.value\n\n descriptor.get = function getter () { return value }\n\n if (descriptor.writable) {\n descriptor.set = function setter (val) { return (value = val) }\n }\n\n delete descriptor.value\n delete descriptor.writable\n\n Object.defineProperty(obj, prop, descriptor)\n\n return descriptor\n}", "function convertDataDescriptorToAccessor (obj, prop, message) {\n var descriptor = Object.getOwnPropertyDescriptor(obj, prop)\n var value = descriptor.value\n\n descriptor.get = function getter () { return value }\n\n if (descriptor.writable) {\n descriptor.set = function setter (val) { return (value = val) }\n }\n\n delete descriptor.value\n delete descriptor.writable\n\n Object.defineProperty(obj, prop, descriptor)\n\n return descriptor\n}", "function convertDataDescriptorToAccessor (obj, prop, message) {\n var descriptor = Object.getOwnPropertyDescriptor(obj, prop)\n var value = descriptor.value\n\n descriptor.get = function getter () { return value }\n\n if (descriptor.writable) {\n descriptor.set = function setter (val) { return (value = val) }\n }\n\n delete descriptor.value\n delete descriptor.writable\n\n Object.defineProperty(obj, prop, descriptor)\n\n return descriptor\n}", "function convertDataDescriptorToAccessor (obj, prop, message) {\n var descriptor = Object.getOwnPropertyDescriptor(obj, prop)\n var value = descriptor.value\n\n descriptor.get = function getter () { return value }\n\n if (descriptor.writable) {\n descriptor.set = function setter (val) { return (value = val) }\n }\n\n delete descriptor.value\n delete descriptor.writable\n\n Object.defineProperty(obj, prop, descriptor)\n\n return descriptor\n}", "get _getter() {\n return descriptorForDecorator(this)._getter;\n }", "static createProperty(name, options = defaultPropertyDeclaration) {\n // Note, since this can be called by the `@property` decorator which\n // is called before `_finalize`, we ensure storage exists for property\n // metadata.\n this._ensureClassProperties();\n this._classProperties.set(name, options);\n if (!options.noAccessor) {\n const superDesc = descriptorFromPrototype(name, this.prototype);\n let desc;\n // If there is a super accessor, capture it and \"super\" to it\n if (superDesc !== undefined && (superDesc.set && superDesc.get)) {\n const { set, get } = superDesc;\n desc = {\n get() { return get.call(this); },\n set(value) {\n const oldValue = this[name];\n set.call(this, value);\n this.requestUpdate(name, oldValue);\n },\n configurable: true,\n enumerable: true\n };\n }\n else {\n const key = typeof name === 'symbol' ? Symbol() : `__${name}`;\n desc = {\n get() { return this[key]; },\n set(value) {\n const oldValue = this[name];\n this[key] = value;\n this.requestUpdate(name, oldValue);\n },\n configurable: true,\n enumerable: true\n };\n }\n Object.defineProperty(this.prototype, name, desc);\n }\n }", "function property(options) {\n // tslint:disable-next-line:no-any decorator\n return function (protoOrDescriptor, name) {\n return name !== undefined ? legacyProperty(options, protoOrDescriptor, name) : standardProperty(options, protoOrDescriptor);\n };\n}", "getProp(obj, index) {\n return this._propGetters[index](obj);\n }", "makeProp(prop, value) {\n\t\tObject.defineProperty(this, prop, {\n\t\t\tvalue,\n\t\t\tenumerable: false,\n\t\t\twritable: true,\n\t\t\tconfigurable: true\n\t\t});\n\t}", "get lastName() \n{ return this._lastName; \n}", "get name() {\n\t\treturn this.#name;\n\t}", "function getter(obj, prop, fn) {\n Object.defineProperty(obj, prop, {\n configurable: true,\n enumerable: true,\n get: fn\n });\n}", "function accessor(k) {\n\tPopup.prototype[k] = function(v) {\n\t\tif (typeof v == \"undefined\") return this[\"_\" + k];\n\t\tthis[\"_\" + k] = v;\n\t\treturn this;\n\t};\n}", "get prop() {\n return this.config.prop;\n }", "function accessor(property) {\n\t\tvar fn = function() {\n\t\t\treturn this[arguments.length ? \"set\" : \"get\"](property, arguments[0]);\n\t\t};\n\n\t\t// Set a flag to later prevent set() to call fn() indefinitely\n\t\tfn.accessor = true;\n\t\treturn fn;\n\t}", "get name(){\n return this._name\n }", "function defineProxyPropertyWithValue(name, value) {\n\t var _ref = Object.getOwnPropertyDescriptor(current, name) || {};\n\n\t var _ref$enumerable = _ref.enumerable;\n\t var enumerable = _ref$enumerable === undefined ? false : _ref$enumerable;\n\t var _ref$writable = _ref.writable;\n\t var writable = _ref$writable === undefined ? true : _ref$writable;\n\n\n\t defineProxyProperty(name, {\n\t configurable: true,\n\t enumerable: enumerable,\n\t writable: writable,\n\t value: value\n\t });\n\t }", "function defineProxyPropertyWithValue(name, value) {\n\t var _ref = Object.getOwnPropertyDescriptor(current, name) || {};\n\n\t var _ref$enumerable = _ref.enumerable;\n\t var enumerable = _ref$enumerable === undefined ? false : _ref$enumerable;\n\t var _ref$writable = _ref.writable;\n\t var writable = _ref$writable === undefined ? true : _ref$writable;\n\n\n\t defineProxyProperty(name, {\n\t configurable: true,\n\t enumerable: enumerable,\n\t writable: writable,\n\t value: value\n\t });\n\t }", "static _attributeNameForProperty(name,options){const attribute=options.attribute;return attribute===false?undefined:typeof attribute==='string'?attribute:typeof name==='string'?name.toLowerCase():undefined;}", "function GetOwnPropertyDescriptor(sandbox, target, name) {\n if(!(this instanceof GetOwnPropertyDescriptor)) return new GetOwnPropertyDescriptor(sandbox, target, name);\n else Read.call(this, sandbox, target);\n\n Object.defineProperties(this, {\n \"name\": {\n value: name\n }\n });\n }", "get name() {\n return this._name;\n }", "get name() {\n return this._name;\n }", "get name() {\n return this._name;\n }", "get name() {\n return this._name;\n }" ]
[ "0.68748796", "0.67906475", "0.6748649", "0.66551924", "0.66551924", "0.6584433", "0.6584433", "0.6584433", "0.65730035", "0.6397988", "0.6397554", "0.6346903", "0.63361025", "0.6328479", "0.6277986", "0.6272427", "0.62479085", "0.62412274", "0.62334985", "0.6225804", "0.61678934", "0.61605597", "0.61556506", "0.6123284", "0.61087924", "0.60749143", "0.6074424", "0.6069073", "0.6045338", "0.60411894", "0.60227954", "0.601197", "0.6007369", "0.59718627", "0.5942934", "0.59286493", "0.5917802", "0.5917125", "0.59114784", "0.59039176", "0.5903547", "0.58993465", "0.5899336", "0.58597606", "0.5857172", "0.5857172", "0.58497685", "0.5846137", "0.5829056", "0.5817401", "0.58035785", "0.58018535", "0.5793358", "0.5793358", "0.5793358", "0.57907295", "0.57868546", "0.57807785", "0.57763183", "0.5775597", "0.57701975", "0.57701975", "0.57701975", "0.57701975", "0.57701975", "0.57701975", "0.57701975", "0.57701975", "0.57701975", "0.57701975", "0.57701975", "0.57701975", "0.57701975", "0.57701975", "0.57701975", "0.57701975", "0.57701975", "0.57701975", "0.57701975", "0.57701975", "0.57701975", "0.57629853", "0.5751638", "0.5724767", "0.57226163", "0.5704889", "0.56960136", "0.5678993", "0.56766045", "0.56762195", "0.5672633", "0.5672501", "0.56683254", "0.5652544", "0.5652544", "0.5650031", "0.5643915", "0.5632763", "0.5632763", "0.5632763", "0.5632763" ]
0.0
-1
! The buffer module from node.js, for the browser.
function r(t,e){if(t===e)return 0;for(var n=t.length,r=e.length,i=0,o=Math.min(n,r);i<o;++i)if(t[i]!==e[i]){n=t[i],r=e[i];break}return n<r?-1:r<n?1:0}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function typedBuffer() {\n}", "function typedBuffer() {\n}", "function typedBuffer() {\n}", "function typedBuffer() {\n}", "function typedBuffer() {\n}", "function typedBuffer() {\n}", "function createBuffer() {\n var ptr = exports.hb_buffer_create();\n return {\n ptr: ptr,\n /**\n * Add text to the buffer.\n * @param {string} text Text to be added to the buffer.\n **/\n addText: function (text) {\n const str = createJsString(text);\n exports.hb_buffer_add_utf16(ptr, str.ptr, str.length, 0, str.length);\n str.free();\n },\n /**\n * Set buffer script, language and direction.\n *\n * This needs to be done before shaping.\n **/\n guessSegmentProperties: function () {\n return exports.hb_buffer_guess_segment_properties(ptr);\n },\n /**\n * Set buffer direction explicitly.\n * @param {string} direction: One of \"ltr\", \"rtl\", \"ttb\" or \"btt\"\n */\n setDirection: function (dir) {\n exports.hb_buffer_set_direction(ptr, {\n ltr: 4,\n rtl: 5,\n ttb: 6,\n btt: 7\n }[dir] || 0);\n },\n /**\n * Set buffer flags explicitly.\n * @param {string[]} flags: A list of strings which may be either:\n * \"BOT\"\n * \"EOT\"\n * \"PRESERVE_DEFAULT_IGNORABLES\"\n * \"REMOVE_DEFAULT_IGNORABLES\"\n * \"DO_NOT_INSERT_DOTTED_CIRCLE\"\n * \"PRODUCE_UNSAFE_TO_CONCAT\"\n */\n setFlags: function (flags) {\n var flagValue = 0\n flags.forEach(function (s) {\n flagValue |= _buffer_flag(s);\n })\n\n exports.hb_buffer_set_flags(ptr,flagValue);\n },\n /**\n * Set buffer language explicitly.\n * @param {string} language: The buffer language\n */\n setLanguage: function (language) {\n var str = createAsciiString(language);\n exports.hb_buffer_set_language(ptr, exports.hb_language_from_string(str.ptr,-1));\n str.free();\n },\n /**\n * Set buffer script explicitly.\n * @param {string} script: The buffer script\n */\n setScript: function (script) {\n var str = createAsciiString(script);\n exports.hb_buffer_set_script(ptr, exports.hb_script_from_string(str.ptr,-1));\n str.free();\n },\n\n /**\n * Set the Harfbuzz clustering level.\n *\n * Affects the cluster values returned from shaping.\n * @param {number} level: Clustering level. See the Harfbuzz manual chapter\n * on Clusters.\n **/\n setClusterLevel: function (level) {\n exports.hb_buffer_set_cluster_level(ptr, level)\n },\n /**\n * Return the buffer contents as a JSON object.\n *\n * After shaping, this function will return an array of glyph information\n * objects. Each object will have the following attributes:\n *\n * - g: The glyph ID\n * - cl: The cluster ID\n * - ax: Advance width (width to advance after this glyph is painted)\n * - ay: Advance height (height to advance after this glyph is painted)\n * - dx: X displacement (adjustment in X dimension when painting this glyph)\n * - dy: Y displacement (adjustment in Y dimension when painting this glyph)\n * - flags: Glyph flags like `HB_GLYPH_FLAG_UNSAFE_TO_BREAK` (0x1)\n **/\n json: function () {\n var length = exports.hb_buffer_get_length(ptr);\n var result = [];\n var infosPtr = exports.hb_buffer_get_glyph_infos(ptr, 0);\n var infosPtr32 = infosPtr / 4;\n var positionsPtr32 = exports.hb_buffer_get_glyph_positions(ptr, 0) / 4;\n var infos = heapu32.subarray(infosPtr32, infosPtr32 + 5 * length);\n var positions = heapi32.subarray(positionsPtr32, positionsPtr32 + 5 * length);\n for (var i = 0; i < length; ++i) {\n result.push({\n g: infos[i * 5 + 0],\n cl: infos[i * 5 + 2],\n ax: positions[i * 5 + 0],\n ay: positions[i * 5 + 1],\n dx: positions[i * 5 + 2],\n dy: positions[i * 5 + 3],\n flags: exports.hb_glyph_info_get_glyph_flags(infosPtr + i * 20)\n });\n }\n return result;\n },\n /**\n * Free the object.\n */\n destroy: function () { exports.hb_buffer_destroy(ptr); }\n };\n }", "function haveBuffer() {\n return typeof commonjsGlobal !== 'undefined' && typeof commonjsGlobal.Buffer !== 'undefined';\n}", "function Buffer(arg){if(!(this instanceof Buffer)){ // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\nif(arguments.length>1)return new Buffer(arg,arguments[1]);return new Buffer(arg);}if(!Buffer.TYPED_ARRAY_SUPPORT){this.length=0;this.parent=undefined;} // Common case.\nif(typeof arg==='number'){return fromNumber(this,arg);} // Slightly less common case.\nif(typeof arg==='string'){return fromString(this,arg,arguments.length>1?arguments[1]:'utf8');} // Unusual.\nreturn fromObject(this,arg);}", "function typedBuffer() {\n }", "function isBuffer(f){return!!f.constructor&&\"function\"==typeof f.constructor.isBuffer&&f.constructor.isBuffer(f)}", "function isBuffer(val){\nreturn val.constructor&&typeof val.constructor.isBuffer==='function'&&val.constructor.isBuffer(val);\n}", "function Buffer (arg) {\n\t\t if (!(this instanceof Buffer)) {\n\t\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t\t return new Buffer(arg)\n\t\t }\n\t\t\n\t\t this.length = 0\n\t\t this.parent = undefined\n\t\t\n\t\t // Common case.\n\t\t if (typeof arg === 'number') {\n\t\t return fromNumber(this, arg)\n\t\t }\n\t\t\n\t\t // Slightly less common case.\n\t\t if (typeof arg === 'string') {\n\t\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t\t }\n\t\t\n\t\t // Unusual.\n\t\t return fromObject(this, arg)\n\t\t}", "function SyncBuffer(buffer)\n{\n this.buffer = buffer;\n this.byteLength = buffer.byteLength;\n}", "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\t\n\t if (!Buffer.TYPED_ARRAY_SUPPORT) {\n\t this.length = 0\n\t this.parent = undefined\n\t }\n\t\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\t\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\t\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\t\n\t if (!Buffer.TYPED_ARRAY_SUPPORT) {\n\t this.length = 0\n\t this.parent = undefined\n\t }\n\t\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\t\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\t\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\t\n\t if (!Buffer.TYPED_ARRAY_SUPPORT) {\n\t this.length = 0\n\t this.parent = undefined\n\t }\n\t\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\t\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\t\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\t\n\t if (!Buffer.TYPED_ARRAY_SUPPORT) {\n\t this.length = 0\n\t this.parent = undefined\n\t }\n\t\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\t\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\t\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\t\n\t if (!Buffer.TYPED_ARRAY_SUPPORT) {\n\t this.length = 0\n\t this.parent = undefined\n\t }\n\t\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\t\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\t\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\t\n\t if (!Buffer.TYPED_ARRAY_SUPPORT) {\n\t this.length = 0\n\t this.parent = undefined\n\t }\n\t\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\t\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\t\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\t\n\t if (!Buffer.TYPED_ARRAY_SUPPORT) {\n\t this.length = 0\n\t this.parent = undefined\n\t }\n\t\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\t\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\t\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "function wrapBuffer(buffer) {\n return buffer;\n}", "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\n\t this.length = 0\n\t this.parent = undefined\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\n\t this.length = 0\n\t this.parent = undefined\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\n\t this.length = 0\n\t this.parent = undefined\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\n\t this.length = 0\n\t this.parent = undefined\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\n\t this.length = 0\n\t this.parent = undefined\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\n\t this.length = 0\n\t this.parent = undefined\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "function isBuffer(val) {\n return val.constructor\n && typeof val.constructor.isBuffer === 'function'\n && val.constructor.isBuffer(val);\n}", "function isBuffer(val) {\n return val.constructor\n && typeof val.constructor.isBuffer === 'function'\n && val.constructor.isBuffer(val);\n}", "function isBuffer(val) {\n return val.constructor\n && typeof val.constructor.isBuffer === 'function'\n && val.constructor.isBuffer(val);\n}", "function isBuffer(val) {\n return val.constructor\n && typeof val.constructor.isBuffer === 'function'\n && val.constructor.isBuffer(val);\n}", "function isBuffer(val) {\n return val.constructor\n && typeof val.constructor.isBuffer === 'function'\n && val.constructor.isBuffer(val);\n}", "function isBuffer(val) {\n return val.constructor\n && typeof val.constructor.isBuffer === 'function'\n && val.constructor.isBuffer(val);\n}", "function isBuffer(val) {\n return val.constructor\n && typeof val.constructor.isBuffer === 'function'\n && val.constructor.isBuffer(val);\n}", "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\n\t if (!Buffer.TYPED_ARRAY_SUPPORT) {\n\t this.length = 0\n\t this.parent = undefined\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\n\t if (!Buffer.TYPED_ARRAY_SUPPORT) {\n\t this.length = 0\n\t this.parent = undefined\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\n\t if (!Buffer.TYPED_ARRAY_SUPPORT) {\n\t this.length = 0\n\t this.parent = undefined\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\n\t if (!Buffer.TYPED_ARRAY_SUPPORT) {\n\t this.length = 0\n\t this.parent = undefined\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\n\t if (!Buffer.TYPED_ARRAY_SUPPORT) {\n\t this.length = 0\n\t this.parent = undefined\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\n\t if (!Buffer.TYPED_ARRAY_SUPPORT) {\n\t this.length = 0\n\t this.parent = undefined\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\n\t if (!Buffer.TYPED_ARRAY_SUPPORT) {\n\t this.length = 0\n\t this.parent = undefined\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\n\t if (!Buffer.TYPED_ARRAY_SUPPORT) {\n\t this.length = 0\n\t this.parent = undefined\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\n\t if (!Buffer.TYPED_ARRAY_SUPPORT) {\n\t this.length = 0\n\t this.parent = undefined\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\n\t if (!Buffer.TYPED_ARRAY_SUPPORT) {\n\t this.length = 0\n\t this.parent = undefined\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\n\t if (!Buffer.TYPED_ARRAY_SUPPORT) {\n\t this.length = 0\n\t this.parent = undefined\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\n\t if (!Buffer.TYPED_ARRAY_SUPPORT) {\n\t this.length = 0\n\t this.parent = undefined\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\n\t if (!Buffer.TYPED_ARRAY_SUPPORT) {\n\t this.length = 0\n\t this.parent = undefined\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\n\t if (!Buffer.TYPED_ARRAY_SUPPORT) {\n\t this.length = 0\n\t this.parent = undefined\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\n\t if (!Buffer.TYPED_ARRAY_SUPPORT) {\n\t this.length = 0\n\t this.parent = undefined\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\n\t if (!Buffer.TYPED_ARRAY_SUPPORT) {\n\t this.length = 0\n\t this.parent = undefined\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "function isBuffer(val) {\n return val.constructor && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val);\n}", "function isBuffer(val) {\n return val.constructor && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val);\n}", "function isBuffer(val) {\n return val.constructor && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val);\n}", "function isBuffer(val) {\n return val.constructor && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val);\n}", "function isBuffer(val) {\n return val.constructor && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val);\n}", "function isBuffer(val) {\n return val.constructor && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val);\n}", "function Buffer(arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1]);\n\t return new Buffer(arg);\n\t }\n\t\n\t if (!Buffer.TYPED_ARRAY_SUPPORT) {\n\t this.length = 0;\n\t this.parent = undefined;\n\t }\n\t\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg);\n\t }\n\t\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8');\n\t }\n\t\n\t // Unusual.\n\t return fromObject(this, arg);\n\t}", "function Buffer(arg,encodingOrOffset,length){if(!Buffer.TYPED_ARRAY_SUPPORT&&!(this instanceof Buffer)){return new Buffer(arg,encodingOrOffset,length);}// Common case.\n\tif(typeof arg==='number'){if(typeof encodingOrOffset==='string'){throw new Error('If encoding is specified then the first argument must be a string');}return allocUnsafe(this,arg);}return from(this,arg,encodingOrOffset,length);}", "function Buffer(arg,encodingOrOffset,length){if(!Buffer.TYPED_ARRAY_SUPPORT&&!(this instanceof Buffer)){return new Buffer(arg,encodingOrOffset,length);}// Common case.\nif(typeof arg==='number'){if(typeof encodingOrOffset==='string'){throw new Error('If encoding is specified then the first argument must be a string');}return allocUnsafe(this,arg);}return from(this,arg,encodingOrOffset,length);}", "function Buffer(arg,encodingOrOffset,length){if(!Buffer.TYPED_ARRAY_SUPPORT&&!(this instanceof Buffer)){return new Buffer(arg,encodingOrOffset,length);}// Common case.\nif(typeof arg==='number'){if(typeof encodingOrOffset==='string'){throw new Error('If encoding is specified then the first argument must be a string');}return allocUnsafe(this,arg);}return from(this,arg,encodingOrOffset,length);}", "function isBuffer(value) {\n var _a;\n return typeof value === 'object' && ((_a = value === null || value === void 0 ? void 0 : value.constructor) === null || _a === void 0 ? void 0 : _a.name) === 'Buffer';\n}", "function Buffer(arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1]);\n\t return new Buffer(arg);\n\t }\n\n\t this.length = 0;\n\t this.parent = undefined;\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg);\n\t }\n\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8');\n\t }\n\n\t // Unusual.\n\t return fromObject(this, arg);\n\t}", "function StringBuffer()\n{ \n this.buffer = []; \n}", "function Buffer(arg,encodingOrOffset,length){\n// Common case.\nif(typeof arg===\"number\"){if(typeof encodingOrOffset===\"string\"){throw new Error(\"If encoding is specified then the first argument must be a string\")}return allocUnsafe(arg)}return from(arg,encodingOrOffset,length)}", "function Buffer(arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1]);\n\t return new Buffer(arg);\n\t }\n\n\t if (!Buffer.TYPED_ARRAY_SUPPORT) {\n\t this.length = 0;\n\t this.parent = undefined;\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg);\n\t }\n\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8');\n\t }\n\n\t // Unusual.\n\t return fromObject(this, arg);\n\t}", "function Buffer(arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1]);\n\t return new Buffer(arg);\n\t }\n\n\t if (!Buffer.TYPED_ARRAY_SUPPORT) {\n\t this.length = 0;\n\t this.parent = undefined;\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg);\n\t }\n\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8');\n\t }\n\n\t // Unusual.\n\t return fromObject(this, arg);\n\t}", "function getBufferFromIfPresent() {\n return root.Buffer && root.Buffer.from && root.Buffer.from.bind(root.Buffer);\n}", "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n this.length = 0\n this.parent = undefined\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n this.length = 0\n this.parent = undefined\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n this.length = 0\n this.parent = undefined\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n this.length = 0\n this.parent = undefined\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n this.length = 0\n this.parent = undefined\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n this.length = 0\n this.parent = undefined\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n this.length = 0\n this.parent = undefined\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n this.length = 0\n this.parent = undefined\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n this.length = 0\n this.parent = undefined\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n this.length = 0\n this.parent = undefined\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n this.length = 0\n this.parent = undefined\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n this.length = 0\n this.parent = undefined\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n this.length = 0\n this.parent = undefined\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n this.length = 0\n this.parent = undefined\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n this.length = 0\n this.parent = undefined\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n this.length = 0\n this.parent = undefined\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n this.length = 0\n this.parent = undefined\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "function Buffer(arg,encodingOrOffset,length){// Common case.\nif(typeof arg==='number'){if(typeof encodingOrOffset==='string'){throw new TypeError('The \"string\" argument must be of type string. Received type number');}return allocUnsafe(arg);}return from(arg,encodingOrOffset,length);}// Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97", "function Buffer(arg,encodingOrOffset,length){// Common case.\nif(typeof arg==='number'){if(typeof encodingOrOffset==='string'){throw new TypeError('The \"string\" argument must be of type string. Received type number');}return allocUnsafe(arg);}return from(arg,encodingOrOffset,length);}// Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97", "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n this.length = 0\n this.parent = undefined\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n }", "function loadBuffer(url) {\n if(typeof document !== 'undefined') {\n buffer = new Uint8Array([30]);\n } else {\n buffer = fs.readFileSync(url);\n }\n}", "function DBusBuffer(buffer, startPos, options) {\n if (typeof options !== 'object') {\n options = { ayBuffer: true, ReturnLongjs: false };\n } else if (options.ayBuffer === undefined) {\n // default settings object\n options.ayBuffer = true; // enforce truthy default props\n }\n this.options = options;\n this.buffer = buffer;\n (this.startPos = startPos ? startPos : 0), (this.pos = 0);\n}", "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n if (!Buffer.TYPED_ARRAY_SUPPORT) {\n this.length = 0\n this.parent = undefined\n }\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n if (!Buffer.TYPED_ARRAY_SUPPORT) {\n this.length = 0\n this.parent = undefined\n }\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n if (!Buffer.TYPED_ARRAY_SUPPORT) {\n this.length = 0\n this.parent = undefined\n }\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n if (!Buffer.TYPED_ARRAY_SUPPORT) {\n this.length = 0\n this.parent = undefined\n }\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n if (!Buffer.TYPED_ARRAY_SUPPORT) {\n this.length = 0\n this.parent = undefined\n }\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n if (!Buffer.TYPED_ARRAY_SUPPORT) {\n this.length = 0\n this.parent = undefined\n }\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n if (!Buffer.TYPED_ARRAY_SUPPORT) {\n this.length = 0\n this.parent = undefined\n }\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n if (!Buffer.TYPED_ARRAY_SUPPORT) {\n this.length = 0\n this.parent = undefined\n }\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n if (!Buffer.TYPED_ARRAY_SUPPORT) {\n this.length = 0\n this.parent = undefined\n }\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n if (!Buffer.TYPED_ARRAY_SUPPORT) {\n this.length = 0\n this.parent = undefined\n }\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n if (!Buffer.TYPED_ARRAY_SUPPORT) {\n this.length = 0\n this.parent = undefined\n }\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}" ]
[ "0.72852165", "0.72852165", "0.72852165", "0.72852165", "0.72852165", "0.72852165", "0.72427696", "0.72012025", "0.71085495", "0.7016613", "0.68976957", "0.6876286", "0.679885", "0.6771264", "0.67562115", "0.67562115", "0.67562115", "0.67562115", "0.67562115", "0.67562115", "0.67562115", "0.6753077", "0.67449844", "0.67449844", "0.67449844", "0.67449844", "0.67449844", "0.67449844", "0.67257625", "0.67257625", "0.67257625", "0.67257625", "0.67257625", "0.67257625", "0.67257625", "0.6712553", "0.6712553", "0.6712553", "0.6712553", "0.6712553", "0.6712553", "0.6712553", "0.6712553", "0.6712553", "0.6712553", "0.6712553", "0.6712553", "0.6712553", "0.6712553", "0.6712553", "0.6712553", "0.6696887", "0.6696887", "0.6696887", "0.6696887", "0.6696887", "0.6696887", "0.6694836", "0.6689937", "0.6687484", "0.6687484", "0.66846246", "0.66740036", "0.6670869", "0.6664371", "0.6644521", "0.6644521", "0.6630525", "0.662662", "0.662662", "0.662662", "0.662662", "0.662662", "0.662662", "0.662662", "0.662662", "0.662662", "0.662662", "0.662662", "0.662662", "0.662662", "0.662662", "0.662662", "0.662662", "0.662662", "0.6590963", "0.6590963", "0.65766215", "0.6573782", "0.65562457", "0.65455794", "0.65455794", "0.65455794", "0.65455794", "0.65455794", "0.65455794", "0.65455794", "0.65455794", "0.65455794", "0.65455794", "0.65455794" ]
0.0
-1
! ignore /! ignore
function i(t,e){const n=Number(e);if(isNaN(n))throw new r("number",e,t);return n}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ignore() { }", "get Ignore() {}", "set Ignore(value) {}", "function ignore() {\n return null\n}", "function ignore() {\n return null;\n}", "function ignore() {\n return null\n }", "function IGNORE() {\r\n //Do not delete.\r\n }", "function skip(){\n\t\n}", "function ignore(){\n var b = readify('beta-ignoring', false)\n\n if (! b) {\n verb(\"Ignoring...\")\n var us = usernames()\n\n for (var i = 0; i < us.length; i++){\n var uname = us[i].children[0].textContent\n var users = ignoredUsers()\n var posts = ignoredPosts()\n\n try {\n if (users.indexOf(uname) !== -1){\n verb(\"Ignoring \" + uname)\n var e = us[i].parentNode\n e.style.display = \"none\"\n e.nextElementSibling.style.display = \"none\"\n e.nextElementSibling.nextElementSibling.style.display = \"none\"\n e.nextElementSibling.nextElementSibling.nextElementSibling.style.display = \"none\"\n\n } else if (posts !== null\n && usernamePost(us[i]).textContent.match(posts)) {\n verb(\"Ignoring post of \" + uname)\n var e = us[i].parentNode\n e.style.display = \"none\"\n e.nextElementSibling.style.display = \"none\"\n e.nextElementSibling.nextElementSibling.style.display = \"none\"\n e.nextElementSibling.nextElementSibling.nextElementSibling.style.display = \"none\"\n }\n\n } catch(e) {\n debu(e.toString())\n }\n }\n }\n}", "function skipHello(){saidHello=true;}", "function isIgnored$2 (self, path$$1) {\n if (!self.ignore.length)\n return false\n\n return self.ignore.some(function(item) {\n return item.matcher.match(path$$1) || !!(item.gmatcher && item.gmatcher.match(path$$1))\n })\n}", "addDefaultGitIgnore() {\n this.gitignore.exclude('# Byte-compiled / optimized / DLL files', '__pycache__/', '*.py[cod]', '*$py.class', '', '# C extensions', '*.so', '', '# Distribution / packaging', '.Python', 'build/', 'develop-eggs/', 'dist/', 'downloads/', 'eggs/', '.eggs/', 'lib/', 'lib64/', 'parts/', 'sdist/', 'var/', 'wheels/', 'share/python-wheels/', '*.egg-info/', '.installed.cfg', '*.egg', 'MANIFEST', '', '# PyInstaller', '# Usually these files are written by a python script from a template', '# before PyInstaller builds the exe, so as to inject date/other infos into it.', '*.manifest', '*.spec', '', '# Installer logs', 'pip-log.txt', 'pip-delete-this-directory.txt', '', '# Unit test / coverage reports', 'htmlcov/', '.tox/', '.nox/', '.coverage', '.coverage.*', '.cache', 'nosetests.xml', 'coverage.xml', '*.cover', '*.py,cover', '.hypothesis/', '.pytest_cache/', 'cover/', '', '# Translations', '*.mo', '*.pot', '', '# Django stuff:', '*.log', 'local_settings.py', 'db.sqlite3', 'db.sqlite3-journal', '', '# Flask stuff:', 'instance/', '.webassets-cache', '', '# Scrapy stuff:', '.scrapy', '', '# Sphinx documentation', 'docs/_build/', '', '# PyBuilder', '.pybuilder/', 'target/', '', '# Jupyter Notebook', '.ipynb_checkpoints', '', '# IPython', 'profile_default/', 'ipython_config.py', '', '# PEP 582; used by e.g. github.com/David-OConnor/pyflow', '__pypackages__/', '', '# Celery stuff', 'celerybeat-schedule', 'celerybeat.pid', '', '# SageMath parsed files', '*.sage.py', '', '# Environments', '.env', '.venv', 'env/', 'venv/', 'ENV/', 'env.bak/', 'venv.bak/', '', '# Spyder project settings', '.spyderproject', '.spyproject', '', '# Rope project settings', '.ropeproject', '', '# mkdocs documentation', '/site', '', '# mypy', '.mypy_cache/', '.dmypy.json', 'dmypy.json', '', '# Pyre type checker', '.pyre/', '', '# pytype static type analyzer', '.pytype/', '', '# Cython debug symbols', 'cython_debug/');\n }", "ignoreEvent(event) { return true; }", "function should_ignore(_testCase, testName) {\r\n\tif (_testCase[\"_should\"] == undefined) \r\n\t\t_testCase[\"_should\"] = {};\r\n\tif (_testCase[\"_should\"][\"ignore\"] == undefined) \r\n\t\t_testCase[\"_should\"][\"ignore\"] = {};\r\n\t_testCase[\"_should\"][\"ignore\"][testName] = true;\t\t\r\n}", "function shouldIgnoreFile(file){\n return /\\/_/.test(file)\n}", "function isIgnore(flags) {\n return (flags & FLAGS.IGNORE) === FLAGS.IGNORE;\n }", "function ignore(self) {\n return fold_(self, _index5.constVoid, _index5.constVoid);\n}", "function skip() {\n this.shouldSkip = true;\n}", "ignore(uri) {\n this.ignoredFileURIs.add(uri);\n console.log(`${uri} ignored`);\n }", "function Skip() { return Skip }", "function skip() {\n\t this.shouldSkip = true;\n\t}", "function skip() {\n\t this.shouldSkip = true;\n\t}", "function cfIgnore() {\n return file('.cfignore', 'node_modules \\nsrc \\npackage.json \\npackage-lock.json\\nconfig.yml \\ngulpfile.babel.js \\nREADME.md', {src: true})\n .pipe(gulp.dest('./dist/'));\n}", "function shouldIgnore(filename, ignore, only) {\n\t filename = _slash2[\"default\"](filename);\n\n\t if (only) {\n\t var _arr = only;\n\n\t for (var _i = 0; _i < _arr.length; _i++) {\n\t var pattern = _arr[_i];\n\t if (_shouldIgnore(pattern, filename)) return false;\n\t }\n\t return true;\n\t } else if (ignore.length) {\n\t var _arr2 = ignore;\n\n\t for (var _i2 = 0; _i2 < _arr2.length; _i2++) {\n\t var pattern = _arr2[_i2];\n\t if (_shouldIgnore(pattern, filename)) return true;\n\t }\n\t }\n\n\t return false;\n\t}", "function shouldIgnore(filename, ignore, only) {\n\t filename = _slash2[\"default\"](filename);\n\n\t if (only) {\n\t var _arr = only;\n\n\t for (var _i = 0; _i < _arr.length; _i++) {\n\t var pattern = _arr[_i];\n\t if (_shouldIgnore(pattern, filename)) return false;\n\t }\n\t return true;\n\t } else if (ignore.length) {\n\t var _arr2 = ignore;\n\n\t for (var _i2 = 0; _i2 < _arr2.length; _i2++) {\n\t var pattern = _arr2[_i2];\n\t if (_shouldIgnore(pattern, filename)) return true;\n\t }\n\t }\n\n\t return false;\n\t}", "function isIgnoredElement(ele) {\n return !ele.hasAttribute || ele.hasAttribute('data-ignore') || $(ele).parents(\"[data-ignore]\").length > 0;\n}", "function skipBlockComment () {\n i += 2;\n while (i < jsString.length && (curr() !== '*' || next() !== '/')) {\n i++;\n }\n i += 2;\n }", "function ignoreElements() {\n return function ignoreElementsOperatorFunction(source) {\n return source.lift(new IgnoreElementsOperator());\n };\n}", "function isIgnored (self, path) {\n\t if (!self.ignore.length)\n\t return false\n\t\n\t return self.ignore.some(function(item) {\n\t return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))\n\t })\n\t}", "function isIgnored (self, path) {\n\t if (!self.ignore.length)\n\t return false\n\t\n\t return self.ignore.some(function(item) {\n\t return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))\n\t })\n\t}", "function onIgnoreTagStripAll(){return\"\";}", "function __FIXME_SBean_assert_ignore_list() {\n\tthis._pname_ = \"assert_ignore_list\";\n\t//this.keywords:\t\tset[string]\t\n}", "function isIgnored (self, path) {\n if (!self.ignore.length)\n return false\n \n return self.ignore.some(function(item) {\n return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))\n })\n }", "skip(opSt) { return false; }", "function isIgnored$2 (self, path) {\n if (!self.ignore.length)\n return false\n\n return self.ignore.some(function(item) {\n return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))\n })\n}", "function shouldIgnore(filename, ignore, only) {\n filename = _slash2[\"default\"](filename);\n\n if (only) {\n var _arr = only;\n\n for (var _i = 0; _i < _arr.length; _i++) {\n var pattern = _arr[_i];\n if (_shouldIgnore(pattern, filename)) return false;\n }\n return true;\n } else if (ignore.length) {\n var _arr2 = ignore;\n\n for (var _i2 = 0; _i2 < _arr2.length; _i2++) {\n var pattern = _arr2[_i2];\n if (_shouldIgnore(pattern, filename)) return true;\n }\n }\n\n return false;\n}", "function applyTsIgnore(ast) {\n const fqn = getFqn(ast);\n if (fqnToIgnore[fqn]) {\n let description = \"\";\n if (_.isString(fqnToIgnore[fqn])) {\n description = fqnToIgnore[fqn];\n }\n return `// @ts-ignore - ${description}` + NL;\n } else {\n return \"\";\n }\n}", "function isIgnored(self, path) {\n if (!self.ignore.length) return false;\n return self.ignore.some(function (item) {\n return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path));\n });\n}", "function isIgnored (self, path) {\n\t if (!self.ignore.length)\n\t return false\n\n\t return self.ignore.some(function(item) {\n\t return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))\n\t })\n\t}", "function isIgnored (self, path) {\n\t if (!self.ignore.length)\n\t return false\n\n\t return self.ignore.some(function(item) {\n\t return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))\n\t })\n\t}", "async set_ignore(params) {\n var schema = {\n stub: { required: 'string', format: 'lowercase' },\n symbol: { required: 'string', format: 'uppercase' },\n ignored: { required: 'boolean' }\n }\n\n if (!(params = this.utils.validator(params, schema))) return false; \n\n var [stub, symbol, ignored] = this.utils.extract_props(params, ['stub', 'symbol', 'ignored']); \n\n var list = await this.config.get(stub + ':ignored');\n if (this.utils.is_array(list)) {\n if (!list.includes(symbol)) {\n list.push(symbol);\n this.set_ignore_list(stub, list);\n }\n }\n \n\n\n }", "function ignore(self, __trace) {\n return fold_(self, _index12.constVoid, _index12.constVoid, __trace);\n}", "function isIgnored (self, path) {\n if (!self.ignore.length)\n return false\n\n return self.ignore.some(function(item) {\n return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))\n })\n}", "function isIgnored (self, path) {\n if (!self.ignore.length)\n return false\n\n return self.ignore.some(function(item) {\n return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))\n })\n}", "function isIgnored (self, path) {\n if (!self.ignore.length)\n return false\n\n return self.ignore.some(function(item) {\n return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))\n })\n}", "function isIgnored (self, path) {\n if (!self.ignore.length)\n return false\n\n return self.ignore.some(function(item) {\n return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))\n })\n}", "function isIgnored (self, path) {\n if (!self.ignore.length)\n return false\n\n return self.ignore.some(function(item) {\n return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))\n })\n}", "function isIgnored (self, path) {\n if (!self.ignore.length)\n return false\n\n return self.ignore.some(function(item) {\n return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))\n })\n}", "function isIgnored (self, path) {\n if (!self.ignore.length)\n return false\n\n return self.ignore.some(function(item) {\n return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))\n })\n}", "function isIgnored (self, path) {\n if (!self.ignore.length)\n return false\n\n return self.ignore.some(function(item) {\n return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))\n })\n}", "function isIgnored (self, path) {\n if (!self.ignore.length)\n return false\n\n return self.ignore.some(function(item) {\n return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))\n })\n}", "function isIgnored (self, path) {\n if (!self.ignore.length)\n return false\n\n return self.ignore.some(function(item) {\n return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))\n })\n}", "function isIgnored (self, path) {\n if (!self.ignore.length)\n return false\n\n return self.ignore.some(function(item) {\n return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))\n })\n}", "function isIgnored (self, path) {\n if (!self.ignore.length)\n return false\n\n return self.ignore.some(function(item) {\n return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))\n })\n}", "function isIgnored (self, path) {\n if (!self.ignore.length)\n return false\n\n return self.ignore.some(function(item) {\n return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))\n })\n}", "function isIgnored (self, path) {\n if (!self.ignore.length)\n return false\n\n return self.ignore.some(function(item) {\n return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))\n })\n}", "function isIgnored (self, path) {\n if (!self.ignore.length)\n return false\n\n return self.ignore.some(function(item) {\n return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))\n })\n}", "function isIgnored (self, path) {\n if (!self.ignore.length)\n return false\n\n return self.ignore.some(function(item) {\n return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))\n })\n}", "function isIgnored (self, path) {\n if (!self.ignore.length)\n return false\n\n return self.ignore.some(function(item) {\n return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))\n })\n}", "function isIgnored (self, path) {\n if (!self.ignore.length)\n return false\n\n return self.ignore.some(function(item) {\n return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))\n })\n}", "function isIgnored (self, path) {\n if (!self.ignore.length)\n return false\n\n return self.ignore.some(function(item) {\n return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))\n })\n}", "function isIgnored (self, path) {\n if (!self.ignore.length)\n return false\n\n return self.ignore.some(function(item) {\n return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))\n })\n}", "function isIgnored (self, path) {\n if (!self.ignore.length)\n return false\n\n return self.ignore.some(function(item) {\n return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))\n })\n}", "function isIgnored (self, path) {\n if (!self.ignore.length)\n return false\n\n return self.ignore.some(function(item) {\n return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))\n })\n}", "function isIgnored (self, path) {\n if (!self.ignore.length)\n return false\n\n return self.ignore.some(function(item) {\n return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))\n })\n}", "function isIgnored (self, path) {\n if (!self.ignore.length)\n return false\n\n return self.ignore.some(function(item) {\n return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))\n })\n}", "function isIgnored (self, path) {\n if (!self.ignore.length)\n return false\n\n return self.ignore.some(function(item) {\n return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))\n })\n}", "function isIgnored (self, path) {\n if (!self.ignore.length)\n return false\n\n return self.ignore.some(function(item) {\n return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))\n })\n}", "function isIgnored (self, path) {\n if (!self.ignore.length)\n return false\n\n return self.ignore.some(function(item) {\n return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))\n })\n}", "function isIgnored (self, path) {\n if (!self.ignore.length)\n return false\n\n return self.ignore.some(function(item) {\n return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))\n })\n}", "function isIgnored (self, path) {\n if (!self.ignore.length)\n return false\n\n return self.ignore.some(function(item) {\n return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))\n })\n}", "function isIgnored (self, path) {\n if (!self.ignore.length)\n return false\n\n return self.ignore.some(function(item) {\n return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))\n })\n}", "function shouldIgnore(filename, ignore) {\n var relname = normalizeSlashes(filename);\n return ignore.some(function (x) { return x.test(relname); });\n}", "function isIgnored(self, path) {\n if (!self.ignore.length) return false;\n\n return self.ignore.some(function (item) {\n return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path));\n });\n}", "static continue(command, ignore = false, rest = null) {\n return new Flag(\"continue\", { command, ignore, rest });\n }", "function _shouldIgnore(pattern, filename) {\n\t if (typeof pattern === \"function\") {\n\t return pattern(filename);\n\t } else {\n\t return pattern.test(filename);\n\t }\n\t}", "function _shouldIgnore(pattern, filename) {\n\t if (typeof pattern === \"function\") {\n\t return pattern(filename);\n\t } else {\n\t return pattern.test(filename);\n\t }\n\t}", "function _shouldIgnore(pattern, filename) {\n\t if (typeof pattern === \"function\") {\n\t return pattern(filename);\n\t } else {\n\t return pattern.test(filename);\n\t }\n\t}", "function blockUnrequired(){\r\n\tset(\"V[z_vaxx_*]\",\"\");\r\n\tset(\"V[z_va01_*]\",\"\");\r\n}", "function notBlockUseCase() { console.log('Not an block use case');}", "dontWantToken () {\n\t\treturn true;\n\t}", "preset () { return false }", "function skipHello() {\n saidHello = true;\n}", "function skipHello() {\n saidHello = true;\n}", "function skipHello() {\n saidHello = true;\n}", "function skipHello() {\n saidHello = true;\n}", "function skipHello() {\n saidHello = true;\n}", "function ignoreInteractions() {\n\n if ( ignoreinteractions === false ) ignoreinteractions = true;\n else ignoreinteractions = false;\n\n // In any case we should redo Post Hoc tests!\n\n buildPostHocTests();\n\n }", "function skipHello()\n{\n saidHello = true;\n}", "shouldIgnoreFile(fileNameSplitByDot) {\n const isHidden = !fileNameSplitByDot[0];\n const hasNoExtension = fileNameSplitByDot.length === 1;\n return isHidden || hasNoExtension;\n }", "function hello2() {\n const bye = \"bye\";\n\n /**\n * For disable the es-lint on the line\n * Please put the below comment\n * now instead of the error we will have the warning for below 2\n */\n // eslint-disable-next-line\n console.log(\"this is sample \", bye);\n\n /**\n * disabling a particular rule for the eslint\n */\n // eslint-disable-next-line quotes\n console.log(\"this is sample \", 2323232);\n\n const a = 95;\n\n console.log(`vaylue for the a the `, a);\n}", "function noop() { } // tslint:disable-line:no-empty", "function Ne(e,t,a){return\"string\"==typeof t&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),Te(e,a||t.type,e,t),Le(t)||t.codemirrorIgnore}", "function skipHello() {\n saidHello = true;\n}", "function exclusionaryTests() {\n\tdanger.git.created_files\n\t\t.filter(filepath => filepath.endsWith('.test.js'))\n\t\t.map(filepath => ({filepath, content: readFile(filepath)}))\n\t\t.filter(\n\t\t\t({content}) =>\n\t\t\t\tcontent.includes('it.only') || content.includes('describe.only'),\n\t\t)\n\t\t.forEach(({filepath}) =>\n\t\t\twarn(\n\t\t\t\t`An <code>only</code> was left in ${filepath} – no other tests can run.`,\n\t\t\t),\n\t\t)\n}", "warn() {}", "function skipProv(p) {return (skip && (SKIP.indexOf(p)>=0));}", "function omit(track) {\n try {\n // return unmodified track if setting is turned off\n if (!Settings.Get().omit.switch) {\n return track;\n }\n else {\n // return unmodified track if the keyword list is empty\n if (Settings.Get().omit.keywords == '') {\n return track;\n }\n else {\n try {\n // split the keywords string at (',') and iterate through them\n Settings.Get().omit.keywords.split(',').forEach(function(keyword) {\n // if a match is found it will be replaced with an empty string\n track = track.replace(RegExp(Helper.RegExp.Escape(keyword), 'gi'), '');\n });\n // return the modified track \n return track;\n }\n // if no seperator has been found, assume there is only one keyword\n catch {\n // if a match is found it will be replaced with an empty string\n track = track.replace(RegExp(Helper.RegExp.Escape(Settings.Get().omit.keywords), 'gi'), '');\n return track;\n }\n }\n }\n }\n catch {\n return track;\n }\n}", "no_op() {}", "hacky(){\n return\n }", "function noop(){}// No operation performed." ]
[ "0.8653394", "0.7446816", "0.7386236", "0.7235458", "0.7168867", "0.7022659", "0.67721653", "0.64045095", "0.6191315", "0.6140491", "0.6120082", "0.61128414", "0.6085999", "0.6049541", "0.6046634", "0.6044394", "0.600617", "0.5982768", "0.59775823", "0.59717566", "0.59364134", "0.59364134", "0.5925819", "0.58979654", "0.58979654", "0.58317494", "0.58286434", "0.5818414", "0.5817855", "0.5817855", "0.5809285", "0.5805773", "0.5789093", "0.57853764", "0.57823586", "0.57697594", "0.5722749", "0.5711413", "0.5707052", "0.5707052", "0.5692417", "0.5683764", "0.56777996", "0.56777996", "0.56777996", "0.56777996", "0.56777996", "0.56777996", "0.56777996", "0.56777996", "0.56777996", "0.56777996", "0.56777996", "0.56777996", "0.56777996", "0.56777996", "0.56777996", "0.56777996", "0.56777996", "0.56777996", "0.56777996", "0.56777996", "0.56777996", "0.56777996", "0.56777996", "0.56777996", "0.56777996", "0.56777996", "0.56777996", "0.56777996", "0.56777996", "0.56777996", "0.56755036", "0.5653617", "0.5637577", "0.56288326", "0.56288326", "0.56288326", "0.56146294", "0.5609458", "0.56071323", "0.56024903", "0.558746", "0.558746", "0.558746", "0.558746", "0.558746", "0.5565302", "0.5562851", "0.55614054", "0.5551513", "0.5550493", "0.55414534", "0.55403996", "0.55378926", "0.55368525", "0.55207634", "0.5510348", "0.5503261", "0.54860777", "0.5483972" ]
0.0
-1
! Date Query casting.
function u(t){return this.cast(t)}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function convertDate() {\n // x.form['fromday-str'] = x.form['fromday'];\n // x.form['untilday-str'] = x.form['untilday'];\n if (x.form.hasOwnProperty(\"fromday\")) x.form['fromday'] = Math.abs(Date.parse(x.form['fromday']) / 1000);\n if (x.form.hasOwnProperty(\"untilday\")) x.form['untilday'] = Math.abs(Date.parse(x.form['untilday']) / 1000);\n }", "function getFormattoQueryBateria (date) {\n return date.getFullYear()\n + \"-\"\n + (\"0\" + (date.getMonth() + 1)).slice(-2)\n + \"-\"\n + (\"0\" + date.getDate()).slice(-2);\n}", "toModel(date) {\n return date && isInteger(date.year) && isInteger(date.month) && isInteger(date.day) ? this._toNativeDate(date) :\n null;\n }", "function isDate(input) {\n return input && input.getDate && !isNaN(input.valueOf());\n }", "function dateToDB(date) {\n //usamos librería moment para dar formato sql\n const dateSQL = moment(date).format(\"YYYY-MM-DD\");\n //devolvemos la fecha\n return dateSQL;\n\n}", "function convertDate(fetchedDate) {\n\n var date = new Date(fetchedDate * 1000);\n var year = date.getFullYear();\n var month = date.getMonth() +1;\n var day = date.getDate();\n var convertedDate = month + \"/\" + day + \"/\" + year;\n // displayedDate.append(convertedDate);\n return convertedDate\n}", "toModel(date) {\n return (date && isInteger(date.year) && isInteger(date.month) && isInteger(date.day)) ?\n { year: date.year, month: date.month, day: date.day } :\n null;\n }", "function convertDate(eventDate) {\r\r\n \tvar myDate = new Date(eventDate);\r\r\n return myDate;\r\r\n }", "D (date) {\n return date.getDate()\n }", "function dateFromSQL(dateString) {\n if(dateString == \"\")\n return \"\";\n\n var month = dateString.slice(5, 7);\n var day = dateString.slice(-2);\n var year = dateString.slice(0, 4);\n\n return (day + \"/\" + month + \"/\" + year);\n }", "function convertDate(date) {\n if (date instanceof Date) {\n return moment(date);\n } else if ((typeof date) == 'string') {\n if (date.indexOf(\"-\") > 0) {\n return moment(new Date(date));\n } else {\n return moment(date, scope.locale.format);\n }\n } else if ((typeof date) == 'number') {\n return moment(date);\n } else if (moment.isMoment(date)) {\n return date;\n }\n }", "function toDate(value){if(isDate(value)){return value;}if(typeof value==='number'&&!isNaN(value)){return new Date(value);}if(typeof value==='string'){value=value.trim();var parsedNb=parseFloat(value);// any string that only contains numbers, like \"1234\" but not like \"1234hello\"\nif(!isNaN(value-parsedNb)){return new Date(parsedNb);}if(/^(\\d{4}-\\d{1,2}-\\d{1,2})$/.test(value)){/* For ISO Strings without time the day, month and year must be extracted from the ISO String\n before Date creation to avoid time offset and errors in the new Date.\n If we only replace '-' with ',' in the ISO String (\"2015,01,01\"), and try to create a new\n date, some browsers (e.g. IE 9) will throw an invalid Date error.\n If we leave the '-' (\"2015-01-01\") and try to create a new Date(\"2015-01-01\") the timeoffset\n is applied.\n Note: ISO months are 0 for January, 1 for February, ... */var _a=Object(tslib__WEBPACK_IMPORTED_MODULE_1__[\"__read\"])(value.split('-').map(function(val){return+val;}),3),y=_a[0],m=_a[1],d=_a[2];return new Date(y,m-1,d);}var match=void 0;if(match=value.match(ISO8601_DATE_REGEX)){return isoStringToDate(match);}}var date=new Date(value);if(!isDate(date)){throw new Error(\"Unable to convert \\\"\"+value+\"\\\" into a date\");}return date;}", "function formatMySQL2JSDate(mysql_date) {\n\n var t, result = null;\n\n if (typeof mysql_date === 'string')\n {\n t = mysql_date.split(/[- :]/);\n\n //when t[3], t[4] and t[5] are missing they defaults to zero\n result = new Date(t[0], t[1] - 1, t[2], t[3] || 0, t[4] || 0, t[5] || 0);\n }\n\n return result;\n }", "function dateToSQL(dateString) {\n if(dateString == \"\")\n return \"\";\n\n var month = dateString.slice(0, 2);\n var day = dateString.slice(3, 5);\n var year = dateString.slice(-4);\n\n return (year + \"/\" + month + \"/\" + day);\n }", "function convertDate(input)\r\n {\r\n function pad(s) { return (s < 10) ? '0' + s : s; }\r\n var d = new Date(input);\r\n return [d.getFullYear(), pad(d.getMonth()+1), pad(d.getDate())].join('-');\r\n }", "fromModel(date) {\n return (date && isInteger(date.year) && isInteger(date.month) && isInteger(date.day)) ?\n { year: date.year, month: date.month, day: date.day } :\n null;\n }", "function setupDateQuery( params ) {\n if( 'all' !== params.dateFrom ) {\n // we will not always provide a time range\n if( !params.duration && !params.dateTo ) {\n params.duration = 'day';\n }\n\n if( 'now' === params.dateFrom ) {\n params.dateFrom = moment();\n } else if( 'today' === params.dateFrom ) {\n params.dateFrom = moment().startOf( 'day' );\n }\n\n if( params.duration ) {\n params.dateFrom = moment( params.dateFrom );\n if( !params.dateFrom.isValid() ) {\n return false;\n }\n }\n }\n return true;\n }", "fromModel(date) {\n return (date instanceof Date && !isNaN(date.getTime())) ? this._fromNativeDate(date) : null;\n }", "function toSQLDate(fechaInput) {\r\n var fechaFormato = new Date(fechaInput + 'T12:00-0500');\r\n var fecha = fechaFormato.toDateString().substr(4, 11);\r\n fecha = fecha.replace('' + fechaFormato.getDate(), '' + (fechaFormato.getDate()) + ',');\r\n fecha = fecha.replace(fecha.substr(0, 3), traducirMes(fecha.substr(0, 3)));\r\n return fecha;\r\n}", "function prepareQueryDates() {\n var userProperties = PropertiesService.getUserProperties();\n var configurationData = userProperties.getProperties();\n\n var startDateHTML = isoToDate(configurationData.StartDate);\n var endDateHTML = isoToDate(configurationData.EndDate);\n\n var startDate = new Date(startDateHTML);\n var endDate = new Date(endDateHTML);\n\n var startDateMil = startDate.getTime();\n var endDateMil = endDate.getTime();\n\n // Set the unit values in milliseconds.\n var msecPerMinute = 1000 * 60;\n var msecPerHour = msecPerMinute * 60;\n var msecPerDay = msecPerHour * 24;\n var daysInData = (endDate - startDate) / msecPerDay;\n\n var dateObj = {\n startDate: startDate,\n startDateHTML: startDateHTML,\n startDateMil: startDateMil,\n endDate: endDate,\n endDateHTML: endDateHTML,\n endDateMil: endDateMil,\n daysInData: daysInData,\n msecPerDay: msecPerDay\n };\n\n return dateObj;\n\n}", "function convertDataFrom(dateStr) {\n\tif(dateStr == '' || dateStr == null){\n\t\treturn '';\n\t}\n var parts = dateStr.split(\"/\");\n var sqlDate = parts[2] + \"-\" + parts[1] + \"-\" + parts[0];\n return sqlDate;\n}", "function convertToSQLDateFormat(dayConversion){\n var todayDate = new Date();\n var today = todayDate.getDay();\n var dayOffset = 0;\n \n if (dayConversion < today) {\n dayOffset = dayConversion - today + 7;\n } else if (dayConversion > today) {\n dayOffset = dayConversion - today;\n }\n \n todayDate.setDate(todayDate.getDate() + dayOffset);\n console.log(todayDate);\n \n \n // Storing the month and day, for preliminary conversion to\n // an SQL-friendly format. JavaScript's Date.getMonth() method\n // returns the number of the month from 0 - 11, hence the \n // addition to account for it.\n var monthFormat = todayDate.getMonth() + 1;\n var dayFormat = todayDate.getDate();\n \n \n // The added 0 at the beginning if the month or date number is\n // less than two digits long.\n if(monthFormat < 10) {\n monthFormat = `0${monthFormat}`;\n }\n \n if(dayFormat < 10) {\n dayFormat = `0${todayDate.getDate()}`;\n }\n\n // The final, fully converted date ready for SQL querying.\n var dateConverted = `${todayDate.getFullYear()}-${monthFormat}-${dayFormat}`;\n \n console.log(dateConverted);\n return dateConverted;\n }", "dateConverter(tempdate) {\n var converted = parseInt((tempdate.replace(\"/Date(\", \"\").replace(\")/\", \"\")));\n var temp = new Date(converted);\n var date = (temp.getDate() + \"/\" + (temp.getMonth() + 1) + \"/\" + temp.getFullYear()).toString();\n return date;\n }", "function convertDataTo(dateStr) {\n\tif(dateStr == '' || dateStr == null){\n\t\treturn '';\n\t}\n var parts = dateStr.split(\"-\");\n var sqlDate = parts[2] + \"/\" + parts[1] + \"/\" + parts[0];\n return sqlDate;\n}", "function dateConversion(toConvert, convertTo) { \n if(convertTo == 'date') {\n var d = new Date(toConvert);\n var month = (d.getMonth() + 1).toString();\n month = month.length == 1 ? \"0\" + month : month;\n var day = d.getDate().toString();\n day = day.length == 1 ? \"0\" + day : day;\n \n return month + \"/\" + day + \"/\" + d.getFullYear();\n } else if(convertTo == 'epoch') {\n return Date.parse(toConvert).getTime();\n }\n}", "function datam(c,q){\n\tif (c) {\n\t\tif (validata(c)){\t\n\t\t\tvar ano = '' + c.value.substring(6,10);\n\t\t\tvar mes = '' + Math.floor(c.value.substring(3,5))-1;\n\t\t\tvar dia = '' + c.value.substring(0,2);\n\t\t\tvar data=new Date(ano,mes,dia);\n\t\t\tdata.setDate(data.getDate()+q);\n\t\t\tdia=data.getDate();\n\t\t\tif (dia<10){\tdia='0'+dia; }\n\t\t\tmes=data.getMonth()+1;\t\t\t\n\t\t\tif (mes<10){\tmes='0'+mes; }\n\t\t\tano=data.getYear();\n\t\t\tnData=dia+'/'+mes+'/'+ano;\n\t\t\tc.value=nData;\n\t\t\treturn true;\n\t\t}\n\t}\n}", "function convertionDate(daty)\n { \n var date_final = null; \n if(daty!='Invalid Date' && daty!='' && daty!=null)\n {\n console.log(daty);\n var date = new Date(daty);\n var jour = date.getDate();\n var mois = date.getMonth()+1;\n var annee = date.getFullYear();\n if(mois <10)\n {\n mois = '0' + mois;\n }\n date_final= annee+\"-\"+mois+\"-\"+jour;\n }\n return date_final; \n }", "function unsafeStringToDate() {\n return operator_1.cast(string_1.string(), function (str) { return new Date(str); }, instance_of_date_1.instanceOfDate());\n}", "function formatDate1(data) {\n var selectDate = new Date(data);\n selectDate = ((selectDate.getMonth() + 1) + '/' + selectDate.getDate() + '/' + selectDate.getFullYear());\n\n //take care of null dates\n if (selectDate === \"12/31/1969\")\n selectDate = \"\"\n else\n selectDate = selectDate;\n return selectDate;\n}", "function convertDate(caregiver) {\n caregiver.created = new Date(caregiver.created).getTime();\n caregiver.DOB = new Date(caregiver.DOB).getTime();\n return caregiver;\n }", "function convertDate(date) {\n return \"\" + new Date(date).getDate() + \".\" + (new Date(date).getMonth()+1) + \".\" + new Date(date).getFullYear(); \n }", "function getFormattoQueryBalance (date) {\n return date.getFullYear()\n + \"-\"\n + (\"0\" + (date.getMonth() + 1)).slice(-2)\n + \"-\"\n + (\"0\" + date.getDate()).slice(-2);\n}", "value2date(value) {\n switch (this.valueType) {\n case 'date':\n return value instanceof Date ? new Date(value.getTime()) : new Date(NaN);\n case 'timestamp':\n return typeof value === 'number' ? new Date(value) : new Date(NaN);\n case 'format':\n return typeof value === 'string' ? this.parseDate(value) : new Date(NaN);\n default:\n return typeof value === 'string' ? this.parseDate(value, this.valueType) : new Date(NaN);\n }\n }", "function createDateStrForDBRequest(date){\n var year = date.getFullYear().toString();\n var tmpMonth = date.getMonth() + 1; \n var month = tmpMonth>9 ? tmpMonth.toString() : ('0'+tmpMonth.toString());\n var tmpDay = date.getDate();\n var day = tmpDay>9 ? date.getDate().toString() : ('0'+tmpDay.toString());\n return year+'-'+month+'-'+day;\n}", "function createDateStrForDBRequest(date){\n var year = date.getFullYear().toString();\n var tmpMonth = date.getMonth() + 1; \n var month = tmpMonth>9 ? tmpMonth.toString() : ('0'+tmpMonth.toString());\n var tmpDay = date.getDate();\n var day = tmpDay>9 ? date.getDate().toString() : ('0'+tmpDay.toString());\n return year+'-'+month+'-'+day;\n}", "function set_date(){\n var query = getQueryParams(document.location.search),\n date_num = query.date,\n today,\n year, day, month, divided, divided_2;\n\n if(date_num == '' || date_num == undefined){\n var today = new Date().toDateString();\n }else{\n divided = date_num.match(/.{1,4}/g);\n year = divided[1];\n divided_2 = divided[0].match(/.{1,2}/g);\n month = divided_2[0];\n day = divided_2[1];\n today = new Date(year, month, day).toDateString();\n }\n $('#date').html(today);\n }", "date2value(date) {\n if (!isValidDate(date)) return null;\n switch (this.valueType) {\n case 'date':\n return date;\n case 'timestamp':\n return date.getTime();\n case 'format':\n return this.formatDate(date);\n default:\n return this.formatDate(date, this.valueType);\n }\n }", "function dateAsStringFilter() {\n return function (date) {\n return moment(date).toDate();\n };\n }", "asDate(fields) {\n this.dateFields = fields;\n return this;\n }", "function isDate(p_Expression){\nreturn !isNaN(new Date(p_Expression));// <<--- this needs checking\n}", "function asDate (value) {\n if (value instanceof Date) {\n return value;\n }\n return _utils_util__WEBPACK_IMPORTED_MODULE_1__[\"msToDate\"](value * 1000);\n}", "function GetDateForQuery(index) {\n var chuoisearch = \"\";\n var fd = \" \", td = \" \";\n var today = new Date();\n switch (index) {\n case 0:\n fd = td = (today.getDate() + '/' + (today.getMonth() + 1) + '/' + today.getFullYear());\n chuoisearch = \"_\" + fd + \"_\" + td + \"_false\";\n return chuoisearch;\n case 1:\n fd = (today.getDate() + '/' + (today.getMonth() + 1) + '/' + today.getFullYear());\n today.setDate(today.getDate() + 1)\n td = (today.getDate() + '/' + (today.getMonth() + 1) + '/' + today.getFullYear());\n chuoisearch = \"_\" + fd + \"_\" + td + \"_false\";\n return chuoisearch;\n case 2:\n var dayOfWeekStartingSundayZeroIndexBased = today.getDay(); // 0 : Sunday ,1 : Monday,2,3,4,5,6 : Saturday\n var mondayOfWeek = new Date(today.getFullYear(), today.getMonth(), today.getDate() - today.getDay() + 1);\n var sundayOfWeek = new Date(today.getFullYear(), today.getMonth(), today.getDate() - today.getDay() + 7);\n fd = (mondayOfWeek.getDate() + '/' + (mondayOfWeek.getMonth() + 1) + '/' + mondayOfWeek.getFullYear());\n td = (sundayOfWeek.getDate() + '/' + (sundayOfWeek.getMonth() + 1) + '/' + sundayOfWeek.getFullYear());\n chuoisearch = \"_\" + fd + \"_\" + td + \"_false\";\n return chuoisearch;\n default:\n chuoisearch = \"_\" + fd + \"_\" + td + \"_false\";\n return chuoisearch;\n }\n}", "convertNewDateToDateType() {\n var date = new Date(); // today's date\n var year = date.getFullYear();\n var month = 1 + date.getMonth();\t// adding 1 makes month accurate January = 1 + 0 = 1 and December = 1 + 11 = 12\n month = ('0' + month).slice(-2);\t// adding 0 makes single digit months 2 digit so that you get last 2 digits i.e. 2 -> 02 and 11 -> 11\n var day = date.getDate();\n day = ('0' + day).slice(-2);\t\t// single digit day such as 2 becomes two digit day 02\n return year + '-' + month + '-' + day;\n }", "function convertDates(d) {\n\tfor (var i = d.length; i--;)\n\t\tconvertDateObj(d[i]);\n\treturn d;\n}", "function changeFieldDateToJavascriptDate(dateValue) {\n return jq.datepicker.formatDate('mm/dd/yy', jq.datepicker.parseDate('yy-mm-dd', dateValue));\n}", "toNativeDate(date) {\n\t\treturn new Date(date.year, date.month - 1, date.day);\n\t}", "function queryEqualDate(path,key,date,criteria){\n\t\tif(!(date==null || date==\"\")) {\n\t\t\tstartAt=date+\"T00:00:00\";\n\t\t\tendAt=date+\" 23:59:59\";\n\t\t\tqueryBetween(path,key,startAt,endAt,criteria)\n\t\t}\n\t\telse throw {\"message\":\"Date cannot be null\"};\n\t}", "function es_date(d) {\n var month = d.getMonth()+1;\n var day = d.getDate();\n var o = (day<10 ? '0' : '') + day + '/' + (month<10 ? '0' : '') + month + '/' + d.getFullYear();\n return o;\n}", "function dlgQuery(){\r\n\tvar day = rl.getComp(\"queryDay\").getValue(),\r\n\t\turl = combineQueryUrl(nf.queryDialog.requestingUrl, day);\r\n\t\r\n\tif(!rl.isNonNullStr(day)){\r\n\t\talert(\"请选择日期!\");\r\n\t\treturn ;\r\n\t}\r\n\tnf.queryReq.query(url);\r\n}", "function dateTimeExpr(d, normalize) {\n if (normalize === void 0) { normalize = false; }\n var units = [];\n if (normalize && d.day !== undefined) {\n if (util_1.keys(d).length > 1) {\n log.warn(log.message.droppedDay(d));\n d = util_1.duplicate(d);\n delete d.day;\n }\n }\n if (d.year !== undefined) {\n units.push(d.year);\n }\n else if (d.day !== undefined) {\n // Set year to 2006 for working with day since January 1 2006 is a Sunday\n units.push(SUNDAY_YEAR);\n }\n else {\n units.push(0);\n }\n if (d.month !== undefined) {\n var month = normalize ? normalizeMonth(d.month) : d.month;\n units.push(month);\n }\n else if (d.quarter !== undefined) {\n var quarter = normalize ? normalizeQuarter(d.quarter) : d.quarter;\n units.push(quarter + '*3');\n }\n else {\n units.push(0); // months start at zero in JS\n }\n if (d.date !== undefined) {\n units.push(d.date);\n }\n else if (d.day !== undefined) {\n // HACK: Day only works as a standalone unit\n // This is only correct because we always set year to 2006 for day\n var day = normalize ? normalizeDay(d.day) : d.day;\n units.push(day + '+1');\n }\n else {\n units.push(1); // Date starts at 1 in JS\n }\n // Note: can't use TimeUnit enum here as importing it will create\n // circular dependency problem!\n for (var _i = 0, _a = ['hours', 'minutes', 'seconds', 'milliseconds']; _i < _a.length; _i++) {\n var timeUnit = _a[_i];\n if (d[timeUnit] !== undefined) {\n units.push(d[timeUnit]);\n }\n else {\n units.push(0);\n }\n }\n if (d.utc) {\n return \"utc(\" + units.join(', ') + \")\";\n }\n else {\n return \"datetime(\" + units.join(', ') + \")\";\n }\n}", "filterBySearchDate(fieldName, operator, searchTerms, version) {\n let query = '';\n let searchValues;\n if (Array.isArray(searchTerms) && searchTerms.length > 1) {\n searchValues = searchTerms;\n if (operator !== OperatorType.rangeExclusive && operator !== OperatorType.rangeInclusive) {\n operator = this._gridOptions.defaultFilterRangeOperator;\n }\n }\n // single search value\n if (!Array.isArray(searchValues) && Array.isArray(searchTerms) && searchTerms.length === 1 && searchTerms[0]) {\n const searchValue1 = this.odataQueryVersionWrapper('dateTime', version, fieldName, parseUtcDate(searchTerms[0], true));\n if (searchValue1) {\n return `${fieldName} ${this.mapOdataOperator(operator)} ${searchValue1}`;\n }\n }\n // multiple search value (date range)\n if (Array.isArray(searchValues) && searchValues.length === 2 && searchValues[0] && searchValues[1]) {\n // date field needs to be UTC and within DateTime function\n const searchValue1 = this.odataQueryVersionWrapper('dateTime', version, fieldName, parseUtcDate(searchValues[0], true));\n const searchValue2 = this.odataQueryVersionWrapper('dateTime', version, fieldName, parseUtcDate(searchValues[1], true));\n if (searchValue1 && searchValue2) {\n if (operator === OperatorType.rangeInclusive) {\n // example:: (Finish >= DateTime'2019-08-11T00:00:00Z' and Finish <= DateTime'2019-09-12T00:00:00Z')\n query = `(${fieldName} ge ${searchValue1} and ${fieldName} le ${searchValue2})`;\n }\n else if (operator === OperatorType.rangeExclusive) {\n // example:: (Finish > DateTime'2019-08-11T00:00:00Z' and Finish < DateTime'2019-09-12T00:00:00Z')\n query = `(${fieldName} gt ${searchValue1} and ${fieldName} lt ${searchValue2})`;\n }\n }\n }\n return query;\n }", "filterBySearchDate(fieldName, operator, searchTerms, version) {\n let query = '';\n let searchValues;\n if (Array.isArray(searchTerms) && searchTerms.length > 1) {\n searchValues = searchTerms;\n if (operator !== OperatorType.rangeExclusive && operator !== OperatorType.rangeInclusive) {\n operator = this._gridOptions.defaultFilterRangeOperator;\n }\n }\n // single search value\n if (!Array.isArray(searchValues) && Array.isArray(searchTerms) && searchTerms.length === 1 && searchTerms[0]) {\n const searchValue1 = this.odataQueryVersionWrapper('dateTime', version, fieldName, parseUtcDate(searchTerms[0], true));\n if (searchValue1) {\n return `${fieldName} ${this.mapOdataOperator(operator)} ${searchValue1}`;\n }\n }\n // multiple search value (date range)\n if (Array.isArray(searchValues) && searchValues.length === 2 && searchValues[0] && searchValues[1]) {\n // date field needs to be UTC and within DateTime function\n const searchValue1 = this.odataQueryVersionWrapper('dateTime', version, fieldName, parseUtcDate(searchValues[0], true));\n const searchValue2 = this.odataQueryVersionWrapper('dateTime', version, fieldName, parseUtcDate(searchValues[1], true));\n if (searchValue1 && searchValue2) {\n if (operator === OperatorType.rangeInclusive) {\n // example:: (Finish >= DateTime'2019-08-11T00:00:00Z' and Finish <= DateTime'2019-09-12T00:00:00Z')\n query = `(${fieldName} ge ${searchValue1} and ${fieldName} le ${searchValue2})`;\n }\n else if (operator === OperatorType.rangeExclusive) {\n // example:: (Finish > DateTime'2019-08-11T00:00:00Z' and Finish < DateTime'2019-09-12T00:00:00Z')\n query = `(${fieldName} gt ${searchValue1} and ${fieldName} lt ${searchValue2})`;\n }\n }\n }\n return query;\n }", "function date (data) {\n return instanceStrict(data, Date) && integer(data.getTime());\n }", "function dateTimeExpr(d, normalize) {\n if (normalize === void 0) { normalize = false; }\n var units = [];\n if (normalize && d.day !== undefined) {\n if (keys(d).length > 1) {\n warn(message.droppedDay(d));\n d = duplicate(d);\n delete d.day;\n }\n }\n if (d.year !== undefined) {\n units.push(d.year);\n }\n else if (d.day !== undefined) {\n // Set year to 2006 for working with day since January 1 2006 is a Sunday\n units.push(SUNDAY_YEAR);\n }\n else {\n units.push(0);\n }\n if (d.month !== undefined) {\n var month = normalize ? normalizeMonth(d.month) : d.month;\n units.push(month);\n }\n else if (d.quarter !== undefined) {\n var quarter$$1 = normalize ? normalizeQuarter(d.quarter) : d.quarter;\n units.push(quarter$$1 + '*3');\n }\n else {\n units.push(0); // months start at zero in JS\n }\n if (d.date !== undefined) {\n units.push(d.date);\n }\n else if (d.day !== undefined) {\n // HACK: Day only works as a standalone unit\n // This is only correct because we always set year to 2006 for day\n var day = normalize ? normalizeDay(d.day) : d.day;\n units.push(day + '+1');\n }\n else {\n units.push(1); // Date starts at 1 in JS\n }\n // Note: can't use TimeUnit enum here as importing it will create\n // circular dependency problem!\n for (var _i = 0, _a = ['hours', 'minutes', 'seconds', 'milliseconds']; _i < _a.length; _i++) {\n var timeUnit = _a[_i];\n if (d[timeUnit] !== undefined) {\n units.push(d[timeUnit]);\n }\n else {\n units.push(0);\n }\n }\n if (d.utc) {\n return \"utc(\" + units.join(', ') + \")\";\n }\n else {\n return \"datetime(\" + units.join(', ') + \")\";\n }\n }", "function DateUtils() {}", "function DateHelper() {}", "function convertToDate(dateVar) {\n\t\tvar dd = dateVar.getDate();\n\t\tvar mm = dateVar.getMonth() + 1; //January is 0!\n\n\t\tvar yyyy = dateVar.getFullYear();\n\t\tif(dd<10) {\n\t\t\tdd='0'+dd\n\t\t} \n\t\tif(mm<10) {\n\t\t\tmm='0'+mm\n\t\t} \n\t\tvar dateVar = dd+'-'+mm+'-'+yyyy;\n\t\treturn dateVar;\n\t}", "function result(date){\n return {\n unix: (new Date(date).getTime()/1000),\n natural: date\n }\n}", "static _extractDateParts(date){return{day:date.getDate(),month:date.getMonth(),year:date.getFullYear()}}", "function setdate(d){\n\treturn d3.time.format('%d %b %Y')(d3.time.format('%Y%m%d').parse(d));\n}", "updateToDate(date) {\n var dateStringTo = date._d;\n var dateObjTo = new Date(dateStringTo);\n var momentObjTo = Moment(dateObjTo);\n var momentStringTo = momentObjTo.format('YYYY-MM-DD');\n this.setState({ selectedToDate: momentStringTo });\n }", "function formatDate2(date) {\n if (date != null) {\n var selectDate = new Date(date);\n selectDate = ((selectDate.getMonth() + 1) + '/' + selectDate.getDate() + '/' + selectDate.getFullYear() +\n \" \" + selectDate.getHours() + \":\" + selectDate.getMinutes() + \":\" + selectDate.getSeconds());\n }\n return selectDate;\n}", "function convertToDate(time) {\n if (angular.isDate(time)) {\n return time;\n }\n\n return new Date(\"1/1/1900 \" + time);\n }", "function cdr_type_date_text(date) {\n let result = null;\n\n if (date) {\n let temp = moment(date).format(`YYYY-MM-DD`);\n result = temp;\n }\n\n return result;\n}", "Qo (date) {\n return getOrdinal(this.Q(date))\n }", "getDate(event) {\n this.registro.year = event.year;\n this.registro.month = event.monthIndex;\n this.isSelect = new Date(this.registro.year, this.registro.month);\n this.valiDate();\n }", "function dayFromDate(dateIn)\r\n{\r\n return dateIn.getDate();\r\n}", "function frmt_date(a,field) {\n for(var i=0; i < a.length; i++){\n if( ! a[i][field] ) { continue }\n var d = new Date(a[i][field] * 1000)\n a[i][field] = d.toISOString().substr(0,16).replace('T',' ')\n }\n return(a)\n}", "function dateTimeExpr(d, normalize = false) {\n\t const units = [];\n\t if (normalize && d.day !== undefined) {\n\t if (keys(d).length > 1) {\n\t warn(message.droppedDay(d));\n\t d = duplicate(d);\n\t delete d.day;\n\t }\n\t }\n\t if (d.year !== undefined) {\n\t units.push(d.year);\n\t }\n\t else if (d.day !== undefined) {\n\t // Set year to 2006 for working with day since January 1 2006 is a Sunday\n\t units.push(SUNDAY_YEAR);\n\t }\n\t else {\n\t units.push(0);\n\t }\n\t if (d.month !== undefined) {\n\t const month = normalize ? normalizeMonth(d.month) : d.month;\n\t units.push(month);\n\t }\n\t else if (d.quarter !== undefined) {\n\t const quarter = normalize ? normalizeQuarter(d.quarter) : d.quarter;\n\t units.push(quarter + '*3');\n\t }\n\t else {\n\t units.push(0); // months start at zero in JS\n\t }\n\t if (d.date !== undefined) {\n\t units.push(d.date);\n\t }\n\t else if (d.day !== undefined) {\n\t // HACK: Day only works as a standalone unit\n\t // This is only correct because we always set year to 2006 for day\n\t const day = normalize ? normalizeDay(d.day) : d.day;\n\t units.push(day + '+1');\n\t }\n\t else {\n\t units.push(1); // Date starts at 1 in JS\n\t }\n\t // Note: can't use TimeUnit enum here as importing it will create\n\t // circular dependency problem!\n\t for (const timeUnit of ['hours', 'minutes', 'seconds', 'milliseconds']) {\n\t if (d[timeUnit] !== undefined) {\n\t units.push(d[timeUnit]);\n\t }\n\t else {\n\t units.push(0);\n\t }\n\t }\n\t if (d.utc) {\n\t return `utc(${units.join(', ')})`;\n\t }\n\t else {\n\t return `datetime(${units.join(', ')})`;\n\t }\n\t}", "convertToDateStrings(obj) {\n\n if(!ParserHelper.isContainer(obj)) {\n return obj;\n }\n\n _.each(obj, function(value, key){\n\n if(ParserHelper.isContainer(value)){\n ParserHelper.convertToDateStrings(value);\n\n }\n\n if(_.isDate(value)) {\n obj[key] = moment(value).format('YYYY-MM-DD');\n }\n\n }, this);\n\n }", "function datePickerDateConverter(date){\r\n dateF = date.trim();\r\n let d = dateF.substring(0, 2);\r\n let m = dateF.substring(3,5);\r\n let y = dateF.substring(6,10);\r\n return(y +\"-\"+m+\"-\"+d);\r\n}", "function selectDate(ufo) {\n return ufo.datetime == inputValue;\n}", "function xx(e) { return x(e.date); }", "function get_publication_date_query(){\n let query = [];\n\n let minDate = document.getElementById(\"minDate\").value;\n let maxDate = document.getElementById(\"maxDate\").value;\n let tmp = 0;\n\n if ((new Date(minDate).getTime() > new Date(maxDate).getTime())){\n tmp = minDate;\n minDate = maxDate;\n maxDate = tmp\n }\n\n query.push(\"minDate=\"+minDate);\n query.push(\"maxDate=\"+maxDate);\n console.log(query);\n return query.join(\"&\");\n}", "function _dateCoerce(obj) {\n return obj.toISOString();\n}", "function joliDate(d){\n var date = d;//d is a date object if d is a text we an use var date = new Date(d);\n return zero(date.getDate())+\"/\"+zero((date.getMonth()+1))+\"/\"+date.getFullYear();\n}", "function convertDateObj(d) {\n\td.start_date = new Date(d.start_date);\n\tif (d.end_date !== null)\n\t\td.end_date = new Date(d.end_date);\n\treturn d;\n}", "function CIU_Date(op, data, rowDef) {\n switch (op) {\n case \"format\":\n return \"2016/01/01\";\n\n default:\n };\n}", "getDate() {\n const paramDate = this.props.match.params.date;\n const today = new Date().toISOString().slice(0, 10);\n const date = (paramDate === undefined) ? String(today) : paramDate;\n return date;\n }", "function convertDate(){\n\t\tvar mArray = [\"Jan\",\"Feb\",\"Mar\",\"Apr\",\"May\",\"Jun\",\"Jul\",\"Aug\",\"Sep\",\"Oct\",\"Nov\",\"Dec\"];\n\t\tvar rawDateNow = new Date();\n\t\tvar tYear = addLeadingZero(rawDateNow.getFullYear());\n\t\tvar tMonth = rawDateNow.getMonth();\n\t\tvar tDay = addLeadingZero(rawDateNow.getDay())\n\t\tvar tHour = addLeadingZero(rawDateNow.getHours());\n\t\tvar tMin = addLeadingZero(rawDateNow.getMinutes());\n\t\tvar tSec = addLeadingZero(rawDateNow.getSeconds());\n\t\tfunction addLeadingZero(x){\n\t\t\treturn(x < 10 ? \"0\" + x : x)\n\t\t}\n\t\treturn tDay + \"-\" + mArray[tMonth] + \"-\" + tYear + \" \" + tHour + \":\" + tMin + \":\" + tSec;\n\t}", "function type(d, _, columns) {\n d.date = parseTime(d.date);\n return d;\n}", "function dateToAussieString(d){\r\n return d.getDate() + \"/\" + (d.getMonth() + 1) + \"/\" + d.getFullYear();\r\n}", "function massageDate(aDate) {\n return DateService.convertJSONToMMDDYYYYDate(aDate);\n }", "function dateSelect() {\r\n // Prevent the page from refreshing\r\n event.preventDefault();\r\n\r\n // change date format to datetime\r\n tableData.forEach(row => row.datetime = new Date(row.datetime));\r\n\r\n // save user input\r\n // d3 object\r\n var userDate = d3.select('#datetime').property('value');\r\n console.log(userDate);\r\n // format to datetime\r\n var userDateFormatted = new Date(userDate);\r\n console.log(userDateFormatted);\r\n\r\n // filter data table by user input\r\n // add if else to enable non-date searches\r\n if (userDate !== '') {\r\n var newData = tableData.filter(function(row) {\r\n var rowDate = row.datetime;\r\n return rowDate.getTime() === userDateFormatted.getTime();\r\n });\r\n }\r\n\r\n else {\r\n var newData = tableData;\r\n };\r\n \r\n var finalData = filterSightings(newData);\r\n console.log(finalData);\r\n\r\n // populate table\r\n tableAppend(finalData);\r\n}", "makeLocalFromDateObject(date) {\n var ret = this.dateStrings(date)\n return ret.day + \".\" + ret.month + \".\" + ret.year\n }", "static _validateDateField(req, obj, field) {\n if (obj[field] == null) {\n return;\n }\n const d = obj[field];\n //Date constructor accepts other types such as arrays but we don't\n //allow this.\n const v = d instanceof Date ? d : new Date(\n (typeof d === 'number' || typeof d === 'string') ? d : NaN);\n if (!Number.isFinite(v.getTime())) { // NaN for invalid date\n throw new NoSQLArgumentError(`Invalid ${field} value`, req);\n }\n obj[field] = v;\n }", "function prepDate(model) { return _.isEmpty(model) ? null : moment(model).toDate();}", "_pushDate(gen, obj) {\n\t switch (gen.dateType) {\n\t case 'string':\n\t return gen._pushTag(TAG.DATE_STRING) &&\n\t gen._pushString(obj.toISOString())\n\t case 'int':\n\t case 'integer':\n\t return gen._pushTag(TAG.DATE_EPOCH) &&\n\t gen._pushIntNum(Math.round(obj / 1000))\n\t case 'float':\n\t // force float\n\t return gen._pushTag(TAG.DATE_EPOCH) &&\n\t gen._pushFloat(obj / 1000)\n\t case 'number':\n\t default:\n\t // if we happen to have an integral number of seconds,\n\t // use integer. Otherwise, use float.\n\t return gen._pushTag(TAG.DATE_EPOCH) &&\n\t gen.pushAny(obj / 1000)\n\t }\n\t }", "get valueAsDate() {\n return this.getInput().valueAsDate;\n }", "truncDate(val) {\n return ChartUtils.truncDate(val, this.props.chartType, this.props.filter)\n }", "function IsDate(p_Expression){\nreturn isDate(p_Expression);\n}", "function dateTimeToExpr(d) {\n var parts = dateTimeParts(d, true);\n var string = parts.join(', ');\n\n if (d.utc) {\n return \"utc(\".concat(string, \")\");\n } else {\n return \"datetime(\".concat(string, \")\");\n }\n }", "function isDate(p_Expression) {\n return !isNaN(new Date(p_Expression)); \t// <<--- this needs checking\n}", "parseLiteral(ast) {\n //when date is passed directly as string (if not string then return undefined)\n //return (ast.kind === Kind.STRING) ? new Date(ast.value) : undefined\n //returning an undefined type indicating GraphQL that this type cannot be converted into Date --> will be treated as error\n if (ast.kind === Kind.STRING) {\n const date = new Date(ast.value);\n //return isNaN(date) ? undefined : date //isNan is a restricted global func\n return Number.isNaN(date.getDate()) ? undefined : date;\n }\n //return nothing will be treated the same as return undefined\n }", "convertDate(day) {\n var dd = String(day.getDate()).padStart(2, '0');\n var mm = String(day.getMonth() + 1).padStart(2, '0'); //January is 0!\n var yyyy = day.getFullYear();\n\n return yyyy+mm+dd\n }", "function DateNorm(date1)\n{\n var day1 = addZero(date1.getDate());\n var month1 = addZero(parseInt(date1.getMonth(), 10) + 1);\n var year1 = date1.getFullYear(); \n var date = String(day1) + \"/\" + String(month1) + \"/\" + String(year1);\n return date;\n}", "static get fieldType() {\n return 'date';\n }", "static get fieldType() {\n return 'date';\n }", "makeDateObject (val) {\n // handle support for eu date format\n let dateAndTime = val.split(' ')\n let arr = []\n if (this.format.indexOf('-') !== -1) {\n arr = dateAndTime[0].split('-')\n } else {\n arr = dateAndTime[0].split('/')\n }\n let year = 0\n let month = 0\n let day = 0\n if (this.format.indexOf('DD/MM/YYYY') === 0 || this.format.indexOf('DD-MM-YYYY') === 0) {\n year = arr[2]\n month = arr[1]\n day = arr[0]\n } else if (this.format.indexOf('YYYY/MM/DD') === 0 || this.format.indexOf('YYYY-MM-DD') === 0) {\n year = arr[0]\n month = arr[1]\n day = arr[2]\n } else {\n year = arr[2]\n month = arr[0]\n day = arr[1]\n }\n\n let date = new Date();\n if(this.hideDate){\n // time only\n let splitTime = dateAndTime[0].split(':')\n // handle date format without seconds\n let secs = splitTime.length > 2 ? parseInt(splitTime[2]) : 0\n date.setHours(parseInt(splitTime[0]), parseInt(splitTime[1]), secs, 0)\n } else if (this.hideTime) {\n // date only\n date = new Date(parseInt(year), parseInt(month)-1, parseInt(day))\n } else {\n // we have both date and time\n let splitTime = dateAndTime[1].split(':')\n // handle date format without seconds\n let secs = splitTime.length > 2 ? parseInt(splitTime[2]) : 0\n date = new Date(parseInt(year), parseInt(month)-1, parseInt(day), parseInt(splitTime[0]), parseInt(splitTime[1]), secs)\n }\n\n return date\n }", "function getDate( val, format ) {\n if ( typeof val === \"string\" && format !== undefined ) {\n // try parse date from string using dataDateFormat\n return AmCharts.stringToDate( val, format );\n } else {\n // last resort: dump everything into Date constructor\n // and let browser handle it\n return new Date( val );\n }\n }", "function $Date() {\n\t\treturn Field.apply(this, arguments);\n\t}" ]
[ "0.63135856", "0.60218096", "0.5958362", "0.5782361", "0.56866527", "0.5682221", "0.5674878", "0.5647385", "0.5588356", "0.55665404", "0.5559616", "0.5543852", "0.5538889", "0.5535527", "0.5533", "0.5524248", "0.5521169", "0.55160135", "0.5496343", "0.54722434", "0.5466093", "0.5461567", "0.54572386", "0.5456199", "0.5453853", "0.54500794", "0.54247355", "0.53986716", "0.539359", "0.5368239", "0.5367601", "0.53450567", "0.53404516", "0.532621", "0.532621", "0.53178555", "0.5311153", "0.5296274", "0.528595", "0.5283449", "0.5282921", "0.52611554", "0.52528775", "0.52517027", "0.52476066", "0.52432454", "0.5242636", "0.5234477", "0.52335745", "0.52319324", "0.5224274", "0.5224274", "0.5222063", "0.52219486", "0.5221712", "0.5219029", "0.5218089", "0.5201497", "0.51932603", "0.5189111", "0.5188781", "0.51884604", "0.51847005", "0.5176792", "0.517025", "0.5168101", "0.51586163", "0.51376396", "0.51319766", "0.5128738", "0.5121821", "0.51191944", "0.5116336", "0.5105735", "0.5097407", "0.5092676", "0.50918055", "0.5088017", "0.50872004", "0.5084853", "0.5083269", "0.50750387", "0.50698286", "0.50641626", "0.5060673", "0.50577873", "0.5054208", "0.5052853", "0.5049778", "0.50377935", "0.5031438", "0.5029827", "0.5028653", "0.5026613", "0.5024197", "0.5023067", "0.5021178", "0.5021178", "0.50182027", "0.5009133", "0.500087" ]
0.0
-1
! Internal helper for update, updateMany, updateOne
function h(t,e,n,r,i,o,c){return t.op=e,u.canMerge(n)&&t.merge(n),r&&t._mergeUpdate(r),s.isObject(i)&&t.setOptions(i),o||c?!t._update||!t.options.overwrite&&0===s.keys(t._update).length?(c&&s.soon(c.bind(null,null,0)),t):(i=t._optionsForExec(),c||(i.safe=!1),n=t._conditions,r=t._updateForExec(),a("update",t._collection.collectionName,n,r,i),c=t._wrapCallback(e,c,{conditions:n,doc:r,options:i}),t._collection[e](n,r,i,s.tick(c)),t):t}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "update(){}", "update(){}", "update(){}", "async update () {\n\t\t// do the update\n\t\tif (!this.ops) {\n\t\t\tthis.ops = {\n\t\t\t\t$set: this.attributes\n\t\t\t};\n\t\t\tdelete this.ops.$set.id;\n\t\t}\n\t\tthis.updateOp = await this.collection.applyOpById(\n\t\t\tthis.id,\n\t\t\tthis.ops,\n\t\t\t{ version: this.modelVersion }\n\t\t);\n\t}", "static update({ id, name, phone, email, sex }) {\r\n return new Promise(async resolve => {\r\n try {\r\n \r\n if( !ObjectID.isValid( id )){\r\n return resolve({ error : true , message : 'params_invalid' });\r\n }\r\n let listUser = await USER_COLL.findByIdAndUpdate( id, {\r\n name, phone, email, sex\r\n }\r\n ,{\r\n new: true\r\n });\r\n \r\n if(!listUser){\r\n return resolve({error: true, message:'cannot_update_list'});\r\n }\r\n return resolve({error: false, message:'update_data_success', data: listUser});\r\n\r\n\r\n } catch (error) {\r\n return resolve({ error: true, message: error.message });\r\n }\r\n })\r\n}", "static updateArticle(idToUpdatePassedIn, articleDataToUpdatePassedIn) {\n\n /* NEW 20180623-1031\n In Edit/Update, ADD NEW PHOTO(s)...\n */\n\n\n console.log('SUPER-DUPER-OOFFAA ******** articleDataToUpdatePassedIn ', articleDataToUpdatePassedIn)\n /* UPDATE: I see Title and URL ... Now time to add the Photos Filenames Array. :o)\n {articleTitle_name: \"Trump’s WAYZO Gots to go 3345 Twice BAZZARRO We L…CIENT Fuel Efficiency Rollbacks Will Hurt Drivers\", articleUrl_name: \"https://www.nytimes.com/2018/05/11/opinion/trump-fuel-efficiency-rollbacks.html\"}\n\n\n ?\n Why only Title field?\n articleDataToUpdatePassedIn {articleTitle_name: \"Mueller EDIT Plans to Wrap Up Obstruction Inquiry Into Trump by Sept. 1, Giuliani Says\"}\n */\n\n\n /* Notes:\n 1. I tried this two ways:\n - UPDATE()\n - FINDBYIDANDUPDATE() << Preferred, for this use case\n\n Mongoose Model.update - this did work\n But, this is for having NO Document Returned.\n http://mongoosejs.com/docs/documents.html\n \"If we don't need the document returned in our application and merely want to update a property in the database directly, Model#update is right for us...\"\n\n So, I need another choice:\n http://mongoosejs.com/docs/api.html#findbyidandupdate_findByIdAndUpdate\n */\n // NEW. Let's (what the hell) update the URL, too. hey.\n /*\n Huh. Did na work.\n boo-hoo.\n What (the h.) is URL here, anyhoo?\n */\n console.log('******** articleDataToUpdatePassedIn.articleUrl_name ', articleDataToUpdatePassedIn.articleUrl_name)\n console.log('******** articleDataToUpdatePassedIn.articleTitle_name ', articleDataToUpdatePassedIn.articleTitle_name)\n\n console.log('******** articleDataToUpdatePassedIn.articlePhotos_name ', articleDataToUpdatePassedIn.articlePhotos_name)\n\n /* 20180628-0740\n Boys and girls, we are going to try to NIP this bad boy,\n right here in the B-U-D. Whoa.\n\n O.M.G. It Worked.\n Goodness Griefiness.\n wswhooohhhhwwhh (sound, breath, exhalation, all that)\n\nIN SUM - YAH, WE DID NEED TO DO ANOTHER JSON.stringify()\nOF THAT CRAZY SIMPLE ARRAY OF STRINGS\nBEFORE SENDING IT TO MONGOOSE / MONGO\nFOR WHATEVER THE HELL IT IS THEy DO\nIN TERMS OF STORING THIS AWAY.\nYEESH.\nAnd as a further comment: when you JSON.stringify()\nthis sort of thing, and then you debug either using\nconsole.log(), OR using debugging in Chrome DevTools,\nyou do ***NOT*** get to \"see\" what it looks like.\nYou always see:\n[ \"asdf\", \"qwer\" ]\nYou do NOT get to see (what actually lands in the database):\n[ '[\"asdf\", \"qwer\"] ' ]\nNOR (same thing):\n[ \"[\\\"asdf\\\", \\\"qwer\\\"]\" ]\n\nJESUS H. CHRIST.\n\n Relevant console explorations:\n In sum: yeah, parsing then stringifying then parsing again ...\n ... it WORKS. Lessee if it'll do that Magic for ME\n ============\n var p5 = \" [ \\\"asdf\\\", \\\"qwer\\\" ] \"\n undefined\n var p6 = JSON.parse(p5)\n undefined\n p6\n Array [ \"asdf\", \"qwer\" ]\n ...\n p6\n Array [ \"asdf\", \"qwer\" ]\n p13 = JSON.parse(p6)\n SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data[Learn More] debugger eval code:1:7\n p14 = JSON.stringify(p6) <<<<< THE MAGIC PART\n \"[\\\"asdf\\\",\\\"qwer\\\"]\"\n p14\n \"[\\\"asdf\\\",\\\"qwer\\\"]\"\n var p15 = JSON.parse(p14)\n undefined\n p15\n Array [ \"asdf\", \"qwer\" ]\n ============\n */\n\n var theLateGreatWhatTheHell = JSON.stringify(articleDataToUpdatePassedIn.articlePhotos_name); // << YES !!!\n console.log('******** theLateGreatWhatTheHell (JSON.stringify(articleDataToUpdatePassedIn.articlePhotos_name) ', theLateGreatWhatTheHell);\n/*\nNote that the \"console.log()\" nonsense does ***NOT*** show us what this thing\n***TRULY*** is. :o(\n* ******** theLateGreatWhatTheHell (JSON.stringify(articleDataToUpdatePassedIn.articlePhotos_name) [\"sometimes__1530187445867_27vid-trump-kennedy-1-thumbLarge.jpg\",\"sometimes__1530187445870_28midterm_xp-superJumbo.jpg\",\"sometimes__1530188021581_00republicans1-jumbo-v3.jpg\"]\n*\n*\n* WHAT IS IN THE (G.D.) DATABASE (which is correct and right and good):\n* \"articlePhotos\" : [ \"[\\\"sometimes__1530187445867_27vid-trump-kennedy-1-thumbLarge.jpg\\\",\\\"sometimes__1530187445870_28midterm_xp-superJumbo.jpg\\\",\\\"sometimes__1530188021581_00republicans1-jumbo-v3.jpg\\\"]\" ],\n */\n\n\n return articleModelHereInService.findByIdAndUpdate(\n {_id: idToUpdatePassedIn},\n { $set:\n {\n articleTitle: articleDataToUpdatePassedIn.articleTitle_name,\n articleUrl: articleDataToUpdatePassedIn.articleUrl_name,\n // articlePhotos: articleDataToUpdatePassedIn.articlePhotos_name, // << NO !!\n articlePhotos: theLateGreatWhatTheHell, // << YES!!!\n }\n },\n { new: true } // Gets you the NEW, just-edited doc (not the orig one)\n )\n .then(\n (whatIGot) => {\n console.log('articleService. Update. then() whatIGot: ', whatIGot)\n /* .update()\n Not the document. Returns a Mongo transaction report.\n {n: 1, nModified: 1, opTime: {…}, electionId: ObjectID, ok: 1}\n */\n\n /* .findByIdAndUpdate()\n model {$__: InternalCache, isNew: false, errors: undefined, _doc: {…}, $init: true}\n */\n\n /* Note / Question\n Here on the returned Model, I find a property '._doc' which does contain my document. Returning this does work.\n But:\n 1)What does that underscore naming convention mean?\n 2) Am I doing this the correct way, to get the data I need?\n 3) Does the returned Model expose some other way to get the document it is holding, than grabbing it off this '._doc' property?\n Feel like I'm missing something.\n But, this is working.\n */\n /* 2018-05-02 Web \"Office Hours\" with Mike Hilborn\n Looks like all is O.K. re: the above questioning, wondering:\n\n \"@William: Underscore notation signifies an internal property of Mongoose model, similar to \"_id\".\"\n \"@William: The \"_doc\" is a pointer to the document object and its properties, so, yeah, feel free to use it to access properties.\"\n\n */\n console.log('articleService. Update. then() whatIGot._doc: ', whatIGot._doc)\n return whatIGot._doc\n }\n )\n .catch((err) => console.log('Service. Update. Catch. err: ', err))\n }", "update(body, res) {\n this.model.findOne({where: {id: body.id}}).then(object => {\n if (object !== null) {\n object.update(body).then(object => res.status(200).json({\n type: 'success',\n message: `updated!`,\n data: object\n }));\n } else {\n res.status(200).json({\n type: 'success',\n message: `not found!`,\n data: null\n })\n }\n }).catch(e => res.status(200).json({\n type: 'Error',\n message: e.message,\n data: e\n }));\n }", "static update(table_name, attributes, where, response, cb) {\n\t\ttable_name\n\t\t\t.findOne({\n\t\t\t\twhere\n\t\t\t})\n\t\t\t.then((found) => {\n\t\t\t\tif (found !== null) {\n\t\t\t\t\ttable_name\n\t\t\t\t\t\t.update(attributes, {\n\t\t\t\t\t\t\twhere: {\n\t\t\t\t\t\t\t\tid: found.id\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t})\n\t\t\t\t\t\t.then((updated) => {\n\t\t\t\t\t\t\tif (updated[0]) {\n\t\t\t\t\t\t\t\tif (typeof cb === 'function') {\n\t\t\t\t\t\t\t\t\tcb({\n\t\t\t\t\t\t\t\t\t\tcode: 200,\n\t\t\t\t\t\t\t\t\t\ttitle: 'Success',\n\t\t\t\t\t\t\t\t\t\tmessage: 'Data is updated',\n\t\t\t\t\t\t\t\t\t\ttype: 'success',\n\t\t\t\t\t\t\t\t\t\tdata: updated\n\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tresponse.status(200).json({\n\t\t\t\t\t\t\t\t\t\tcode: 200,\n\t\t\t\t\t\t\t\t\t\ttitle: 'Success',\n\t\t\t\t\t\t\t\t\t\tmessage: 'Data is updated',\n\t\t\t\t\t\t\t\t\t\ttype: 'success',\n\t\t\t\t\t\t\t\t\t\tdata: updated\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} else {\n\t\t\t\t\t\t\t\tif (typeof cb === 'function') {\n\t\t\t\t\t\t\t\t\tcb({\n\t\t\t\t\t\t\t\t\t\tcode: 400,\n\t\t\t\t\t\t\t\t\t\ttitle: 'Warning',\n\t\t\t\t\t\t\t\t\t\tmessage: 'Unable to update',\n\t\t\t\t\t\t\t\t\t\ttype: 'warning',\n\t\t\t\t\t\t\t\t\t\tdata: []\n\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tresponse.status(200).json({\n\t\t\t\t\t\t\t\t\t\tcode: 400,\n\t\t\t\t\t\t\t\t\t\ttitle: 'Warning',\n\t\t\t\t\t\t\t\t\t\tmessage: 'Unable to update',\n\t\t\t\t\t\t\t\t\t\ttype: 'warning',\n\t\t\t\t\t\t\t\t\t\tdata: []\n\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t})\n\t\t\t\t\t\t.catch((error) => {\n\t\t\t\t\t\t\tif (typeof cb === 'function') {\n\t\t\t\t\t\t\t\tcb({\n\t\t\t\t\t\t\t\t\tcode: 400,\n\t\t\t\t\t\t\t\t\ttitle: 'Failed',\n\t\t\t\t\t\t\t\t\tmessage: error.message,\n\t\t\t\t\t\t\t\t\ttype: 'error',\n\t\t\t\t\t\t\t\t\ttrace: {\n\t\t\t\t\t\t\t\t\t\taddress: 'update : Function model.update()',\n\t\t\t\t\t\t\t\t\t\terror: JSON.stringify(error)\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} else {\n\t\t\t\t\t\t\t\tresponse.status(400).json({\n\t\t\t\t\t\t\t\t\tcode: 400,\n\t\t\t\t\t\t\t\t\ttitle: 'Failed',\n\t\t\t\t\t\t\t\t\tmessage: error.message,\n\t\t\t\t\t\t\t\t\ttype: 'error',\n\t\t\t\t\t\t\t\t\ttrace: {\n\t\t\t\t\t\t\t\t\t\taddress: 'update : Function model.update()',\n\t\t\t\t\t\t\t\t\t\terror: JSON.stringify(error)\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\tif (typeof cb === 'function') {\n\t\t\t\t\t\tcb({\n\t\t\t\t\t\t\tcode: 404,\n\t\t\t\t\t\t\ttitle: 'Warning',\n\t\t\t\t\t\t\tmessage: 'Data not found',\n\t\t\t\t\t\t\ttype: 'warning',\n\t\t\t\t\t\t\tdata: []\n\t\t\t\t\t\t});\n\t\t\t\t\t} else {\n\t\t\t\t\t\tresponse.status(200).json({\n\t\t\t\t\t\t\tcode: 404,\n\t\t\t\t\t\t\ttitle: 'Warning',\n\t\t\t\t\t\t\tmessage: 'Data not found',\n\t\t\t\t\t\t\ttype: 'warning',\n\t\t\t\t\t\t\tdata: []\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t})\n\t\t\t.catch((error) => {\n\t\t\t\tif (typeof cb === 'function') {\n\t\t\t\t\tcb({\n\t\t\t\t\t\tcode: 400,\n\t\t\t\t\t\ttitle: 'Failed',\n\t\t\t\t\t\tmessage: error.message,\n\t\t\t\t\t\ttype: 'error',\n\t\t\t\t\t\ttrace: {\n\t\t\t\t\t\t\taddress: 'update : Function model.findOne()',\n\t\t\t\t\t\t\terror: JSON.stringify(error)\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\tresponse.status(400).json({\n\t\t\t\t\t\tcode: 400,\n\t\t\t\t\t\ttitle: 'Failed',\n\t\t\t\t\t\tmessage: error.message,\n\t\t\t\t\t\ttype: 'error',\n\t\t\t\t\t\ttrace: {\n\t\t\t\t\t\t\taddress: 'update : Function model.findOne()',\n\t\t\t\t\t\t\terror: JSON.stringify(error)\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t});\n\t}", "update(id, data, params) {}", "update(instance, {\n question, student, moderated, visible, moderatorComments, retired,\n }) {\n const docID = this.getID(instance);\n const updateData = {};\n if (question) {\n updateData.question = question;\n }\n if (student) {\n updateData.studentID = Users.getID(student);\n }\n if (_.isBoolean(moderated)) {\n updateData.moderated = moderated;\n }\n if (_.isBoolean(visible)) {\n updateData.visible = visible;\n }\n if (moderatorComments) {\n updateData.moderatorComments = moderatorComments;\n }\n if (_.isBoolean(retired)) {\n updateData.retired = retired;\n }\n this._collection.update(docID, { $set: updateData });\n }", "update(entity, options) {\n // update entity might be a partial of T but must at least have its key.\n // pass the Update<T> structure as the payload\n const update = this.toUpdate(entity);\n options = this.setSaveEntityActionOptions(options, this.defaultDispatcherOptions.optimisticUpdate);\n const action = this.createEntityAction(EntityOp.SAVE_UPDATE_ONE, update, options);\n if (options.isOptimistic) {\n this.guard.mustBeUpdate(action);\n }\n this.dispatch(action);\n return this.getResponseData$(options.correlationId).pipe(\n // Use the update entity data id to get the entity from the collection\n // as might be different from the entity returned from the server\n // because the id changed or there are unsaved changes.\n map((updateData) => updateData.changes), withLatestFrom(this.entityCollection$), map(([e, collection]) => collection.entities[this.selectId(e)]), shareReplay(1));\n }", "submitUpdatePair(data, sendingUpdate, recievingUpdate) {\n return new Promise((resolve, reject) => {\n Promise.all([\n this.db.User.Data.updateOne(\n { _id: ObjectID(data[0]._id) },\n sendingUpdate,\n { upsert: false }\n ).then(update => { return update; }),\n this.db.User.Data.updateOne(\n { _id: ObjectID(data[1]._id) },\n recievingUpdate,\n { upsert: false }\n ).then(update => { return update; })\n ])\n .then(data => { \n resolve(data); })\n .catch(err => { \n console.log(err);\n reject(err); });\n });\n }", "updateOne(query = {}, object, upsert = false) {\n //console.log('UPDATE', query, object);\n let id = query['_id'];\n let params = {\n TableName: this.database,\n Key: {\n _pk_className: this.className\n },\n ReturnValues: 'ALL_NEW'\n };\n let find = Promise.resolve();\n if (id) {\n if (typeof id == 'string') {\n find = this._get(id).then(result => {\n if (result.length > 0 && result[0]._id === id) {\n return result[0];\n }\n return null;\n });\n }\n else {\n return this.updateMany(query, object, upsert);\n }\n }\n else {\n if (Object.keys(query).length > 0) {\n find = this.find(query, { limit: 1 }).then(results => {\n if (results.length > 0 && results[0]._id) {\n return results[0];\n }\n return null;\n });\n }\n else {\n throw new node_1.Parse.Error(node_1.Parse.Error.INVALID_QUERY, 'DynamoDB : you must specify query keys');\n }\n }\n let exp = new Expression_1.Expression();\n exp = exp.build(query);\n params.ConditionExpression = exp.Expression;\n params.ExpressionAttributeNames = exp.ExpressionAttributeNames;\n params.ExpressionAttributeValues = exp.ExpressionAttributeValues;\n return new Promise((resolve, reject) => {\n find.then((result) => {\n if (result && result._id) {\n params.UpdateExpression = Expression_1.Expression.getUpdateExpression(object, params, result);\n params.Key._sk_id = result._id;\n //console.log('UPDATE PARAMS', params);\n this.dynamo.update(params, (err, data) => {\n if (err) {\n if (err.name == 'ConditionalCheckFailedException') {\n if (upsert) {\n reject(err);\n }\n else {\n resolve({ ok: 1, n: 0, nModified: 0, value: null });\n }\n }\n else {\n reject(err);\n }\n }\n else {\n if (data && data.Attributes) {\n data.Attributes._id = data.Attributes._sk_id;\n delete data.Attributes._pk_className;\n delete data.Attributes._sk_id;\n resolve({ ok: 1, n: 1, nModified: 1, value: data.Attributes });\n }\n else {\n resolve({ ok: 1, n: 1, nModified: 1, value: null });\n }\n }\n });\n }\n else {\n // here we do upserting\n if (upsert) {\n object = Object.assign({}, object['$set'], object['$inc']);\n object['_id'] = cryptoUtils_1.newObjectId();\n this.insertOne(object).then(res => resolve({ ok: 1, n: 1, nModified: 1, value: res.ops[0] }));\n }\n else {\n resolve({ ok: 1, n: 1, nModified: 1, value: null });\n }\n }\n });\n });\n }", "function update(req , res){\n\tvar model = getModel(req.params.model);\n\tif (!req.params.id){\n\t\treturn res.status(400).send({request:\"update\" , status:-1 , err:new Error(\"Missing id in update request\")});\n\t}\n\t// Params to be updated\n\tvar pars = _.keys(req.body);\n\t\n\t model.findById(req.params.id, function (err, found) {\n\t \tif (!found)\n\t \t\treturn res.status(400).send({request:\"update\" , status:-1 , err:new Error(\"Unknown documents \"+req.params.id)});\n\t\tpars.forEach(function(p , i){\n \t\t\tfound[p] = req.body[p];\n \t\t});\n\t\tfound.save(function (err) {\n\t\t\tif (!err) {\n\t\t\t\t// MAPS\n\t\t\t\t// Should we update something in maps?\n\t\t\t\tcheckDocumentInMap(found , req.params.model , found.lang, function(err , ret){\n\t\t\t\t\tif (err){\n\t\t\t\t\t\tlogToConsole(err);\n\t\t\t\t\t\treturn res.status(500).send({request:\"update\" , status:-1, err:err}); \n\t\t\t\t\t}else{\n\t\t\t\t\t\tif (ret.__changed__){\n\t\t\t\t\t\t\tret.save(function (err , ret) {\n\t\t\t\t\t\t\t\tif (!err) {\n\t\t\t\t\t\t\t\t\t// @FIXME: potrei avere piu elementi nell'array \n\t\t\t\t\t\t\t\t\treturn res.send({request:\"update\" , status:1 , _id:ret._id , map_id : ret._maps_to_[0]});\n\t\t\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t\t\t}else {\n\t\t\t\t\t\t\t\t\tlogToConsole(err);\n\t\t\t\t\t\t\t\t\treturn res.status(500).send({request:\"update\" , status:-1, err:err}); \n\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\treturn res.send({request:\"update\" , status:1});\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t} else {\n\t\t\t\treturn res.status(500).send({request:\"update\" , status:-1, err:err}); \n\t\t\t}\n\t\t});\n\t });\n}", "update(entityName, updates) {\n updates = Array.isArray(updates) ? updates : updates ? [updates] : [];\n return { entityName, op: ChangeSetOperation.Update, entities: updates };\n }", "static update(request, response) {\r\n\r\n itemsModel.getById(request.body.id)\r\n .then( data => {\r\n if (data.length > 0) {\r\n\r\n //recupera do body os campos que serao atualizados na tabela\r\n const conditions = [\r\n {\r\n field: 'id',\r\n value: request.body.id\r\n },\r\n {\r\n field: 'title',\r\n value: request.body.title\r\n },\r\n {\r\n field: 'descr',\r\n value: request.body.descr\r\n },\r\n {\r\n field: 'photo',\r\n value: request.body.photo\r\n },\r\n {\r\n field: 'category',\r\n value: request.body.category\r\n },\r\n ];\r\n\r\n //chama rotina para atualizacao dos dados\r\n itemsModel.update(conditions) \r\n response.sendStatus(200);\r\n console.log('Item has been updated. ID: ', request.body.id); \r\n } else {\r\n response.sendStatus(404);\r\n console.log('Item not found. ID: ', request.body.id);\r\n }\r\n })\r\n .catch(err => {\r\n response.sendStatus(500);\r\n console.log('Error updating Item by ID: ', request.body.id, err);\r\n });\r\n \r\n }", "updateOne(query, updateObj) {\n return this.findById(query)\n .then((doc) => {\n if (doc) {\n return doc.update(updateObj).exec();\n }\n else {\n return Promise.reject(\"document not found\");\n }\n });\n }", "update(id) {\n\n }", "update() {\n this.checkOkToUpdate();\n\n if (true) {\n let key = DB._getDbKey(this.obj.toModel(), this.collection);\n\n if (key != this.key) {\n console.log(\"Old key: \", this.key, \"New key: \", key);\n throw \"Update should not change key!\";\n }\n }\n\n if (this.state == ObjectStates.COMMITTED) {\n this.state = ObjectStates.UPDATE_PENDING;\n this.db._addDirty(this, this.collection);\n }\n }", "updateById(id, updateObj) {\n return this.findById(id)\n .then((doc) => {\n if (doc) {\n return doc.update(updateObj).exec();\n }\n else {\n return Promise.reject(\"document not found\");\n }\n });\n }", "async update({ params, request, response }) {}", "async update({ params, request, response }) {\n }", "function handlerCRUD(fullObject, operationType) {\n\n\n //console.log(fullObject); // OK\n //console.log(operationType); // OK\n\n let helpers = {\n statusID: function (valueNeeded) {\n\n let newStatus;\n\n statuses.forEach(function (currentValue) {\n if (currentValue.Status == valueNeeded) {\n newStatus = currentValue.ID;\n }\n });\n\n return newStatus.toString();\n },\n internalID: function (fullObjId, fullObjInternalId) {\n\n console.log(fullObjId, fullObjInternalId);\n\n if (fullObjInternalId == '0') {\n return fullObjId;\n } else {\n return fullObjInternalId;\n }\n }\n };\n\n\n if (operationType == \"Update\") {\n\n\n\t let valuepairs = [\n\t\t\t[\"Title\", fullObject.RequestCodeSAP],\n\t\t\t[\"Date\", new Date(fullObject.StartDate).toISOString()],\n\t\t\t[\"Approver\", fullObject.ApproverID],\n\t\t\t[\"Reason\", fullObject.Reason],\n\t\t\t[\"WorkSchedule\", fullObject.WorkScheduleID],\n\t\t\t[\"OvertimeNo\", fullObject.OvertimeNo],\n\t\t\t[\"HolidaysNo\", fullObject.HolidaysNo],\n\t\t\t[\"End_x0020_Date\", new Date(fullObject.EndDate).toISOString()],\n\t\t\t[\"ChildrenCareHours\", fullObject.ChildrenCareHours],\n\t\t\t[\"TimeAdmin\", fullObject.IdTimeAdmin],\n\t\t];\n\n\n\n /* this operation make sens only if update */\n\n let statusChanged = helpers.statusID(\"Changed\");\n let statusHistory = helpers.statusID(\"History\");\n\n //console.log(\"statusy pierwszy changed: \", statusChanged, statusHistory);\n console.log(\"inside update\");\n //console.log(fullObject);\n console.log(fullObject.ID, fullObject.InternalID);\n\n let internalID = \"\" + helpers.internalID(fullObject.ID, fullObject.InternalID);\n console.log(\"internal ID \", internalID);\n\n\n\n valuepairs.push([\"InternalID\", '' + internalID]);\n valuepairs.push([\"Status\", helpers.statusID(\"Changed\")]);\n\n console.log(valuepairs);\n\n $().SPServices({\n operation: \"UpdateListItems\",\n async: false,\n batchCmd: \"New\",\n listName: \"Requests\",\n valuepairs: valuepairs,\n completefunc: function (xData, Status) {\n console.log(\"New Changed!\" + \" \" + Status);\n }\n });\n\n\n\n $().SPServices({\n operation: \"UpdateListItems\",\n async: false,\n batchCmd: \"Update\",\n listName: \"Requests\",\n ID: fullObject.ID,\n valuepairs: [\n [\"InternalID\", internalID],\n [\"Status\", statusHistory]\n ],\n completefunc: function (xData, Status) {\n console.log(\"History Request!\" + \" \" + Status);\n }\n });\n\n } else if (operationType == \"Accepted\") {\n \n $().SPServices({\n operation: \"UpdateListItems\",\n async: false,\n batchCmd: \"Update\",\n listName: \"Requests\",\n ID: fullObject.ID,\n valuepairs: [[\"Status\", helpers.statusID(operationType)]],\n completefunc: function (xData, Status) {\n console.log(\"Request Approved!\" + \" \" + Status);\n }\n });\n\n } else if (operationType == \"Declined\") {\n \n $().SPServices({\n operation: \"UpdateListItems\",\n async: false,\n batchCmd: \"Update\",\n listName: \"Requests\",\n ID: fullObject.ID,\n valuepairs: [[\"Status\", helpers.statusID(operationType)]],\n completefunc: function (xData, Status) {\n console.log(\"Request Declined!\" + \" \" + Status);\n }\n });\n\n } else if (operationType == \"Create\") {\n \n \n\t let valuepairs = [\n\t\t\t[\"Title\", fullObject.RequestCodeSAP],\n\t\t\t[\"Date\", new Date(fullObject.StartDate).toISOString()],\n\t\t\t[\"Approver\", fullObject.ApproverID],\n\t\t\t[\"Reason\", fullObject.Reason],\n\t\t\t[\"WorkSchedule\", fullObject.WorkScheduleID],\n\t\t\t[\"OvertimeNo\", fullObject.OvertimeNo],\n\t\t\t[\"HolidaysNo\", fullObject.HolidaysNo],\n\t\t\t[\"End_x0020_Date\", new Date(fullObject.EndDate).toISOString()],\n\t\t\t[\"ChildrenCareHours\", fullObject.ChildrenCareHours],\n\t\t\t[\"TimeAdmin\", fullObject.IdTimeAdmin],\n\t\t];\n\n valuepairs.push([\"InternalID\", '0']);\n valuepairs.push([\"Status\", helpers.statusID(\"Submitted\")]);\n\n\n console.log(valuepairs);\n\n $().SPServices({\n operation: \"UpdateListItems\",\n async: false,\n batchCmd: \"New\",\n listName: \"Requests\",\n valuepairs: valuepairs,\n completefunc: function (xData, Status) {\n console.log(\"Request Sent for Approval!\" + \" \" + Status);\n let tmpstr = xData.responseText;\n let arr = tmpstr.split(\" \");\n // console.log(arr);\n let ktory = 29; \n arr.forEach( function(item, indx) {\n \tif(item.indexOf(\"ows_ID=\") == 0 ) {\n \t\tktory = indx;\n \t\t\n \t\tconsole.log(item);\n \t}\n });\n // always 29? - i masz odpowiedz, ze nie zawsze jest to 29!!!\n\n //console.log( arr[ktory].replace('\"','').replace('\"','').split(\"=\")[1] );\n // return parseInt( arr[29].replace('\"','').replace('\"','').split(\"=\")[1] );\n let newAjdi = arr[ktory].replace('\"','').replace('\"','').split(\"=\")[1];\n fullObject.ID = newAjdi;\n }\n });\n } else {\n\n\n\n let statusDelete;\n if (fullObject.Status == helpers.statusID(\"Accepted\")) {\n statusDelete = helpers.statusID(\"Removing Accepted\");\n } else if (fullObject.Status == helpers.statusID(\"Completed\")) {\n statusDelete = helpers.statusID(\"Removing Completed\");\n } else {\n statusDelete = helpers.statusID(\"Deleted\");\n }\n $().SPServices({\n operation: \"UpdateListItems\",\n async: false,\n batchCmd: \"Update\",\n listName: \"Requests\",\n ID: fullObject.ID,\n valuepairs: [\n\t\t\t\t[\"Status\", statusDelete]\n\t\t\t],\n completefunc: function (xData, Status) {\n console.log(\"Data Deletion Done!\");\n }\n });\n }\n \n \n}", "updateRecord(recordId: number, newRecord: Object) {\n // Asserting all values in record are valid\n if (!this._assertRecordValid(newRecord)) {\n return\n }\n\n // Retrieving old record\n let oldRecord: Object = this.crudStore.getData().get(recordId)\n\n // Iterating over the new record to update and setting the invisible fields\n // value's so that they cannot change since invisible fields are not editable\n // in any circumstance\n for (let field: any of (this.crudStore.getSchema(): List<Object>)) {\n // Asserting current field invisible, if yes saving the old value\n if (field.invisible) {\n newRecord[field.id] = oldRecord[field.id]\n }\n }\n \n // Asserting store is a server store\n if (this.crudStore.type === 'server') {\n // Executing record update action to server\n this.crudStore.executeServerDatabaseAction('update', newRecord)\n }\n else {\n // Updating record in temporary store\n this.crudStore.setData(this.crudStore.getData().set(recordId, newRecord));\n }\n }", "function update(){\r\nCustomer.updateMany({dni:\"32111114-D\"},{note:\"nanai\"}, (err, ret) =>{\r\n\t\r\n\tif(err) {\r\n\t\tconsole.error(err);\r\n\t\t\r\n\t} else {\r\n\t\tconsole.log(\"Los dueños que coinciden con el criterio de busqueda han sido actualizados: \", ret);\r\n\t\tconsole.log(\"Todo correcto!!\");\r\n\t\t\r\n\t}\r\n\t\r\n\t\r\n});\r\n\r\n}", "async update({ params, request, response }) {\n }", "function updateRelation (model, id, data) {\n\n model.findById(id, function (err, instance) {\n if (err) {console.log(err);}\n\n if (instance !== null) {\n instance.updateAttributes(data);\n }\n\n });\n}", "async update(attributes, id = undefined) {\r\n let result;\r\n if (_.isNil(attributes)) {\r\n throw new Exception('attributes should not empty', 1000);\r\n }\r\n if (_.isUndefined(id)) {\r\n result = await this.Models().update(attributes, {\r\n where: this.getWheres()\r\n });\r\n } else {\r\n const item = await this.findById(id);\r\n result = await item.update(attributes);\r\n }\r\n return result;\r\n }", "async updateMany(query, updateQuery) {\n try {\n const updated = await this.model.updateMany(query, updateQuery);\n if (updated) return true;\n return null;\n } catch (error) {\n this.logger.debug(error.stack);\n this.logger.error(error.message);\n return null;\n }\n }", "saveUpdateManySuccess(collection, action) {\n const updates = this.guard.mustBeUpdateResponses(action);\n const isOptimistic = this.isOptimistic(action);\n const mergeStrategy = this.extractMergeStrategy(action);\n collection = this.entityChangeTracker.mergeSaveUpdates(updates, collection, mergeStrategy, false /* never skip */);\n return this.setLoadingFalse(collection);\n }", "update(query, updateObj) {\n return this.find(query)\n .then((docs) => {\n const promises = docs.map((doc) => {\n return doc.update(updateObj).then(() => Promise.resolve(doc)).catch((e) => Promise.reject(e));\n });\n return Promise.all(promises);\n });\n }", "function addUpdates(batch, data) {\n if (typeof data.update === 'undefined') return;\n\n for (var i = 0; i < data.update.length; i++) {\n var doc = data.update[i];\n var id = castId(doc._id);\n\n delete doc._id;\n\n batch.find({_id: id}).updateOne({$set: doc});\n }\n }", "function testUpdate(){\n UserModel.findByIdAndUpdate({_id:'5c016964c01b2f04cc7e514d'}, {name: 'John'}, {new: true},function(err, user){\n console.log('findByIdAndUpdate', err, user)\n })\n}", "async doUpdate () {\n\t\tif (Object.keys(this.changes).length === 0) {\n\t\t\t// nothing to save\n\t\t\treturn;\n\t\t}\n\t\t// do the update\n\t\tconst op = { $set: this.changes };\n\t\tthis.updateOp = await new ModelSaver({\n\t\t\trequest: this.request,\n\t\t\tcollection: this.collection,\n\t\t\tid: this.existingModel.id\n\t\t}).save(op);\n\t\tObject.assign(this.existingModel.attributes, this.changes);\n}", "selectupdate(id, selectupdate) {\n return recipes().then(recipeCollection => {\n let UpdateInfo = {}; \n if(selectupdate.title){\n UpdateInfo.title=selectupdate.title;\n }\n if(selectupdate.ingredients){\n UpdateInfo.ingredients=selectupdate.ingredients;\n }\n if(selectupdate.steps){\n UpdateInfo.steps=selectupdate.steps;\n }\n let updateCommand = {\n $set: UpdateInfo\n };\n return recipeCollection.updateOne({ _id: id }, updateCommand).then((result) => {\n return this.getRecipeById(id);\n });\n }); \n}", "updateOneInCache(entity, options) {\n // update entity might be a partial of T but must at least have its key.\n // pass the Update<T> structure as the payload\n const update = this.toUpdate(entity);\n this.createAndDispatch(EntityOp.UPDATE_ONE, update, options);\n }", "function update( options ) {\n return ( request, reply ) => {\n\n let _handler = ( request, options ) => {\n\n debug( 'update' );\n\n return new Promise( done => {\n\n options.getCriteria( request, done )\n\n } ).then(criteria=> {\n\n var Model = request.server.getModel( options.model );\n\n return Model.update( criteria, request.payload )\n })\n };\n\n let _reply = ( reply, response ) => {\n\n reply( response );\n\n };\n\n return _do( _handler, _reply, request, reply, options, 'update' )\n\n }\n}", "updateRecipe (id, recipeUpdates) {\n return this.getRecipeById(id).then(currentRecipe => {\n let RecipeUpdateInfo = {\n title: recipeUpdates.title,\n ingredients:recipeUpdates.ingredients,\n steps: recipeUpdates.steps\n };\n let updateCommand = {\n $set: RecipeUpdateInfo\n };\n return recipes().then(recipeCollection => {\n return recipeCollection.updateOne({ _id: id }, updateCommand).then(() => {\n return this.getRecipeById(id);\n });\n });\n });\n}", "updateProduct(id, updatedProduct) {\n if (!id || !updatedProduct || id == undefined || updatedProduct == undefined)\n {\n return Promise.reject(\"Please valid input for your product.\\n\");\n }\n\n return products().then((productsCollection) => {\n let updatedProdcutData = {};\n\n\n if (updatedProduct.title) {\n updatedProdcutData.title = updatedProduct.title;\n }\n\n if (updatedProduct.user) {\n updatedProdcutData.user = updatedProduct.user;\n }\n\n\n if (updatedProduct.description) {\n updatedProdcutData.description = updatedProduct.description;\n }\n\n if (updatedProduct.price) {\n updatedProdcutData.price = updatedProduct.price;\n }\n\n if (updatedProduct.condition) {\n updatedProdcutData.condition = updatedProduct.condition;\n }\n\n if (updatedProduct.purchasedYear) {\n updatedProdcutData.purchasedYear = updatedProduct.purchasedYear;\n }\n\n if (updatedProduct.image) {\n updatedProdcutData.productImage = updatedProduct.image;\n }\n\n if (updatedProduct.status) {\n updatedProdcutData.status = updatedProduct.status;\n }\n\n let updateCommand = {\n $set: updatedProdcutData\n };\n return productsCollection.updateOne({ _id: id }, updateCommand).then(() => {\n return this.getProductByID(id);\n }).catch((err)=>{\n console.log(\"Error while updating product:\", err);\n });\n });\n }", "async updateOne(updateObject, id) {\n const updatedBooking = await this.Bookings.findByIdAndUpdate(\n id,\n updateObject,\n { new: true, useFindAndModify: false },\n );\n\n return updatedBooking;\n}", "_update(update) {\n Channel._preprocessUpdate(update, this._sid);\n\n let updated = false;\n for (let key in update) {\n let localKey = fieldMappings[key];\n if (!localKey) {\n continue;\n }\n\n if (localKey === fieldMappings.status) {\n this._status = filterStatus(update.status);\n } else if (localKey === fieldMappings.attributes) {\n if (!JsonDiff.isDeepEqual(this._attributes, update.attributes)) {\n this._attributes = update.attributes;\n updated = true;\n }\n } else if (update[key] instanceof Date) {\n if (!this[localKey] || this[localKey].getTime() !== update[key].getTime()) {\n this['_' + localKey] = update[key];\n updated = true;\n }\n } else if (this[localKey] !== update[key]) {\n this['_' + localKey] = update[key];\n updated = true;\n }\n }\n\n // if uniqueName is not present in the update - then we should set it to null on the client object\n if (!update.status && !update.uniqueName) {\n if (this._uniqueName) {\n this._uniqueName = null;\n updated = true;\n }\n }\n\n if (updated) { this.emit('updated', this); }\n }", "updateField(recordId: number, key: string, value: string|number) {\n // Retrieving the record that is requested to go over the field update \n let record = this.crudStore.getData().get(recordId);\n\n // Asserting record retrieved successfully\n if (record) {\n // Updating field of record\n record[key] = value;\n\n // Updating record\n this.updateRecord(recordId, record)\n }\n else {\n throw \"CRUDActions.updateField: record wasn't retrieved successfully\"\n }\n }", "updateOne(req, res, next) {\n const id = req.body.id;\n const data = _.pick(req.body, 'slug', 'questionType', 'question', 'answer');\n\n return Promise.resolve().then(() => {\n return StudyItemService.update(id, data);\n }).then((instance) => {\n req.setResponseCode(HTTP_STATUS_CODE.OK);\n req.setResponseBody(Util.Mongoose.toJSON(instance));\n return next();\n }).catch((e) => {\n req.setResponseError(e);\n return next();\n })\n }", "updateThought({params, body}, res) {\n thoughts.findOneAndUpdate({_id: params.id}, body, {new: true, runValidators: true})\n .then(dbThoughtData => {\n if(!dbThoughtData) {\n res.status(404).json({message: 'No Thoughts found with this ID!'});\n return;\n }\n res.json(dbThoughtData);\n })\n .catch(err => res.json(err))\n}", "updateThought({\n params,\n body\n }, res) {\n Thought.findOneAndUpdate({\n _id: params.thoughtId\n }, {\n $set: body\n }, {\n runValidators: true,\n new: true\n })\n .then(updateThought => {\n if (!updateThought) {\n return res.status(404).json({\n message: 'No thought with this id!'\n });\n }\n return res.json({\n message: \"Success\"\n });\n })\n .catch(err => res.json(err));\n }", "updateOne(Model, query, updateModelFunction, body) {\n return new Promise((resolve, reject) => {\n if (typeof updateModelFunction !== \"function\") {\n return reject(errors.generateError(\"InternalServerError\", \"Expected argument function for update in updateOne method in crudService.\"));\n }\n Model.findOne(query, function (error, doc) {\n if (error) {\n return reject(errors.generateError(\"InternalServerError\", error));\n }\n if (doc === null) {\n return reject(errors.generateError(\"NotFoundError\", \"Not found element for update\"));\n }\n updateModelFunction(body, doc)\n .then(result => {\n doc.save(function(saveErrors) {\n if (saveErrors) {\n return reject(errors.generateError(\"InternalServerError\", saveErrors))\n }\n return resolve({status: 200});\n })\n })\n .catch(error => {\n return reject(errors.onCatchHandler(error));\n });\n })\n })\n }", "saveUpdateOneSuccess(collection, action) {\n const update = this.guard.mustBeUpdateResponse(action);\n const isOptimistic = this.isOptimistic(action);\n const mergeStrategy = this.extractMergeStrategy(action);\n collection = this.entityChangeTracker.mergeSaveUpdates([update], collection, mergeStrategy, isOptimistic /*skip unchanged if optimistic */);\n return this.setLoadingFalse(collection);\n }", "function _update(model, op, conditions, doc, options, callback) {\n const mq = new model.Query({}, {}, model, model.collection);\n\n callback = model.$handleCallbackError(callback);\n // gh-2406\n // make local deep copy of conditions\n if (conditions instanceof Document) {\n conditions = conditions.toObject();\n } else {\n conditions = utils.clone(conditions);\n }\n options = typeof options === 'function' ? options : utils.clone(options);\n\n const versionKey = get(model, 'schema.options.versionKey', null);\n _decorateUpdateWithVersionKey(doc, options, versionKey);\n\n return mq[op](conditions, doc, options, callback);\n}", "async update ({ params, request, response }) {\n }", "async update ({ params, request, response }) {\n }", "async update ({ params, request, response }) {\n }", "async update ({ params, request, response }) {\n }", "async update ({ params, request, response }) {\n }", "async update ({ params, request, response }) {\n }", "async update ({ params, request, response }) {\n }", "update(req, res) {\n if (!req.body.title || req.body.title === ''\n || !req.body.content || req.body.content === '') {\n res.send({ message: 'Both fields are required' });\n } else {\n Document.findOne({ where: { id: req.params.id } })\n .then((document) => {\n if (!document) {\n res.status(404).send({ message: 'Document could not be found!' });\n } else if (document.userId !== req.decoded.id) {\n res.status(401).send({ message: 'You can only update documents you own!' });\n } else {\n document.updateAttributes({\n title: req.body.title || document.title,\n content: req.body.content || document.content,\n }).then(() => {\n res.status(200).send({ message: 'Your document was successfully updated!' });\n });\n }\n });\n }\n }", "function findAndUpdate(model, type, id, res, updateParams) {\n model.findOne({ '_id': id}, function(err, doc) {\n if (doc && !err) {\n if (type === 'User') {\n updateUser(doc, res, updateParams);\n }\n else if (type === 'Task') {\n updateTask(doc, res, updateParams);\n }\n else {\n res.status(500).json({ message: 'Error occured updating type',\n data: [] });\n }\n }\n else {\n res.status(404).json({ message: 'Error: ' + type + ' was not found.', \n data: [] }); \n }\n });\n}", "async bulkUpdates(criteria, attributes = {}, inputTrusted = false) {\n // perpare query\n const builder = this.preQueryHelper(criteria)\n\n const tobeUpdatedAttr = {}\n\n // fill data\n // except guarded fields\n let updateableFields = this.model.updateableFieldsViaInput\n if (!updateableFields || inputTrusted)\n updateableFields = this.model.fillable\n const guardedFields = this.model.guarded\n _.each(updateableFields, field => {\n if (!_.contains(guardedFields, field)) {\n if (attributes.hasOwnProperty(field)) {\n tobeUpdatedAttr[field] = attributes[field]\n }\n }\n })\n\n // bulk update\n const result = await builder.update(tobeUpdatedAttr)\n\n return result\n }", "updateToAll() {}", "admin_update (req, res) {\n ConfigModel.findOneAndUpdate({\"_id\" : req.body._id}, req.body, {upsert:false, new:true},function (err, resData) {\n if (err) return res.json({resStatus:'error', msg : AppMessages.SERVER_ERR});\n return res.json({resStatus:'success', msg :'Update Successfull',result: resData});\n });\n }", "async update(ctx){\n try{\n const results = await ctx.db.Company.update({\n name: ctx.request.body.name,\n city: ctx.request.body.city,\n address: ctx.request.body.address\n }, {\n where: {\n id: ctx.params.id\n }\n });\n results == 0 ? ctx.throw(500,'invalid id provide') : ctx.body = `company is updated with id ${ctx.params.id}`;\n }\n catch (err) {\n ctx.throw(500, err)\n }\n }", "prepareUpdateBatch(batch) {\n return this.sql.update(this.getTable(), batch[0]);\n }", "updatePizza({ params, body }, res) {\n // The new: true parameter is to ensure that mongoose returns the new document rather than the old non-updated one \n // validators are generally only run when data is created for a document, not when its updated, so we run validators here. \n Pizza.findOneAndUpdate({ _id: params.id }, \n body, { new: true, runValidators: true })\n .then(dbPizzaData => {\n dbPizzaData ?\n res.json(dbPizzaData) :\n res.status(404).json({ message: 'No pizza found with this id! ' });\n })\n .catch(err => res.status(400).json(err));\n }", "findOneAndUpdate(query={}, data) {\n // get the collection and find the matching records using sift\n const collection = this.getCollection();\n const record = sift(query, collection)[0];\n // update the records with the new data, then validate\n Object.assign(record, data);\n return this.validate(record)\n .then(() => {\n // once updated data is validated, persist to localStorage and return the updated records\n this.setCollection(collection);\n return record;\n });\n }", "function d(t,e,r,n,o,i,s){return t.op=e,c.canMerge(r)&&t.merge(r),n&&t._mergeUpdate(n),a.isObject(o)&&t.setOptions(o),i||s?!t._update||!t.options.overwrite&&0===a.keys(t._update).length?(s&&a.soon(s.bind(null,null,0)),t):(o=t._optionsForExec(),s||(o.safe=!1),r=t._conditions,n=t._updateForExec(),u(\"update\",t._collection.collectionName,r,n,o),s=t._wrapCallback(e,s,{conditions:r,doc:n,options:o}),t._collection[e](r,n,o,a.tick(s)),t):t}", "function updateMultipleStatus(itemsDB, itemCode, swapItemCode, status, callback){\n itemsDB.updateMany({$or:[{ItemCode:itemCode},{ItemCode:swapItemCode}]}, {Status: status}, function(err,val){\n if(!err){\n if(status == \"pending\"){\n itemsDB.updateOne({ItemCode:itemCode}, {Initiated:1}, function(error2, doc2){\n if(!error2){\n itemsDB.updateOne({ItemCode:swapItemCode}, {Initiated:0}, function(error3, doc3){\n if(!error3){\n callback(false);\n } else {\n console.log(error3);\n callback(true);\n }\n });\n } else {\n console.log(error2);\n callback(true);\n }\n });\n } else if(status == \"swapped\"){\n callback(false);\n } else if(status == \"available\"){\n itemsDB.updateOne({ItemCode:itemCode}, {Initiated:0}, function(error2, doc2){\n if(!error2){\n itemsDB.updateOne({ItemCode:swapItemCode}, {Initiated:0}, function(error3, doc3){\n if(!error3){\n callback(false);\n } else {\n console.log(error3);\n callback(true);\n }\n });\n } else {\n console.log(error2);\n callback(true);\n }\n });\n }\n }else{\n console.log(err);\n callback(true);\n }\n });\n}", "update(objUpdate) {\n if(!objUpdate.id) return new Error('item missing id property');\n if(this.warehouse[objUpdate.id]) {\n this.warehouse[objUpdate.id] = Object.assign({}, objUpdate);\n return objUpdate;\n }\n else {\n return new Error('id not found');\n }\n }", "updateJob(req, res) {\n const jobtitle = req.body.jobtitle;\n const jobtype = req.body.jobtype;\n const jobdescription = req.body.jobdescription;\n const requiredexperience = req.body.requiredexperience;\n const jobprice = req.body.jobprice;\n const id = req.body.id;\n\n job\n .updateOne(\n { _id: id },\n {\n jobtitle: jobtitle,\n jobtype: jobtype,\n jobdescription: jobdescription,\n requiredexperience: requiredexperience,\n jobprice: jobprice,\n }\n )\n .then(function (result) {\n res.status(200).json({ message: \"Job has been updated\" });\n })\n .catch(function (err) {\n res.status(500).json({ message: err });\n });\n }", "updateOne(values, condition, cb) {\n orm.updateOne('burgers', values, condition, (res) => cb(res)); \n }", "updateUser({ params, body }, res) {\n // use find one and update method - search by id\n User.findOneAndUpdate({ _id: params.id }, body, {\n // return new (updated) user after update\n new: true,\n // run validators\n runValidators: true,\n })\n .then((dbUserData) => {\n // if id does not match any user, return 404\n if (!dbUserData) {\n res.status(404).json({ message: \"No user found with that id!\" });\n return;\n }\n // return updated user\n res.json(dbUserData);\n })\n // catch and return error if exists\n .catch((err) => {\n console.log(err);\n res.status(400).json(err);\n });\n }", "function update(data) {\n\t\tdebug('update request', data);\n\t\tif (!data[pk]) return emit(routes.read, {\"error\": \"no id attribute in update data for \" + routes.read});\n\t\tvar id = data[pk];\n\t\tdelete data[pk]; // ok\n\t\tdata = normalize(data);\n\t\tvar query = table.update(data).where(\n\t\t\ttable[pk].equals(id)\n\t\t).returning(\"*\").toQuery();\n\t\tdb.query(query.text, query.values, function(err, resp){\n\t\t\tdebug('update resp:', err);\n\t\t\tif (err) {\n\t\t\t\temit(routes.update, {\"error\": \"db error\"}); // TODO better specific error reporting\n\t\t\t} else {\n\t\t\t\tdebug(resp.rows);\n\t\t\t\tbroadcast(routes.update, resp.rows);\n\t\t\t}\n\t\t});\n\t}", "update(request, response) {\n console.log('request stuff', request.params, request.body);\n Resttask.findByIdAndUpdate(request.params._id, request.body, { new: true })\n .then(task => response.json(task))\n .catch(error => response.json(error));\n }", "updateEmployeeManager(employeeId, managerId) {\n return this.connection.query(\n \"UPDATE employee SET manager_id = ? WHERE id = ?\",\n [managerId, employeeId]\n );\n}", "function multiUpdate(req, user, callback){\n // Updates all twitter data of specified user\n Twitter.update({user: req.body.oldEmail}, {$set: {user: user.email}}, {multi: true},\n function (err, doc) {\n if(err){\n callback(true);\n } else {\n // Updates all tweets data of specified user\n Tweets.update({user: req.body.oldEmail}, {$set: {user: user.email}}, {multi: true},\n function (err, doc) {\n if(err){\n callback(true);\n } else {\n // Updates all shortened data of specified user\n Shortened.update({user: req.body.oldEmail}, {$set: {user: user.email}},\n {multi: true}, function (err, doc) {\n if(err){\n callback(true);\n } else {\n callback();\n }\n });\n }\n });\n }\n });\n }", "patch (id, data, query) {\r\n let model = this.model.findOne({ [this.key]: id })\r\n return model\r\n .then((modelInstance) => {\r\n for (var attribute in data) {\r\n if (data.hasOwnProperty(attribute) && attribute !== this.key && attribute !== '_id') {\r\n modelInstance[attribute] = data[attribute]\r\n }\r\n }\r\n return modelInstance.save()\r\n })\r\n .then(modelInstance => modelInstance)\r\n }", "static async updateReview(reviewId, userId, text, date){\n\n try{\n const updateResponse = await reviews.updateOne (\n // First set is where we want to update\n {user_id: user, _id: ObjectId(reviewId)},\n // Second set is what we want to update\n {$set: {text: text, date:date}} \n\n\n )\n return updateResponse\n\n }catch(e){\n console.log(\n `Unable to post review ${e}`\n )\n return{error: e}\n }\n\n }", "updateOneInCache(entity, options) {\n // update entity might be a partial of T but must at least have its key.\n // pass the Update<T> structure as the payload\n this.dispatcher.updateOneInCache(entity, options);\n }", "async updateOrder(id, invoice_no, po_no, order_items, ordered_by, status, updated_by) {\n const order = await OrderModel.findByIdAndUpdate(id, {\n invoice_no: invoice_no,\n po_no: po_no,\n order_items: this.consolidate(order_items),\n ordered_by: ordered_by,\n status: status,\n updated_by: updated_by,\n updated: Date.now()\n },\n {new: true});\n\n return order;\n }", "function y(t,e,r,n,i,o,s){return t.op=e,c.canMerge(r)&&t.merge(r),n&&t._mergeUpdate(n),a.isObject(i)&&t.setOptions(i),o||s?!t._update||!t.options.overwrite&&0===a.keys(t._update).length?(s&&a.soon(s.bind(null,null,0)),t):(i=t._optionsForExec(),s||(i.safe=!1),r=t._conditions,n=t._updateForExec(),u(\"update\",t._collection.collectionName,r,n,i),s=t._wrapCallback(e,s,{conditions:r,doc:n,options:i}),t._collection[e](r,n,i,a.tick(s)),t):t}", "handleUpdate(e) {\n e.preventDefault();\n // if user chooses to update 1 item (first item that matches parameters)\n if (this.state.UpdateProp && this.state.filter && e.target.value === 'update1') {\n fetch('/putOne', {\n method: \"PUT\",\n headers: {\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify({\n filterUpdate: this.state.filterUpdate,\n filter: this.state.filter,\n propNew: this.state.UpdateProp,\n propData: this.state.newData\n })\n }).then(res => res.json())\n .then(response => alert('project updated!'), (error) => {\n throw error.message;\n })\n\n window.location.reload(); // fetch data once more to show updates\n }\n // if user chooses to updateALL items (all items that match parameters)\n if (this.state.UpdateProp && this.state.filter && e.target.value === 'updateAll') {\n fetch('/putAll', {\n method: \"PUT\",\n headers: {\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify({\n filterUpdate: this.state.filterUpdate,\n filter: this.state.filter,\n propNew: this.state.UpdateProp,\n propData: this.state.newData\n })\n }).then(res => res.json())\n .then(response => alert('project updated!'), (error) => {\n throw error.message;\n })\n\n window.location.reload(); // fetch data once more to show updates\n }\n\n }", "onSaveUpdates() {\n\t\t\t\n\t\t\t// Some kind of bug here due to multiple components, this might be the best way around it\n\t\t\tif (!this._oODataModel.oMetadata) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis._setBusy(true);\n\n\t\t\t// Submit changes*/\n\t\t\tthis._oODataModel.submitChanges({\n\t\t\t\tsuccess: (oData) => {\n\t\t\t\t\tthis._setBusy(false);\n\t\t\t\t\tthis._handleBatchResponseAndReturnErrorFlag(oData);\n\t\t\t\t\tthis._resetODataModel();\n\t\t\t\t},\n\t\t\t\terror: this._handleSimpleODataError.bind(this)\n\t\t\t});\n\n\t\t}", "async _update(query, options, { eventId } = {}) {\n /* Add option to return record instead of a count. */\n let ret, err;\n let opts = Object.assign({ returning: true }, options);\n\n /* Update selected record. */\n [err, ret] = await to(this.Model.update(query, opts));\n if (err) this._handleErrors(err, { eventId });\n let [count, models] = ret;\n\n /* Return updated record. */\n this.cache.update = models;\n return models.map(e => e.get({ plain: true }));\n }", "update() {\n // Prepare collection with bundle schema.\n this.collection.simpleSchema = () => {\n return this.schema;\n };\n return this.collection.update.apply(this.collection, arguments);\n }", "async updateObjectInternal(collection, obj) {\n await this.handleApiResult(this.getServerInstance().promiseTimeout(this.getServerInstance().patchInCollection(collection, obj, false)));\n }", "async _updateResource(idOrObj, $set, opts, convert = true) {\n let query = {};\n if ((typeof idOrObj === 'string') && uuid_validate_1.default(idOrObj)) {\n query._id = idOrObj;\n }\n else\n query = idOrObj;\n query.deletedAt = null;\n let updatedResource;\n try {\n updatedResource = await this._model.findOneAndUpdate(query, { $set }, { new: true });\n }\n catch (e) {\n return this._handleError(e);\n }\n if (!updatedResource)\n throw new Error('general.errors.notFound');\n return convert\n ? this._convertFrom(updatedResource, opts)\n : updatedResource;\n }", "async function upsert(model, req, res) {\n // req.body.UpdatedById = req.user.id;\n\n if (Array.isArray(req.body)) {\n /*\n Bulk Insert / Update\n */\n if (req.body.length === 0) {\n handleResult(Promise.resolve([]), res);\n } else if (\"id\" in req.body[0]) {\n const records = req.body.map(body => {\n\n // Remove id from update and set where clause.\n const id = body.id;\n delete body.id;\n\n return db.models[model].update(body, {\n where: {\n id\n }\n });\n });\n handleResult(Promise.all(records), res);\n } else if (model === \"Fields\") {\n // If there are fields that don't have an Id we also want to create associated custom fields\n const records = req.body.map(field => {\n field.CustomField = {source_table: null, source_field: null, notes: null};\n return db.models[model].create(field, {\n include: [\"CustomField\"]\n });\n });\n handleResult(Promise.all(records), res);\n } else {\n const options = {\n individualHooks: true\n };\n handleResult(db.models[model].bulkCreate(req.body, options), res);\n }\n } else if (req.body.id) {\n /*\n Single Update\n */\n const record = req.body;\n const id = req.body.id;\n delete record.id;\n\n logger.info(`Updating single ${model}`);\n handleResult(\n db.models[model].update(record, {\n where: {\n id\n }\n }),\n res\n );\n } else {\n /*\n Single Insert\n */\n handleResult(db.models[model].create(req.body), res);\n }\n}", "async update({ company, position, link, description, statusId }) {\n // Same check when creating plus statusId\n if (!company || !position || !statusId) {\n // Status 422: Unprocessable Entity\n // https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/422\n throw new CustomError('Company, position and status are required', 422);\n }\n try {\n // update DB\n await db.applications.update(this.id, {\n company,\n position,\n link,\n description,\n statusId,\n id: this.id,\n createdAt: this.createdAt,\n slug: this.slug,\n });\n // update instance\n this.company = company;\n this.position = position;\n this.link = link;\n this.description = description;\n this.statusId = statusId;\n } catch (error) {\n Logger.logError('Error updating application in DB', error);\n // We suppose an error with the DB\n throw new CustomError('Sorry, application could not be updated. Try again in a few moments.', 500);;\n }\n }", "updateProperty(req,res){\n const property = propertys.find(ad => ad.id === parseInt(req.params.id))\n if(!property) return res.status(404).send({error:404, message:'property not found'})\n property.price = req.body.price,\n property.type = req.body.type,\n res.status(201).send({message: 'success', property})\n \n}", "static async updatePut(req, res, next) {\n try {\n const { title, description, status, due_date } = req.body\n const [count, data] = await ToDo.update(\n { title, description, status, due_date },\n {\n where: {\n id: +req.params.id,\n UserId: +req.decoded.id,\n },\n returning: true,\n }\n )\n if (count === 0) {\n throw { status: 404 }\n } else {\n res.status(200).json(data[0])\n }\n } catch (err) {\n next(err)\n }\n }", "function d(e,t,n,o,r,s,l){return e.op=t,c.canMerge(n)&&e.merge(n),o&&e._mergeUpdate(o),i.isObject(r)&&e.setOptions(r),s||l?!e._update||!e.options.overwrite&&0===i.keys(e._update).length?(l&&i.soon(l.bind(null,null,0)),e):(r=e._optionsForExec(),l||(r.safe=!1),n=e._conditions,o=e._updateForExec(),a(\"update\",e._collection.collectionName,n,o,r),l=e._wrapCallback(t,l,{conditions:n,doc:o,options:r}),e._collection[t](n,o,r,i.tick(l)),e):e}", "updateOnly(model, options = {}) {\n return model\n .update(\n options.pick\n ? _.pick(options.defaults, options.pick)\n : options.trim\n ? _.omitBy(options.defaults, _.isUndefined)\n : options.defaults,\n {\n where: options.where,\n transaction: options.transaction,\n // This throws and error and should not be needed for updates.\n include: undefined\n }\n )\n .then(() => {\n // Just returns number of rows updated\n return [options.defaults, false];\n });\n }", "async update () {\n\t\tif (this.dontSaveIfExists) {\n\t\t\t// or don't bother if the derived class says so\n\t\t\tthis.model = this.existingModel;\n\t\t\treturn;\n\t\t}\n\t\tawait this.determineChanges();\n\t\tawait this.doUpdate();\n\t}", "_updateCommonFields(updateData, {\n firstName, lastName, picture, website, interests, careerGoals, retired,\n }) {\n if (firstName) {\n updateData.firstName = firstName;\n }\n if (lastName) {\n updateData.lastName = lastName;\n }\n if (picture) {\n updateData.picture = picture;\n }\n if (website) {\n updateData.website = website;\n }\n if (interests) {\n updateData.interestIDs = Interests.getIDs(interests);\n }\n if (careerGoals) {\n updateData.careerGoalIDs = CareerGoals.getIDs(careerGoals);\n }\n if (_.isBoolean(retired)) {\n updateData.retired = retired;\n }\n // console.log('_updateCommonFields', updateData);\n }", "async updateDogProfile(update, id) {\n const dog = await Dog.findOne({where: {id}})\n return await dog.update(update);\n}", "static update(request, response) {\r\n\r\n clientsModel.getById(request.body.id)\r\n .then( data => {\r\n if (data.length > 0) {\r\n\r\n //recupera do body os campos que serao atualizados na tabela\r\n const conditions = [\r\n {\r\n field: 'id',\r\n value: request.body.id\r\n },\r\n {\r\n field: 'name',\r\n value: request.body.name\r\n },\r\n {\r\n field: 'email',\r\n value: request.body.email\r\n },\r\n {\r\n field: 'password',\r\n value: request.body.password\r\n },\r\n {\r\n field: 'countrycode',\r\n value: request.body.countrycode\r\n },\r\n {\r\n field: 'areacode',\r\n value: request.body.areacode\r\n },\r\n {\r\n field: 'telephone',\r\n value: request.body.telephone\r\n },\r\n {\r\n field: 'zipcode',\r\n value: request.body.zipcode\r\n },\r\n ];\r\n\r\n //chama rotina para atualizacao dos dados\r\n clientsModel.update(conditions) \r\n response.sendStatus(200);\r\n console.log('Client has been updated. ID: ', request.body.id); \r\n } else {\r\n response.sendStatus(404);\r\n console.log('Client not found. ID: ', request.body.id);\r\n }\r\n })\r\n .catch(err => {\r\n response.sendStatus(500);\r\n console.log('Error updating Client by ID: ', request.body.id, err);\r\n });\r\n \r\n }", "function _update(query, op, conditions, doc, options, callback) {\n // make sure we don't send in the whole Document to merge()\n query.op = op;\n conditions = utils.toObject(conditions);\n\n var oldCb = callback;\n if (oldCb) {\n if (typeof oldCb === 'function') {\n callback = function(error, result) {\n oldCb(error, result ? result.result : {ok: 0, n: 0, nModified: 0});\n };\n } else {\n throw new Error('Invalid callback() argument.');\n }\n }\n\n // strict is an option used in the update checking, make sure it gets set\n if (options) {\n if ('strict' in options) {\n query._mongooseOptions.strict = options.strict;\n }\n }\n\n // if doc is undefined at this point, this means this function is being\n // executed by exec(not always see below). Grab the update doc from here in\n // order to validate\n // This could also be somebody calling update() or update({}). Probably not a\n // common use case, check for _update to make sure we don't do anything bad\n if (!doc && query._update) {\n doc = query._updateForExec();\n }\n\n if (mquery.canMerge(conditions)) {\n query.merge(conditions);\n }\n\n // validate the selector part of the query\n var castedQuery = castQuery(query);\n if (castedQuery instanceof Error) {\n query._castError = castedQuery;\n if (callback) {\n callback(castedQuery);\n return query;\n } else if (!options || !options.dontThrowCastError) {\n throw castedQuery;\n }\n }\n\n // validate the update part of the query\n var castedDoc;\n try {\n var $options = {retainKeyOrder: true};\n if (options && options.minimize) {\n $options.minimize = true;\n }\n castedDoc = query._castUpdate(utils.clone(doc, $options),\n (options && options.overwrite) || op === 'replaceOne');\n } catch (err) {\n query._castError = castedQuery;\n if (callback) {\n callback(err);\n return query;\n } else if (!options || !options.dontThrowCastError) {\n throw err;\n }\n }\n\n castedDoc = setDefaultsOnInsert(query, query.schema, castedDoc, options);\n if (!castedDoc) {\n // Make sure promises know that this is still an update, see gh-2796\n query.op = op;\n callback && callback(null);\n return query;\n }\n\n if (utils.isObject(options)) {\n query.setOptions(options);\n }\n\n if (!query._update) {\n query._update = castedDoc;\n }\n\n // Hooks\n if (callback) {\n if (op === 'update') {\n return query._execUpdate(callback);\n }\n return query['_' + op](callback);\n }\n\n return Query.base[op].call(query, castedQuery, castedDoc, options, callback);\n}", "async update({request, response, params: {id}}) {\n\n const name = await nameService.findNameBy('id', id);\n\n if (name) {\n name.status = request.input('status')\n console.log(name)\n name.save()\n\n return response.status(200).send({\n status: 200,\n message: \"name updated\"\n })\n }\n else{\n return response.status(400).send({\n status: 400,\n message: \"invalid name id\"\n })\n }\n }", "updatePendingMessagesOffer(id , data){\n return this.schema.updateOne({'pendingMessages.offerId' : id },\n { '$set' : {'pendingMessages.$.messageState': data} });\n }", "'ofertas.update'(ofertaID, bOferta) {\n const oferta = Ofertas.findOne(ofertaID); //Obtiene el documento de la oferta dada su ID\n if (oferta === undefined || oferta === null) {\n throw new Meteor.Error(`[Ofertas] Lo sentimos la oferta laboral con ID: ${ofertaID} no existe.`);\n }\n\n Ofertas.update(ofertaID, {$set: bOferta}, {returnNewDocument: true});\n }", "update(id, level) {\n // CRUD - Create, Read, Update, Delete\n }" ]
[ "0.7033877", "0.7033877", "0.7033877", "0.6674613", "0.65501845", "0.65378743", "0.65124494", "0.6500941", "0.6498702", "0.64758044", "0.64499", "0.6436075", "0.6383846", "0.63816726", "0.6361778", "0.6350804", "0.63317055", "0.6253434", "0.6216551", "0.61959016", "0.6155909", "0.6128625", "0.61246294", "0.6113754", "0.6107518", "0.61065507", "0.61023635", "0.60888463", "0.6079942", "0.6076605", "0.6070454", "0.60628885", "0.60558695", "0.6055384", "0.60423714", "0.6037628", "0.6036437", "0.6031758", "0.6024523", "0.6022635", "0.6021946", "0.6020947", "0.601338", "0.6000092", "0.5975487", "0.5975256", "0.5973141", "0.59617096", "0.5958683", "0.5958683", "0.5958683", "0.5958683", "0.5958683", "0.5958683", "0.5958683", "0.5952763", "0.5948779", "0.59486157", "0.59475064", "0.59448373", "0.59446806", "0.5939806", "0.5937656", "0.59262174", "0.5922903", "0.59112924", "0.5907946", "0.58999264", "0.58871186", "0.5878722", "0.58701164", "0.58624715", "0.58429384", "0.58414197", "0.58402747", "0.5839661", "0.58381724", "0.5837589", "0.58361083", "0.58340895", "0.58285135", "0.58272195", "0.58257145", "0.58254343", "0.58208305", "0.5816463", "0.581645", "0.5810939", "0.5798337", "0.5794262", "0.57911015", "0.5789128", "0.5787902", "0.5787499", "0.57759625", "0.57740563", "0.57684225", "0.5766365", "0.57639855", "0.57491" ]
0.5818969
85
! Returns the value passed to it.
function i(t){return t}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function value() { }", "get value() {}", "get value() {}", "_get_value() {\n return this._has_value() ? this._value : undefined;\n }", "GetValue()\n\t{\n\t\treturn this.value;\n\t}", "function GetValue(param)\r\n\t{\r\n\r\n\t}", "function getVal() {\n return 5;\n}", "function get(x) { return x; }", "value() { return undefined; }", "_getValue() {\n return this._value;\n }", "function getVal(val) {\n if (typeof val === 'function') {\n return val.apply(undefined, slice.call(arguments, 1));\n } else {\n return val;\n }\n }", "function value ( ) {\n\t\treturn this[0][ !arguments.length ? 'vGet' : 'vSet' ].apply(this[0], arguments);\n\t}", "function get() {\n return _value;\n }", "value() {\n return this.#value;\n }", "get value() {\n\t\treturn this.__value;\n\t}", "get value() {\n\t\treturn this.__value;\n\t}", "get value() { return this._value; }", "get value() { return this._value; }", "get value() { return this._value; }", "get value() { return this._value; }", "get value() { return this._value; }", "get value() { return this._value; }", "get value() { return this._value; }", "get value() { return this._value; }", "get value() { return this._value; }", "get value() {\n return this.args.value;\n }", "value() {return 0}", "getValue()\n {\n return this.value;\n }", "getValue() {\n return this.value;\n }", "get value() { return this.#val; }", "valueOf() {\n return this.value;\n }", "valueOf() {\n return this.value;\n }", "valueOf() {\n return this.value;\n }", "valueOf() {\n return this.value;\n }", "get() {\n return this._value;\n }", "function get(value) {\n console.log('everything is ' + value);\n}", "get value () {\n\t\treturn this._value;\n\t}", "get value () {\n\t\treturn this._value;\n\t}", "get intValue() {}", "function returnArg() {\n\treturn arg;\n}", "getCachedValue() {\n if (!this.hasOwnProperty('value')) {\n return (this.value = this.getValue());\n }\n return this.value;\n }", "getValue() {\n return this.value;\n }", "getValue() {\n return this.value;\n }", "getValue() {\n return this.value;\n }", "function identity(val){\n\t return val;\n\t }", "function __getter(value) {\n // console.log('GET', arguments)\n\n return value;\n }", "valueOf() {\n return this.value;\n }", "valueOf() {\n return this.value;\n }", "valueOf() {\n return this.value;\n }", "valueOf() {\n return this.value;\n }", "valueOf() {\n return this.value;\n }", "valueOf() {\n return this.value;\n }", "valueOf() {\n return this.value;\n }", "get value() {\n return this.getValue();\n }", "get value() {\r\n return this._value;\r\n }", "getCurrentValue() {\n \n }", "getValue(owner){\n return this._value;\n }", "get value(){ return this._value; }", "function getVal(args) {\n return strippedValue.call(getUtilMaskEle(args), args.element);\n}", "function identify(value) {\n return value;\n}", "get value() {\n return this._value;\n }", "get value() {\n return this._value;\n }", "get value() {\n return this._value;\n }", "get value() {\n return this._value;\n }", "get value() {\n return this._value;\n }", "get value() {\n return this._value;\n }", "function getValue(el) {\n return '_value' in el ? el._value : el.value;\n}", "function getValue(el) {\n return '_value' in el ? el._value : el.value;\n}", "function getValue(el) {\n return '_value' in el ? el._value : el.value;\n}", "function getValue(el) {\n return '_value' in el ? el._value : el.value;\n}", "function getValue(el) {\n return '_value' in el ? el._value : el.value;\n}", "function getValue(el) {\n return '_value' in el ? el._value : el.value;\n}", "function getValue(el) {\n return '_value' in el ? el._value : el.value;\n}", "function getValue(el) {\n return '_value' in el ? el._value : el.value;\n}", "function getValue(el) {\r\n return '_value' in el ? el._value : el.value;\r\n}", "function getValue(el) {\r\n return '_value' in el ? el._value : el.value;\r\n}", "get value () {\n return this._value\n }", "function get_self(x) {\r\n return x;\r\n}", "getValue() {\n return this.defined ? this.value : \"None\";\n }", "get value() {\n return this.getAsElem(0);\n }", "get value() {\n return this.getAsElem(0);\n }", "get value() {\n return this._value;\n }", "getValue() {\n return this.value;\n }", "function identity(val){\n return val;\n }", "function identity(val){\n return val;\n }", "function identity(val){\n return val;\n }", "function idem(value) {\n return value;\n}", "function SoloValue() {}", "function returnArg(arg) {\n return arg;\n}", "get value() {\n this._maybeCompute();\n return this._state = 'complete' ? this._value : undefined;\n }", "getValue() { return this.input.value; }", "function get() {\n return x;\n}", "get inputValue() {\n if (this.getAsElem(0).getIf(\"value\").isPresent()) {\n return new ValueEmbedder(this.getAsElem(0).value);\n }\n else {\n return ValueEmbedder.absent;\n }\n }", "function fnDirect(value) { return value; }", "function grab(val) {\n console.log(val);\n}", "getValue() {\n\t\treturn getLast( this.stack );\n\t}", "getValue(){\n\t\treturn this.props.value;\n\t}", "get() {\n const value = this.properties[name].get_value();\n return value;\n }", "get() {\n return this.value\n }", "get() {\n return this.value;\n }", "get() {\n return this.value;\n }" ]
[ "0.74821967", "0.745293", "0.745293", "0.7302565", "0.72826886", "0.6938265", "0.69131595", "0.68675154", "0.6835031", "0.6772233", "0.6737532", "0.67359936", "0.67350465", "0.6734898", "0.6691064", "0.6691064", "0.6691053", "0.6691053", "0.6691053", "0.6691053", "0.6691053", "0.6691053", "0.6691053", "0.6691053", "0.6691053", "0.6675834", "0.66531575", "0.6636697", "0.6602993", "0.6566582", "0.65069115", "0.65069115", "0.65069115", "0.65069115", "0.6505944", "0.6505739", "0.65003085", "0.65003085", "0.6491084", "0.64709544", "0.6454886", "0.64442796", "0.64442796", "0.64442796", "0.6437841", "0.643393", "0.6429539", "0.6429539", "0.6429539", "0.6429539", "0.6429539", "0.6429539", "0.6429539", "0.64274126", "0.64217305", "0.64199", "0.6418681", "0.63936716", "0.6367962", "0.63676643", "0.6364761", "0.6364761", "0.6364761", "0.6364761", "0.6352259", "0.6352259", "0.6336483", "0.6336483", "0.6336483", "0.6336483", "0.6336483", "0.6336483", "0.6336483", "0.6336483", "0.63226914", "0.63226914", "0.6320944", "0.6307987", "0.6305127", "0.6302293", "0.6302293", "0.629529", "0.628299", "0.62706035", "0.62706035", "0.62706035", "0.6259551", "0.62407047", "0.62307054", "0.62256575", "0.62216854", "0.6217966", "0.62057304", "0.6198306", "0.6195673", "0.61929566", "0.61928123", "0.6178369", "0.61773205", "0.6156579", "0.6156579" ]
0.0
-1
! Ignore /! Removes listeners from parent
function y(t){if(null!=t&&null!=t._parent)for(const e in t._handlers)t._parent.removeListener(e,t._handlers[e])}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "removeListeners() {}", "removeListeners() {}", "removeListeners() {}", "detachListeners() {\n this.#outInterface.off('line', this.lineListener);\n this.#errInterface.off('line', this.errorListener);\n this.#child.off('exit', this.exitListener);\n this.#child.removeAllListeners('close');\n }", "removeEventListeners() {\n // Empty in base class.\n }", "function removeListeners() {\n window.removeEventListener('message', _onParentMessage);\n}", "_removeEventListeners() {\n this.currentEventListeners.forEach(listener => {\n this.domElement.removeEventListener(listener.event, listener.callBack);\n });\n this.currentEventListeners = null;\n }", "doDestroy() {\n const me = this;\n\n me.trigger('destroy');\n if (me.listeners && me.listeners.detacher) {\n me.listeners.detacher();\n }\n me.removeAllListeners();\n\n super.doDestroy();\n }", "detach() {\n const that = this;\n that._removeEventListeners();\n }", "destroy() {\n this.listeners = null;\n }", "_unlisten() {\n const that = this;\n\n if (that._trackListener) {\n that._trackListener.unlisten();\n }\n\n if (that._fillListener) {\n that._fillListener.unlisten();\n }\n\n if (that._lineListener) {\n that._lineListener.unlisten();\n }\n }", "removeAllListeners (eventName) {\n // perform default behavior, preserve fn arity\n if (eventName) {\n super.removeAllListeners(eventName)\n } else {\n super.removeAllListeners()\n }\n // re-add internal events\n this._setupInternalEvents()\n // trigger stop check just in case\n this._onRemoveListener()\n }", "removeAllListeners() {\n this.listeners = {};\n }", "removeAllListeners() {\n const me = this,\n listeners = me.eventListeners || (me.eventListeners = {});\n\n for (let event in listeners) {\n listeners[event].forEach((cfg) => me.removeListener(event, cfg));\n }\n }", "removeAll() {\n this.listeners.forEach(listener => listener.destroy());\n this.listeners = [];\n }", "_removeListeners() {\n document.removeEventListener('click', this._handleWindowClick);\n window.removeEventListener('resize', this._handleResize);\n this.el.removeEventListener('keydown', this._handleKeyDown);\n document.removeEventListener('blur', this._handleBlur, true);\n document.removeEventListener('focus', this._handleFocus, true);\n document.removeEventListener('spark.visible-children', this._handleVisibleChildren, true);\n }", "detach() {\n if (!this.owner) {\n return;\n }\n\n _each(this.events(), (handler, event) => {\n handler = Event.normalizeHandler(handler, this);\n this.owner.off(event, handler);\n });\n this.owner = null;\n }", "removeListeners()\n {\n this.cancel.removeEventListener('click', this.destroy);\n }", "_clearListeners() {\n for (let listener of this._listeners) {\n listener.remove();\n }\n this._listeners = [];\n }", "_clearListeners() {\n for (const listener of this._listeners) {\n listener.remove();\n }\n this._listeners = [];\n }", "destroy() {\n let i;\n for (let type in this._listeners) {\n let arr = this._listeners[type];\n for (i = 0; i < arr.length; i += 1) {\n arr[i] = null;\n }\n }\n }", "doDestroy() {\n this.trigger('destroy');\n this.removeAllListeners();\n super.doDestroy();\n }", "removeAllListeners() {\n const listeners = this.eventListeners;\n let i, thisObj;\n\n for (const event in listeners) {\n const bucket = listeners[event]; // We iterate backwards since we call removeListener which will splice out of\n // this array as we go...\n\n for (i = bucket.length; i-- > 0;)\n /* empty */\n {\n const cfg = bucket[i];\n this.removeListener(event, cfg);\n thisObj = cfg.thisObj;\n\n if (thisObj && thisObj.untrackDetachers) {\n thisObj.untrackDetachers(this);\n }\n }\n }\n }", "removeAllListeners() {\n this._onOpen.removeAllListeners();\n this._onMessage.removeAllListeners();\n this._onUnpackedMessage.removeAllListeners();\n this._onResponse.removeAllListeners();\n this._onSend.removeAllListeners();\n this._onClose.removeAllListeners();\n this._onError.removeAllListeners();\n }", "destroy () {\n this.eventListeners = null;\n }", "destroy() {\n this.removeDomListeners()\n // 238-4\n this.unsubscribers.forEach(unsub => unsub())\n }", "detachedCallback() {\n this.querySelector('ul').removeEventListener('click', this);\n }", "_removeEventListeners() {\n\n if (this._isNative) {\n this.selectEl.removeEventListener('change', this._onInputBound);\n }\n else {\n this.el.removeEventListener('change', this._onInputBound, true);\n }\n }", "function _clearListeners(arr) {\n if (arr == null || arr._parent == null) {\n return;\n }\n\n for (const key in arr._handlers) {\n arr._parent.removeListener(key, arr._handlers[key]);\n }\n}", "function removeEventListeners(){\n _.forEach(unlistenCallbacks, function(unlisten){\n unlisten();\n });\n unlistenCallbacks = [];\n }", "removeAllEventListeners () {\n this.eventListeners = [];\n }", "detachedCallback () {\n this.querySelector('ul').removeEventListener('click', this);\n }", "removeEvents() {\n }", "removeAllEventListeners() {\n this.eventListeners.forEach(({ target, type, boundListener }) => {\n this.log(`Removing \"${type}\" eventlistener`, target);\n target.removeEventListener(type, boundListener);\n });\n this.eventListeners.length = 0;\n }", "removeAllEventListeners() {\n this.eventListeners.forEach(({target, type, boundListener}) => {\n this.log(`Removing \"${type}\" eventlistener`, target);\n target.removeEventListener(type, boundListener);\n });\n this.eventListeners.length = 0;\n }", "function remove(){primus.removeListener(\"error\",remove).removeListener(\"open\",remove).removeListener(\"end\",remove).timers.clear(\"connect\")}", "cancel() {\n\t\tthis.removeAllListeners()\n\t}", "removeListeners() {\n const client = MatrixClientPeg.get();\n if (client === null) return;\n\n client.removeListener('sync', this.onSync);\n client.removeListener('Room.timeline', this.onRoomTimeline);\n client.removeListener('Event.decrypted', this.onEventDecrypted);\n client.removeListener('Room.timelineReset', this.onTimelineReset);\n client.removeListener('Room.redaction', this.onRedaction);\n }", "_removeEventListeners() {\n\n this.el.removeEventListener('click', this._onClickBound);\n window.removeEventListener('scroll', this._onScrollBound);\n window.removeEventListener('orientationchange', this._onScrollBound);\n document.removeEventListener('spark.visible-children', this._onVisibleBound, true);\n\n if (canObserve)\n this._removeMutationObserver();\n else\n window.removeEventListener('resize', this._onResizeBound);\n }", "disconnectedCallback() {\n this.removeEventListener(\"mousedown\", this.tapEventOn);\n this.removeEventListener(\"mouseover\", this.tapEventOn);\n this.removeEventListener(\"mouseout\", this.tapEventOff);\n this.$.button.removeEventListener(\"focused-changed\", this.focusToggle);\n super.disconnectedCallback();\n }", "removeListeners() {\n var descriptor = this.getDescriptor();\n if (descriptor) {\n descriptor.unlisten(DescriptorEventType.ACTIVATED, this.onActivated, false, this);\n descriptor.unlisten(DescriptorEventType.DEACTIVATED, this.onDeactivated, false, this);\n descriptor.unlisten(DescriptorEventType.DEACTIVATED, this.onActivationError, false, this);\n }\n }", "unWireEvent() {\n this.viewerContainer.removeEventListener('scroll', this.scrollHandler);\n this.viewerContainer.removeEventListener('mousedown', this.onMouseDownInternal);\n this.viewerContainer.removeEventListener('mousemove', this.onMouseMoveInternal);\n if (!Browser.isDevice) {\n this.editableDiv.removeEventListener('keypress', this.onKeyPressInternal);\n if (Browser.info.name === 'chrome') {\n this.editableDiv.removeEventListener('textInput', this.onTextInput);\n }\n }\n else {\n this.editableDiv.removeEventListener('input', this.onTextInputInternal);\n }\n this.editableDiv.removeEventListener('paste', this.onPaste);\n this.viewerContainer.removeEventListener('contextmenu', this.onContextMenu);\n this.editableDiv.removeEventListener('blur', this.onFocusOut);\n this.editableDiv.removeEventListener('keydown', this.onKeyDownInternal);\n this.editableDiv.removeEventListener('compositionstart', this.compositionStart);\n this.editableDiv.removeEventListener('compositionupdate', this.compositionUpdated);\n this.editableDiv.removeEventListener('compositionend', this.compositionEnd);\n this.viewerContainer.removeEventListener('mouseup', this.onMouseUpInternal);\n if (!isNullOrUndefined(this.iframe)) {\n this.iframe.removeEventListener('load', this.onIframeLoad);\n }\n this.viewerContainer.removeEventListener('dblclick', this.onDoubleTap);\n window.removeEventListener('resize', this.onWindowResize);\n window.removeEventListener('keyup', this.onKeyUpInternal);\n window.removeEventListener('mouseup', this.onImageResizer);\n window.removeEventListener('touchend', this.onImageResizer);\n }", "onChildRemove() {\n if (this._childRemove) {\n this._childRemove.raise();\n }\n }", "onChildRemove() {\n if (this._childRemove) {\n this._childRemove.raise();\n }\n }", "addOnRemove (listener) {\n this.listeners.push(listener)\n }", "unbind() {\n if (this.parent) {\n const parent = childToParent.get(this);\n parent.removeChild(this);\n }\n }", "destroy() {\n this.removeDOMListeners();\n this.unsubscribers.forEach((unsub) => unsub());\n }", "unlisten() {\n [\"change\"].forEach(name => {\n this.el_.removeEventListener(name, this.handler_, false)\n })\n\n /* Final reset */\n this.reset()\n }", "disconnectedCallback() {\n // Detect super?\n if (this.removeEvents) this.removeEvents();\n }", "detached() {\n const that = this;\n\n super.detached();\n\n that._unlisten();\n }", "onRemove() {}", "removeEventListeners() {\n\t\twindow.removeEventListener('resize', this.bindResize);\n\t\tthis.domElement.removeEventListener('click', this.bindClick);\n\t\tTweenMax.ticker.removeEventListener('tick', this.bindRender);\n\t\tEmitter.off('LOADING_COMPLETE', this.bindEnter);\n\t\twindow.removeEventListener('mousemove', this.boundMouseMove);\n\t}", "_removeListeners() {\n try {\n WINDOW$1.document.removeEventListener('visibilitychange', this._handleVisibilityChange);\n\n WINDOW$1.removeEventListener('blur', this._handleWindowBlur);\n WINDOW$1.removeEventListener('focus', this._handleWindowFocus);\n\n restoreRecordDroppedEvent();\n\n if (this._performanceObserver) {\n this._performanceObserver.disconnect();\n this._performanceObserver = null;\n }\n } catch (err) {\n this._handleException(err);\n }\n }", "_removeMessageListener() {\n handlers.remove(this.componentId);\n }", "undelegateEvents() {\n this.delegatedEventListeners.forEach(({ type, listener }) => {\n this.el.removeEventListener(type, listener);\n });\n\n this.delegatedEventListeners = [];\n }", "destroy() {\n this.emit('destroy');\n this.removeAllListeners();\n }", "onDestroy() {\n this.unlisten()\n }", "onBeforeDetach(msg) {\n this.node.addEventListener('change', this);\n this.node.removeEventListener('click', this);\n this.node.removeEventListener('dblclick', this);\n }", "_removeEventListeners() {\n this.el.removeEventListener('click', this._onClickBound);\n this.el.removeEventListener('keydown', this._onKeydownBound);\n }", "destroy() {\n\t\tdocument.removeEventListener( 'click', this.onDocumentClick, true );\n\t\tthis.el.removeEventListener( 'click', this.onSubmenuToggleClick, false );\n\t\tthis.el.removeEventListener( 'mouseover', this.onMenuItemMouseEnter, false );\n\t\tthis.el.removeEventListener( 'mouseout', this.onMenuItemMouseLeave, false );\n\t\tthis.el.removeEventListener( 'focus', this.onMenuLinkFocus, true );\n\t\tthis.el.removeEventListener( 'blur', this.onMenuLinkBlur, true );\n\t}", "detached() {\n this.__removeBroadcastEventListeners();\n }", "close() {\n events.removeListener('failure', this._listeners.failure);\n events.removeListener('success', this._listeners.success);\n events.removeListener('request', this._listeners.request);\n events.removeListener('event', this._listeners.event);\n }", "unlisten() {\n EventManager.off('resize', this.onResize)\n }", "unbindEvents() {\n this.toggleListeners.forEach(toggleListener => toggleListener.destroy());\n this.openListeners.forEach(openListener => openListener.destroy());\n this.closeListeners.forEach(closeListener => closeListener.destroy());\n this.radioOpenListeners.forEach(radioOpenListener => radioOpenListener.destroy());\n this.radioCloseListeners.forEach(radioCloseListener => radioCloseListener.destroy());\n this.inputOpenListeners.forEach(inputOpenListener => inputOpenListener.destroy());\n }", "function killListeners (poly){\n //Elimino los listener del array de Listeners\n for (var i=poly.listeners.length-1; i>=0;i--){\n poly.listeners[i].remove();\n poly.listeners.pop\n } \n }", "dispose() {\n // Perfect place to remove eventlisteners etc\n }", "kill() {\n this.removeEventListeners();\n }", "function removeListeners() {\r\n gameOverModal.btn.removeEventListener(\"click\", backToMenu);\r\n }", "__detatchListeners() {\n if (qx.bom.History.SUPPORTS_HASH_CHANGE_EVENT) {\n qx.bom.Event.removeNativeListener(\n window,\n \"hashchange\",\n this.__checkOnHashChange\n );\n } else {\n qx.event.Idle.getInstance().removeListener(\n \"interval\",\n this.__onHashChange,\n this\n );\n }\n }", "destroy() {\n this.emitter.removeAllListeners();\n }", "remove() {\n //remove handlers of any atomic data defined here\n const {source, handler} = this.events;\n source.remove();\n //reset `this.events` \n this.events = {};\n }", "remove() {\n //remove handlers of any atomic data defined here\n const {source, handler} = this.events;\n source.remove();\n //reset `this.events` \n this.events = {};\n }", "_removeEventListeners () {\n this._socket.removeAllListeners(ConnectionSocket.EVENT_ESTABLISHED)\n this._socket.removeAllListeners(ConnectionSocket.EVENT_CLOSED)\n this._socket.removeAllListeners(ConnectionSocket.EVENT_PEER_CONNECTED)\n this._socket.removeAllListeners(ConnectionSocket.EVENT_PEER_PING)\n this._socket.removeAllListeners(ConnectionSocket.EVENT_PEER_SIGNAL)\n this._rtc.removeAllListeners(ConnectionRTC.EVENT_RTC_SIGNAL)\n this._rtc.removeAllListeners(ConnectionRTC.EVENT_PEER_PING)\n this._rtc.removeAllListeners(ConnectionRTC.EVENT_CLOSED)\n }", "destroy() {\n\t\tfor(const [event, listener] of this.listeners) this.client.removeListener(event, listener);\n\t\tthis.listeners.clear();\n\t}", "_removeHandleListeners() {\n this._startHandle.on(\".drag\", null);\n this._endHandle.on(\".drag\", null);\n }", "removeEventListeners() {\r\n this.elementListener.removeEventListener(\"mouseenter\", this.onMouseEnterBind);\r\n this.elementListener.removeEventListener(\"mouseleave\", this.onMouseLeaveBind);\r\n this.elementListener.removeEventListener(\"mousemove\", this.onMouseMoveBind);\r\n \r\n if (this.gyroscope) {\r\n window.removeEventListener(\"deviceorientation\", this.onDeviceOrientationBind);\r\n }\r\n \r\n if (this.glare || this.fullPageListening) {\r\n window.removeEventListener(\"resize\", this.onWindowResizeBind);\r\n }\r\n }", "function removeListeners() {\r\n modal.yes.removeEventListener(\"click\", backToMenu);\r\n modal.no.removeEventListener(\"click\", backToGame);\r\n }", "onDestroy() {\n for(var topic in this.listeners) {\n this.removeTopic(topic);\n }\n clearInterval(this.panInterval);\n super.onDestroy();\n }", "addListeners()\n {\n this.destroy = this.destroy.bind(this);\n this.cancel.addEventListener('click', this.destroy);\n }", "destroy() {\n this.fireEvent('destroy', this);\n\n this.removeListeners();\n }", "componentWillUnmount() {\n this.removeListeners();\n }", "function Label_NotifyDestruction()\n{\n\t//request parent form\n\tvar parentForm = this.InterpreterObject.GetParentFormObject();\n\t//valid?\n\tif (parentForm && parentForm.HTML)\n\t{\n\t\t//remove ourselves from the array\n\t\tparentForm.HTML.OnKeyDownListenerIds.Remove(this.id);\n\t}\n}", "removeEventListeners() {\n this.elementListener.removeEventListener(\"mouseenter\", this.onMouseEnterBind);\n this.elementListener.removeEventListener(\"mouseleave\", this.onMouseLeaveBind);\n this.elementListener.removeEventListener(\"mousemove\", this.onMouseMoveBind);\n\n if (this.gyroscope) {\n window.removeEventListener(\"deviceorientation\", this.onDeviceOrientationBind);\n }\n\n if (this.glare || this.fullPageListening) {\n window.removeEventListener(\"resize\", this.onWindowResizeBind);\n }\n }", "detachListeners () {\n if (this.listenersAttached) {\n window.removeEventListener('resize', this.handleWindowResize)\n window.removeEventListener('mouseup', this.handleMouseUp)\n window.removeEventListener('touchend', this.handleTouchEnd)\n window.removeEventListener('touchcancel', this.handleTouchEnd)\n window.removeEventListener('pointerdown', this.handlePointerEvent)\n window.removeEventListener('pointermove', this.handlePointerEvent)\n window.removeEventListener('pointerup', this.handlePointerEvent)\n window.removeEventListener('pointercancel', this.handlePointerEvent)\n this.listenersAttached = false\n }\n }", "remove() {\n this.target.removeListener(this.event, this.callback, {\n context: this.context,\n remaining: this.remaining\n });\n }", "removeAllEvents() {\n this.destroy();\n }", "removeDragListeners() {}", "removeDragListeners() {}", "function clearPrimaryListeners() {\n clearInterval(consuming);\n // consumer.removeListener('data', receiveData);\n consumer.removeListener('error', error);\n events.removeListener('worker:shutdown', shutdown);\n }", "terminal() {\n this.eventStream.removeAllListeners();\n this.getRoot().getInstance().context.children.clear();\n }", "_cleanToRemovedListeners() {\n const toRemovedListeners = this._toRemovedListeners;\n\n for (let i = 0; i < toRemovedListeners.length; ++i) {\n const selListener = toRemovedListeners[i];\n\n const listeners = this._listenersMap[selListener._getListenerID()];\n\n if (!listeners) {\n continue;\n }\n\n const fixedPriorityListeners = listeners.getFixedPriorityListeners();\n const sceneGraphPriorityListeners = listeners.getSceneGraphPriorityListeners();\n\n if (sceneGraphPriorityListeners) {\n const idx = sceneGraphPriorityListeners.indexOf(selListener);\n\n if (idx !== -1) {\n sceneGraphPriorityListeners.splice(idx, 1);\n }\n }\n\n if (fixedPriorityListeners) {\n const idx = fixedPriorityListeners.indexOf(selListener);\n\n if (idx !== -1) {\n fixedPriorityListeners.splice(idx, 1);\n }\n }\n }\n\n toRemovedListeners.length = 0;\n }", "function removeAllListeners(container, opt) {\n container.children().each(function() {\n try {\n jQuery(this).die('click');\n } catch (e) {\n }\n try {\n jQuery(this).die('mouseenter');\n } catch (e) {\n }\n try {\n jQuery(this).die('mouseleave');\n } catch (e) {\n }\n try {\n jQuery(this).unbind('hover');\n } catch (e) {\n }\n })\n try {\n container.die('click', 'mouseenter', 'mouseleave');\n } catch (e) {\n }\n clearInterval(opt.cdint);\n container = null;\n\n\n\n }", "detach() {\n this.attached.removeEventListener('mousedown', this.event);\n this.attached.removeEventListener('mouseup', this.event);\n this.attached.removeEventListener('click', this.event);\n this.attached.removeEventListener('dblclick', this.event);\n \n this.attached = null;\n }", "cleanEchoListeners() {\n this.echoListeners.forEach(element => {\n window.Echo.private(\n element.channel\n ).stopListening(element.event);\n });\n }", "undelegateEvents() {\n if (!this.$el) {\n return;\n }\n\n this.$el.off('.delegateEvents' + this.cid);\n }", "_removeEvents () {\n this.container.classList.remove(\"tooltiped\");\n\n this.container.removeEventListener(\"mouseenter\", this._mouseOver);\n this.container.removeEventListener(\"mousemove\", this._mouseMove);\n this.container.removeEventListener(\"mouseleave\", this._mouseOut);\n }", "removeDisplayedListeners() {\n if ( this.visibilityTracker ) {\n this.visibilityTracker.removeListener( this.boundVisibilityListener );\n this.visibilityTracker.dispose();\n this.visibilityTracker = null;\n }\n if ( this.node ) {\n this.node.changedInstanceEmitter.removeListener( this.boundInstancesChangedListener );\n this.node = null;\n }\n }", "_onTweenerRemove () {}", "function removeListener(w, event, cb) {\n\t if(w.detachEvent) w.detachEvent('on' + event, cb);\n\t else if (w.removeEventListener) w.removeEventListener(event, cb, false);\n\t }", "function removeListener(w, event, cb) {\n\t if(w.detachEvent) w.detachEvent('on' + event, cb);\n\t else if (w.removeEventListener) w.removeEventListener(event, cb, false);\n\t }" ]
[ "0.7566249", "0.7566249", "0.7566249", "0.73587704", "0.7239737", "0.72362185", "0.70446074", "0.7024819", "0.68826467", "0.68824977", "0.6870223", "0.6862425", "0.6849543", "0.68463", "0.6837777", "0.683191", "0.68318266", "0.68052083", "0.6768219", "0.6766341", "0.67645943", "0.67582434", "0.67443115", "0.67405427", "0.6723607", "0.6718948", "0.6703298", "0.66838026", "0.6683509", "0.66810805", "0.667222", "0.66559815", "0.6653225", "0.66456115", "0.66442806", "0.66299856", "0.6629685", "0.6616831", "0.66071206", "0.660439", "0.66031635", "0.6564942", "0.6559929", "0.6559929", "0.65550125", "0.65406233", "0.65355825", "0.65354925", "0.65232974", "0.6509636", "0.64970595", "0.6484132", "0.64834946", "0.6481008", "0.64680326", "0.6467836", "0.6465929", "0.6463182", "0.6461012", "0.64344823", "0.64337033", "0.64330405", "0.642434", "0.6419438", "0.6401824", "0.63926214", "0.6391014", "0.6380985", "0.6373319", "0.63621646", "0.6358128", "0.6358128", "0.63565874", "0.63519186", "0.63501334", "0.63449615", "0.63447744", "0.6333019", "0.6330038", "0.6329921", "0.63290983", "0.6328287", "0.63270307", "0.6327013", "0.63194644", "0.63174933", "0.6312085", "0.6312085", "0.6311649", "0.6310247", "0.63091403", "0.6304726", "0.63045996", "0.6294417", "0.628979", "0.6287202", "0.6283786", "0.6269529", "0.6268397", "0.6268397" ]
0.7062334
6
! ignore /! ignore
function y(t){h||(h=n(70));const e=function(t,e,n){const r=this;this.$parent=n,h.apply(this,arguments),n&&(n.on("save",function(){r.emit("save",r),r.constructor.emit("save",r)}),n.on("isNew",function(t){r.isNew=t,r.emit("isNew",t),r.constructor.emit("isNew",t)}))};(e.prototype=Object.create(h.prototype)).$__setSchema(t),e.prototype.constructor=e,e.schema=t,e.$isSingleNested=!0,e.prototype.toBSON=function(){return this.toObject(p)};for(const n in t.methods)e.prototype[n]=t.methods[n];for(const n in t.statics)e[n]=t.statics[n];for(const t in i.prototype)e[t]=i.prototype[t];return e}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ignore() { }", "get Ignore() {}", "set Ignore(value) {}", "function ignore() {\n return null\n}", "function ignore() {\n return null;\n}", "function ignore() {\n return null\n }", "function IGNORE() {\r\n //Do not delete.\r\n }", "function skip(){\n\t\n}", "function ignore(){\n var b = readify('beta-ignoring', false)\n\n if (! b) {\n verb(\"Ignoring...\")\n var us = usernames()\n\n for (var i = 0; i < us.length; i++){\n var uname = us[i].children[0].textContent\n var users = ignoredUsers()\n var posts = ignoredPosts()\n\n try {\n if (users.indexOf(uname) !== -1){\n verb(\"Ignoring \" + uname)\n var e = us[i].parentNode\n e.style.display = \"none\"\n e.nextElementSibling.style.display = \"none\"\n e.nextElementSibling.nextElementSibling.style.display = \"none\"\n e.nextElementSibling.nextElementSibling.nextElementSibling.style.display = \"none\"\n\n } else if (posts !== null\n && usernamePost(us[i]).textContent.match(posts)) {\n verb(\"Ignoring post of \" + uname)\n var e = us[i].parentNode\n e.style.display = \"none\"\n e.nextElementSibling.style.display = \"none\"\n e.nextElementSibling.nextElementSibling.style.display = \"none\"\n e.nextElementSibling.nextElementSibling.nextElementSibling.style.display = \"none\"\n }\n\n } catch(e) {\n debu(e.toString())\n }\n }\n }\n}", "function skipHello(){saidHello=true;}", "function isIgnored$2 (self, path$$1) {\n if (!self.ignore.length)\n return false\n\n return self.ignore.some(function(item) {\n return item.matcher.match(path$$1) || !!(item.gmatcher && item.gmatcher.match(path$$1))\n })\n}", "addDefaultGitIgnore() {\n this.gitignore.exclude('# Byte-compiled / optimized / DLL files', '__pycache__/', '*.py[cod]', '*$py.class', '', '# C extensions', '*.so', '', '# Distribution / packaging', '.Python', 'build/', 'develop-eggs/', 'dist/', 'downloads/', 'eggs/', '.eggs/', 'lib/', 'lib64/', 'parts/', 'sdist/', 'var/', 'wheels/', 'share/python-wheels/', '*.egg-info/', '.installed.cfg', '*.egg', 'MANIFEST', '', '# PyInstaller', '# Usually these files are written by a python script from a template', '# before PyInstaller builds the exe, so as to inject date/other infos into it.', '*.manifest', '*.spec', '', '# Installer logs', 'pip-log.txt', 'pip-delete-this-directory.txt', '', '# Unit test / coverage reports', 'htmlcov/', '.tox/', '.nox/', '.coverage', '.coverage.*', '.cache', 'nosetests.xml', 'coverage.xml', '*.cover', '*.py,cover', '.hypothesis/', '.pytest_cache/', 'cover/', '', '# Translations', '*.mo', '*.pot', '', '# Django stuff:', '*.log', 'local_settings.py', 'db.sqlite3', 'db.sqlite3-journal', '', '# Flask stuff:', 'instance/', '.webassets-cache', '', '# Scrapy stuff:', '.scrapy', '', '# Sphinx documentation', 'docs/_build/', '', '# PyBuilder', '.pybuilder/', 'target/', '', '# Jupyter Notebook', '.ipynb_checkpoints', '', '# IPython', 'profile_default/', 'ipython_config.py', '', '# PEP 582; used by e.g. github.com/David-OConnor/pyflow', '__pypackages__/', '', '# Celery stuff', 'celerybeat-schedule', 'celerybeat.pid', '', '# SageMath parsed files', '*.sage.py', '', '# Environments', '.env', '.venv', 'env/', 'venv/', 'ENV/', 'env.bak/', 'venv.bak/', '', '# Spyder project settings', '.spyderproject', '.spyproject', '', '# Rope project settings', '.ropeproject', '', '# mkdocs documentation', '/site', '', '# mypy', '.mypy_cache/', '.dmypy.json', 'dmypy.json', '', '# Pyre type checker', '.pyre/', '', '# pytype static type analyzer', '.pytype/', '', '# Cython debug symbols', 'cython_debug/');\n }", "ignoreEvent(event) { return true; }", "function should_ignore(_testCase, testName) {\r\n\tif (_testCase[\"_should\"] == undefined) \r\n\t\t_testCase[\"_should\"] = {};\r\n\tif (_testCase[\"_should\"][\"ignore\"] == undefined) \r\n\t\t_testCase[\"_should\"][\"ignore\"] = {};\r\n\t_testCase[\"_should\"][\"ignore\"][testName] = true;\t\t\r\n}", "function shouldIgnoreFile(file){\n return /\\/_/.test(file)\n}", "function isIgnore(flags) {\n return (flags & FLAGS.IGNORE) === FLAGS.IGNORE;\n }", "function ignore(self) {\n return fold_(self, _index5.constVoid, _index5.constVoid);\n}", "function skip() {\n this.shouldSkip = true;\n}", "ignore(uri) {\n this.ignoredFileURIs.add(uri);\n console.log(`${uri} ignored`);\n }", "function Skip() { return Skip }", "function skip() {\n\t this.shouldSkip = true;\n\t}", "function skip() {\n\t this.shouldSkip = true;\n\t}", "function cfIgnore() {\n return file('.cfignore', 'node_modules \\nsrc \\npackage.json \\npackage-lock.json\\nconfig.yml \\ngulpfile.babel.js \\nREADME.md', {src: true})\n .pipe(gulp.dest('./dist/'));\n}", "function shouldIgnore(filename, ignore, only) {\n\t filename = _slash2[\"default\"](filename);\n\n\t if (only) {\n\t var _arr = only;\n\n\t for (var _i = 0; _i < _arr.length; _i++) {\n\t var pattern = _arr[_i];\n\t if (_shouldIgnore(pattern, filename)) return false;\n\t }\n\t return true;\n\t } else if (ignore.length) {\n\t var _arr2 = ignore;\n\n\t for (var _i2 = 0; _i2 < _arr2.length; _i2++) {\n\t var pattern = _arr2[_i2];\n\t if (_shouldIgnore(pattern, filename)) return true;\n\t }\n\t }\n\n\t return false;\n\t}", "function shouldIgnore(filename, ignore, only) {\n\t filename = _slash2[\"default\"](filename);\n\n\t if (only) {\n\t var _arr = only;\n\n\t for (var _i = 0; _i < _arr.length; _i++) {\n\t var pattern = _arr[_i];\n\t if (_shouldIgnore(pattern, filename)) return false;\n\t }\n\t return true;\n\t } else if (ignore.length) {\n\t var _arr2 = ignore;\n\n\t for (var _i2 = 0; _i2 < _arr2.length; _i2++) {\n\t var pattern = _arr2[_i2];\n\t if (_shouldIgnore(pattern, filename)) return true;\n\t }\n\t }\n\n\t return false;\n\t}", "function isIgnoredElement(ele) {\n return !ele.hasAttribute || ele.hasAttribute('data-ignore') || $(ele).parents(\"[data-ignore]\").length > 0;\n}", "function skipBlockComment () {\n i += 2;\n while (i < jsString.length && (curr() !== '*' || next() !== '/')) {\n i++;\n }\n i += 2;\n }", "function isIgnored (self, path) {\n\t if (!self.ignore.length)\n\t return false\n\t\n\t return self.ignore.some(function(item) {\n\t return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))\n\t })\n\t}", "function isIgnored (self, path) {\n\t if (!self.ignore.length)\n\t return false\n\t\n\t return self.ignore.some(function(item) {\n\t return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))\n\t })\n\t}", "function ignoreElements() {\n return function ignoreElementsOperatorFunction(source) {\n return source.lift(new IgnoreElementsOperator());\n };\n}", "function onIgnoreTagStripAll(){return\"\";}", "function __FIXME_SBean_assert_ignore_list() {\n\tthis._pname_ = \"assert_ignore_list\";\n\t//this.keywords:\t\tset[string]\t\n}", "function isIgnored (self, path) {\n if (!self.ignore.length)\n return false\n \n return self.ignore.some(function(item) {\n return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))\n })\n }", "skip(opSt) { return false; }", "function isIgnored$2 (self, path) {\n if (!self.ignore.length)\n return false\n\n return self.ignore.some(function(item) {\n return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))\n })\n}", "function shouldIgnore(filename, ignore, only) {\n filename = _slash2[\"default\"](filename);\n\n if (only) {\n var _arr = only;\n\n for (var _i = 0; _i < _arr.length; _i++) {\n var pattern = _arr[_i];\n if (_shouldIgnore(pattern, filename)) return false;\n }\n return true;\n } else if (ignore.length) {\n var _arr2 = ignore;\n\n for (var _i2 = 0; _i2 < _arr2.length; _i2++) {\n var pattern = _arr2[_i2];\n if (_shouldIgnore(pattern, filename)) return true;\n }\n }\n\n return false;\n}", "function applyTsIgnore(ast) {\n const fqn = getFqn(ast);\n if (fqnToIgnore[fqn]) {\n let description = \"\";\n if (_.isString(fqnToIgnore[fqn])) {\n description = fqnToIgnore[fqn];\n }\n return `// @ts-ignore - ${description}` + NL;\n } else {\n return \"\";\n }\n}", "function isIgnored(self, path) {\n if (!self.ignore.length) return false;\n return self.ignore.some(function (item) {\n return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path));\n });\n}", "function isIgnored (self, path) {\n\t if (!self.ignore.length)\n\t return false\n\n\t return self.ignore.some(function(item) {\n\t return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))\n\t })\n\t}", "function isIgnored (self, path) {\n\t if (!self.ignore.length)\n\t return false\n\n\t return self.ignore.some(function(item) {\n\t return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))\n\t })\n\t}", "async set_ignore(params) {\n var schema = {\n stub: { required: 'string', format: 'lowercase' },\n symbol: { required: 'string', format: 'uppercase' },\n ignored: { required: 'boolean' }\n }\n\n if (!(params = this.utils.validator(params, schema))) return false; \n\n var [stub, symbol, ignored] = this.utils.extract_props(params, ['stub', 'symbol', 'ignored']); \n\n var list = await this.config.get(stub + ':ignored');\n if (this.utils.is_array(list)) {\n if (!list.includes(symbol)) {\n list.push(symbol);\n this.set_ignore_list(stub, list);\n }\n }\n \n\n\n }", "function ignore(self, __trace) {\n return fold_(self, _index12.constVoid, _index12.constVoid, __trace);\n}", "function isIgnored (self, path) {\n if (!self.ignore.length)\n return false\n\n return self.ignore.some(function(item) {\n return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))\n })\n}", "function isIgnored (self, path) {\n if (!self.ignore.length)\n return false\n\n return self.ignore.some(function(item) {\n return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))\n })\n}", "function isIgnored (self, path) {\n if (!self.ignore.length)\n return false\n\n return self.ignore.some(function(item) {\n return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))\n })\n}", "function isIgnored (self, path) {\n if (!self.ignore.length)\n return false\n\n return self.ignore.some(function(item) {\n return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))\n })\n}", "function isIgnored (self, path) {\n if (!self.ignore.length)\n return false\n\n return self.ignore.some(function(item) {\n return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))\n })\n}", "function isIgnored (self, path) {\n if (!self.ignore.length)\n return false\n\n return self.ignore.some(function(item) {\n return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))\n })\n}", "function isIgnored (self, path) {\n if (!self.ignore.length)\n return false\n\n return self.ignore.some(function(item) {\n return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))\n })\n}", "function isIgnored (self, path) {\n if (!self.ignore.length)\n return false\n\n return self.ignore.some(function(item) {\n return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))\n })\n}", "function isIgnored (self, path) {\n if (!self.ignore.length)\n return false\n\n return self.ignore.some(function(item) {\n return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))\n })\n}", "function isIgnored (self, path) {\n if (!self.ignore.length)\n return false\n\n return self.ignore.some(function(item) {\n return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))\n })\n}", "function isIgnored (self, path) {\n if (!self.ignore.length)\n return false\n\n return self.ignore.some(function(item) {\n return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))\n })\n}", "function isIgnored (self, path) {\n if (!self.ignore.length)\n return false\n\n return self.ignore.some(function(item) {\n return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))\n })\n}", "function isIgnored (self, path) {\n if (!self.ignore.length)\n return false\n\n return self.ignore.some(function(item) {\n return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))\n })\n}", "function isIgnored (self, path) {\n if (!self.ignore.length)\n return false\n\n return self.ignore.some(function(item) {\n return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))\n })\n}", "function isIgnored (self, path) {\n if (!self.ignore.length)\n return false\n\n return self.ignore.some(function(item) {\n return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))\n })\n}", "function isIgnored (self, path) {\n if (!self.ignore.length)\n return false\n\n return self.ignore.some(function(item) {\n return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))\n })\n}", "function isIgnored (self, path) {\n if (!self.ignore.length)\n return false\n\n return self.ignore.some(function(item) {\n return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))\n })\n}", "function isIgnored (self, path) {\n if (!self.ignore.length)\n return false\n\n return self.ignore.some(function(item) {\n return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))\n })\n}", "function isIgnored (self, path) {\n if (!self.ignore.length)\n return false\n\n return self.ignore.some(function(item) {\n return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))\n })\n}", "function isIgnored (self, path) {\n if (!self.ignore.length)\n return false\n\n return self.ignore.some(function(item) {\n return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))\n })\n}", "function isIgnored (self, path) {\n if (!self.ignore.length)\n return false\n\n return self.ignore.some(function(item) {\n return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))\n })\n}", "function isIgnored (self, path) {\n if (!self.ignore.length)\n return false\n\n return self.ignore.some(function(item) {\n return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))\n })\n}", "function isIgnored (self, path) {\n if (!self.ignore.length)\n return false\n\n return self.ignore.some(function(item) {\n return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))\n })\n}", "function isIgnored (self, path) {\n if (!self.ignore.length)\n return false\n\n return self.ignore.some(function(item) {\n return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))\n })\n}", "function isIgnored (self, path) {\n if (!self.ignore.length)\n return false\n\n return self.ignore.some(function(item) {\n return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))\n })\n}", "function isIgnored (self, path) {\n if (!self.ignore.length)\n return false\n\n return self.ignore.some(function(item) {\n return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))\n })\n}", "function isIgnored (self, path) {\n if (!self.ignore.length)\n return false\n\n return self.ignore.some(function(item) {\n return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))\n })\n}", "function isIgnored (self, path) {\n if (!self.ignore.length)\n return false\n\n return self.ignore.some(function(item) {\n return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))\n })\n}", "function isIgnored (self, path) {\n if (!self.ignore.length)\n return false\n\n return self.ignore.some(function(item) {\n return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))\n })\n}", "function isIgnored (self, path) {\n if (!self.ignore.length)\n return false\n\n return self.ignore.some(function(item) {\n return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))\n })\n}", "function shouldIgnore(filename, ignore) {\n var relname = normalizeSlashes(filename);\n return ignore.some(function (x) { return x.test(relname); });\n}", "function isIgnored(self, path) {\n if (!self.ignore.length) return false;\n\n return self.ignore.some(function (item) {\n return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path));\n });\n}", "static continue(command, ignore = false, rest = null) {\n return new Flag(\"continue\", { command, ignore, rest });\n }", "function _shouldIgnore(pattern, filename) {\n\t if (typeof pattern === \"function\") {\n\t return pattern(filename);\n\t } else {\n\t return pattern.test(filename);\n\t }\n\t}", "function _shouldIgnore(pattern, filename) {\n\t if (typeof pattern === \"function\") {\n\t return pattern(filename);\n\t } else {\n\t return pattern.test(filename);\n\t }\n\t}", "function _shouldIgnore(pattern, filename) {\n\t if (typeof pattern === \"function\") {\n\t return pattern(filename);\n\t } else {\n\t return pattern.test(filename);\n\t }\n\t}", "function blockUnrequired(){\r\n\tset(\"V[z_vaxx_*]\",\"\");\r\n\tset(\"V[z_va01_*]\",\"\");\r\n}", "function notBlockUseCase() { console.log('Not an block use case');}", "dontWantToken () {\n\t\treturn true;\n\t}", "preset () { return false }", "function skipHello() {\n saidHello = true;\n}", "function skipHello() {\n saidHello = true;\n}", "function skipHello() {\n saidHello = true;\n}", "function skipHello() {\n saidHello = true;\n}", "function skipHello() {\n saidHello = true;\n}", "function ignoreInteractions() {\n\n if ( ignoreinteractions === false ) ignoreinteractions = true;\n else ignoreinteractions = false;\n\n // In any case we should redo Post Hoc tests!\n\n buildPostHocTests();\n\n }", "function skipHello()\n{\n saidHello = true;\n}", "shouldIgnoreFile(fileNameSplitByDot) {\n const isHidden = !fileNameSplitByDot[0];\n const hasNoExtension = fileNameSplitByDot.length === 1;\n return isHidden || hasNoExtension;\n }", "function hello2() {\n const bye = \"bye\";\n\n /**\n * For disable the es-lint on the line\n * Please put the below comment\n * now instead of the error we will have the warning for below 2\n */\n // eslint-disable-next-line\n console.log(\"this is sample \", bye);\n\n /**\n * disabling a particular rule for the eslint\n */\n // eslint-disable-next-line quotes\n console.log(\"this is sample \", 2323232);\n\n const a = 95;\n\n console.log(`vaylue for the a the `, a);\n}", "function noop() { } // tslint:disable-line:no-empty", "function Ne(e,t,a){return\"string\"==typeof t&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),Te(e,a||t.type,e,t),Le(t)||t.codemirrorIgnore}", "function skipHello() {\n saidHello = true;\n}", "warn() {}", "function exclusionaryTests() {\n\tdanger.git.created_files\n\t\t.filter(filepath => filepath.endsWith('.test.js'))\n\t\t.map(filepath => ({filepath, content: readFile(filepath)}))\n\t\t.filter(\n\t\t\t({content}) =>\n\t\t\t\tcontent.includes('it.only') || content.includes('describe.only'),\n\t\t)\n\t\t.forEach(({filepath}) =>\n\t\t\twarn(\n\t\t\t\t`An <code>only</code> was left in ${filepath} – no other tests can run.`,\n\t\t\t),\n\t\t)\n}", "function skipProv(p) {return (skip && (SKIP.indexOf(p)>=0));}", "function omit(track) {\n try {\n // return unmodified track if setting is turned off\n if (!Settings.Get().omit.switch) {\n return track;\n }\n else {\n // return unmodified track if the keyword list is empty\n if (Settings.Get().omit.keywords == '') {\n return track;\n }\n else {\n try {\n // split the keywords string at (',') and iterate through them\n Settings.Get().omit.keywords.split(',').forEach(function(keyword) {\n // if a match is found it will be replaced with an empty string\n track = track.replace(RegExp(Helper.RegExp.Escape(keyword), 'gi'), '');\n });\n // return the modified track \n return track;\n }\n // if no seperator has been found, assume there is only one keyword\n catch {\n // if a match is found it will be replaced with an empty string\n track = track.replace(RegExp(Helper.RegExp.Escape(Settings.Get().omit.keywords), 'gi'), '');\n return track;\n }\n }\n }\n }\n catch {\n return track;\n }\n}", "no_op() {}", "hacky(){\n return\n }", "function noop(){}// No operation performed." ]
[ "0.8652147", "0.7446572", "0.73859835", "0.7234087", "0.7167445", "0.70217335", "0.67718285", "0.6404717", "0.61901206", "0.6141006", "0.611969", "0.6112831", "0.60844624", "0.60475874", "0.60462904", "0.60432476", "0.60051274", "0.5981711", "0.5976254", "0.5972818", "0.5935619", "0.5935619", "0.5925366", "0.5894516", "0.5894516", "0.5829746", "0.58288664", "0.58171844", "0.58171844", "0.5816781", "0.5809409", "0.58062756", "0.57885814", "0.5786809", "0.5781662", "0.57662535", "0.57216376", "0.57107085", "0.5706412", "0.5706412", "0.5691542", "0.56828785", "0.56770533", "0.56770533", "0.56770533", "0.56770533", "0.56770533", "0.56770533", "0.56770533", "0.56770533", "0.56770533", "0.56770533", "0.56770533", "0.56770533", "0.56770533", "0.56770533", "0.56770533", "0.56770533", "0.56770533", "0.56770533", "0.56770533", "0.56770533", "0.56770533", "0.56770533", "0.56770533", "0.56770533", "0.56770533", "0.56770533", "0.56770533", "0.56770533", "0.56770533", "0.56770533", "0.56728107", "0.56529355", "0.56369984", "0.5626949", "0.5626949", "0.5626949", "0.56161416", "0.5609741", "0.56076837", "0.5604408", "0.5587355", "0.5587355", "0.5587355", "0.5587355", "0.5587355", "0.5564175", "0.5562831", "0.5561341", "0.5552319", "0.5551413", "0.5541745", "0.55403334", "0.55370325", "0.5536922", "0.5519766", "0.5508956", "0.5504736", "0.54877645", "0.54854244" ]
0.0
-1
! ignore /! Returns this documents _id cast to a string.
function r(){return null!=this._id?String(this._id):null}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function o(){return null!=this._id?String(this._id):null}", "toString() {\r\n\t\t\treturn 's' + this.idNum;\r\n\t\t}", "function n(){return null!=this._id?String(this._id):null}", "function n(){return null!=this._id?String(this._id):null}", "toString() {\n return this.id();\n }", "getId() {\n const parent = this.getParent();\n return parent ? `${parent.getId()}/${this.getInternalId()}` : this.getInternalId();\n }", "function idGetter() {\n if (this._id != null) {\n return String(this._id);\n }\n\n return null;\n}", "function idGetter() {\n if (this._id != null) {\n return String(this._id);\n }\n\n return null;\n}", "function idGetter() {\n if (this._id != null) {\n return String(this._id);\n }\n\n return null;\n}", "function idGetter() {\n if (this._id != null) {\n return String(this._id);\n }\n\n return null;\n}", "function idGetter() {\n if (this._id != null) {\n return String(this._id);\n }\n\n return null;\n}", "idString() {\n return ( Date.now().toString( 36 ) + Math.random().toString( 36 ).substr( 2, 5 ) ).toUpperCase();\n }", "getID() {\n return this._data.id ? this._data.id.trim() : null;\n }", "toString() {\r\n return this.id ? `<@${this.id}>` : null;\r\n }", "id() {\n const model = internal(this).model;\n return internal(model).entities.id(this);\n }", "get identifier() {\n if (this._uid) {\n return this._uid;\n } else {\n return this._id;\n }\n }", "function ObjectId() {\n var timestamp = (new Date().getTime() / 1000 | 0).toString(16);\n return timestamp + 'xxxxxxxxxxxxxxxx'.replace(/[x]/g, function () {\n return (Math.random() * 16 | 0).toString(16);\n }).toLowerCase();\n}", "toHexString() {\n if (ObjectId.cacheHexString && this.__id) {\n return this.__id;\n }\n const hexString = this.id.toString('hex');\n if (ObjectId.cacheHexString && !this.__id) {\n this.__id = hexString;\n }\n return hexString;\n }", "getNodeIDString() {\n return helperfunctions_1.bufferToNodeIDString(this.nodeID);\n }", "get id() {\n if (!this._id) {\n this._id = Util.GUID();\n }\n return this._id;\n }", "function objectIdToString(entity) {\n if (!entity) return entity\n entity[idProperty] = entity[idProperty].toString()\n return entity\n }", "createId() {\n return this.firestore.collection('_').doc().id;\n }", "function Entity$toIdString(obj) {\n return obj.meta.type.fullName + \"|\" + obj.meta.id;\n}", "getIdentifier() { return this.docIdentifier; }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n console.log('in id getter');\n return this._id + 'TEMPORARY';\n }", "function coerceId(id) {\n return id === null || id === undefined || id === '' ? null : id + '';\n }", "function toObjectId( data ) {\n\treturn data ;\n}", "function getID() {\n\tvar tmp = Math.round(Math.random() * 100000);\n\tvar str = \"OBJ\" + tmp;\n\treturn str;\n}", "_id () {\n return (Math.random().toString(16) + '000000000').substr(2, 8)\n }", "getLongId() {\n return this.form_.id_ + '-' + this.id_;\n }", "get id() { return this._id; }", "get id() { return this._id; }", "get id() { return this._id; }", "function getId () {\n return '_' + Math.random().toString(36).substr(2, 9);\n}", "function idGetter() {\n if (this.$__._id) {\n return this.$__._id;\n }\n\n this.$__._id = this._id == null\n ? null\n : String(this._id);\n return this.$__._id;\n}", "getUID() {\n return this._id;\n }", "function convertObjectIdToString(...args) {\n return args.map(obj => {\n obj._id = obj._id.toString();\n return obj;\n });\n }", "getId() {\n return this._data.Id;\n }", "function toId(text) {\n if (text && text.id) {\n text = text.id;\n } else if (text && text.userid) {\n text = text.userid;\n }\n if (typeof text !== 'string' && typeof text !== 'number') return '';\n return ('' + text).toLowerCase().replace(/[^a-z0-9]+/g, '');\n}", "function cursorToId(cursor) {\n return unbase64(cursor).substring(PREFIX.length);\n}", "function cursorToId(cursor) {\n return unbase64(cursor).substring(PREFIX.length);\n}" ]
[ "0.7108244", "0.7106047", "0.7063738", "0.7063738", "0.6905292", "0.6743027", "0.6708931", "0.6708931", "0.6708931", "0.6708931", "0.6708931", "0.6595603", "0.6582902", "0.6465702", "0.6418251", "0.6397523", "0.6375707", "0.62922573", "0.62424135", "0.6236174", "0.62212014", "0.61810976", "0.6180219", "0.6141816", "0.60534024", "0.60534024", "0.60534024", "0.60534024", "0.60534024", "0.60534024", "0.60534024", "0.60534024", "0.60534024", "0.60534024", "0.60534024", "0.60534024", "0.60534024", "0.60534024", "0.60534024", "0.60534024", "0.60534024", "0.60534024", "0.60534024", "0.60534024", "0.60534024", "0.60534024", "0.60534024", "0.60534024", "0.60534024", "0.60534024", "0.60534024", "0.60534024", "0.60534024", "0.60534024", "0.60534024", "0.60534024", "0.60534024", "0.60534024", "0.60534024", "0.60534024", "0.60534024", "0.60534024", "0.60534024", "0.60534024", "0.60534024", "0.60534024", "0.60534024", "0.60534024", "0.60534024", "0.60534024", "0.60534024", "0.60534024", "0.60534024", "0.60534024", "0.60534024", "0.60534024", "0.60534024", "0.60534024", "0.60534024", "0.60534024", "0.60534024", "0.60534024", "0.60534024", "0.6020043", "0.59911054", "0.5987096", "0.5980402", "0.5948469", "0.5915887", "0.58989483", "0.58989483", "0.58989483", "0.58912206", "0.58906907", "0.5887641", "0.5865403", "0.58608484", "0.5854711", "0.5842543", "0.5842543" ]
0.74571913
0
function to generate a JSON web token from the user object we pass in
function generateToken(user) { return jwt.sign(user, process.env.SECRET, { expiresIn : 60*60*24 // in seconds }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createToken(user) {\n\tvar token = jsonwebToken.sign({\n\t\t_id: user._id,\n\t\tname: user.name,\n\t\tusername: user.username\n\t}, secretKey, {\n\t\texpiretesInMinute: 1440\n\t})\n\n\treturn token;\n}", "function generateToken (user) {\n var payload = {\n exp: moment.add(14, 'days').unix(),\n init: moment().unix(),\n sub: user._id\n };\n return jwt.encode(payload, config.TOKEN_SECRET);\n}", "function createToken(user) {\n return jsonwebtoken.sign({\n id: user._id,\n name: user.name,\n username: user.username\n }, secretKey, {\n expiresInMinute: 1440\n });\n}", "function createToken(user) {\n\n\tvar token = jsonwebtoken.sign({\n\t\tid: user._id,\n\t\tname: user.name,\n\t\tusername: user.username\n\t}, secretKey, {\n\t\texpiresInMinute: 1440\n\t});\n\n\treturn token;\n}", "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}", "function generateToken(user){\n return jwt.sign(user, authConfig.secret, {\n expiresIn: 10080\n });\n}", "function generateToken(user){\n const token = jwt.sign({\n id: user.id,\n username: user.username,\n email : user.email,\n isSeller: user.isSeller\n }, KEY,{expiresIn: '3h'})\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 generateToken(user) {\n return jwt.sign(user, config.secret, {\n expiresIn: 604800 // in seconds\n });\n}", "function generateToken (user) {\n return jwt.sign(user, config.secret, {\n expiresIn: 10080 // milliseconds\n })\n}", "function genToken(user) {\n const payload = {\n subject: user.id,\n username: user.username,\n //getting the department to then display users based on\n //the current user's dep\n department: user.department\n };\n const options = {\n expiresIn: '1d'\n };\n return jwt.sign(payload, secret.jwtSecret, options);\n}", "function genToken(user) {\n\tconst payload = {\n\t\tsubject: user.id,\n\t\tusername: user.username\n\t};\n\tconst options = {\n\t\texpiresIn: '1h'\n\t};\n\treturn jwt.sign(payload, jwtKey, options);\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 createUserToken(user){\n\tvar timestamp = new Date().getTime();\n\treturn jwt.encode({sub: user.id, iat: timestamp}, config.secret)\n}", "function createToken(user) {\n var payload = {\n sub: user._id,\n iat: moment().unix(),\n exp: moment().add(50, 'days').unix()\n };\n return jwt.encode(payload, config.TOKEN_SECRET);\n }", "function generateToken(user) {\n return (token = jwt.sign(\n {\n id: user.id,\n password: user.password,\n username: user.username,\n fname: user.fname,\n lname: user.lname,\n score: user.score,\n currentQuestionId: user.currentQuestionId,\n questionAnswered: user.questionAnswered,\n },\n SECRET_KEY,\n { expiresIn: \"72h\" }\n ));\n}", "function generateToken(user) {\n //the data\n const payload = {\n userId: user.id,\n username: user.username,\n };\n const secret = secrets.jwtSecret;\n const options = {\n expiresIn: '1d',\n };\n return jwt.sign(payload, secret, options);\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 genarToken(idUser = {}) {\n return jwt.sign(idUser, authConfig.secret,\n {expiresIn: 86400})\n}", "function createToken(user) {\n var payload = {\n exp: moment().add(14, 'days').unix(),\n iat: moment().unix(),\n sub: user._id\n };\n\n return jwt.encode(payload, tokenSecret);\n}", "function generateToken(user, userPrograms) {\n return jwt.sign(\n {\n userInfo: user,\n userPrograms: userPrograms,\n },\n SECRET_KEY,\n { expiresIn: '1h' }\n );\n}", "function tokenForUser (user){\n const timestamp = new Date().getTime()\n return jwt.encode({ sub: user, iat: timestamp }, process.env.SECRET)\n}", "function generateToken(user) {\n const jwtPayload = {\n ...user,\n };\n const jwtOptions = {\n expiresIn: '1h',\n }\n return jwt.sign(jwtPayload, jwtKey, jwtOptions);\n}", "function generateAccessToken(user){\n return jsonwebtoken.sign(user, process.env.SECRET, {expiresIn: '50m'});\n}", "function createToken(user) {\n var payload = {\n sub: user._id,\n iat: moment().unix(),\n exp: moment().add(14, 'days').unix()\n };\n return jwt.encode(payload, config.TOKEN_SECRET);\n}", "function createToken( user ){ \n //Objeto con los datos de usuario que yo quiero almacenar en un token\n var payload = {\n sub: user._id,\n name: user.name,\n surname: user.surname,\n nick: user.nick,\n email: user.email,\n role: user.role,\n image: user.image,\n iat: moment().unix(), //Con moment puedo obtener un momento exacto de tiempo.\n exp: moment().add(30, 'days').unix() //Al momento actual se le suman 30 días con esos parámetros.\n };\n\n \n //Con el encode jwt crea un token en base al payload con los datos del usuario y una clave secreta estática propia.\n return jwt.encode(payload, secret);\n}", "function createToken( user ) \n{\n return jwt.sign( user, 'secret', { expiresIn: 60 * 60 * 5 } );\n}", "function createJWToken(user) {\n let payload = _.pick(user, ['id', 'email'])\n return jwt.sign(payload, config.JWTSecret, { expiresIn: '30d' })\n}", "function tokenForUser(user) {\n\tconsole.log('tokenForUser fired');\n\tconsole.log('user id in tokenForUser is : ',user.id);\n\tvar timestamp = new Date().getTime();\n\treturn jwt.encode({ sub: user.id, iat: timestamp }, EnvConfig.secret);\n}", "tokenForUser(user) {\n const timeStamp = new Date().getTime();\n return jwt.encode({ sub: user.id, iat: timeStamp }, config.secret);\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 }", "function createJwtToken(user) {\n return jsonwebtoken.sign({ user }, JWT_SECRET, {\n subject: user.username,\n expiresIn: JWT_EXPIRY,\n algorithm: 'HS256'\n });\n}", "function tokenForUser(user) {\n const timestamp = new Date().getTime();\n return jwt.encode({ sub: user.id, iat: timestamp }, process.env.API_SECRET);\n}", "function createToken(user) {\n var token = _jsonwebtoken2.default.sign({\n email: user.email\n }, _config2.default.jwtSecret);\n var person = user.professional ? user.professional : user.client;\n var organization = user.professional ? user.professional.organization : '';\n return {\n _id: person._id,\n token: token,\n email: user.email,\n role: user.role,\n firstname: user.professional ? user.professional.firstname : user.client.firstname,\n lastname: user.professional ? user.professional.lastname : user.client.lastname,\n organizationId: organization\n };\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}", "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 createToken(user) {\n //Creating a payload \n var payload = {\n sub: user._id,\n iat: moment().unix(),\n expire: moment().add(14, 'days').unix\n }\n return jwt.encode(payload, 'secret');\n}", "function tokenForUser(user) {\n const timestamp = new Date().getTime();\n return jwt.encode({ sub: user.id, iat: timestamp }, process.env.AUTH_SECRET);\n}", "function generateToken(user) {\n const payload = {\n sub: user.id,\n name: user.name\n };\n const options = {\n expiresIn: '7d'\n };\n return jwt.sign(payload, process.env.JWT_SECRET, options);\n}", "function createToken(user) {\n return jwt.sign({ id: user.id, email: user.email }, config.jwtSecret, {\n expiresIn: 86400 // 86400 expires in 24 hours\n });\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 //Saves the time and date\n const timestamp = new Date().getTime();\n //Creates a JWT for the user - sub: user.id - sets the subject (who the token belongs to) as the user id; iat: timestamp - issued at time, sets the date/time for when the token was issued, the date/time is captured when the function executes; keys.secret - encrypts the user id using a random string of characters\n return jwt.encode({ sub: user.id, iat: timestamp }, keys.secret);\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}", "function tokenForUser(user) {\n const timestamp = new Date().getTime();\n return jwt.encode({ sub: user.id, iat: timestamp }, process.env.JWT_SECRET);\n}", "function createToken(user) {\n let payload = {\n username: user.username,\n zipCode: user.zipCode,\n country: user.country\n };\n\n return jwt.sign(payload, SECRET_KEY);\n}", "function genToken(user, role) {\n var expires = expiresIn(1); // 1 heure\n var date_licence= Date.parse(user[0].date_valid);\n var token = jwt.encode({\n iss: user[0].idclient,\n exp: expires,\n dmn: user[0].domaine,\n valid: date_licence,\n niveau: user[0].niveau\n }, secret.secretToken, 'HS512');\n\n return {\n token: token,\n bike: role};\n}", "function generateToken(user) {\r\n const paylaod = {\r\n id: user.UUID,\r\n username: user.username\r\n }\r\n\r\n const options = {\r\n expiresIn: \"8h\"\r\n }\r\n\r\n return jwt.sign(paylaod, process.env.JWT_SECRET, options)\r\n}", "function generateToken(user) {\n const payload = {\n sub: user.id,\n username: user.email\n }\n\n const options = {\n expiresIn: '1d'\n }\n\n return jwt.sign(payload, process.env.JWT_SECRET, options)\n}", "function createToken(user) {\n let payload = { userId: user.userId, username: user.username };\n return jwt.sign(payload, SECRET_KEY);\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 createToken (user) {\n const payload = {\n sub: user._id, // id del usuario (no incluir el id dela bbdd, en este caso mongodb)\n iat: moment().unix(), // fecha creacion token (momento en que se llama esta funcion)\n esp: moment().add(14, 'days').unix(), // fecha expiracion\n };\n\n // codificamos payload\n return jwt.encode(payload, config.SECRET_TOKEN);\n}", "function generateToken(user) {\n const payload = {\n subject: user.id,\n handle: user.handle\n };\n const options = {\n expiresIn: \"1d\"\n };\n return jwt.sign(payload, secret, options);\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 createToken(user) {\n return jwt.sign({\n auth: user._id,\n exp: Date.now() + tokenExpiration,\n }, secret);\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}", "function generateAccessToken(useremailobject) {\n //return the token with expiration time of 1hr\n return jwt.sign(useremailobject, process.env.ACCESS_TOKEN_SECRET, {expiresIn: \"1h\"});\n}", "function makeUserToken(json) {\n json = json || {};\n return {\n token: json.token,\n qrCode: json.qr_code,\n userName: json.user,\n accountId: json.account_id,\n isInvite: json.type === enums[\"q\" /* UserTokenTypeEnum */].INVITE,\n isReset: json.type === enums[\"q\" /* UserTokenTypeEnum */].RESET\n };\n}", "function createToken(user) {\n let payload = {\n username: user.username,\n };\n let token = jwt.sign(payload, SECRET)\n return token;\n}", "async getToken(user){\n const token = await jwt.sign({id: user.getId(), name: user.getName()}, this.secretKey, {expiresIn: this.expiration});\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 token(user) {\n return getUserToken(buildUser(user));\n}", "function makeToken(user) {\n const payload = {\n subject: user.id,\n username: user.username,\n };\n const options = {\n expiresIn: '5 hour',\n };\n return jwt.sign(payload, jwtSecret, options);\n}", "function createJWT(user) {\n var payload = {\n sub: user._id,\n iat: moment().unix(),\n exp: moment().add(14, 'days').unix()\n };\n return jwt.encode(payload, config.TOKEN_SECRET);\n }", "function generateToken(user) {\n // header payload and verify signature\n // payload -> username, id, roles, expiration date\n const payload = {\n sub: user.id,\n fullname: user.fullname,\n username: user.username,\n phonenumber: user.phonenumber\n };\n\n const options = {\n expiresIn: \"1d\"\n };\n // verify signature -> a secret, 'process.env.JWT_SECRET' IS HAVING ISSUES\n return jwt.sign(payload, process.env.JWT_SECRET, options);\n}", "function createToken(user) {\r\n const token = jwt.sign(\r\n {user}, \r\n JWT_SECRET,\r\n {\r\n subject: user.username,\r\n expiresIn: JWT_EXPIRY,\r\n algorithm: 'HS256'\r\n });\r\n return token;\r\n}", "function createJWT(user) {\r\n var payload = {\r\n sub: user._id,\r\n iat: moment().unix(),\r\n exp: moment().add(7, 'days').unix()\r\n };\r\n return jwt.encode(payload, 'blablablaladoscuro'); }", "function createJWT(user) {\n var payload = {\n sub: user._id,\n iat: moment().unix(),\n exp: moment().add(14, 'days').unix()\n };\n return jwt.encode(payload, config.TOKEN_SECRET);\n}", "function generateAccessToken(user) {\n console.log(user)\n return jwt.sign(user, 'secret', { expiresIn: '5m' })\n}", "function createJWT(user) {\n var payload = {\n sub: user._id,\n iat: moment().unix(),\n exp: moment().add(14, 'days').unix()\n };\n return jwt.encode(payload, config.TOKEN_SECRET);\n}", "function createToken(user) {\n return jwt.sign(user, config.secret, { expiresIn: \"10h\" });\n // return jwt.sign(user, config.secret, { expiresIn: 10 });\n}", "function generateToken(user, duration) {\n const token = jwt.sign(user.toJSON(), process.env.JWT_SECRET, {\n expiresIn: duration\n });\n return token;\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}", "function generateToken(payload){\n var secret=\"IamTheTougestLogic\";\n var token = jwt.encode(payload, secret);\n return token;\n}", "function generatetoken(phone,password){\n const token=jwt.sign({phone,password},'mysecret');\n return token;\n \n}", "function createJWT(user) {\n var payload = {\n sub: user._id,\n iat: moment().unix(),\n exp: moment().add(14, 'days').unix()\n };\n return jwt.encode(payload, 'JWT Token Secret');\n}", "function createToken(user) {\n const { username, is_admin } = user;\n const payload = { username, is_admin };\n const token = jwt.sign(payload, SECRET_KEY);\n return 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 signToken(user){\n //toObject() returns a basic js object\n // comprised of data from db. Delete password before creating jwt\n\n const userData = user.toObject()\n delete userData.password\n return jwt.sign(userData, JWT_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 createJWT(_user) {\n var payload = {\n sub: _user.id,\n iat: moment().unix(),\n exp: moment().add(14, 'days').unix()\n };\n return jwt.encode(payload, TOKEN_SECRET);\n}", "function generateTemporaryToken(user) {\n return jwt.sign(\n {\n // Storing typical values that are used during mutations\n id: user.id,\n username: user.username,\n email: user.email\n //avatarUrl: user.avatarUrl\n },\n process.env.TOKEN_SECRET_KEY,\n { expiresIn: \"1d\" }\n )\n}", "function tokenGenerado(nombre, isadmin) {\n\n const payload = {\n nombreUser: nombre,\n admin: isadmin\n } \n \n var token = jwt.sign(payload, jwtClave);\n \n //envio Token\n return token\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}", "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 createToken(user, expTime) {\n\n const claims = {\n id: user.id,\n scope: user.scope,\n access: user.access,\n permissions: user.permissions\n }\n\n var exp = expTime || (157680000); //5 years\n\n var obj = _.omit(claims, 'password'); //make sure claims contains no password filed by mistake\n\n var token = jwt.sign({\n data: obj\n }, jwtConfig.secret, {\n expiresIn: exp\n });\n\n\n return token;\n}", "function getJWTToken (socialUserId) {\n return jwt.create(socialUserId)\n}", "function createUserToken(user) {\n\tconsole.assert(user.hasPaid !== undefined, 'createUserToken passed user without hasPaid property');\n\n\tlet payload = {\n\t\tusername : user.username,\n\t\thasPaid : user.hasPaid || false\n\t};\n\n\treturn jwt.sign(payload, SECRET_KEY);\n}", "function createToken(data) {\n //sign() --> si aspetta come parametro un json con i parametri che si vogliono mettere nel token\n let param = {\n \"_id\": data[\"_id\"],\n \"email\": data.email,\n \"iat\": data.iat || Math.floor(Date.now() / 1000),\n \"exp\": Math.floor(Date.now() / 1000) + TTL\n }\n let token = jwt.sign(param, PRIVATE_KEY);\n return token;\n}", "function createJwt(user) {\n const token = jwt.sign({\n _id: user._id\n }, secret);\n const jwtToken = {\n access: 'auth',\n token,\n };\n return jwtToken;\n}", "function jwt() {\n return User.jwt();\n}", "function genToken(userDetails) {\n return new Promise((resolve, reject) => {\n jwt.sign(Object.assign({}, userDetails), process.env.JWT_SECRET,\n {\n algorithm: 'HS256',\n expiresIn: 5184000,\n audience: 'user',\n issuer: 'qrtrmstr',\n subject: 'user-token'\n },\n (err, decoded) => {\n if(err) reject(new ApiError('Error creating JWT', 500, err));\n resolve (decoded);\n });\n })\n}", "function maketoken(info){\n info.expires=Date.now()+tokenExpiresTime\n return jwt.encode(info,secret)\n}", "function getToken(id){\r\n return jwt.sign({object: id}, 'Hello_123');\r\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 createUserToken( user ) { // LEO WAS HERE\n var token = {\n userId : user._id,\n username : user.username,\n roles : user.roles\n };\n var token = jwt.sign( token, config.secret, {\n ignoreExpiration: true\n });\n\n user.password = null;\n user.deviceType = null;\n user.deviceToken = null;\n\n return {\n success : true,\n code : 200,\n user : user,\n token : token,\n message : 'Authentication Ok.'\n }\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}", "async generateLoginToken(userInfo){\n let tokenPayload = _.pick(userInfo, ['_id', 'mobile_no', 'roles']);\n return jwtHelper.generateToken(tokenPayload)\n .then((token) => {\n // now store the generated token\n UserProfileDataManager.update({_id: userInfo._id}, {$set: {auth_token: token}});\n return token;\n });\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}" ]
[ "0.7900093", "0.7887839", "0.7876791", "0.7837659", "0.77515906", "0.7744988", "0.76834", "0.76323235", "0.76323235", "0.76162827", "0.76114887", "0.7597723", "0.75809175", "0.75688136", "0.756339", "0.7537657", "0.7534492", "0.7529682", "0.75286126", "0.7499811", "0.74983186", "0.74965703", "0.7494265", "0.74904513", "0.7478419", "0.74762934", "0.7474388", "0.74743474", "0.74705374", "0.74478894", "0.7439179", "0.7437373", "0.74314517", "0.7427336", "0.74273014", "0.74243796", "0.7421141", "0.74194735", "0.7410685", "0.7408035", "0.7398483", "0.7397439", "0.7386133", "0.7385602", "0.73770255", "0.73754317", "0.7374503", "0.7369397", "0.7365665", "0.73639077", "0.73582983", "0.73407894", "0.7329391", "0.7318393", "0.73117286", "0.73060054", "0.7277608", "0.7260774", "0.7243587", "0.7213806", "0.72113156", "0.7206498", "0.71967244", "0.7169075", "0.7138803", "0.71387815", "0.71379435", "0.7128278", "0.70885265", "0.70792925", "0.7077267", "0.7074908", "0.70615464", "0.7060831", "0.70466334", "0.70434463", "0.7039475", "0.7033931", "0.70223457", "0.7012844", "0.6986246", "0.6974775", "0.69102275", "0.68850803", "0.68716997", "0.68557584", "0.68429476", "0.6815658", "0.68145096", "0.6805772", "0.6805116", "0.6804693", "0.67820644", "0.67707735", "0.6758053", "0.67495173", "0.6738957", "0.67325824", "0.6692584", "0.66730547" ]
0.7413354
38
We don't want to use the entire user object to sign our JWTs that's a lot of information to eventually store in a cookie. Plus, we don't want to be returning huge blocks of what could be sensitive user information. We need control. Let's create a function to select the user information we want to pass through
function setUserInfo(request) { return { _id: request._id, username: request.username, email: request.email }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function detectUser(user_data_object) {\n try {\n let [user] = await Admin.query().where({\n id: user_data_object.child_id,\n });\n if (!user) {\n [user] = await moderator.query().where({\n id: user_data_object.child_id,\n });\n if (!user) {\n [user] = await Teacher.query().where({\n id: user_data_object.child_id,\n });\n if (!user) {\n [user] = await Student.query().where({\n id: user_data_object.child_id,\n });\n if (!user) {\n return null; // can't detect this , i know this not make sense but this is proper test too\n }\n return {\n user: user,\n role: system_roles.student, //?this is very important for hashing images in the next middleware\n }; //student will be returned from here\n }\n return {\n user: user,\n role: system_roles.teacher, //?this is very important for hashing images in the next middleware\n }; // teacher will be returned from here\n }\n //if there's user that's mean this user is Moderator\n return {\n user: user,\n role: system_roles.moderator, //?this is very important for hashing images in the next middleware\n }; // Moderator will be returned\n }\n //if all the above not make sense so he must be Admin\n return {\n user: user,\n role: system_roles.admin, //?this is very important for hashing images in the next middleware\n }; // admin will be returned\n } catch (error) {\n console.log(error);\n }\n}", "function showUser(req,res){\n console.log(\"individual user requested\");\n\n var token = req.cookies.token || req.body.token || req.param('token') || req.headers['x-access-token'];\n var decodedInfo;\n\n if(token){\n\n //VERIFY SECRET AND CHECK TOKEN EXPIRATION:\n jwt.verify(token, superSecret, function(err, decoded){\n if(err){\n res.status(403).send({success: false, message: 'failed to authen token'});\n } else {\n //IF TOKEN IS VALID AND ACTIVE, SAVE FOR OTHER ROUTES TO USE:\n req.decoded = decoded;\n decodedInfo = decoded;\n }\n\n //FIND USER AND SHOW INFO:\n User.findOne({email: decodedInfo.email}, function(err, user){\n if(err) res.send(err);\n console.log(user);\n res.json(user);\n });\n }); //CLOSE TOKEN VALIDATION CHECK\n } //CLOSE TOKEN CHECK\n} //CLOSE SHOW USER FUNCTION", "function storedUser(): Object {\n return userState.selectors.getUser(store.getState());\n}", "function getLogginInfo() {\n const token = jsCookie.get(TOKEN_KEY);\n if (!token)\n return undefined;\n const user = jwtDecode(token);\n return user;\n}", "function default_1(user) {\n if (Object.keys(user).length === 0) {\n return {};\n }\n const response = {\n name: user.name,\n login: user.login,\n avatar_url: user.avatar_url\n };\n return response;\n}", "getCurrentUser(request, response, next) {\n const args = {\n tenant_id: request.session.tenant_id,\n user_id: request.params.user_id,\n };\n\n UsersService.prototype.getCurrentUserEntities(args).then((user) => {\n response.json(\n user,\n );\n }).catch((error) => next(error));\n }", "defaults(user = {}) {\n const gen = this.setup.gen;\n const username = user.username || gen.username();\n return {\n username,\n email: username,\n firstName: gen.firstName(),\n lastName: gen.lastName(),\n isAdmin: false,\n status: 'active',\n projectId: [this.setup.defaults.project.id],\n userRole: 'researcher',\n identityProviderName: 'Cognito Native Pool',\n authenticationProviderId: `https://cognito-idp.${this.setup.defaults.awsRegion}.amazonaws.com/${this.setup.defaults.userPoolId}`,\n ...user,\n };\n }", "getUser(email, password) {\n this.email = email;\n this.password = password;\n\n const userData = this.app.readDataFile(userFilePath);\n\n userData.forEach((item) => {\n if (item.email === this.email && item.password === this.password) {\n this.userInfo = item;\n }\n });\n\n return this.userInfo;\n }", "function getCurrentUser(req, res) {\n // I'm picking only the specific fields its OK for the audience to see publicly\n // never send the whole user object in the response, and only show things it's OK\n // for others to read (like ID, name, email address, etc.)\n const { id, username } = req.user;\n res.json({\n id, username\n });\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", "getIdentity(req, res, next) {\n res.json(req.user);\n }", "static getUser() {\n return JSON.parse(localStorage.getItem('userInfo'));\n }", "function userFromJwt(jwtPayload) {\n jwt_1.checkMandatoryValue('id', exports.mappingUserFields, jwtPayload);\n jwt_1.checkMandatoryValue('userName', exports.mappingUserFields, jwtPayload);\n return {\n id: userId(jwtPayload),\n givenName: userGivenName(jwtPayload),\n familyName: userFamilyName(jwtPayload),\n email: userEmail(jwtPayload),\n userName: userName(jwtPayload),\n scopes: userScopes(jwtPayload),\n customAttributes: customAttributes(jwtPayload),\n hasScope: hasScopeWrapper(userScopes(jwtPayload))\n };\n}", "function createUserReqObject(user) {\n // get object value\n var safeObj = user.toObject({ hide: 'password lastPasswords passwordUpdatedLast updated created', transform: true });\n\n // return the safe obj\n return safeObj;\n}", "function userLoggedInAdvanced (req, res, next) {\n // first check if we have HTTP Basic Auth\n const auth = basicAuth(req)\n // changed var to let because heroku still doesn't support let\n var userEmail, authToken\n if (auth) {\n userEmail = auth.name\n authToken = auth.pass\n } else {\n // else we just look in the http header or body or params\n userEmail = req.get('User-Email') || req.body.user_email || req.query.user_email\n authToken = req.get('Auth-Token') || req.body.auth_token || req.query.auth_token\n }\n\n console.log(auth)\n if (!userEmail || !authToken) return res.status(401).json({error: 'unauthorised'})\n\n User.findOne({email: userEmail, auth_token: authToken}, (err, user) => {\n if (err || !user) return res.status(401).json({error: 'unauthorised'})\n\n req.currentUser = user\n next()\n })\n}", "jwt() {\n return (req, res, next) => {\n passport.authenticate('jwt', { session: false }, (err, user, info) => {\n\n if (err) {\n return next(err);\n }\n\n // If a user is authenticated, pass user data in req.user\n if (user) {\n const { id, username } = user;\n req.user = {\n id,\n username,\n };\n }\n\n next();\n })(req, res, next);\n };\n }", "function getUserNonSensative(req, res, next){\n /*\n * NOTE: parseValidateCookie Must be called before this function in the\n * router in order to confirm that the cookie is verified and the token is\n * valid.\n */\n return res.status(200).send({\n \"name\": req.user.name,\n \"email\": req.user.email\n });\n}", "function format(user) {\r\n const { id, username } = user\r\n return {\r\n id,\r\n username,\r\n accessToken: user.generateToken()\r\n }\r\n}", "LogIn(req, res, next) {\n // EXTRACT FORM DATA\n const { username, password } = req.body;\n\n // FIND USER BY USERNAME\n User.findByUserName(username).then(user => {\n // IF A USER ISN'T FOUND\n if (!user) {\n return res.status(401).json({ success: false, message: 'User not found' });\n }\n // IF A USER IS FOUND, CONTINUE AND COMPARE PASSWORD WITH HASH\n User.comparePassword(password, user.password, (err, isMatch) => {\n if (err) throw err;\n // IF PASSWORDS MATCH\n if (isMatch) {\n // CREATE A TOKEN\n const token = jwt.sign({ id: user.id, username: user.username }, process.env.SECRET_KEY, {\n expiresIn: 604800 // 1 WEEK\n });\n // SEND JSON OBJECT ALONG WITH TOKEN\n res.status(200).json({\n success: true,\n token: 'JWT ' + token,\n user: {\n id: user.id,\n username: user.username,\n email: user.email\n }\n });\n } else {\n return res.status(401).json({ success: false, message: 'Wrong password' });\n }\n });\n });\n }", "function getUser() {\n return {\n name: 'Awotunde',\n handle: '@egunawo33', \n location: 'Orun, Aye'\n }\n}", "async signin(parent, body, context, info) {\n const user = await User.findOne({\n where: { email: body.email }\n })\n \n if(user) {\n const isCorrect = await bcrypt.compare(body.password, user.password)\n if(!isCorrect) {\n throw new Error('Senha inválida')\n }\n const token = jwt.sign({ id: user.id }, 'secret')\n \n return {\n token,\n user\n }\n }\n }", "async function GetCurrentUser(req, res) {\n console.log(\"get me\");\n try {\n /* const decoded = jwt.verify(req.cookies[COOKIE_NAME], JWT_SECRET); */\n var decoded = jwt.verify(\n req.headers[\"authorization\"],\n process.env.SECRET_KEY\n );\n console.log(\"decoded\", decoded);\n return res.send(decoded);\n } catch (err) {\n console.log(err);\n res.send(null);\n }\n}", "static async getMe(request, response) {\n const token = request.headers['x-token'];\n if (!token) { return response.status(401).json({ error: 'Unauthorized' }); }\n\n // Retrieve the user based on the token\n const userId = await findUserIdByToken(request);\n if (!userId) return response.status(401).send({ error: 'Unauthorized' });\n\n const user = await findUserById(userId);\n\n if (!user) return response.status(401).send({ error: 'Unauthorized' });\n\n const processedUser = { id: user._id, ...user };\n delete processedUser._id;\n delete processedUser.password;\n // Return the user object (email and id only)\n return response.status(200).send(processedUser);\n }", "tokenForUser(user) {\n const timeStamp = new Date().getTime();\n return jwt.encode({ sub: user.id, iat: timeStamp }, config.secret);\n }", "static isAuthenticatedAsUser (req, res, next) {\n try {\n const jwtToken = AuthorizationUtil._extractToken(req)\n\n const jwtPayload = AuthorizationUtil.extractJWTInformation(jwtToken)\n // so you can use get user who made the request in the endpoint\n // since it will receive the same req object\n req.user = new User(jwtPayload.userId, jwtPayload.username)\n return next()\n } catch (ignored) {\n return ApiResponse.sendErrorApiResponse(403, 'Not authenticated', res)\n }\n }", "async function getSingleUser(req, res) {\n req.profile.hash_password = undefined;\n req.profile.salt = undefined;\n return res.status(200).json(req.profile);\n}", "function getUserInfo(req, res, next) {\n var token = _getTokenFromRequest(req);\n var allowAnonymous = req.disallowAnonymous ? false : true;\n\n logger.debug('checking token : ' + token);\n _verifyToken(token, function (err, info) {\n var errMsg = 'Internal server error';\n if (err) {\n logger.error('_verifyToken failed ', err);\n if (err === 400 || err === 419) {\n if (allowAnonymous) {\n logger.debug('_verifyToken added empty user in req'); \n \t req.user = {};\n return next();\n }\n errMsg = (err === 400) ? 'requires access token' : 'invalid access token';\n }\n return res.status(err).send(utils.fail(errMsg));\n }\n req.user = info;\n return next();\n });\n}", "function currentUser(req) {\n for (let user in users) {\n if (req.session.user_id === user) {\n return user;\n }\n }\n return \"\";\n}", "function genUserInfo (userInfo, dbUser, grps, token) {\n\tlet newPayload = {};\n\tlet userData = {};\n\tuserData['name'] = dbUser['userName'];\n userData['nickName'] = dbUser['nickName'];\n userData['gender'] = dbUser['gender'];\n userData['pic'] = dbUser['pic'];\n\tuserData['email'] = dbUser['email'];\n\tuserData['cp'] = userInfo['cp'];\n newPayload['userInfo'] = userData;\n newPayload['services'] = grps;\n newPayload['role'] = dbUser['roleName'];\n newPayload['authToken'] = token;\n newPayload['responseCode'] = '000';\n\tnewPayload['responseMsg'] = 'login success';\n\treturn newPayload;\n}", "static getCurrentUser(request, response) {\n response.json(request.user)\n }", "function getAuthInfo(){\n const token = localStorage.getItem('authToken');\n if (token) {\n const base64Url = token.split('.')[1];\n const base64 = base64Url.replace('-', '+').replace('_', '/');\n const obj = JSON.parse(window.atob(base64));\n return obj.user; \n }\n}", "static async ensureAuthenticated(req, res, next) {\n // Check the user based on API.\n const apiKey = req.get(\"user-api\") || req.body[0]?.user_api;\n const userId = req.get(\"user-id\") || req.body[0]?.user_id;\n if (apiKey && userId) {\n let sqlQuery = \"SELECT * FROM user WHERE id = ?\";\n const ourUser = await db.query(sqlQuery, userId);\n if (ourUser.length > 0) {\n let uncDb = await Utils.decrypt(ourUser[0].api_key);\n if (uncDb == apiKey) {\n let curUser = {\n steam_id: ourUser[0].steam_id,\n name: ourUser[0].name,\n super_admin: ourUser[0].super_admin,\n admin: ourUser[0].admin,\n id: ourUser[0].id,\n small_image: ourUser[0].small_image,\n medium_image: ourUser[0].medium_image,\n large_image: ourUser[0].large_image,\n };\n req.user = curUser;\n return next();\n }\n }\n }\n if (req.isAuthenticated()) {\n return next();\n }\n res.redirect(\"auth/steam\");\n }", "function loadFieldsInUser(userDB, res) {\n var token = jwt.sign({ user: userDB }, SECRET_KEY, { expiresIn: 14400 });//4hours\n\n res.status(200).json({\n ok: true,\n user: userDB,\n token: token,\n id: userDB._id,\n menu: getMenu(userDB.role)\n });\n}", "static async loadCurUser() {\n\n var user_result = await APISocket.get(`user/me?populate=teams&extension=true`)\n\n // User is on one team: normalize values that are stored on the TeamUser object\n if (user_result.teams.length === 1) {\n\n // Properties defined on the TeamUser that need to be normalized back into actual user properties\n var team_user = await APISocket.get(`team/${user_result.teams[0].id}/users/${user_result.id}`)\n for (let [key, value] of Object.entries(team_user)) {\n user_result[key] = value;\n }\n\n }\n\n // Rename/remap fields\n user_result.extension_secret = (\" \" + user_result.extensionSecret).slice(1);\n delete user_result.extensionSecret;\n\n return user_result;\n\n }", "static getUserDetail() {\n return axios.get(`/api/users/${Auth.getPayload().sub}`, { headers: { Authorization: `Bearer ${Auth.getToken()}` } })\n .then(res => ({\n id: res.data._id,\n firstName: this.capitalizeFirstLetter(res.data.firstName),\n lastName: this.capitalizeFirstLetter(res.data.lastName),\n profileUrl: res.data.profileUrl\n }))\n }", "signin(req, res) {\n // first, find user by the email/username in the request body.\n const loginData = req.body.email ? {email: req.body.email} : {username: req.body.username};\n // When retrieving the user from database, include the password for authentication:\n User.findOne(loginData, '+password', (err, user) => {\n // Error check\n if(err) return res.status(500).send(err);\n // Not being able to find a user is not an error, handles null\n if(user === null) {\n response = {success: false, message: 'Could not find registered user with the email/username'};\n return res.status(500).send(response);\n }\n // if there's no user found, or they put a wrong password:\n if(!user || (user && !user.validPassword(req.body.password))) {\n response = {success: false, message: 'Incorrect email/username or password.'};\n return res.status(500).send(response);\n }\n\n const userData = user.toObject();\n // remove the password from this object before creating the token:\n delete userData.password\n\n userData['iat'] = new Date().getTime() / 1000;\n userData['exp'] = (new Date().getTime() + 10000000) / 1000; // 1000 = 1 second\n\n const token = jwt.sign(userData, process.env.SECRET_TOKEN);\n // send the token back to the client in our response:\n response = {success: true, message: 'Logged in successfully.', token};\n return res.status(200).json(response);\n });\n }", "function getUser () {return user;}", "function getUser(uid, data) {\n return new Promise((resolve, reject) => {\n adminWebModel.getUser(data).then((result) => {\n if (result) {\n let token = jwt.sign({ uid: uid }, key.JWT_SECRET_KEY, {\n expiresIn: timer.TOKEN_EXPIRATION\n })\n resolve({ code: code.OK, message: '', data: { 'token': token, 'user': {'profile': result.profile, 'building': result.buildings} }})\n }\n }).catch((err) => {\n if (err.message === message.INTERNAL_SERVER_ERROR)\n reject({ code: code.INTERNAL_SERVER_ERROR, message: err.message, data: {} })\n else\n reject({ code: code.BAD_REQUEST, message: err.message, data: {} })\n })\n })\n }", "function makeUserSafe(user){\n var safeUser = {};\n var safeKeys = ['cid', 'fullname', 'email', 'username', 'following'];\n\n safeKeys.forEach(function(key){\n safeUser[key] = user[key];\n });\n return safeUser;\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}", "userInfo(state) {\n return state.currentUserDetails;\n }", "async fetchUser () {\n const user = await getJSON('/api/user')\n if (!this.checkResponse(user)) return\n this.user = user\n this.assets = user.assets\n this.exchanges = user.exchanges\n this.walletMap = {}\n for (const [assetID, asset] of Object.entries(user.assets)) {\n if (asset.wallet) {\n this.walletMap[assetID] = asset.wallet\n }\n }\n this.updateMenuItemsDisplay()\n return user\n }", "function selectUserByID(con) {\n return function (req, res) {\n getUserIDFromToken(con, req.body.Token).then(UserID => {\n let allowed = false;\n if (req.params.userid === UserID) {\n allowed = true;\n } else {\n\n }\n con.query(\n \"SELECT * FROM User WHERE UserID = \" +\n req.params.userid,\n function (err, result) {\n if (err) {\n console.error(\"error connecting: \" + err.stack);\n res.status(500).send(\"Error from database: \" + err.stack); // Internal server error code\n return;\n }\n if (result.length == 1) {\n const user = {\n UserID: result[0].UserID,\n University: result[0].University,\n Email: result[0].Email,\n FirstName: result[0].FirstName,\n LastName: result[0].LastName,\n };\n res.send(user);\n } else {\n res.status(404).send(\"User not found\"); // Bad permission\n }\n }\n );\n });\n }\n}", "function tokenForUser (user){\n const timestamp = new Date().getTime()\n return jwt.encode({ sub: user, iat: timestamp }, process.env.SECRET)\n}", "function getOneUser(req, res, next) {\n oneUserDetails(req, res).then((result) => {\n return res.status(200).json(result);\n }).catch((err) => {\n next(err);\n });\n}", "async getUser (req, res) {\n const findOneUserQuery = `\n SELECT avatar, firstname, lastname, email, username, location, bio\n FROM users\n WHERE username = $1\n `;\n\n try {\n\n // A user must be signed in to see edit information\n // Signed in user must also be requesting their own user data.\n if (!req.user || req.user.username !== req.params.username) {\n return res.status(403).send('You\\'re not allowed to edit this profile');\n }\n\n const { rows } = await db.query(findOneUserQuery, [ req.params.username ]);\n const profileUser = rows[0];\n\n // If profile user was not found in database\n if (!profileUser) {\n return res.status(404).send('User not found');\n }\n\n return res.status(200).json({ profileUser });\n } catch (error) {\n return res.status(400).send(error);\n }\n }", "async function getPayload(username, userLoggedIn) {\n var user = await User.findOne({ username: username });\n\n if (user == null) {\n user = await User.findById(username);\n\n if (user == null) {\n return {\n pageTitle: \"User not found\",\n userLoggedIn: userLoggedIn,\n userLoggedInJs: JSON.stringify(userLoggedIn),\n };\n }\n }\n\n return {\n pageTitle: user.username,\n userLoggedIn: userLoggedIn,\n userLoggedInJs: JSON.stringify(userLoggedIn),\n profileUser: user,\n };\n}", "function returnUserInfo (searchUser) {\n return users[searchUser];\n}", "function jwtSignUser(user){\n// const QUOLTER_DAY = 60*60*6;\n// return jwt.sign(user, config.authentication.jwtSecret,{\n// expiresIn: QUOLTER_DAY\n// }) \n\nconst token =jwt.sign(user,config.get('jwtPrivateKey'))\nreturn token\n}", "getUserObject() {\n return {\n firstName: this.#firstName,\n lastName: this.#lastName,\n email: this.#email,\n phoneNumber: this.#phoneNumber,\n street: this.#street,\n city: this.#city,\n country: this.#country,\n zipCode: this.#zipCode\n };\n }", "toJSON() {\n let userData = this.get() //.get built into get hte user we are working with\n delete userData.password //this removes the password so when we are passing around user info that the pw isnt a parto f that user object that gets passed between the backend and frontend..but does not remove it from the database\n return userData\n }", "getPrivileges(request,response){\n let requesting_user_id, requesting_user ;\n try{\n let token = request.get(\"Authorization\").trim().slice(6).trim();\n let decoded = jwt.verify(token,secret);\n requesting_user_id = decoded.id ;\n }catch(exception){\n return setTimeout( function(){\n return response.status(500).json({ error: errorMessage.server });\n },100);\n }\n\n console.log(\"User id: \"+requesting_user_id);\n return User.findById(requesting_user_id).then( user => {\n if(user){\n requesting_user = user ;\n return response.status(200).json(user.admin);\n }else{\n return response.status(404).json({ error: errorMessage.userNotFound });\n }\n }).catch( error => {\n console.log(error);\n try{\n return response.status(400).json({error: errorMessage.badRequest});\n }catch(e){}\n });\n }", "userDetails(userName) {\n var userCollect = {};\n var userID;\n var userIndex;\n var account;\n\n // First we find the user ID of the selected user. We also save the index number for the record in the JSON\n // structure.\n //\n for (let i = 0; i < this.DB.users.length; i++) {\n if (this.DB.users[i].username == userName) {\n userID = this.DB.users[i].user_id;\n userIndex = i;\n }\n }\n\n // We get the current account status from another table in the database, account. We store this in\n // a variable here for convenience.\n //\n for (let i = 0; i < this.DB.account.length; i++) {\n if (this.DB.account[i].user_id == userID) {\n account = this.DB.account[i].creditSEK;\n }\n }\n\n // This is the way to add the details you want from the db into your own data structure.\n // If you want to change the details, then just add or remove items accordingly below.\n userCollect = this.__userDetails(\n this.DB.users[userIndex].user_id,\n this.DB.users[userIndex].credentials,\n this.DB.users[userIndex].username,\n this.DB.users[userIndex].first_name,\n this.DB.users[userIndex].last_name,\n this.DB.users[userIndex].email,\n account\n );\n\n return userCollect;\n }", "async function getUserOnJWT(token) {\n const e = new FormError();\n let user;\n let user_capabilities;\n try {\n // Attempt to decode the JWT token\n const data = decodeJWT(token);\n\n // We should have an ID attribute\n if (!data.id) throw new Error();\n\n // Check that we've got a valid session\n user = await User.findById(data.id);\n if (!user) throw new Error();\n\n const { meta_value } = await Usermeta.findOne({\n attributes: ['meta_value'],\n where: {\n user_id: user.id,\n meta_key: `${prefix}capabilities`,\n },\n });\n if (!meta_value) throw new Error();\n user_capabilities = meta_value.split('\"')[1];\n } catch (_) {\n e.set('session', 'Invalid session ID');\n }\n e.throwIf();\n\n return {\n user,\n user_capabilities,\n };\n }", "function authenticateUser(req, res, next) {\n req.jwtInfo = null;\n var token = req.body.token || req.query.token || req.headers['x-access-token'] || req.headers.token;\n\n if (token) {\n jwt.verify(token, config.jwtSecret, function(err, decoded) {\n if (err) console.error(err);\n else {\n User.findOne({\n slug: decoded.slug,\n tokenDate: decoded.tokenDate\n })\n .then(function(user) {\n if (user) {\n req.jwtInfo = decoded;\n }\n next();\n });\n }\n });\n } else {\n next();\n }\n}", "async getUser() {\n let user = await this.getUserByCert();\n\n if(user == null)\n return null;\n\n return {\n name: this.CommonName,\n type: this.UserType,\n publicKey: user.publicKey\n }\n }", "getUserById(request, response, next) {\n try {\n const userId = request.params.id;\n this._knex(this._user).where('id', userId).then(user => {\n user.forEach(arrayObj => {\n delete arrayObj.hashedPassword;\n response.json(user);\n });\n });\n } catch (err) {\n next(err);\n }\n }", "function tokenForUser(user) {\n const timestamp = new Date().getTime();\n return jwt.encode({sub: user.id, iat: timestamp}, config.secret)\n}", "async getToken(user){\n const token = await jwt.sign({id: user.getId(), name: user.getName()}, this.secretKey, {expiresIn: this.expiration});\n return token;\n }", "function getauth(req,res,next){\n const authToken = req.headers[\"authtoken\"];\n jwt.verify(authToken,SECRET_KEY,(err,user)=>{\n if(err){\n res.status(400).send(\"Un Authrised.\")\n }\n else{\n req.userid = user.id;\n next();\n }\n })\n}", "async function getCurrentUser() {\n // checks to see if there's an Airtable user with the Netlify ID\n let response = await fetch(`https://api.airtable.com/v0/appcEdYdqWTVWe80T/users?filterByFormula=%7BnetlifyID%7D%3D%27${netlifyIdentity.currentUser().id}%27`, {\n method: 'GET',\n headers: {\n 'Authorization': 'Bearer keyV4oqFP1aJ9oo7R',\n 'Content-Type': 'application/json'\n }\n })\n let json = await response.json()\n\n if (json.records.length == 0) {\n // if not, create an Airtable user – createAirtableUser sets currentUser when done\n createAirtableUser()\n } else {\n // if yes, set the currentUser object from the existing data\n let user = netlifyIdentity.currentUser()\n currentUser = {\n netlifyID: user.id,\n airtableID: json.records[0].id,\n email: user.email,\n name: user.user_metadata.full_name\n }\n }\n}", "login(body) {\n return HTTP.post('users/signin', body)\n .then(res => {\n localStorage.setItem('accessToken', res.data.accessToken)\n localStorage.setItem('refreshToken', res.data.refreshToken)\n //FIXME: the user can be retrieved in the storage ?\n return UserResource.getMe()\n })\n .then(response => {\n return response.data\n })\n .catch(err => {\n throw err\n })\n }", "function currentUser (){\n return JSON.parse(window.sessionStorage.getItem(\"user_info\"));\n}", "fetchProfile(req, res, next) {\n res.status(200).json({\n user: {\n id: req.user.id,\n username: req.user.username,\n email: req.user.email\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}", "getInitialUserInfo(DB, request, response) {\n\t\tDB.get_initial_user(request.params.auth_id).then((userData) => {\n\t\t\tif (userData[0]) response.status(200).send(userData);\n\t\t\telse response.status(404).send('User Not Found...');\n\t\t});\n\t}", "function getUser(){\n return user;\n }", "function tokenForUser(user) {\n const timestamp = new Date().getTime();\n return jwt.encode({ sub: user.id, iat: timestamp }, process.env.JWT_SECRET);\n}", "function tokenForUser(user) {\n const timestamp = new Date().getTime();\n return jwt.encode({ sub: user.id, iat: timestamp }, process.env.AUTH_SECRET);\n}", "function getAuthUser(req,res){\n var email = req.body.emailAddress;\n var userAuth = {};\n \n if(email && email !== '' && email !== undefined) {\n userDbStub.forEach(function(user) {\n if(user.emailAddress === email) {\n userAuth = user;\n } \n }, this);\n }else{\n res.status(401).send('email not defined');\n }\n return userAuth; \n}", "function setCurrentUserFromJWT(jwt, fromCookie) {\n\n //console.log();\n //console.log('++++++++> setCurrentUser(): jwt=' + jwt)\n\n var haveUser = false;\n if (jwt) {\n // See https://github.com/auth0/jwt-decode\n try {\n var decoded = jwt_decode(jwt);\n console.log(decoded);\n var ident = decoded.identity;\n haveUser = true;\n\n } catch (e) {\n console.log('Error decoding JWT: ', e)\n alert('Error decoding invalid JWT')\n haveUser = false;\n }\n }\n\n\n\n // Change the current user.\n var oldCurrentUser = _currentUser;\n if (haveUser) {\n\n\n\n var user = {\n authority: ident.authority,\n avatar: ident.avatar,\n email: ident.email,\n entityType: ident.entity_type,\n firstname: ident.first_name,\n fullname: ident.full_name,\n gender: ident.gender,\n id: ident.id,\n isAdmin: ident.is_admin,\n languages: ident.languages,\n lastname: ident.last_name,\n locale: ident.locale,\n location: ident.location,\n mediaPage: ident.media_page,\n middlename: ident.middle_name,\n privileges: ident.privileges,\n status: ident.status,\n timezone: ident.timezone,\n // type: ident.type,\n };\n\n console.log('Setting _currentUser to ', user);\n _currentUser = user;\n _currentEntityId = ident.id;\n _ttuat = jwt;\n _jwt = jwt;\n\n // Enable and display the UI\n if (_bindToDOM) {\n _jQuery('.authservice-logged-in').show();\n _jQuery('.authservice-logged-out').hide();\n _jQuery('.authservice-current-user-firstname').text(user.firstname);\n _jQuery('.authservice-current-user-lastname').text(user.lastname);\n\n if (user.avatar) {\n _jQuery('.authservice-current-user-avatar').attr('src', user.avatar).show();\n _jQuery('.authservice-default-user-avatar').attr('src', user.avatar).hide();\n } else {\n _jQuery('.authservice-current-user-avatar').attr('src', user.avatar).hide();\n _jQuery('.authservice-default-user-avatar').attr('src', user.avatar).show();\n }\n }//- _bindToDOM\n\n if (_onUserChange) { // && oldCurrentUser==null) {\n\n var newUser = getCurrentUser(); // may be a clone\n var newTtuat = _ttuat;\n (_onUserChange)(newUser, newTtuat, fromCookie);\n }\n return true;\n\n } else {\n\n // No longer logged in\n _currentUser = null;\n _currentEntityId = -1;\n _ttuat = null;\n _jwt = null;\n\n // Remove the cookie\n console.log('Removing ' + LOGIN_DETAILS_COOKIE_NAME + ' (not sure why)')\n setCookie(LOGIN_DETAILS_COOKIE_NAME, null, 0);\n\n if (_bindToDOM) {\n _jQuery('.authservice-logged-in').hide();\n _jQuery('.authservice-logged-out').show();\n _jQuery('.authservice-current-user-firstname').text('');\n _jQuery('.authservice-current-user-lastname').text('');\n _jQuery('.authservice-current-user-avatar').attr('src', '').hide();\n }//- _bindToDOM\n\n if (_onUserChange) { // && oldCurrentUser != null) {\n var fromCookie = false;\n _onUserChange(null, null, fromCookie);\n }\n\n return false;\n }\n }", "function viewUser(req, res) {\n if (req == null || req.params == null) {\n return utils.res(res, 400, 'Bad Request');\n }\n\n if (req.user_id == null) {\n return utils.res(res, 401, 'Invalid Token');\n }\n\n if (req.params.id == null) {\n return utils.res(res, 400, 'Please provide user_id of user to fetch');\n }\n\n // Fetch the user info\n models.User.findOne({\n 'user_id': req.params.id\n }, 'user_id name role email age university total_coins cyber_IQ')\n .lean()\n .exec(function (err, user) {\n if (err || user == null) {\n return utils.res(res, 404, 'Such user does not exist');\n }\n\n user['id'] = user['user_id'];\n delete user['user_id'];\n delete user['_id'];\n if (!user['university']) {\n user['university'] = 'NA';\n }\n\n return utils.res(res, 200, 'Retrieval Successful', user);\n });\n}", "function tokenForUser(user) {\n\tconsole.log('tokenForUser fired');\n\tconsole.log('user id in tokenForUser is : ',user.id);\n\tvar timestamp = new Date().getTime();\n\treturn jwt.encode({ sub: user.id, iat: timestamp }, EnvConfig.secret);\n}", "function signToken(user){\n //toObject() returns a basic js object\n // comprised of data from db. Delete password before creating jwt\n\n const userData = user.toObject()\n delete userData.password\n return jwt.sign(userData, JWT_SECRET)\n}", "function prepUser (body) {\n return {\n username: body.username,\n password: body.password,\n email: body.email,\n role: body.role\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 }", "function tokenForUser(user) {\n const timestamp = new Date().getTime();\n return jwt.encode({ sub: user.id, iat: timestamp }, process.env.API_SECRET);\n}", "userProfile(user) {\n let response = {\n status: 200,\n data: {\n id: user.id,\n first_name: user.first_name,\n last_name: user.last_name,\n email: user.email,\n address: user.address\n }\n }\n return response;\n }", "AUTH_USER (state, userData) {\n state.idToken = userData.token\n state.userId = userData.userId\n }", "getUser() {\n const token = localStorage.getItem('Authorization');\n let user = null;\n\n // If a token exists then decode it\n if (token) {\n const base64Url = token.split('.')[1];\n const base64 = base64Url.replace(/-/g, '+').replace(/_/g, '/');\n const secondsSinceEpoch = new Date() / 1000;\n const parsedToken = JSON.parse(window.atob(base64));\n\n // If current date is after expiration date then destroy it\n if (secondsSinceEpoch > parsedToken.exp) {\n this.destroyToken();\n } else {\n user = parsedToken;\n }\n }\n\n return user;\n }", "static get _required_user_attributes() { return ['email' , 'password']; }", "function getUserObj() { return {username: $(\"#username\").val(), password: $(\"#password\").val()}}", "serverInit(context, request) {\n if (request && request.headers.cookie) {\n try {\n // Set authenticated from cookie.\n const parsed = cookie.parse(request.headers.cookie);\n const usernameField = `CognitoIdentityServiceProvider.${AWS_COGNITO_CLIENT_ID}.LastAuthUser`;\n // If username field hasn't been set, the other fields will not have been set.\n if (!parsed[usernameField]) {\n return;\n }\n const username = parsed[usernameField].replace('@', '%40');\n const accessTokenField = `CognitoIdentityServiceProvider.${AWS_COGNITO_CLIENT_ID}.${username}.accessToken`;\n const jwtToken = parsed[accessTokenField];\n if (!jwtToken) {\n return;\n }\n const userDataField = `CognitoIdentityServiceProvider.${AWS_COGNITO_CLIENT_ID}.${username}.userData`;\n let userData;\n try {\n userData = JSON.parse(parsed[userDataField]);\n } catch (error) {\n console.error('Error parsing JSON:', error);\n }\n const idTokenPayload = userData.UserAttributes.reduce(\n (payload, attribute) => {\n payload[attribute.Name] = attribute.Value;\n return payload;\n },\n {}\n );\n const user = {\n username: username,\n signInUserSession: {\n idToken: {\n payload: idTokenPayload\n },\n accessToken: {\n jwtToken: jwtToken,\n payload: {}\n }\n }\n };\n context.commit('setAuthenticated', user);\n } catch (error) {\n console.error('serverInit error:', error);\n }\n }\n }", "function getUserFromRec2(req) {\n const user = {\n credito_: req.body.credito_\n };\n return user;\n}", "function generateToken(user){\n const token = jwt.sign({\n id: user.id,\n username: user.username,\n email : user.email,\n isSeller: user.isSeller\n }, KEY,{expiresIn: '3h'})\n return token\n}", "hydrateUser(context, userInfo) {\n const { dispatch, getters } = context\n const isSyncMode = getters.syncMode\n\n // If we already have an authenticated user in the state, no need to do anything...\n const activeUser = getters.activeUser\n if (activeUser.is_logged_in) return activeUser\n\n // If no session info exists, hydrate into the anonymous app user...\n if (!userInfo) {\n if (debugHydrate) console.log(`[${pluginName}] Hydrating anonymous app user (no session found)`)\n return dispatch('clearActiveUser').then(() => getters.activeUser)\n }\n\n // Otherwise, hydrate into the authenticated app user...\n if (!isSyncMode) return dispatch('hydrateLocalUser', userInfo) // local user mode\n return dispatch('hydrateExternalUser', userInfo) // external user (sync) mode\n }", "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}", "function getUserID() {\n\n var token = getCookie()\n if (token == \"guest\") {\n return 'guest'\n }\n var decodedJWT = jwt_decode(token);\n return decodedJWT.sub\n}", "getUsers() {\n const { userSession } = this.state;\n\n fetch(\"http://localhost:3000/api/v1/users\")\n .then(res => res.json())\n .then(users => {\n if (userSession.isUserSignedIn()) {\n const userData = userSession.loadUserData();\n\n this.setState({\n userData\n });\n\n let currentUser = users.find(\n user => user.username === userData.username\n );\n\n if (currentUser) {\n this.setState({ users, currentUser });\n } else {\n this.createUser(userData.username);\n }\n }\n });\n }", "signin(req, res){\n var data = req.body;\n\n if(!data.email){\n res.status(400).send({message: 'E-mail obrigatorio'});\n return;\n }\n\n if(!data.senha){\n res.status(400).send({message: 'Senha e obrigatoria'});\n return;\n }\n\n UserModel.findOne({where: {email: data.email, senha: sha1(data.senha)}}).then(user => {\n if(!user){\n res.status(401).send({message: 'Usuário e/ou senha inválidos'});\n }\n else{\n\n var token = jwt.sign({\n 'id': user.id,\n 'nome': user.nome,\n 'email': user.email\n }, config.token.secret, config.token.options);\n\n user.token = token;\n user.ultimo_login = new Date();\n user.save();\n\n var response = {\n 'id': user.id,\n 'nome': user.nome,\n 'email': user.email,\n 'data_criacao': user.data_criacao,\n 'data_atualizacao': user.data_atualizacao,\n 'ultimo_login': user.ultimo_login,\n 'token': user.token,\n 'telefones': []\n };\n\n user.getTelefones().then(telefones => {\n telefones.forEach(tel => {\n response.telefones.push({\n numero: tel.numero,\n ddd: tel.ddd\n });\n });\n\n res.status(200).send(response);\n });\n }\n });\n }", "getCurrentUser() {\n var data = JSON.parse(localStorage['cache_/campusm/sso/state']).data;\n\n // Actual username has a non-obvious key in local storage\n data.username = data.serviceUsername_363;\n\n return data;\n }", "function getUser() {\n var cookie = document.cookie.split(';');\n \n for(var i=0; i< cookie.length; i++) {\n var splitEq = cookie[i].split(\"=\");\n if(splitEq[0]==\"username\") {\n curUser =splitEq[1];\n } else if(splitEq[0]==\" fullname\") { //space needed because of how its split\n curFullName = splitEq[1];\n } else if(splitEq[0]==\" server\") {\n if(splitEq[1]==\"public\") {\n console.log(\"starting public\");\n pubPriv=1;\n } else if(splitEq[1]==\"private\") {\n console.log(\"starting private\");\n pubPriv=0;\n }\n }\n }\n}", "function getUserProfile(user) {\n return {\n coords: [noise(user.longitude), noise(user.latitude)],\n name: user.name,\n location: user.city + ', ' + user.state,\n email: user.email,\n company: user.currentemployer,\n cohort: user.cohort\n };\n}", "function getUserInformation(){\n console.log(userInformation);\n return userInformation;\n }", "getUserData() {\n return JSON.parse(localStorage.getItem(SIMPLEID_USER_SESSION));\n }", "getUser(id){\n //postDB(\"user/Get\", { \"use_id\" : id });\n return { \"name\" : \"steven\", \"img\" : '', \"share\" : false };\n }", "function jwt() {\n return User.jwt();\n}", "function tokenForUser(user){\n //Saves the time and date\n const timestamp = new Date().getTime();\n //Creates a JWT for the user - sub: user.id - sets the subject (who the token belongs to) as the user id; iat: timestamp - issued at time, sets the date/time for when the token was issued, the date/time is captured when the function executes; keys.secret - encrypts the user id using a random string of characters\n return jwt.encode({ sub: user.id, iat: timestamp }, keys.secret);\n}", "getUser() {\r\n return (this.user instanceof core.User) ? this.user : core.User.fromJWT(this.user);\r\n }", "function setUser() {\n user = JSON.parse(getCookie(\"user\"));\n}", "auth_user_data(state, user){\n state.auth_user = user\n }" ]
[ "0.6256919", "0.6165934", "0.612771", "0.61237", "0.61176735", "0.6079125", "0.60630393", "0.60513335", "0.6019698", "0.6015317", "0.59884596", "0.59785044", "0.59489715", "0.594654", "0.5932744", "0.59269696", "0.5923711", "0.5921045", "0.5908859", "0.590842", "0.5906462", "0.5905197", "0.58961064", "0.58934975", "0.5890426", "0.5890347", "0.5884175", "0.5883568", "0.58742374", "0.5872544", "0.58717424", "0.58712685", "0.58710575", "0.58701324", "0.5861929", "0.5861206", "0.5849515", "0.58492464", "0.5831235", "0.5822307", "0.5805333", "0.58026576", "0.57950836", "0.57931995", "0.57897556", "0.5782841", "0.5771717", "0.5759312", "0.5754844", "0.5750792", "0.5718087", "0.5713448", "0.5701016", "0.5693919", "0.56899196", "0.5688283", "0.5684376", "0.5679166", "0.5678386", "0.567629", "0.5675553", "0.56671196", "0.5665725", "0.5654803", "0.56531143", "0.5652927", "0.56507677", "0.5645659", "0.5643465", "0.56431395", "0.5640996", "0.5639908", "0.5638297", "0.5635458", "0.56321734", "0.5631636", "0.5630494", "0.5627333", "0.56227225", "0.5620625", "0.5617362", "0.56160486", "0.5607202", "0.5607047", "0.559821", "0.55980533", "0.5594571", "0.55922043", "0.5590008", "0.5585501", "0.55829775", "0.5582193", "0.5579296", "0.55691034", "0.5565888", "0.5563571", "0.55632126", "0.55623394", "0.55620325", "0.55599874", "0.5558146" ]
0.0
-1
Verifies if FrameNodes retain and parse their data appropriately.
function test() { let { FrameNode } = devtools.require("devtools/shared/profiler/tree-model"); let { CATEGORY_OTHER } = devtools.require("devtools/shared/profiler/global"); let frame1 = new FrameNode("hello/<.world (http://foo/bar.js:123:987)", { location: "hello/<.world (http://foo/bar.js:123:987)", line: 456, isContent: FrameNode.isContent({ location: "hello/<.world (http://foo/bar.js:123:987)" }) }, false); is(frame1.getInfo().nodeType, "Frame", "The first frame node has the correct type."); is(frame1.getInfo().functionName, "hello/<.world", "The first frame node has the correct function name."); is(frame1.getInfo().fileName, "bar.js", "The first frame node has the correct file name."); is(frame1.getInfo().hostName, "foo", "The first frame node has the correct host name."); is(frame1.getInfo().url, "http://foo/bar.js", "The first frame node has the correct url."); is(frame1.getInfo().line, 123, "The first frame node has the correct line."); is(frame1.getInfo().column, 987, "The first frame node has the correct column."); is(frame1.getInfo().categoryData.toSource(), "({})", "The first frame node has the correct category data."); is(frame1.getInfo().isContent, true, "The first frame node has the correct content flag."); let frame2 = new FrameNode("hello/<.world (http://foo/bar.js#baz:123:987)", { location: "hello/<.world (http://foo/bar.js#baz:123:987)", line: 456, isContent: FrameNode.isContent({ location: "hello/<.world (http://foo/bar.js#baz:123:987)" }) }, false); is(frame2.getInfo().nodeType, "Frame", "The second frame node has the correct type."); is(frame2.getInfo().functionName, "hello/<.world", "The second frame node has the correct function name."); is(frame2.getInfo().fileName, "bar.js#baz", "The second frame node has the correct file name."); is(frame2.getInfo().hostName, "foo", "The second frame node has the correct host name."); is(frame2.getInfo().url, "http://foo/bar.js#baz", "The second frame node has the correct url."); is(frame2.getInfo().line, 123, "The second frame node has the correct line."); is(frame2.getInfo().column, 987, "The second frame node has the correct column."); is(frame2.getInfo().categoryData.toSource(), "({})", "The second frame node has the correct category data."); is(frame2.getInfo().isContent, true, "The second frame node has the correct content flag."); let frame3 = new FrameNode("hello/<.world (http://foo/#bar:123:987)", { location: "hello/<.world (http://foo/#bar:123:987)", line: 456, isContent: FrameNode.isContent({ location: "hello/<.world (http://foo/#bar:123:987)" }) }, false); is(frame3.getInfo().nodeType, "Frame", "The third frame node has the correct type."); is(frame3.getInfo().functionName, "hello/<.world", "The third frame node has the correct function name."); is(frame3.getInfo().fileName, "#bar", "The third frame node has the correct file name."); is(frame3.getInfo().hostName, "foo", "The third frame node has the correct host name."); is(frame3.getInfo().url, "http://foo/#bar", "The third frame node has the correct url."); is(frame3.getInfo().line, 123, "The third frame node has the correct line."); is(frame3.getInfo().column, 987, "The third frame node has the correct column."); is(frame3.getInfo().categoryData.toSource(), "({})", "The third frame node has the correct category data."); is(frame3.getInfo().isContent, true, "The third frame node has the correct content flag."); let frame4 = new FrameNode("hello/<.world (http://foo/:123:987)", { location: "hello/<.world (http://foo/:123:987)", line: 456, isContent: FrameNode.isContent({ location: "hello/<.world (http://foo/:123:987)" }) }, false); is(frame4.getInfo().nodeType, "Frame", "The fourth frame node has the correct type."); is(frame4.getInfo().functionName, "hello/<.world", "The fourth frame node has the correct function name."); is(frame4.getInfo().fileName, "/", "The fourth frame node has the correct file name."); is(frame4.getInfo().hostName, "foo", "The fourth frame node has the correct host name."); is(frame4.getInfo().url, "http://foo/", "The fourth frame node has the correct url."); is(frame4.getInfo().line, 123, "The fourth frame node has the correct line."); is(frame4.getInfo().column, 987, "The fourth frame node has the correct column."); is(frame4.getInfo().categoryData.toSource(), "({})", "The fourth frame node has the correct category data."); is(frame4.getInfo().isContent, true, "The fourth frame node has the correct content flag."); let frame5 = new FrameNode("hello/<.world (resource://foo.js -> http://bar/baz.js:123:987)", { location: "hello/<.world (resource://foo.js -> http://bar/baz.js:123:987)", line: 456, isContent: FrameNode.isContent({ location: "hello/<.world (resource://foo.js -> http://bar/baz.js:123:987)" }) }, false); is(frame5.getInfo().nodeType, "Frame", "The fifth frame node has the correct type."); is(frame5.getInfo().functionName, "hello/<.world", "The fifth frame node has the correct function name."); is(frame5.getInfo().fileName, "baz.js", "The fifth frame node has the correct file name."); is(frame5.getInfo().hostName, "bar", "The fifth frame node has the correct host name."); is(frame5.getInfo().url, "http://bar/baz.js", "The fifth frame node has the correct url."); is(frame5.getInfo().line, 123, "The fifth frame node has the correct line."); is(frame5.getInfo().column, 987, "The fifth frame node has the correct column."); is(frame5.getInfo().categoryData.toSource(), "({})", "The fifth frame node has the correct category data."); is(frame5.getInfo().isContent, false, "The fifth frame node has the correct content flag."); let frame6 = new FrameNode("Foo::Bar::Baz", { location: "Foo::Bar::Baz", line: 456, category: CATEGORY_OTHER, isContent: FrameNode.isContent({ location: "Foo::Bar::Baz", category: CATEGORY_OTHER }) }, false); is(frame6.getInfo().nodeType, "Frame", "The sixth frame node has the correct type."); is(frame6.getInfo().functionName, "Foo::Bar::Baz", "The sixth frame node has the correct function name."); is(frame6.getInfo().fileName, null, "The sixth frame node has the correct file name."); is(frame6.getInfo().hostName, null, "The sixth frame node has the correct host name."); is(frame6.getInfo().url, null, "The sixth frame node has the correct url."); is(frame6.getInfo().line, 456, "The sixth frame node has the correct line."); is(frame6.getInfo().categoryData.abbrev, "other", "The sixth frame node has the correct category data."); is(frame6.getInfo().isContent, false, "The sixth frame node has the correct content flag."); let frame7 = new FrameNode("EnterJIT", { location: "EnterJIT", isContent: FrameNode.isContent({ location: "EnterJIT" }) }, false); is(frame7.getInfo().nodeType, "Frame", "The seventh frame node has the correct type."); is(frame7.getInfo().functionName, "EnterJIT", "The seventh frame node has the correct function name."); is(frame7.getInfo().fileName, null, "The seventh frame node has the correct file name."); is(frame7.getInfo().hostName, null, "The seventh frame node has the correct host name."); is(frame7.getInfo().url, null, "The seventh frame node has the correct url."); is(frame7.getInfo().line, null, "The seventh frame node has the correct line."); is(frame7.getInfo().column, null, "The seventh frame node has the correct column."); is(frame7.getInfo().categoryData.abbrev, "js", "The seventh frame node has the correct category data."); is(frame7.getInfo().isContent, false, "The seventh frame node has the correct content flag."); let frame8 = new FrameNode("chrome://browser/content/content.js", { location: "chrome://browser/content/content.js", line: 456, column: 123 }, false); is(frame8.getInfo().hostName, null, "The eighth frame node has the correct host name."); let frame9 = new FrameNode("hello/<.world (resource://gre/foo.js:123:434)", { location: "hello/<.world (resource://gre/foo.js:123:434)", line: 456 }, false); is(frame9.getInfo().hostName, null, "The ninth frame node has the correct host name."); finish(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "hasUnsavedChanges() {\n for (let [key, node] of Object.entries(this._nodesStack)) {\n if (node.hasUnsavedChanges()) {\n return true;\n }\n }\n return false;\n }", "checkAlive() {\n\n\t\tlet currentFrame = this.#_augmentaScene.frame;\n\n\t\tfor(var id in this.#_augmentaObjects) {\n\t\t\t\n\t\t\tlet object = this.#_augmentaObjects[id];\n\n\t\t\tif (currentFrame - object.lastSeen > this.#_augmentaObjectTimeOut) {\n\t\t\t\tthis.#_objectWillLeave(this.#_augmentaObjects[id]);\n\t\t\t\tdelete this.#_augmentaObjects[id];\t\t\t\t\t\t\n\t\t\t}\n\t\t}\n\t}", "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 checkFrames(frames){\n\t\tvar width = frames[0].width,\n\t\t\theight = frames[0].height,\n\t\t\tduration = frames[0].duration;\n\t\tfor(var i = 1; i < frames.length; i++){\n\t\t\tif(frames[i].width != width) throw \"Frame \" + (i + 1) + \" has a different width\";\n\t\t\tif(frames[i].height != height) throw \"Frame \" + (i + 1) + \" has a different height\";\n\t\t\tif(frames[i].duration < 0 || frames[i].duration > 0x7fff) throw \"Frame \" + (i + 1) + \" has a weird duration (must be between 0 and 32767)\";\n\t\t\tduration += frames[i].duration;\n\t\t}\n\t\treturn {\n\t\t\tduration: duration,\n\t\t\twidth: width,\n\t\t\theight: height\n\t\t};\n\t}", "function cleanFrame(fr,fn){\n\tfor(var i=0;i<fr.elements.length;i++){\n\t\tcleanElement(fr.elements[i]);\n\t\t//fl.trace(\"clean stage element \"+fr.elements[i]);\n\t}\n\t\n}", "function checkFrames(frames) {\n var width = frames[0].width,\n height = frames[0].height,\n duration = frames[0].duration;\n for (var i = 1; i < frames.length; i++) {\n if (frames[i].width != width)\n throw \"Frame \" + (i + 1) + \" has a different width\";\n if (frames[i].height != height)\n throw \"Frame \" + (i + 1) + \" has a different height\";\n if (frames[i].duration < 0 || frames[i].duration > 0x7fff)\n throw \"Frame \" + (i + 1) + \" has a weird duration (must be between 0 and 32767)\";\n duration += frames[i].duration;\n }\n return {\n duration: duration,\n width: width,\n height: height\n };\n }", "hasFrames() {\nreturn this.fCount !== 0;\n}", "function Interpreter_ProcessLoadedFrames()\n{\n\t//do we have work to do?\n\tvar processing = this.IFramesWaitingForLoad.length > 0;\n\t//if we are processing\n\tif (processing)\n\t{\n\t\t//\"copy\" the array of frames to load\n\t\tvar updateList = this.IFramesWaitingForLoad;\n\t\t//reset the array of loading iframes\n\t\tthis.IFramesWaitingForLoad = [];\n\t\t//loop through the update objects\n\t\tfor (var i = 0, c = updateList.length; i < c; i++)\n\t\t{\n\t\t\t//get the object\n\t\t\tvar intObject = this.LoadedObjects[updateList[i]];\n\t\t\t//now it can load its children\n\t\t\tintObject.NoChildrenUpdate = false;\n\t\t\t//get the doc\n\t\t\tvar theDoc = intObject.HTML.contentWindow.document;\n\t\t\t//correct its doctype\n\t\t\ttheDoc.open();\n\t\t\ttheDoc.write(Get_String(intObject.Properties[__NEMESIS_PROPERTY_HTML_DOCTYPE], \"<!DOCTYPE html>\"));\n\t\t\ttheDoc.close();\n\t\t\t//correct the HTML Parent\n\t\t\tintObject.HTMLParent = theDoc.body;\n\t\t\t//ensure the scroll is listening\n\t\t\tBrowser_AddEvent(theDoc, __BROWSER_EVENT_SCROLL, Simulator_OnScroll);\n\t\t\t//listen to key presses\n\t\t\tBrowser_AddEvent(theDoc, __BROWSER_EVENT_KEYDOWN, Simulator_ProcessOnKeyDown);\n\t\t\tBrowser_AddEvent(theDoc, __BROWSER_EVENT_KEYUP, Simulator_ProcessOnKeyUp);\n\t\t\t//block the context menu\n\t\t\tBrowser_AddEvent(theDoc.body, __BROWSER_EVENT_MOUSERIGHT, Browser_BlockEvent);\n\t\t\t//and the help request\n\t\t\tBrowser_AddEvent(theDoc.body, __BROWSER_EVENT_HELP, Browser_BlockEvent);\n\t\t\t//and add the default css for IFRAMES\n\t\t\tBrowser_AddIframeCSS(theDoc);\n\t\t\t//if there is a designer?\n\t\t\tif (__DESIGNER_CONTROLLER)\n\t\t\t{\n\t\t\t\t//we also peek at mouse move\n\t\t\t\tBrowser_AddEvent(theDoc, __BROWSER_EVENT_MOUSEMOVE, WI4_PlugIn_Generic_DesignerMouseOver);\n\t\t\t\ttheDoc.addEventListener(__BROWSER_EVENT_MOUSEUP, WI4_PlugIn_Generic_ForwardEvent, true);\n\t\t\t}\n\t\t\t//force an update\n\t\t\tintObject.UpdateDisplay(true);\n\t\t}\n\t}\n\t//return true if we were processing\n\treturn processing;\n}", "function Unknown_IFrame_NotifyDestruction()\n{\n\t//if we exist in the loaded iframes (WE SHOULD!)\n\tif (__SIMULATOR.Interpreter.LoadedIFrames[this.InterpreterObject.DataObject.Id])\n\t{\n\t\t//no more\n\t\tdelete __SIMULATOR.Interpreter.LoadedIFrames[this.InterpreterObject.DataObject.Id];\n\t}\n}", "hasFrameSize() {\n return this.frameSize != VideoData.FRAME_SIZE_NOT_READY;\n }", "function Interpreter_HasFramesWaitingForLoading()\n{\n\t//assume we are completed\n\tvar bHasFramesLoading = false;\n\t//loop through the iframes\n\tfor (var i = 0, c = this.IFramesWaitingForLoad.length; i < c; i++)\n\t{\n\t\t//get the object\n\t\tvar intObject = this.LoadedObjects[this.IFramesWaitingForLoad[i]];\n\t\t//valid?\n\t\tif (intObject && intObject.HTML)\n\t\t{\n\t\t\t//check if its ready\n\t\t\tif (!intObject.HTML.contentWindow || !intObject.HTML.contentWindow.document || !intObject.HTML.contentWindow.document.body || intObject.HTML.contentWindow.document.readyState != \"complete\")\n\t\t\t{\n\t\t\t\t//is the problem the uninitialised?\n\t\t\t\tif (intObject.HTML.contentWindow && intObject.HTML.contentWindow.document && intObject.HTML.contentWindow.document.body && intObject.HTML.contentWindow.document.readyState != \"complete\")\n\t\t\t\t{\n\t\t\t\t\t//open the doc\n\t\t\t\t\tintObject.HTML.contentWindow.document.open();\n\t\t\t\t\t//and close it\n\t\t\t\t\tintObject.HTML.contentWindow.document.close();\n\t\t\t\t}\n\t\t\t\t//not ready\n\t\t\t\tbHasFramesLoading = true;\n\t\t\t\t//end loop\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\t//return the result\n\treturn bHasFramesLoading;\n}", "cleanParser() {\n this.bnodes = {}\n this.why = null\n }", "function validNOFRAMES()\n {\n this.ruleID = 'validNOFRAMES';\n }", "function isInFrame() {\n try {\n return self !== top && parent !== self;\n } catch (e) {\n return true;\n }\n}", "function assertEquivalentNodes(previousNodes, nodes) {\n if (previousNodes.length !== nodes.length) {\n throw new Error('The number of i18n message children changed between first and second pass.');\n }\n\n if (previousNodes.some(function (node, i) {\n return nodes[i].constructor !== node.constructor;\n })) {\n throw new Error('The types of the i18n message children changed between first and second pass.');\n }\n}", "function assertEquivalentNodes(previousNodes, nodes) {\n if (previousNodes.length !== nodes.length) {\n throw new Error('The number of i18n message children changed between first and second pass.');\n }\n if (previousNodes.some((node, i) => nodes[i].constructor !== node.constructor)) {\n throw new Error('The types of the i18n message children changed between first and second pass.');\n }\n}", "function assertEquivalentNodes(previousNodes, nodes) {\n if (previousNodes.length !== nodes.length) {\n throw new Error('The number of i18n message children changed between first and second pass.');\n }\n if (previousNodes.some((node, i) => nodes[i].constructor !== node.constructor)) {\n throw new Error('The types of the i18n message children changed between first and second pass.');\n }\n}", "function cleanFrameset(fsDOM) {\n // Remove existing src attributes.\n if (fsDOM != null) {\n var frameNodeList = fsDOM.getElementsByTagName('frame');\n var numberOfFrames = frameNodeList.length;\n var oldName = 'FrameName'; // Default frame name if none specified.\n\n for (var curFrame = 0; curFrame < numberOfFrames; curFrame++) {\n if (frameNodeList[curFrame].name) // Check that the frame has a name.\n\t oldName = frameNodeList[curFrame].name;\n if (oldName != \"mm_target\") { // Set a unique name and cleanup frame tag.\n frameNodeList[curFrame].name = makeUniqueFrameName(oldName);\n\n // Remove the invalid src attribute.\n frameNodeList[curFrame].removeAttribute(\"src\");\n } } }\n\n return fsDOM;\n}", "popFrame() {\n this[INNER_VM].popFrame();\n }", "cleanGarbage() {\n const self = this;\n this.forEveryElement(DOWN_TO_TOP, LEFT_TO_RIGHT, (elm, left, top, right, bottom) => {\n \n if(elm.position.isValid()){\n const {line, column} = elm.position;\n elm.cleanTemporaryData();\n self.data[line][column] = elm;\n } else {\n throw new Error('Cannot clean invalid position');\n }\n \n });\n }", "processFrameInput() {\n\n var frame = parseInt(this._currentFrameInput.value);\n if (isNaN(frame)) {\n console.log(\"Provided invalid frame input: \" + this._currentFrameInput.value);\n this._currentFrameInput.classList.add(\"has-border\");\n this._currentFrameInput.classList.add(\"is-invalid\");\n return;\n }\n\n const maxFrame = this._maxFrameNumber;\n if (frame > maxFrame)\n {\n frame = maxFrame;\n }\n else if (frame < 0)\n {\n frame = 0;\n }\n\n this._currentFrameInput.classList.remove(\"has-border\");\n this._currentFrameInput.classList.remove(\"is-invalid\");\n this.goToFrame(frame);\n this.checkAllReady();\n }", "function reloadFrame()/*:void*/ {\n this.setPreviewLoading$67CD();\n this.waitForReloadTimer$67CD = undefined;\n this.updatePreview$67CD();\n }", "function checkLabels(theDoc) {\n\tvar labels = theDoc.layers.itemByName(layerName).textFrames;\n\tcheckForDuplicate(labels);\n\t\tfor (var i = 0; i < labels.length; i++){\n \t\t\tvar theLabel = labels[i];\n \t\t checkLabelOverlap(theLabel);\n \t\t\tcheckBounds(theLabel);\n\t\t\tcheckLabelOverlap(theLabel);\n \t\t};\n}", "function checkFrames(frames) {\n if (!frames[0]) {\n postMessage({\n error: 'Something went wrong. Maybe WebP format is not supported in the current browser.'\n });\n return;\n }\n\n var width = frames[0].width,\n height = frames[0].height,\n duration = frames[0].duration;\n\n for (var i = 1; i < frames.length; i++) {\n duration += frames[i].duration;\n }\n return {\n duration: duration,\n width: width,\n height: height\n };\n }", "function checkFrames(frames) {\n if (!frames[0]) {\n postMessage({\n error: 'Something went wrong. Maybe WebP format is not supported in the current browser.'\n });\n return;\n }\n\n var width = frames[0].width,\n height = frames[0].height,\n duration = frames[0].duration;\n\n for (var i = 1; i < frames.length; i++) {\n duration += frames[i].duration;\n }\n return {\n duration: duration,\n width: width,\n height: height\n };\n }", "function deserializeKeepAliveFrame(buffer, streamId, flags, encoders) {\n invariant_1(\n streamId === 0,\n 'RSocketBinaryFraming: Invalid KEEPALIVE frame, expected stream id to be 0.'\n );\n\n const length = buffer.length;\n let offset = FRAME_HEADER_SIZE;\n const lastReceivedPosition = readUInt64BE(buffer, offset);\n offset += 8;\n let data = null;\n if (offset < buffer.length) {\n data = encoders.data.decode(buffer, offset, buffer.length);\n }\n\n return {\n data,\n flags,\n lastReceivedPosition,\n length,\n streamId,\n type: FRAME_TYPES.KEEPALIVE,\n };\n }", "function checkFrame() {\n (window.requestAnimationFrame || window.webkitRequestAnimationFrame)(\n function() {\n check();\n checkFrame && checkFrame();\n }\n );\n }", "function verifyStructure() {\n var component, key;\n parameters.structure.integrity = true;\n \n for (key in parameters.structure.components) {\n component = parameters.structure.components[key];\n if (component.integrity !== true) {\n parameters.structure.integrity = false;\n }\n }\n }", "function _markRemoved() {\n\t this.shouldSkip = true;\n\t this.removed = true;\n\t this.node = null;\n\t}", "function _markRemoved() {\n\t this.shouldSkip = true;\n\t this.removed = true;\n\t this.node = null;\n\t}", "function checkNewNode(node) {\r\n //If it is a video element\r\n if (node.nodeName.match(/video/i))\r\n // Observe changes in the video element\r\n return VideoRenderer.handle(node);\r\n //Look in childs\r\n for (var j = 0; j < node.childNodes.length; j++)\r\n checkNewNode(node.childNodes.item(j));\r\n }", "dirty() {\r\n this._xml = null;\r\n }", "retain() {}", "checkNoChanges() {\n checkNoChangesInternal(this._lView[TVIEW], this._lView, this.context);\n }", "checkNoChanges() {\n checkNoChangesInternal(this._lView[TVIEW], this._lView, this.context);\n }", "checkNoChanges() {\n checkNoChangesInternal(this._lView[TVIEW], this._lView, this.context);\n }", "checkNoChanges() {\n checkNoChangesInternal(this._lView[TVIEW], this._lView, this.context);\n }", "checkNoChanges() {\n checkNoChangesInternal(this._lView[TVIEW], this._lView, this.context);\n }", "checkNoChanges() {\n checkNoChangesInternal(this._lView[TVIEW], this._lView, this.context);\n }", "dirtyWorkaround() {\n if (!this._bPatched && this.getVersion() !== Constants.CONTRACT_V_JSON && !this.isDataModified()) return;\n\n this.getData();\n this.setVersion(Constants.CONTRACT_V_V8);\n\n const buffData = serializeContractDataV8(this._cacheData);\n const objData = deSerializeContractDataV8(buffData);\n\n this._data.contractData = serializeContractDataV8(objData);\n delete this._cacheData;\n\n this._bPatched = true;\n }", "function haveMoreFramesToSend() {\n if (gFrames.length == 0) {\n returnToTest('no-more-frames');\n } else {\n returnToTest('still-have-frames');\n }\n}", "function fieldDataHasChanged(previous, current) {\n\t if (is.Array(previous) && is.Array(current)) {\n\t if (previous.length != current.length) { return true }\n\t for (var i = 0, l = previous.length; i < l; i++) {\n\t if (previous[i] != current[i]) { return true }\n\t }\n\t return false\n\t }\n\t return previous != current\n\t}", "function NodeFrame( time ) {\n\n\tthis.time = time !== undefined ? time : 0;\n\n\tthis.id = 0;\n\n}", "_restoreOriginalChildNodes() {\n // Add the original nodes back in\n this.properties.originalChildNodes.forEach(item => this.nodes.content.appendChild(item));\n // Remove this stale array\n delete this.properties.originalChildNodes;\n\n // Make sure that any nodes with a layer-id are properly linked in the parent component\n // Note that onReplaceableContentAdded() will not get called to add these the way it is\n // called for any replaceable content that is inserted\n this._findNodesWithin(this, (node, isComponent) => {\n const layerId = node.getAttribute && node.getAttribute('layer-id');\n if (layerId) this.parentComponent.nodes[layerId] = node;\n\n // If its a UI Component and not some generic DOM node, setup the originalChildNode's parentComponent pointer as well\n if (isComponent) {\n if (!node.properties) node.properties = {};\n node.properties.parentComponent = this.parentComponent;\n }\n });\n }", "isReadFrameReady() {\n return this.hasFrameSize() && this.videoDataBuffer.length >= this.frameSize;\n }", "function parseInternal(data) {\n var tokenizer = createTokenizer(data), cat, id, file = new Text.File(data), block = new Text.DataBlock(data, \"default\"), saveFrame = new Text.DataBlock(data, \"empty\"), inSaveFrame = false, blockSaveFrames;\n moveNext(tokenizer);\n while (tokenizer.currentTokenType !== 6 /* End */) {\n var token = tokenizer.currentTokenType;\n // Data block\n if (token === 0 /* Data */) {\n if (inSaveFrame) {\n return error(tokenizer.currentLineNumber, \"Unexpected data block inside a save frame.\");\n }\n if (block.categories.length > 0) {\n file.dataBlocks.push(block);\n }\n block = new Text.DataBlock(data, data.substring(tokenizer.currentTokenStart + 5, tokenizer.currentTokenEnd));\n moveNext(tokenizer);\n // Save frame\n }\n else if (token === 1 /* Save */) {\n id = data.substring(tokenizer.currentTokenStart + 5, tokenizer.currentTokenEnd);\n if (id.length === 0) {\n if (saveFrame.categories.length > 0) {\n blockSaveFrames = block.additionalData[\"saveFrames\"];\n if (!blockSaveFrames) {\n blockSaveFrames = [];\n block.additionalData[\"saveFrames\"] = blockSaveFrames;\n }\n blockSaveFrames[blockSaveFrames.length] = saveFrame;\n }\n inSaveFrame = false;\n }\n else {\n if (inSaveFrame) {\n return error(tokenizer.currentLineNumber, \"Save frames cannot be nested.\");\n }\n inSaveFrame = true;\n saveFrame = new Text.DataBlock(data, id);\n }\n moveNext(tokenizer);\n // Loop\n }\n else if (token === 2 /* Loop */) {\n cat = handleLoop(tokenizer, inSaveFrame ? saveFrame : block);\n if (cat.hasError) {\n return error(cat.errorLine, cat.errorMessage);\n }\n // Single row\n }\n else if (token === 4 /* ColumnName */) {\n cat = handleSingle(tokenizer, inSaveFrame ? saveFrame : block);\n if (cat.hasError) {\n return error(cat.errorLine, cat.errorMessage);\n }\n // Out of options\n }\n else {\n return error(tokenizer.currentLineNumber, \"Unexpected token. Expected data_, loop_, or data name.\");\n }\n }\n // Check if the latest save frame was closed.\n if (inSaveFrame) {\n return error(tokenizer.currentLineNumber, \"Unfinished save frame (`\" + saveFrame.header + \"`).\");\n }\n if (block.categories.length > 0) {\n file.dataBlocks.push(block);\n }\n return result(file);\n }", "function fastCheck() {\n for (var i = watchArray.length - 1; i >= 0; i--) {\n if (!watchArray[i].inited) continue;\n\n var deltaTop = Math.abs(getDocOffsetTop(watchArray[i].clone) - watchArray[i].docOffsetTop),\n deltaHeight = Math.abs(watchArray[i].parent.node.offsetHeight - watchArray[i].parent.height);\n\n if (deltaTop >= 2 || deltaHeight >= 2) return false;\n }\n return true;\n }", "function fastCheck() {\n for (var i = watchArray.length - 1; i >= 0; i--) {\n if (!watchArray[i].inited) continue;\n\n var deltaTop = Math.abs(getDocOffsetTop(watchArray[i].clone) - watchArray[i].docOffsetTop),\n deltaHeight = Math.abs(watchArray[i].parent.node.offsetHeight - watchArray[i].parent.height);\n\n if (deltaTop >= 2 || deltaHeight >= 2) return false;\n }\n return true;\n }", "function validateNode(node) {\n return [\n node.type === \"AssignmentExpression\" && node.left.type === \"MemberExpression\"\n ];\n}", "function _validateFrame(state, frame) {\n if(!_isArray(frame) || frame.length !== 1 || !_isObject(frame[0])) {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; a JSON-LD frame must be a single object.',\n 'jsonld.SyntaxError', {frame: frame});\n }\n}", "function _crossCheck (node) {\n if (!ecma.util.isa(node, CNode)) {\n throw new Error('child is not a data node');\n }\n if (node.parentNode !== this) {\n throw new Error('child belongs to another parent');\n }\n }", "emptyStruct(ref);\n } else {\n if (p.typeBits === 0x03) {\n cap(p.hi, ref);\n } else {\n nonpreallocated(arena, ref, p.object, p.typeBits, p.hi);\n }\n }", "function _resyncRemoved() {\n if (this.key == null || !this.container || this.container[this.key] !== this.node) {\n this._markRemoved();\n }\n}", "function isStackFrameNode(stackframe) {\n if (stackframe.isNative) {\n return true;\n } else {\n const fileName = stackframe.getFileName();\n if (!fileName) {\n return true;\n } else {\n return !path.isAbsolute(fileName) && fileName[0] !== '.';\n }\n }\n}", "function _markRemoved() {\n this.shouldSkip = true;\n this.removed = true;\n this.node = null;\n}", "function _markRemoved() {\n this.shouldSkip = true;\n this.removed = true;\n this.node = null;\n}", "function _checkParser() {\n eval(Processing(canvas, parserTest.body));\n _pass();\n}", "get _valid( ) { return(this._ctx.browser && this._ctx.browser.contentWindow); }", "function updateDocumentState() {\n\n // Get the Iframe content not in xml \n let JqueryIframe = $(`<div>${tinymce.activeEditor.getContent()}</div>`)\n let JquerySavedContent = $(`#raje_root`)\n\n // True if they're different, False is they're equal\n ipcRenderer.send('updateDocumentState', JqueryIframe.html() != JquerySavedContent.html())\n }", "validateResponse (data) {\n\t\tconst expectedCodemark = DeepClone(this.codemark);\n\t\tAssert(data.codemark.modifiedAt >= this.modifiedAfter, 'modifiedAt is not greater than before the codemark was updated');\n\t\texpectedCodemark.modifiedAt = data.codemark.modifiedAt;\n\t\texpectedCodemark.version++;\n\t\texpectedCodemark.markerIds.splice(this.deletedMarkerIndex, 1);\n\t\texpectedCodemark.fileStreamIds.splice(this.deletedMarkerIndex, 1);\n\t\t// verify what we fetch is what we got back in the response\n\t\tAssert.deepEqual(data.codemark, expectedCodemark, 'fetched codemark does not match');\n\t}", "processFrameInput() {\n\n var frame = parseInt(this._currentFrameInput.value);\n if (isNaN(frame)) {\n console.log(\"Provided invalid frame input: \" + this._currentFrameInput.value);\n this._currentFrameInput.classList.add(\"has-border\");\n this._currentFrameInput.classList.add(\"is-invalid\");\n return;\n }\n\n const maxFrame = this._mediaInfo.num_frames - 1;\n if (frame > maxFrame)\n {\n frame = maxFrame;\n }\n else if (frame < 0)\n {\n frame = 0;\n }\n\n this._currentFrameInput.classList.remove(\"has-border\");\n this._currentFrameInput.classList.remove(\"is-invalid\");\n this.goToFrame(frame);\n }", "setFromFrames(frames) {\nvar signdesc;\n//------------\n// ASSERT: this is currently empty.\nif (frames != null ? frames.length : void 0) {\nsigndesc = {\ni: 0,\ngloss: \"ALL_FRAMES\",\nframes: frames\n};\nthis.extendSigns(signdesc);\nthis.setCompleted();\n} else {\nif (typeof lggr.debug === \"function\") {\nlggr.debug(\"JASAnimData.setFromFrames(): empty frames list.\");\n}\n}\nreturn void 0; // void result\n}", "function FrameNode(frameKey, { location, line, category, isContent }, isMetaCategory) {\n this.key = frameKey;\n this.location = location;\n this.line = line;\n this.youngestFrameSamples = 0;\n this.samples = 0;\n this.calls = [];\n this.isContent = !!isContent;\n this._optimizations = null;\n this._tierData = [];\n this._stringTable = null;\n this.isMetaCategory = !!isMetaCategory;\n this.category = category;\n this.nodeType = \"Frame\";\n this.byteSize = 0;\n this.youngestFrameByteSize = 0;\n}", "renderNodeChanges(data, dataDiffer = this.dataDiffer, viewContainer = this.nodeOutlet.viewContainer, parentData) {\n const changes = dataDiffer.diff(data);\n if (!changes) {\n return;\n }\n changes.forEachOperation((item, adjustedPreviousIndex, currentIndex) => {\n if (item.previousIndex == null) {\n this.insertNode(data[currentIndex], currentIndex, viewContainer, parentData);\n }\n else if (currentIndex == null) {\n viewContainer.remove(adjustedPreviousIndex);\n this.levels.delete(item.item);\n }\n else {\n const view = viewContainer.get(adjustedPreviousIndex);\n viewContainer.move(view, currentIndex);\n }\n });\n this.changeDetectorRef.detectChanges();\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 _validateFrame(frame) {\n if(!_isArray(frame) || frame.length !== 1 || !_isObject(frame[0])) {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; a JSON-LD frame must be a single object.',\n 'jsonld.SyntaxError', {frame: frame});\n }\n}", "function _validateFrame(frame) {\n if(!_isArray(frame) || frame.length !== 1 || !_isObject(frame[0])) {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; a JSON-LD frame must be a single object.',\n 'jsonld.SyntaxError', {frame: frame});\n }\n}", "function _validateFrame(frame) {\n if(!_isArray(frame) || frame.length !== 1 || !_isObject(frame[0])) {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; a JSON-LD frame must be a single object.',\n 'jsonld.SyntaxError', {frame: frame});\n }\n}", "function _validateFrame(frame) {\n if(!_isArray(frame) || frame.length !== 1 || !_isObject(frame[0])) {\n throw new JsonLdError(\n 'Invalid JSON-LD syntax; a JSON-LD frame must be a single object.',\n 'jsonld.SyntaxError', {frame: frame});\n }\n}", "function isMainFrame(_frame){\n\treturn _frame.labelType == LABEL_TYPE_NAME && !isNoEasingFrame(_frame) && !isSpecialFrame(_frame, EVENT_PREFIX) && !isSpecialFrame(_frame, MOVEMENT_PREFIX);\n}", "function fieldDataHasChanged(previous, current) {\n if (is.Array(previous) && is.Array(current)) {\n if (previous.length != current.length) { return true }\n for (var i = 0, l = previous.length; i < l; i++) {\n if (previous[i] != current[i]) { return true }\n }\n return false\n }\n return previous != current\n}", "function visDeconstruct(svgNode) {\n var deconstructed = VisDeconstruct.deconstruct(svgNode);\n\n updaters.push(new VisUpdater(svgNode, deconstructed.dataNodes.nodes, deconstructed.dataNodes.ids,\n deconstructed.schematizedData));\n\n console.log(deconstructed.schematizedData);\n\n var deconData = {\n schematized: deconstructed.schematizedData,\n ids: deconstructed.dataNodes.ids\n };\n\n // Now send a custom event with dataNodes to the content script\n var evt = document.createEvent(\"CustomEvent\");\n evt.initCustomEvent(\"deconDataEvent\", true, true, deconData);\n document.dispatchEvent(evt);\n}", "isEmpty() {\n const actualLength = this.getLength();\n this._node.__setLastDiff({\n actual: actualLength.toString(),\n timeout: this._node.getTimeout(),\n });\n return actualLength === 0;\n }", "refDiff() {\n let res = {\n toAdd: [],\n toRemove: [],\n toUpdate: [],\n };\n Object.keys(this.frameNew).forEach((key) => {\n !this.frameOld[key] && res.toAdd.push(this.frameNew[key]);\n this.frameOld[key] && res.toUpdate.push(this.frameNew[key]);\n });\n Object.keys(this.frameOld).forEach((key) => {\n !this.frameNew[key] && res.toRemove.push(this.frameOld[key]);\n });\n return res;\n }", "constructor(frameInit) {\n this.frameOld = {};\n this.frameNew = frameInit;\n }", "parseFrameNumb(coach) {\r\n let frameNumb = {};\r\n\r\n if ( coach.isWord(\"unbounded\") ) {\r\n coach.expectWord(\"unbounded\");\r\n coach.skipSpace();\r\n\r\n frameNumb.unbounded = true;\r\n\r\n let word = coach.readWord().toLowerCase();\r\n if ( word != \"preceding\" && word != \"following\" ) {\r\n coach.throwError(\"expected word preceding or following\");\r\n }\r\n\r\n if ( word == \"preceding\" ) {\r\n frameNumb.preceding = true;\r\n } else {\r\n frameNumb.following = true;\r\n }\r\n }\r\n else if ( coach.isWord(\"current\") ) {\r\n coach.expectWord(\"current\");\r\n coach.skipSpace();\r\n\r\n coach.expectWord(\"row\");\r\n frameNumb.currentRow = true;\r\n }\r\n else {\r\n frameNumb.value = coach.parsePgNumber();\r\n coach.skipSpace();\r\n\r\n let word = coach.readWord().toLowerCase();\r\n if ( word != \"preceding\" && word != \"following\" ) {\r\n coach.throwError(\"expected word preceding or following\");\r\n }\r\n\r\n if ( word == \"preceding\" ) {\r\n frameNumb.preceding = true;\r\n } else {\r\n frameNumb.following = true;\r\n }\r\n }\r\n\r\n return frameNumb;\r\n }", "function checkMem() {\n // see: https://github.com/WebAssembly/design/issues/1210\n if (buffer !== memory.buffer) {\n buffer = memory.buffer;\n I8 = new Int8Array(buffer);\n U8 = new Uint8Array(buffer);\n I16 = new Int16Array(buffer);\n U16 = new Uint16Array(buffer);\n I32 = new Int32Array(buffer);\n U32 = new Uint32Array(buffer);\n if (hasBigInt64) {\n I64 = new BigInt64Array(buffer);\n U64 = new BigUint64Array(buffer);\n }\n F32 = new Float32Array(buffer);\n F64 = new Float64Array(buffer);\n }\n }", "read_frame(size, replace) {\n // Make new frame or replace existing frame.\n let frame;\n let refidx = this.refs.length;\n if (replace == -1) {\n // Create new frame.\n frame = new Frame(this.store);\n this.refs.push(frame);\n } else {\n // Replace exising frame.\n frame = this.refs[replace];\n if (frame === undefined) throw \"Invalid replacement reference\";\n }\n\n // Read all the frame slots.\n let slots = new Array(size * 2);\n for (let n = 0; n < size; ++n) {\n // Read key and value.\n let name = this.read();\n let value = this.read();\n\n // Fill frame slot.\n slots[n * 2] = name;\n slots[n * 2 + 1] = value;\n\n // Register frame for id: slots.\n if (name === this.store.id) {\n let existing = this.store.find(value);\n if (existing) {\n // Replace existing proxy/stub.\n existing.state = PUBLIC;\n this.refs[refidx] = existing;\n frame = existing;\n } else {\n // Register new frame.\n this.store.register(value, frame);\n }\n }\n }\n\n // Assign slots to frame.\n frame.slots = slots;\n\n return frame;\n }", "async validateReceivedCertificate(signerHex, signatureHex) {\n // First verify the certificate\n let thisKeyHex = await this.sigController.exportPub();\n let data = await hashData(this.certificate + thisKeyHex);\n let signer = hexToBytes(signerHex);\n let signature = hexToBytes(signatureHex);\n let signatureValid = await SignatureController.verifyElse(\n data,\n signature,\n signer\n );\n\n if (signatureValid) {\n let signers = Object.keys(this.tree);\n for (let i = 0; i < signers.length; i++) {\n if (this.processedKeys.includes(signers[i])) {\n continue;\n }\n let validBranch = await this.validateBranch(signers[i], signerHex);\n console.log(\"bas\");\n if (!validBranch) {\n return false;\n }\n }\n return true;\n } else {\n return false;\n }\n }", "function clean( node ){\n\tvar l = node.c.length;\n\twhile( l-- ){\n\t\tif( typeof node.c[l] == 'object' )\n\t\t\tclean( node.c[l] );\n\t}\n\tnode.n = node.a = node.c = null;\n}", "unused() {\r\n return this._storage.byteLength - this._readIndex;\r\n }", "function _resyncRemoved() {\n\t if (this.key == null || !this.container || this.container[this.key] !== this.node) {\n\t this._markRemoved();\n\t }\n\t}", "function _resyncRemoved() {\n\t if (this.key == null || !this.container || this.container[this.key] !== this.node) {\n\t this._markRemoved();\n\t }\n\t}", "finishedReconstruction() {\n this.reconPack = null;\n this.buffers = [];\n }", "finishedReconstruction() {\n this.reconPack = null;\n this.buffers = [];\n }", "finishedReconstruction() {\n this.reconPack = null;\n this.buffers = [];\n }", "retain() {\n }", "function specOnlyIsInstructionStateEmpty() {\n return instructionState.lFrame.parent === null;\n}", "function specOnlyIsInstructionStateEmpty() {\n return instructionState.lFrame.parent === null;\n}", "function specOnlyIsInstructionStateEmpty() {\n return instructionState.lFrame.parent === null;\n}", "function specOnlyIsInstructionStateEmpty() {\n return instructionState.lFrame.parent === null;\n}", "function specOnlyIsInstructionStateEmpty() {\n return instructionState.lFrame.parent === null;\n}", "function specOnlyIsInstructionStateEmpty() {\n return instructionState.lFrame.parent === null;\n}", "function cleanNodes() {\n while (container.firstChild) {\n container.removeChild(container.firstChild);\n }\n }", "function frameLoaded(e) {\n frame.postMessage(JSON.stringify(mainData), frame.url);\n}", "function markBranchNodeChanged( offset ) {\n\t\tvar item, newItem,\n\t\t\tadj = isReversed ? -1 : 1,\n\t\t\ti = offset - 1;\n\n\t\twhile ( i >= 0 ) {\n\t\t\titem = document.data.getData( i-- );\n\t\t\tif ( !(\n\t\t\t\tve.dm.LinearData.static.isOpenElementData( item ) &&\n\t\t\t\tve.dm.nodeFactory.lookup(\n\t\t\t\t\tve.dm.LinearData.static.getType( item )\n\t\t\t\t).prototype instanceof ve.dm.BranchNode\n\t\t\t) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif ( item.internal && item.internal.changesSinceLoad !== undefined ) {\n\t\t\t\t// Guard against marking the same node twice\n\t\t\t\tif ( changedBranchNodes.indexOf( item ) === -1 ) {\n\t\t\t\t\tnewItem = ve.copy( item );\n\t\t\t\t\tchangedBranchNodes.push( newItem );\n\t\t\t\t\tnewItem.internal.changesSinceLoad += adj;\n\t\t\t\t\tdocument.data.splice( i + 1, 1, ve.deepFreeze( newItem ) );\n\t\t\t\t}\n\t\t\t}\n\t\t\t// This is a branch node boundary, so go no further\n\t\t\tbreak;\n\t\t}\n\t}", "function updateOutgoingNodesData(currElements) {\n\n\t\t//console.log(\"updating data of\", currElements);\n\n\t\t// loop through board data\n\t\tlet onlyNodes = [];\n\t\tcurrElements.forEach(function (element) {\n\n\t\t\t// if the element is not a node, skip it\n\t\t\tif (element['type'] != \"prettyNode\") return;\n\n\t\t\t//element['data']['incomingNodes'] = getIncomers(element, currElements);\n\t\t\telement['data']['outgoingNodes'] = getOutgoers(element, currElements);\n\t\t\tonlyNodes.push(element);\n\n\t\t});\n\t\t//console.log(document.getElementsByClassName(\"react-flow__node\"));\n\n\t\t//the point of the code below is a workaround for the node not re-rendering on data change\n\t\t//loop through the html of the nodes\n\t\tlet i = 0;\n\t\tlet htmlNodes = document.getElementsByClassName(\"react-flow__node\");\n\t\tfor (i = 0; i < htmlNodes.length; i++) {\n\n\t\t\t//get id of the node from the class name\n\t\t\tlet htmlNodeId = htmlNodes[i].classList[2];\n\n\t\t\tlet j = 0;\n\t\t\tfor (j = 0; j < onlyNodes.length; j++) {\n\t\t\t\t//if id of html node matches the json data node, update the outgoingNodes counter\n\t\t\t\tif (htmlNodeId == onlyNodes[j]['id']) {\n\t\t\t\t\tlet currLabel = htmlNodes[i].getElementsByClassName(\"MuiChip-label\")[0];\n\t\t\t\t\tcurrLabel.innerText = onlyNodes[j]['data']['outgoingNodes'].length + \"\";\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn currElements;\n\t}", "frameFactory(parser, parent, element) {\n return {'NODE': 1, 'ARC': 2, 'parent': parent, 'parser': parser, 'store': parser.store, 'element': element,\n 'lastChild': 0, 'base': null, 'lang': null, 'node': null, 'nodeType': null, 'listIndex': 1, 'rdfid': null, 'datatype': null, 'collection': false, /** Terminate the frame and notify the store that we're done */\n 'terminateFrame': function () {\n if (this.collection) {\n this.node.close()\n }\n }, /** Add a symbol of a certain type to the this frame */'addSymbol': function (type, uri) {\n uri = uriUtil.join(uri, this.base)\n this.node = this.store.sym(uri)\n\n this.nodeType = type\n }, /** Load any constructed triples into the store */'loadTriple': function () {\n if (this.parent.parent.collection) {\n this.parent.parent.node.append(this.node)\n } else {\n this.store.add(this.parent.parent.node, this.parent.node, this.node, this.parser.why)\n }\n if (this.parent.rdfid != null) {\n // reify\n var triple = this.store.sym(uriUtil.join('#' + this.parent.rdfid, this.base))\n this.store.add(triple, this.store.sym(RDFParser.ns.RDF + 'type'), this.store.sym(RDFParser.ns.RDF + 'Statement'), this.parser.why)\n this.store.add(triple, this.store.sym(RDFParser.ns.RDF + 'subject'), this.parent.parent.node, this.parser.why)\n this.store.add(triple, this.store.sym(RDFParser.ns.RDF + 'predicate'), this.parent.node, this.parser.why)\n\n this.store.add(triple, this.store.sym(RDFParser.ns.RDF + 'object'), this.node, this.parser.why)\n }\n }, /** Check if it's OK to load a triple */'isTripleToLoad': function () {\n return (this.parent != null && this.parent.parent != null && this.nodeType === this.NODE && this.parent.nodeType ===\n this.ARC && this.parent.parent.nodeType === this.NODE)\n }, /** Add a symbolic node to this frame */'addNode': function (uri) {\n this.addSymbol(this.NODE, uri)\n if (this.isTripleToLoad()) {\n this.loadTriple()\n }\n }, /** Add a collection node to this frame */'addCollection': function () {\n this.nodeType = this.NODE\n this.node = this.store.collection()\n this.collection = true\n if (this.isTripleToLoad()) {\n this.loadTriple()\n }\n }, /** Add a collection arc to this frame */'addCollectionArc': function () {\n this.nodeType = this.ARC\n }, /** Add a bnode to this frame */'addBNode': function (id) {\n if (id != null) {\n if (this.parser.bnodes[id] != null) {\n this.node = this.parser.bnodes[id]\n } else {\n this.node = this.parser.bnodes[id] = this.store.bnode()\n }\n } else {\n this.node = this.store.bnode()\n }\n this.nodeType = this.NODE\n if (this.isTripleToLoad()) {\n this.loadTriple()\n }\n }, /** Add an arc or property to this frame */'addArc': function (uri) {\n if (uri === RDFParser.ns.RDF + 'li') {\n uri = RDFParser.ns.RDF + '_' + this.parent.listIndex\n this.parent.listIndex++\n }\n\n this.addSymbol(this.ARC, uri)\n }, /** Add a literal to this frame */'addLiteral': function (value) {\n if (this.parent.datatype && this.parent.datatype !== RDFParser.ns.RDF +'langString') {\n this.node = this.store.literal(value, this.store.sym(this.parent.datatype))\n } else {\n this.node = this.store.literal(value, this.lang)\n }\n this.nodeType = this.NODE\n if (this.isTripleToLoad()) {\n this.loadTriple()\n }\n }\n }\n }", "function prev(){\n\t\t\t\t\t//check for beginning\n\t\t\t\t\tif(PCArray.length <= 1) {\n\t\t\t\t\t\tif(com.timeout){\n\t\t\t\t\t\t\tclearTimeout(com.timeout);\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t//restore the values\n\t\t\t\t\t\n\t\t\t\t\tif(com.sse.evolution.children().last().length == 0){\n\t\t\t\t\t\tif(com.timeout){\n\t\t\t\t\t\t\tclearTimeout(com.timeout);\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\tcom.sse.evolution.children().last().remove();\n\t\t\t\t\t\n\t\t\t\t\t//get the previous values or set them to []\n\t\t\t\t\t\n\t\t\t\t\tvar values = com.sse.evolution.children().last().data(\"values\");\n\t\t\t\t\tvalues = (typeof values != 'undefined')?values:[];\n\n\t\t\t\t\tcom.sse.stack.html(\"\");\n\t\t\t\t\t\n\t\t\t\t\t//redraw old values\n\t\t\t\t\tcStack = com.stack.editable( values );\n\t\t\t\t\tcom.sse.stack.append(cStack);\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t//restore program counter\n\t\t\t\t\tPC = PCArray.pop();\n\t\t\t\t\t$(tokens[ PC ]).removeClass(cls.currentToken); //todo: make tokens jQuery\n\t\t\t\t\t\n\t\t\t\t\tif(PCArray.length > 0 ){\n\t\t\t\t\t\t$(tokens[PCArray[PCArray.length-1]]).addClass(cls.currentToken);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$(\"#\"+ids.ssePosition ).text(PC);\n\n\n\t\t\t\t\t//restore framepointer\n\t\t\t\t\tframepointer = FPArray.pop();\n\t\t\t\t\t$(\"#\"+ids.FPPosition ).text(framepointer);\n\t\t\t\t\t\n\t\t\t\t\treturn true;\n\t\t\t\t}", "eraseUntouched() {\n let toRemove = [];\n for (var packetId in this.packetIdToData) {\n if (!this.touchedPacketsIds[packetId]) {\n toRemove.push(packetId);\n }\n }\n\n toRemove.forEach(packetId => {\n console.info(\"Packet \" + packetId + \" no longer used.\");\n\n delete this.packetIdToData[packetId];\n\n if (this.requestedPacketIds[packetId]) {\n delete this.requestedPacketIds[packetId];\n }\n });\n\n for (var packetId in this.touchedPacketsIds) {\n if (!this.packetIdToData[packetId]) {\n return false;\n }\n }\n\n return true;\n }" ]
[ "0.50392133", "0.49830282", "0.480903", "0.4806113", "0.47843248", "0.4759983", "0.47067067", "0.4679669", "0.46404475", "0.46131605", "0.46005794", "0.45839298", "0.45417598", "0.4516648", "0.45046744", "0.44876117", "0.44876117", "0.44740707", "0.4452664", "0.44363233", "0.44228184", "0.4421494", "0.43937245", "0.4389677", "0.4389677", "0.43827215", "0.43782872", "0.43747586", "0.43718785", "0.43718785", "0.43683136", "0.43667978", "0.43376517", "0.43362382", "0.43362382", "0.43362382", "0.43362382", "0.43362382", "0.43362382", "0.43156394", "0.4310854", "0.43089983", "0.43042454", "0.4300795", "0.42978275", "0.42803025", "0.4277054", "0.4277054", "0.4272612", "0.42701012", "0.426212", "0.42578965", "0.42566526", "0.42495462", "0.42490056", "0.42490056", "0.42288715", "0.4228107", "0.42267266", "0.4222446", "0.42139837", "0.42118496", "0.42057112", "0.42047483", "0.4180442", "0.41791448", "0.41791448", "0.41791448", "0.41791448", "0.4174796", "0.4173896", "0.41676173", "0.4154427", "0.41457933", "0.41336182", "0.41328156", "0.41315147", "0.41276821", "0.4119989", "0.41162723", "0.4115876", "0.411506", "0.411506", "0.41103154", "0.41103154", "0.41103154", "0.4106404", "0.41048485", "0.41048485", "0.41048485", "0.41048485", "0.41048485", "0.41048485", "0.41000825", "0.40971717", "0.40971556", "0.4097053", "0.4091838", "0.40905112", "0.40775162" ]
0.4883816
2
vm.createUser = createUser; vm.error = false;
function register(username,password,passwordRepeat) { if(validation(username,password,passwordRepeat)){ UserService .register(username, password) .then( function(response){ var user = response.data; if(user){ $location.url("/user/"+user._id); }else { vm.error = "Cannot register Now!" $("#username").css("background-color", "lightcoral"); $("#username").val("*Username Required"); } }, function (response) { vm.error =response.data; $("#username").css("background-color", "lightcoral"); $("#username").val("*Username Exists"); } ); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function userController(userService){\n //binding del controlador con el html, solo en el controlador\n var vm = this;\n\n vm.btnadd = true;\n vm.btnedit = false;\n\n vm.getUsers ={};\n\n vm.btnadd = true;\n vm.btnedit = false;\n loadUsers();\n\n function loadUsers(){\n userService.getUsers().then(function (response) {\n vm.getUsers = response.data;\n\n });\n }\n\n\n vm.save= function(form){\n var newUser ={\n firstName : vm.firstName,\n lastName : vm.lastName,\n email : vm.email,\n password: vm.password\n }\n\n userService.setUsers(newUser).success(function(data){\n console.log(data);\n vm.firstName = null;\n vm.lastName = null;\n vm.email = null;\n vm.password = null;\n });\n\n vm.delete = function(id){\n console.log(id);\n userService.deleteUsers(id)\n .success(function(data){\n init();\n })\n }\n\n vm.firstName = null;\n console.log(newUser);\n }\n vm.showInfoUpdate = function(pobjUser){\n vm.btnadd = false;\n vm.btnedit = true;\n vm.id = pobjUser._id;\n vm.firstName = pobjUser.firstName;\n vm.lastName = pobjUser.lastName;\n vm.email = pobjUser.email;\n vm.password = pobjUser.password;\n vm.btnedit\n }\n vm.update = function(){\n var newUser ={\n _id: vm.id,\n firstName : vm.firstName,\n lastName : vm.lastName,\n email : vm.email,\n password: vm.password\n }\n\n userService.updateUsers(newUser).then(function (response) {\n loadUsers();\n vm.btnadd = true;\n vm.btnedit = false;\n vm.firstName = null;\n vm.lastName = null;\n vm.email = null;\n vm.password = null;\n\n });\n\n\n }\n }", "create(userData, callback){\n this.$http({\n method: 'POST',\n url: '/api/user',\n data: userData\n })\n .success(function(data, status, headers, config) {\n console.log(status);\n // callback if user creation succeded\n callback(true, userData);\n })\n .error(function(data, status, headers, config) {\n console.log(status);\n console.log(data);\n console.log(headers);\n console.log(config);\n // callback if user creation was not successful\n callback(false, userData);\n });\n }", "function createUser(newUser){\n\n UserService\n .createUser(newUser)\n .then(\n function (doc) {\n vm.user = null;\n init();\n });\n }", "function register() {\n var model = vm.model;\n usSpinnerService.spin('spinner-1');\n\n if (model.password !== model.confirmPassword) {\n toaster.pop({\n type: 'error',\n title: 'Register',\n body: 'Passwords do not match',\n showCloseButton: true,\n onHideCallback: function () {\n usSpinnerService.stop('spinner-1');\n }\n });\n\n model.password = '';\n model.confirmPassword = '';\n return;\n }\n\n var addUserRequest = {\n pwd: vm.model.password,\n cpwd: vm.model.confirmPassword,\n alias: vm.model.username,\n firstName: vm.model.firstName,\n lastName: vm.model.lastName,\n email: vm.model.email,\n phone: vm.model.phoneNumber\n }\n\n registerFactory.registerNewUser(addUserRequest).then(\n function (registerNewUserResponse) {\n //success\n var data = registerNewUserResponse.data;\n vm.userId = data;\n\n var customer = {\n FirstName: vm.model.firstName,\n LastName: vm.model.lastName,\n PhoneNumber: vm.model.phoneNumber,\n // alias: vm.alias,\n EmailAddress: vm.model.email,\n CustomerDuplicateCheckIndicator: 0,\n SendEmailReceipts: model.sendEmailReceipts\n }\n\n customerFactory.createCustomer(customer).then(\n function (createCustomerResponse) {\n //success\n vm.customerId = createCustomerResponse.data;\n customerAccount.customerId = vm.customerId;\n\n var accountModel= {\n merchantId: vm.merchantId,\n customerId: createCustomerResponse.data.customerId,\n accountNumber: vm.model.accountNumber\n }\n\n registerFactory.createMerchantCustomerXref(accountModel).then(\n function (createMerchantCustomerXrefResponse) {\n //success\n\n registerFactory.updatecustomerAccount(customerAccount).then(\n function (updatecustomerAccountResponse) {\n //success\n $location.path('login');\n },\n function (updatecustomerAccountResponse) {\n //failure\n toaster.pop({\n type: 'error',\n title: 'updatecustomerAccount',\n body: updatecustomerAccountResponse.data,\n showCloseButton: true\n });\n });\n },\n function (createMerchantCustomerXrefResponse) {\n //failure\n toaster.pop({\n type: 'error',\n title: 'createMerchantCustomerXref',\n body: createMerchantCustomerXrefResponse.data,\n showCloseButton: true\n });\n });\n },\n function (createCustomerResponse) {\n //failure\n toaster.pop({\n type: 'error',\n title: 'createCustomer',\n body: createCustomerResponse.data,\n showCloseButton: true\n });\n });\n },\n function (registerNewUserResponse) {\n //failure\n toaster.pop({\n type: 'error',\n title: 'registerNewUser',\n body: registerNewUserResponse.data,\n showCloseButton: true\n });\n });\n }", "function SignupController($state, UsersService) { // add inject UsersService, $state\n const vm = this;\n\n vm.addNewUser = addNewUser;\n vm.newUser = {};\n\n activate();\n\n function activate(){\n }\n\n function addNewUser(){\n UsersService\n .addNewUser(vm.newUser)\n .then(function(){\n vm.newUser = {};\n $state.go('show');\n });\n }\n}", "function SignUpCtrl($scope, $route, common, core, ngDialog) {\n var _this = this;\n //#region Variables\n this.controllerId = Controllers.DetailsCtrl.controllerId;\n this.checkUsername = false;\n this.checkPassword = \"\";\n this.inputType = 'password';\n this.addUser = function () {\n if (_this.checkUsername) {\n _this.checkUsername = false;\n var promise = _this.core.dataService.addUser(_this.addUserRequest, function (response, success) {\n if (success) {\n _this.user = response;\n _this.ngDialog.open({ template: 'registrationTemplate' });\n _this.addUserRequest = new App.Services.AddUserRequest();\n _this.$scope.reviewForm.$setPristine();\n _this.checkPassword = \"\";\n }\n else {\n _this.logError('Cannot create user!');\n }\n });\n return promise;\n }\n else {\n _this.logError('Invalide username!');\n }\n };\n this.checkUser = function () {\n _this.checkUserRequest.userName = _this.addUserRequest.userName;\n if (_this.checkUserRequest.userName != null) {\n var promise = _this.core.dataService.checkUser(_this.checkUserRequest, function (response, success) {\n _this.user2 = response;\n if (_this.user2.userName != null) {\n _this.logError('The username is taken');\n _this.checkUsername = false;\n }\n else {\n _this.checkUsername = true;\n _this.logSuccess('The username is free !');\n }\n });\n }\n else {\n _this.logError('Invalid username');\n }\n };\n this.hideShowPassword = function () {\n if (_this.inputType == 'password') {\n _this.inputType = 'text';\n }\n else {\n _this.inputType = 'password';\n }\n };\n this.$scope = $scope;\n this.common = common;\n this.core = core;\n this.ngDialog = ngDialog;\n this.log = common.logger.getLogFn();\n this.logError = common.logger.getLogFn('', 'error');\n this.logWarning = common.logger.getLogFn('', 'warn');\n this.logSuccess = common.logger.getLogFn('', 'success');\n this.addUserRequest = new App.Services.AddUserRequest();\n this.getLogCredentialsRequest = new App.Services.GetLogCredentialsRequest();\n this.checkUserRequest = new App.Services.CheckUserRequest();\n this.activate([]);\n }", "function newUser(){\r\r\n}", "function RegisterController($state, userService,messageHandler) {\n\n\n /* Atributos */\n\n var self = this;\n\n self.nick = \"\";\n\n self.contrasenia = \"\";\n\n self.repitaContrasenia = \"\";\n\n self.mail = \"\";\n\n self.direccion = \"\";\n\n self.nombre = \"\";\n\n\n this.laContraseniaCoincide = function(){\n return angular.equals(self.contrasenia,self.repitaContrasenia);\n\n };\n\n this.goToLogin = function() {\n $state.go(\"logIn\");\n };\n\n this.register = function() {\n\n if (!this.laContraseniaCoincide())\n {\n messageHandler.notificarError(\"Las contraseñas no son iguales\");\n } else {\n var newUser = userService.newUser(self.nombre, self.nick, self.contrasenia, self.mail, self.direccion);\n userService .registrarse(newUser)\n .then(function (response){\n messageHandler.notificarMensaje(response.data);\n self.goToLogin();\n }\n )\n .catch(function (response){messageHandler.notificarError(response.data.error)})\n }\n };\n\n\n\n\n}", "save(form) {\n // llamado al servicio del usuario para enviar el nuevo objeto [user] a la base de datos\n this.userService.registerSimple(this.user).subscribe(response => {\n // en caso de que el backend responda con los datos del usuario editado se presenta un mensaje de correcto\n if (response.user && response.user._id) {\n this.status = true;\n form.reset();\n this.launchAlert('success', 'Se ha Ingresado un Nuevo Usuario!', 'El Usuario: ' + response.user.nombre + ' ' + response.user.apellido + ', Ha sido ingresado exitosamente!', null, false, 1500, null, 'top', 'row', true);\n // si el servidor no ha respondido con los parametros correctos (hubo un error), se presenta un mensaje de error\n }\n else {\n this.status = false;\n this.launchAlert('error', 'No se ha podido ingresar el Usuario!', null, null, false, 1500, null, 'top', 'row', true);\n }\n }, error => {\n // en caso de que el backend no responda o directamente arroje un error se presenta un mensaje de error\n this.launchAlert('error', 'No se ha podido ingresar el Usuario!', error.error.Message, null, false, 1500, null, 'top', 'row', true);\n this.status = false;\n console.log(error);\n });\n }", "function CreateUserController($state, authService, userDataService, householdDataService, $log, authToken, $http) {\n var vm = this;\n\n vm.createUser = createUser;\n function createUser() {\n vm.message = '';\n // use the create function in the userService\n userDataService.create(vm.userData)\n .then(function(data) {\n vm.userData = {};\n vm.message = data.data.message;\n console.log(data);\n authToken.setToken(data.data.token);\n userDataService.user = data.data.user;\n $state.go('householdSignUpPage');\n }, function(err) {\n $log.error(err);\n $state.go('homePage');\n });\n };\n }", "function createUser() {\n var username = $('#usernameFld').val();\n var password = $('#passwordFld').val();\n var firstName = $('#firstNameFld').val();\n var lastName = $('#lastNameFld').val();\n var role = $('#roleFld').val();\n\n var user = new User(username,password,firstName,lastName,role,null,null,null);\n\n userService\n .createUser(user)\n .then(findAllUsers)\n .then(emptyUserForm);\n }", "setUser(newUser) {\n this.user = newUser\n }", "function test_create_user(first, last, password, email){\r\n console.log(\"Testing user creation\");\r\n user_model.create_user(first, last, password, email);\r\n\r\n}", "function createUser() {}", "function UserControllerfn() {\n \n \tvar uservm = this;\n \tuservm.user= {\n \t\t\t\"Name\" :\"bushan\",\n \t\t\t\"User-type\" : \"User\",\n \t\n \t\t \t}\n \t\t \t\n \t\n console.log('I am here at the User controller ');\n }", "create(context, user){\n context.showAlert = false \n context.showSuccess = false \n HTTP.post(USERS, user)\n .then((resp) => {\n if (resp.status>= 200 && resp.status <=300){\n console.log(resp)\n var id = resp.data.id\n // redirect to show user view \n context.$router.push({ name: 'EmployeesShow', params: { id }}) \n }\n })\n .catch((err) => {\n context.showAlert = true\n context.errMsg = err.response.data\n console.log(err)\n if (err.response) {\n console.log(err.response.data);\n console.log(err.response);\n }\n })\n }", "createUser(newUser) {\n return this.perform('post', '/user', newUser);\n }", "function createAccountController($scope, $location, SMAAlertFactory, ProjectConstants, DataService) {\n\n $scope.AppC.ShowHeader = false;\n $scope.AppC.ShowFooter = false;\n $scope.AppC.ActivePageName = \"\";\n\n //var vid = document.getElementsByClassName(\"bgvid\")[0];\n //vid.muted = true;\n\n /*jshint validthis:true */\n var createA = this;\n\n //createA.UserName = \"userEmail@userEmailServer.com\";\n //createA.Password = \"Password1\";\n //createA.Name = \"FirstName MI LastName\";\n //createA.SchoolCorporation = \"Adams Central\";\n //createA.County = \"Adams\";\n //createA.State = \"Indiana\";\n\n createA.UserName = \"\";\n createA.Password = \"\";\n createA.Name = \"\";\n createA.SchoolCorporation = \"\";\n createA.County = \"\";\n createA.State = \"AL\";\n createA.PhoneNumber = \"\";//M0027\n\n createA.CheckPassword = checkPassword;\n createA.PasswordValidation = function () { };\n createA.PasswordValidation.ShowMessages = false;\n createA.PasswordValidation.ContainsUppercase = false;\n createA.PasswordValidation.ContainsLowercase = false;\n createA.PasswordValidation.ContainsNumber = false;\n createA.PasswordValidation.ContainsSymbol = false;\n createA.PasswordValidation.ContainsLength = false;\n createA.PasswordValidation.ContainsWhitespace = false;\n\n //createA.ShowData = showData;\n createA.CreateAccount = checkValidation;\n\n createA.userClickedButton = null;\n\n return createA;\n\n function checkValidation() {\n var phonenumberpattern = /\\(?([0-9]{3})\\)?([ .-]?)([0-9]{3})\\2([0-9]{4})/;\n if (ProjectConstants.App.IsDownForMaintenance === true) { // quick check to see if the app is offline\n SMAAlertFactory.CreateInfoAlert(\"Oops!\", \"iAspire is currently down for maintenance.\\n\" + \"Please try again later.\");\n } else {\n if (!createA.UserName || createA.UserName === \"\") {\n SMAAlertFactory.CreateInfoAlert(\"Error\", \"Invalid email\");\n } else if (!createA.Password || createA.Password === \"\") {\n SMAAlertFactory.CreateInfoAlert(\"Error\", \"Invalid Password.\\nMinimum requirements:\\nlength 8 - 12 characters\\n 1 small character\\n1 capital character\\n1 number\");\n } else if (!createA.Name || createA.Name === \"\") {\n SMAAlertFactory.CreateInfoAlert(\"Error\", \"Please enter a name\");\n } else if (!createA.SchoolCorporation || createA.SchoolCorporation === \"\") {\n SMAAlertFactory.CreateInfoAlert(\"Error\", \"Please enter a school corporation/Organization\");\n }\n //else if (createA.PhoneNumber != \"\" && phonenumberpattern.test(createA.PhoneNumber) == false) {\n // SMAAlertFactory.CreateInfoAlert(\"Error\", \"Please enter a valid phone number\");\n //}\n //else if (!createA.County || createA.County === \"\") {\n // SMAAlertFactory.CreateInfoAlert(\"Error\", \"Please Enter a county\");\n //}\n else if (!createA.State || createA.State === \"\") {\n SMAAlertFactory.CreateInfoAlert(\"Error\", \"Please Enter a state\");\n } else {\n createA.userClickedButton = true;\n //var obj = {\n // UserName: createA.UserName,\n // Password: createA.Password,\n // Name: createA.Name,\n // SchoolCorporation: createA.SchoolCorporation,\n // County: createA.County,\n // State: createA.State,\n //}\n var obj = {\n UserName: createA.UserName,\n Password: createA.Password,\n Name: createA.Name,\n SchoolCorporation: createA.SchoolCorporation,\n State: '',//M0027\n PhoneNumber: createA.PhoneNumber \n };\n DataService.createAccount(obj)\n .success(function (data, status, headers, config) {\n $scope.AppC.userLogin = createA.UserName;\n $scope.AppC.userPassword = createA.Password;\n window.location.hash = \"#/login\";\n })\n .error(function (data, status, headers, config) {\n console.error(data);\n if (status === 409) {\n SMAAlertFactory.CreateInfoAlert(\"Oops!\", \"Email is already is use.\");\n } else {\n SMAAlertFactory.CreateInfoAlert(\"Oops!\", \"Something has gone wrong.\\n\" + \"Please try again later.\");\n }\n createA.userClickedButton = false;\n });\n }\n }\n\n }\n\n function checkPassword(event) {\n\n //var containsUppercase = /(?=.*[A-Z]).*$/;\n //var containsLowercase = /(?=.*[a-z]).*$/;\n //var containsNumber = /(?=.*[0-9]).*$/;\n //var containsSymbol = /(?=.*[!@#$%^*()_+}{\":;'?/<.>,]).*$/;\n //var containsLength = /(^.{8,20}$)/;\n var containsLength = /(?=^.{6,}).*$/;\n var containsWhitespace = /(?=.*[\\s]).*$/;\n\n if (createA.Password) {\n // check for an uppercase letter\n //if (containsUppercase.test(createA.Password) === true) {\n // createA.PasswordValidation.ContainsUppercase = true;\n //} else {\n // createA.PasswordValidation.ContainsUppercase = false;\n //}\n //// check for a lowercase letter\n //if (containsLowercase.test(createA.Password) === true) {\n // createA.PasswordValidation.ContainsLowercase = true;\n //} else {\n // createA.PasswordValidation.ContainsLowercase = false;\n //}\n //// check for a number\n //if (containsNumber.test(createA.Password) === true) {\n // createA.PasswordValidation.ContainsNumber = true;\n //} else {\n // createA.PasswordValidation.ContainsNumber = false;\n //}\n //// check for a symbol\n //if (containsSymbol.test(createA.Password) === true) {\n // createA.PasswordValidation.ContainsSymbol = true;\n //} else {\n // createA.PasswordValidation.ContainsSymbol = false;\n //}\n // check for length\n if (containsLength.test(createA.Password) === true) {\n createA.PasswordValidation.ContainsLength = true;\n } else {\n createA.PasswordValidation.ContainsLength = false;\n }\n // check for whitespace\n if (containsWhitespace.test(createA.Password) === true) {\n createA.PasswordValidation.ContainsWhitespace = true;\n } else {\n createA.PasswordValidation.ContainsWhitespace = false;\n }\n // check all\n //if (createA.PasswordValidation.ContainsUppercase === true &&\n // createA.PasswordValidation.ContainsLowercase === true &&\n // createA.PasswordValidation.ContainsNumber === true &&\n // createA.PasswordValidation.ContainsSymbol === true &&\n // createA.PasswordValidation.ContainsLength === true &&\n // createA.PasswordValidation.ContainsWhitespace === false) {\n // setTimeout(function () {\n // createA.PasswordValidation.ShowMessages = false;\n // $scope.$apply();\n // }, 2000);\n //} else {\n // createA.PasswordValidation.ShowMessages = true;\n //}\n if (createA.PasswordValidation.ContainsLength === true &&\n createA.PasswordValidation.ContainsWhitespace === false) {\n setTimeout(function () {\n // double check\n if (createA.PasswordValidation.ContainsLength === true &&\n createA.PasswordValidation.ContainsWhitespace === false) {\n createA.PasswordValidation.ShowMessages = false;\n $scope.$apply();\n }\n }, 2000);\n } else {\n createA.PasswordValidation.ShowMessages = true;\n }\n } else {\n createA.PasswordValidation.ShowMessages = false;\n }\n }\n\n //function showData() {\n // console.log(createA.UserName);\n // if (createA.UserName && createA.UserName.$valid) {\n // console.log(createA.UserName.$valid);\n // }\n // if (createA.UserName && createA.UserName.$error) {\n // console.log(createA.UserName.$error);\n // }\n // console.log(createA.Password);\n // if (createA.Password &&createA.Password.$valid) {\n // console.log(createA.Password.$valid);\n // }\n // if (createA.Password &&createA.Password.$error) {\n // console.log(createA.Password.$error);\n // }\n // console.log(createA);\n //}\n }", "function register(userObj) {\n vm.emails.push(userObj.emails);\n userObj.emails = vm.emails;\n console.log(userObj);\n UserService\n .createUser(userObj)\n .then(function (response) {\n console.log(response);\n var currentUser = response.data;\n if(currentUser != null){\n UserService.setCurrentUser(currentUser);\n $location.url('/profile');\n }\n else{\n //promise fullfilled, inpsite of getting a null response.\n console.log(\"Username already exists\");\n vm.showAlert = true;\n }\n });\n }", "authorizedUser(user) { \n this.user = user;\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}", "register() {\n let self = this;\n if (self.registerForm.$invalid) {\n return;\n }\n self.loader.show();\n let copy = angular.copy(self.userRegister);\n self.defaultValues();\n self.UserService.register(copy).then(\n // Success\n ()=> {\n self.loader.hide();\n self.$state.go('center');\n }).catch(\n // Errors\n (err)=> {\n self.loader.hide();\n self.$l.debug(\"Err\", err);\n let msg;\n switch (err.status) {\n case 400:\n msg = err.data.message;\n break;\n case 500:\n msg = 'Błąd serwera';\n break;\n default:\n msg = 'Nieznany błąd serwera';\n break;\n }\n notie.alert(3, msg, 3);\n });\n }", "function createNewUser() {\n\n $(\"#new-name\").removeClass('error');\n $(\"#new-email\").removeClass('error');\n $(\"#new-username\").removeClass('error');\n $(\"#new-password\").removeClass('error');\n\n var name = $(\"#new-name\").val();\n var email = $(\"#new-email\").val();\n var username = $(\"#new-username\").val();\n var password = $(\"#new-password\").val();\n\n if (Usergrid.validation.validateName(name, function (){\n $(\"#new-name\").focus();\n $(\"#new-name\").addClass('error');}) &&\n Usergrid.validation.validateEmail(email, function (){\n $(\"#new-email\").focus();\n $(\"#new-email\").addClass('error');}) &&\n Usergrid.validation.validateUsername(username, function (){\n $(\"#new-username\").focus();\n $(\"#new-username\").addClass('error');}) &&\n Usergrid.validation.validatePassword(password, function (){\n $(\"#new-password\").focus();\n $(\"#new-password\").addClass('error');}) ) {\n // build the options object to pass to the create entity function\n var options = {\n type:'users',\n username:username,\n password:password,\n name:name,\n email:email\n };\n\n client.createEntity(options, function (err, newUser) {\n if (err){\n window.location = \"#login\";\n $('#login-section-error').html('There was an error creating the new user.');\n } else {\n appUser = newUser;\n //new user is created, so set their values in the login form and call login\n $(\"#username\").val(username);\n $(\"#password\").val(password);\n login();\n }\n });\n }\n }", "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 }", "function init() {\n vm.login = login;\n function login(user) {\n\n // create a promise which calls the Node.JS backed code to get the websites of a particular websites.\n var promise = UserService.login(user);\n promise\n .then(function (user) {\n //console.log(\"fsd\");\n //console.log(user);\n console.log(\"hit in client\")\n\n\n\n var loginUser = user.data;\n console.log(loginUser)\n if (loginUser != null) {\n console.log(\"uper hit\");\n $rootScope.currentUser = user;\n console.log(loginUser._id);\n $location.url('/profile/' + loginUser._id);\n } else {\n vm.error = 'user not found';\n }\n })\n .catch(function (err) {\n //catch the error and print it to the console.\n vm.error = 'user not found';\n });\n }\n }", "function signupFailed(err) {\n vm.error = err.data;\n vm.messages.error = vm.error.message;\n // enable signup\n vm.enabled = true;\n }", "function checkUser(form){\n vm.role= 'User'\n userService\n .checkUser(vm.user)\n .then(function(Outuser){\n console.log(Outuser);\n //loginVm.user= Outuser;\n $location.path('/movie-list');\n },function(error){\n clear(form);\n vm.errorMessage = 'Invalid User';\n })\n }", "function addNewUser() {\n}", "function create_user(userobject){\n\n}", "function init() {\n \n newUser()\n\n}", "function handleSignUpSuccess(data) {\n // display a loader\n $scope.signupLoader = false;\n\n $scope.signupMessage = data.message;\n \n // clear all models...\n $scope.signupName = '';\n $scope.signupUsername = '';\n $scope.signupEmail = '';\n $scope.signupPassword = '';\n }", "signUp() {\n let $location = this.location; // Setting 'this.location' to a variable in order to use it to redirect the user within the scope of this signUp() function\n\n this.CollectionAppService.userSignup(this.username, this.password).then(data => {\n $location.path('/login'); // On successful signup, redirect the user to the login page\n }, data => {\n // If the username is already registered, alert the user\n if (data.status == 500) {\n this.isDuplicate = true; // Set to true because the username is already registered\n }\n });\n }", "saveUser() {\n this.submitted = true;\n if (this.userForm.invalid) {\n return;\n }\n this.submitted = false;\n this.service.post('add-edit-user', this.userForm.value)\n .subscribe(res => {\n if (res['status'] == true) {\n this.toastr.success(res['msg'], '', { timeOut: 1000 });\n this.router.navigateByUrl('/sessions/signin', { skipLocationChange: true }).then(() => {\n this.router.navigate(['/users/user-list/' + this.userForm.value.user_role]);\n });\n // location.reload();\n }\n else {\n this.toastr.warning(res['msg'], '', { timeOut: 1000 });\n }\n });\n }", "function addedSuccess (){\n $scope.vm.editForm.$dirty = false;\n vm.addCustomer = true;\n vm.addMessage = \"Customer Added\";\n vm.title = 'Edit';\n vm.buttonText = 'Update';\n startTimer();\n }", "function createUser(user){\n return $http.post(url.user, user).then( handleSuccess, handleError);\n }", "function selectUser(user) {\n\t vm.currentUser = user;\n\t\t}", "function ModalInstanceController($uibModalInstance,$state,AuthService,$localStorage,$auth,$http) {\r\n var $ctrl = this;\r\n $ctrl.error = \"\";\r\n $ctrl.user = {};\r\n $ctrl.loginlearner = loginlearner;\r\n $ctrl.newuserlogin = newuserlogin;\r\n $ctrl.register = register;\r\n $ctrl.fastsignuplearner = fastsignuplearner;\r\n $ctrl.status = {};\r\n $ctrl.faststatus = {};\r\n $ctrl.last = $localStorage.currentUser;\r\n $ctrl.authenticate = authenticate;\r\n if($localStorage.currentUser) {\r\n $ctrl.user = {email: $ctrl.last.email, firstname: $ctrl.last.info.firstname};\r\n }\r\n $ctrl.imagePaths = imagePaths;\r\n $ctrl.fastSignup = {};\r\n $ctrl.slowSignup = {};\r\n \r\n $ctrl.forgotuser = {};\r\n $ctrl.forgotpwd = forgotpwd;\r\n \r\n function forgotpwd() {\r\n AuthService.forgotpwd($ctrl.forgotuser, function (result) {\r\n if (result === true) {\r\n $ctrl.forgotuser = {};\r\n $ctrl.status = {class: 'alert alert-success fade in', message: \"Success! Please check your email.\"};\r\n } else {\r\n $ctrl.status = {class: 'alert alert-danger fade in', message: \"Error! Please try again.\"};\r\n }\r\n });\r\n }\r\n \r\n /*\r\n * @desc login\r\n */\r\n function loginlearner() {\r\n AuthService.loginLearner($ctrl.user,function(result){\r\n if (result === true) {\r\n $uibModalInstance.close();\r\n $state.go('learner.home');\r\n } else {\r\n $ctrl.status = {class: 'alert alert-danger fade in', message: \"Either email or password is incorrect.\"};\r\n }\r\n });\r\n }\r\n \r\n function newuserlogin(type) {\r\n delete $localStorage.currentUser;\r\n $localStorage.learnermodalcheck = {type: type};\r\n $ctrl.last = {};\r\n $ctrl.user = {};\r\n $uibModalInstance.close();\r\n }\r\n\r\n function register() {\r\n $ctrl.user = angular.copy($ctrl.slowuser);\r\n AuthService.registerLearner($ctrl.user, function (result) {\r\n if (result === true) {\r\n $ctrl.slowuser = {};\r\n $ctrl.slowSignup.$setPristine();\r\n $ctrl.slowSignup.$setUntouched();\r\n \r\n $ctrl.status = {class: 'alert alert-success fade in', message: \"Success! Please check your email.\"};\r\n } else {\r\n $ctrl.status = {class: 'alert alert-danger fade in', message: result};\r\n }\r\n });\r\n }\r\n \r\n function fastsignuplearner(){\r\n $ctrl.user = angular.copy($ctrl.fastuser);\r\n AuthService.fastSignUp($ctrl.user, function(result){\r\n if (result === true) {\r\n $ctrl.fastuser = {};\r\n $ctrl.fastSignup.$setPristine();\r\n $ctrl.fastSignup.$setUntouched();\r\n $ctrl.faststatus = {class: 'alert alert-success fade in', message: \"Success! Please check your email.\"};\r\n } else {\r\n $ctrl.faststatus = {class: 'alert alert-danger fade in', message: result};\r\n }\r\n });\r\n }\r\n \r\n function authenticate(provider){\r\n $auth.authenticate(provider)\r\n .then(function(response) {\r\n if(response.data.status === 200){\r\n $uibModalInstance.close();\r\n $localStorage.currentUser = {token: response.data.token, type: response.data.type, id: response.data.data._id, email: response.data.data.email, info: response.data.data.personalInfo};\r\n $localStorage.loginstatus = true;\r\n \r\n $http.defaults.headers.common.Authorization = 'JWT ' + response.token;\r\n $state.go('learner.home');\r\n } else {\r\n \r\n }\r\n });\r\n }\r\n \r\n \r\n\r\n }", "function createUser(user) {\n var newUser = {\n username: user.username,\n password: user.password,\n firstName: \"\",\n lastName: \"\"\n };\n return $http.post(\"/api/user\", newUser);\n }", "function createUser(userData) {\n\t\tuserAuth.register(userData, function(err) {\n\t\t\tif(err){ \n\t\t\t\t$rootScope.flashMessage = {data: \"Something went wrong please try again\", type: \"error\"}\n\t\t\t}else{\n\t\t\t\tif($rootScope.currentUser.role == \"Author\"){\n\t\t\t\t\t$location.path('/info');\n\t\t\t\t\t$rootScope.flashMessage = {data: \"Kindly fill your profile details\", type: \"success\"}\n\t\t\t\t\tvm.showForm = true;\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\t$location.path('/');\n\t\t\t\t$rootScope.flashMessage = {data: \"Successfully Logged In\", type: \"success\"}\n\t\t\t}\n\t\t});\n\t}", "function SProfileController($routeParams, $location, UserService, $rootScope) {\n var vm = this;\n vm.updateUser = updateUser;\n vm.deleteUser = deleteUser;\n vm.userId = $rootScope.currentUser._id;\n vm.logout = logout;\n var userId = $rootScope.currentUser._id;\n /*it is good practice to declare initialization ina function. say init*/\n function init(){\n UserService\n .findUserById(userId)\n .then(function (response) {\n vm.user = response.data;\n });\n }\n init();\n // Author: Sesha Sai Srivatsav\n function logout() {\n UserService\n .logout()\n .then(\n function (response) {\n $location.url(\"/login\");\n },\n function () {\n $location.url(\"/login\");\n }\n );\n }\n // Author: Sesha Sai Srivatsav\n function deleteUser() {\n UserService\n .deleteUser(userId)\n .then(function (response) {\n var result= response.data;\n if(result){\n $location.url(\"/login\");\n }else{\n vm.error = \"can't delete you.\"\n }\n });\n }\n // Author: Sesha Sai Srivatsav\n function updateUser(user){\n UserService\n .updateUser(userId, user)\n .then(function (res) {\n var updatedUser = res.data;\n if (updatedUser){\n vm.success=\"successfully updated!\";\n }else{\n vm.error = \"Some thing doesn't seem right here\";\n }\n });\n }\n\n\n\n }", "function SignupController($scope, UserFactory, $http, $location) {\n UserFactory.username = $scope.username;\n UserFactory.password = $scope.password;\n\n $scope.processForm = function () {\n $http.post('/signup', JSON.stringify({ username: $scope.username, password: $scope.password }))\n .success(function (response) {\n console.log(response);\n if (response.status === 'Signup successful!') {\n $location.path('/take-a-pic');\n }\n })\n .error(function (reponse) {\n $scope.message = 'Please enter a valid username and password';\n });\n };\n}", "function _reset() {\n FocusOnService.focus('username');\n\n $scope.user = {\n username : '',\n firstName : '',\n lastName : '',\n admin : false,\n passports : {\n password : '',\n protocol : 'local'\n },\n password_confirmation : '',\n }\n }", "function professorRegister(user) {\n vm.profError = \"\";\n vm.profnoMatch = \"\";\n vm.profMessage = \"\";\n vm.profSuccess = false;\n checkValidation(user);\n if(vm.profError.length === 0){\n user.role = 'professor';\n if ($scope.professorForm.$valid) {\n userService\n .findUserByUsername(user.username)\n .then(function (usr) {\n if (usr)\n vm.profMessage = \"Username Taken\";\n else\n requestProfessorRegistration(user);\n });\n }\n else {\n $scope.professorForm.submitted = true;\n vm.profError = \"Missing fields!\"\n }\n }\n }", "created() {\n request200('GET', '/in/user', {}, x => {\n this.user = x;\n });\n this.update();\n }", "_registerUser(id){\n\t\tthis.idUser = id;\n\t}", "function UserController() {\n // var vm = this;\n }", "userExists(){\n // set Status for previous view in case server validation failed \n this.displayMode = 'none';\n this.isAgreed = false;\n // add xhr message into form error validation message object - will be shown on screen\n for(let i in this.messageService.xhr.warn){\n this.addform.emailid.$setValidity(i, !this.messageService.xhr.warn[i]);\n }\n\n this.abortForm = true;\n }", "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 save() {\n authService.signUp(vm.signupModel).then(function() {\n AlertHelper.addInfo('Usuário cadastrado com sucesso.');\n $location.path('/common/auth/signin');\n }, function() {\n AlertHelper.addError('Erro ao cadastrar usuário');\n });\n }", "function registerUser() {\n let email = $(\"#txtEmail\").val();\n let pass= $(\"#txtPassword\").val();\n let first= $('#txtFirst').val();\n let last = $('#txtLast').val();\n let age = $('#txtAge').val();\n let address = $('#txtAddress').val();\n let phone = $('#txtPhone').val();\n let payment = $('#txtPayment').val();\n let color = $('#txtColor').val();\n\n let user = new User(email, pass, first, last, age, address, phone, payment, color);\n console.log(user);\n\n saveUser(user); // This function is on the storeManager\n clearUser();\n\n}", "function createUserController(request, response) {\n const userData = request.body;\n delete userData.password;\n\n const newUser = model.insert(userData);\n\n response.status(httpStatus.CREATED).json(newUser);\n}", "createUserClick(){\n this.setState({createUser: true});\n }", "function init(){\n UserService\n .findUserById(userId)\n .then(function (response) {\n vm.user = response.data;\n });\n }", "add(userObject, response) {\n //password encryption\n userObject.password = encryptOperations.encryptPassword(\n userObject.password\n );\n UserModel.create(userObject, (err) => {\n if (err) {\n console.log(\"Error in Record Add\");\n response.status(appCodes.SERVER_ERROR).json({\n status: appCodes.ERROR,\n message: \"Record Not Added Due to Error\"\n });\n } else {\n console.log(\"Record Added..\");\n sendMail(userObject.userid, \"register\");\n\n response\n .status(appCodes.OK)\n .json({ status: appCodes.SUCCESS, message: \"Record Added\" });\n }\n });\n }", "createUser(user) {\n this.http.post(this.apiUrl + '/signup', user)\n .subscribe((response) => {\n /*\n * use repose email to ensure we got the correct response payload\n * but user.password because response.password is hashed\n */\n const { email } = response.result;\n this.login(email, user.password);\n }, (error) => {\n console.log('TCL: AuthService -> createUser -> error', error);\n this.authStatusListener.next(false);\n });\n }", "insertUser() {\n console.log(\"inside controller\");\n let _this = this;\n let data = this.req.body;\n\n //_this.res.status(200).send({res: 'done'});\n\n Users.insertUser(data, function(err, data){\n console.log(err);\n if(err) _this.res.status(500).send(err.errmsg);\n\n return _this.res.status(200).send({message: \"User added successfully\",\"status\":\"1\"});\n });\n }", "function registrationUser(e){\n registrationForm.form.find('label[class = \"error\"]').remove();\n var val = registrationForm.form.find('#myForm').valid();\n if(val){\n var user = registrationForm.getValueForm();\n user.logIN = false;\n user.tasks = [];\n e.preventDefault();\n collectionOfUser.create(\n user,\n function(newUser){\n if(loginUser.login === 'admin'){\n $('#db').append(createNewRow(newUser));\n }\n registrationForm.hide();\n },\n error\n ); \n }\n }", "function createOrLoginUser(user) {\n\n var cleanName = user.cn.split(\",\");\n cleanName = cleanName[1].trim() + \" \" + cleanName[0];\n\n $scope.currentUser = user.cn;\n\n $cookies.putObject(\"user\", {\n full: cleanName,\n username: user.sAMAccountName,\n mail: user.mail,\n officeLoc: user.l\n });\n\n setCommService($scope.currentUser, user.sAMAccountName);\n\n httpService.postUser({\n username: user.sAMAccountName,\n full: cleanName,\n mail: user.mail,\n location: user.l,\n profilePic: \"\"\n }).then(function() {\n $location.path(\"/\");\n }, function(err) {\n alert(\"there was a problem posting your info to the database\");\n });\n }", "function addUser(event) {\n //event.preventDefault();\n\n\n //compile all user info into one object\n var newUser = {\n 'FirstSelection' : '' +ToSaveSplit[0]+ '',\n\t\t\t'SecondSelection' : ''+ToSaveSplit[1]+ '',\n\t\t\t'Description' : ''+Description+''\n }\n\n // Use AJAX to post the object to our adduser service\n $.ajax({\n type: 'POST',\n data: newUser,\n url: '/users/adduser',\n dataType: 'JSON'\n }).done(function( response ) {\n\n // Check for successful (blank) response\n if (response.msg === '') {\n\n }\n else {\n\n // If something goes wrong, alert the error message that our service returned\n alert('Error: ' + response.msg);\n\n }\n });\n}", "function createUser(user) {\n var url = \"/api/user\";\n return $http.post(url,user);\n\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}", "initCreateEndpoint() {\n this.router.post('/', (req, res) =>\n this.getDAO().create(req.body).then(user => res.status(200).send(user))\n .catch(err => {\n debug('[create]', err.message);\n return this.sendErr(res, 400, err.message);\n }));\n }", "userCreate() {\n this.setState({\n userCheck: true,\n loading: false\n });\n }", "register(){\n console.log(this.username + ' is now registered');\n }", "registerUser(email, password){\n Services.user.register(email, password).then((res) => {\n if (res.success){\n this.loginUser(email, password);\n }\n }).catch((err) => {\n alert(\"Error on register user: \" + err.error.err);\n });\n }", "save() {\n try{\n validateUserData()\n }catch(err) {\n \n }\n }", "function controller_by_user(){\n\t\ttry {\n\t\t\t\n $scope.user_data = {username:\"\",user_pass:\"\",email:\"\"};\n $scope.submitRegister = function(){\n \n // animation loading \n \t$ionicLoading.show({\n \t\ttemplate: '<div class=\"loader\"><svg class=\"circular\"><circle class=\"path\" cx=\"50\" cy=\"50\" r=\"20\" fill=\"none\" stroke-width=\"2\" stroke-miterlimit=\"10\"/></svg></div>'\n \t}); \n \n var nonce_url = \"http://www.agro.aplicacionesmoviles.uy//api/get_nonce/?controller=user&method=register&callback=JSON_CALLBACK\";\n $sce.trustAsResourceUrl(nonce_url);\n \n $http.jsonp(nonce_url).success(function(resp_nonce, status, headers, config){\n console.log(\"resp_nonce\",resp_nonce);\n \n var http_params = $scope.user_data ;\n http_params.nonce = resp_nonce.nonce;\n var http_header = {params: http_params};\n \n var register_url = \"http://www.agro.aplicacionesmoviles.uy//api/user/register/?insecure=cool&callback=JSON_CALLBACK\";\n $sce.trustAsResourceUrl(register_url);\n $http.jsonp(register_url,http_header).success(function(resp_register, status, headers, config){\n console.log(\"resp_register\",resp_register);\n\n if(resp_register.user_id){ \n $ionicLoading.hide();\n $ionicPopup.show({\n title: \"Felicidades!!\",\n template: \"S cuenta fue creada con éxito. Puede acceder.\",\n buttons: [{\n text: \"OK\", \n onTap: function(e){\n \n $ionicHistory.nextViewOptions({\n disableAnimate: true,\n disableBack: true\n });\n \n $ionicHistory.clearHistory();\n $ionicHistory.clearCache();\n $state.go(\"agrovirtual.user_login\");\n \t\t\t\t },\n }]\n })\n }else{\n \n $ionicLoading.hide();\n $ionicPopup.show({\n title: resp_register.status,\n template: resp_register.error,\n buttons: [{\n text: \"Cerrar\"\n }]\n })\n \n }\n }).error(function (err_register, status, headers, config) {\n console.log(\"err_register\",err_register);\n }); \n \n }).error(function (err_nonce, status, headers, config) {\n console.log(\"err_nonce\",err_nonce);\n });\n \n } \n\t\t\t\n\t\t} catch(e){\n\t\t\tconsole.log(\"%cerror: %cPage: `user_register` and field: `Custom Controller`\",\"color:blue;font-size:18px\",\"color:red;font-size:18px\");\n\t\t\tconsole.dir(e);\n\t\t}\n\t}", "constructor() {\n super();\n this.windowControllers = new AbortController();\n this.username = \"\";\n this.password = \"\";\n this.errorMSG = \"Enter User name\";\n this.hidePassword = true;\n this.hasPass = false;\n }", "function userCreate(userDetail, cb) \n{\n let newUser = new User(userDetail);\n \n newUser.save(function (err) \n {\n if (err) \n {\n cb(err, null);\n return;\n }\n console.log('New User: ' + newUser);\n cb(null, newUser);\n \n });\n\n}", "function userCtrl(zmUserService) {\n\tvar vm = this;\n\tvm.user = {\n\t\tid:''\n\t};\n}", "function login (username, password) {\n if(!password && !username){\n vm.allError= \"Enter all details\";\n vm.error= \"Enter all details\";\n }\n else if(!password){\n vm.pwdError = \"Password required\";\n vm.error = \"Password required\";\n }else if(!username){\n vm.nameError = \"Username required\";\n vm.error = \"Username required\";\n }else{\n UserService\n .login(username, password)\n .then(function(response){\n var user = response.data;\n console.log(response);\n if(user._id) {\n if($rootScope.previousUrl){\n $location.url($rootScope.previousUrl);\n }else{\n $location.url(\"/\");\n }\n } else {\n vm.error = response.error;\n $location.url(\"/\");\n }\n }, function (error) {\n vm.error=error.data;\n $location.url(\"/login\");\n });\n }\n }", "function createUser(){\n var info = getUserInfo();\n if (info.user.name === \"\" || info.user.username === \"\" || info.user.password === \"\"){\n alert(\"Must enter a Name, Username and Password\");\n }else{\n createUserAjax(info);\n }\n }", "function addUser() {\n }", "register() {\n if(this.state.usernameAvailable && this.state.username.length > 0\n && this.state.password.length > 0 && this.state.confirmPassword === this.state.password &&\n this.state.firstName.length > 0 && this.state.lastName.length >0 &&\n this.state.dateOfBirth.length > 0){\n const credentials = {\n username: this.state.username,\n password: this.state.password,\n firstName: this.state.firstName,\n lastName: this.state.lastName,\n role: this.state.role,\n dateOfBirth: this.state.dateOfBirth,\n collegeLists: []\n };\n\n this.userService.register(credentials).then(user => {\n\n\n // Redirect back to home\n if (user) {\n window.location = '/';\n }\n });\n\n\n\n }\n\n else{\n alert('One more fields is incorrect!');\n }\n }", "function registerUser(tempUser) {\n return $http.post('/register', tempUser);\n } // end registerUser()", "function RegisterController(auth, $location, $timeout, notifier) {\n var vm = this,\n numberOfFields = $('.forms li').length,\n updateValue = 100 / numberOfFields,\n CLIENT_ROLE = 'Client';\n\n vm.status = \"Profile completeness...\";\n\n vm.changeInput = function () {\n debugger;\n var totalUpdate = 0;\n $(\".forms input, .forms option:selected\").each(function () {\n if (this.value !== \"\") {\n //for select -> Default value is not count-able\n var isOptionElement = $(this).is(\"option\");\n\n if (isOptionElement && ((this.value !== 'Default') && this.value !== '? undefined:undefined ?')) {\n totalUpdate += updateValue;\n } else if (!isOptionElement) {\n totalUpdate += updateValue;\n }\n }\n });\n vm.progress = totalUpdate;\n };\n\n\n function checkAndAssignClientRole(user) {\n user.roles = user.roles || [];\n //client role does not exist in the array of roles\n if ($.inArray(CLIENT_ROLE, user.roles) !== 0) {\n user.roles.push(CLIENT_ROLE);\n }\n }\n\n vm.registerUser = function registerUser(user, registerUserForm) {\n if (registerUserForm.$valid) {\n checkAndAssignClientRole(user);\n auth.register(user)\n .then(function () {\n notifier.success('User registered!');\n $location.path('/account/login');\n }, function (err) {\n notifier.error('Internal user registration problem');\n });\n }\n }\n\n vm.registerCompany = function registerCompany(companyCreator, registerCompanyForm) {\n if (registerCompanyForm.$valid) {\n debugger;\n checkAndAssignClientRole(companyCreator);\n auth.register(companyCreator)\n .then(function () {\n notifier.success('Company registered!');\n $location.path('/account/login');\n }, function (err) {\n notifier.error('Internal company registration problem');\n $location.path('/account/login');\n });\n }\n\n }\n\n vm.selectOptions = {\n placeholder: \"Select roles...\",\n dataTextField: \"RoleName\",\n dataValueField: \"RoleValue\",\n valuePrimitive: true,\n autoBind: false,\n dataSource: [\n { RoleName: 'Owner', RoleValue: 'Owner' },\n { RoleName: 'Admin', RoleValue: 'Admin' },\n { RoleName: 'Creator', RoleValue: 'Creator' },\n { RoleName: 'Employee', RoleValue: 'Employee' },\n { RoleName: 'Manager', RoleValue: 'Manager' },\n { RoleName: 'Supervisor', RoleValue: 'Supervisor' },\n { RoleName: 'Worker', RoleValue: 'Worker' },\n { RoleName: 'Client', RoleValue: 'Client' }\n ]\n }\n\n //vm.selectedIds = ['Owner', 'Admin'];\n }", "createUser(userId) {\n if (this.hasUser(userId)) {\n console.warn(`User:${ userId } already exist`);\n return;\n }\n this.data[userId] = { reminders:[] };\n }", "addNewAccount() {\n this.okPressed = true;\n return this._Wallet.addAccount(this.common, this.newAccountLabel).then((res) => {\n this._$timeout(() => {\n this.okPressed = false;\n this.checkNumberOfAccounts();\n // Hide modal\n $(\"#addAccountModal\").modal('hide');\n this.reset();\n return;\n });\n }, \n (err) => {\n this._$timeout(() => {\n this.okPressed = false;\n this.reset();\n return;\n });\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 handleCreate(request, response) {\n var result = { success: false };\n const username = request.body.username;\n const password = passwordHash.generate(request.body.password);\n\n createUser(username, password, function (err, result) {\n result = { success: true };\n console.log(result.success);\n response.json(result);\n });\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 }", "function register() {\n\n var oFile = document.getElementById(\"fileUpload\").files[0]; // <input type=\"file\" id=\"fileUpload\" accept=\".jpg,.png,.gif,.jpeg\"/>\n\n if (oFile.size > 2097152) // 2 mb for bytes.\n {\n alert(\"El tamaño de la foto excede el tamaño máximo de 2mb\");\n return;\n }\n\n\n if (vm.regData.hasOwnProperty(\"Foto\")){\n vm.regData.Foto = vm.regData.Foto.base64;\n }\n\n if (!vm.regData.hasOwnProperty(\"Foto\")){\n vm.regData.Foto = \"\";\n }\n\n\n vm.regData.Telefono = vm.regData.Telefono.toString();\n vm.dataLoading = true;\n\n\n UserService.RegisterEmployer(vm.regData)\n .then(function (response) {\n\n FlashService.Success('Registro exitoso', true);\n\n var userFoto = $localStorage.$default({\n Foto : response.data.Foto\n });\n\n var data = response.data;\n delete data.Foto;\n\n AuthenticationService.SetCredentials( data.UserId, data.Password, \n data); \n ProfileCourseService.SetProfileData(data);\n\n $location.path('/employerprofile'); \n\n },function(response){\n\n FlashService.Error(\"Registro fallido\");//errores\n vm.dataLoading = false;\n });\n }", "function UserPlusDialogController ($timeout, $scope, $stateParams, $uibModalInstance, entity, UserPlus, User,Principal) {\n var vm = this;\n console.log('la conhateuymfe');\n Principal.identity().then(function (user) {\n var data = {\n user: user\n };\n console.log(data);\n console.log(data.user.authorities);\n vm.users = User.query({auth:data.user.authorities[0]});\n });\n console.log(UserPlus);\n vm.userPlus = entity;\n // console.log(entity2);\n vm.clear = clear;\n vm.datePickerOpenStatus = {};\n vm.openCalendar = openCalendar;\n vm.save = save;\n\n\n\n\n\n $timeout(function (){\n angular.element('.form-group:eq(1)>input').focus();\n });\n\n function clear () {\n $uibModalInstance.dismiss('cancel');\n }\n\n function save () {\n vm.isSaving = true;\n\n\n\n if (vm.userPlus.id !== null) {\n UserPlus.update(vm.userPlus, onSaveSuccess, onSaveError);\n } else {\n UserPlus.save(vm.userPlus, onSaveSuccess, onSaveError);\n }\n }\n\n function onSaveSuccess (result) {\n $scope.$emit('proyService1App:userPlusUpdate', result);\n $uibModalInstance.close(result);\n vm.isSaving = false;\n }\n\n function onSaveError () {\n vm.isSaving = false;\n }\n\n vm.datePickerOpenStatus.birthday = false;\n\n function openCalendar (date) {\n vm.datePickerOpenStatus[date] = true;\n }\n\n\n }", "function handleUserChangeSuccess() {\n var user = userState.user();\n $scope.userNickname = user ? user.nickname : undefined;\n updateCanShowRootOperations();\n }", "function register() {\r\n var username = $(\"#usernameFld\").val();\r\n var pass = $(\"#passwordFld\").val();\r\n var pass2 = $(\"#confirmPasswordFld\").val();\r\n if (pass == pass2 && username.length > 0) {\r\n console.log(\"Registering \" + username + \":\" + pass);\r\n userService.register(username, pass).then(goToProfile,\r\n function(resp) {\r\n console.log(\"no login\" + resp);\r\n }\r\n )\r\n } else {\r\n console.log(\"Error, something missing\");\r\n }\r\n }", "function registration() {\n $scope.registrationOk = false;\n $scope.registrationError = false;\n $scope.groupError = false;\n var data = {\n id: $scope.id,\n pass: calcMD5($scope.pass),\n fullName: $scope.name,\n regionGroup: $scope.group,\n email: $scope.email,\n phone: $scope.phone,\n workplace: $scope.workplace,\n informed: concatInformed(),\n academic: $scope.academic,\n population: concatPopulation(),\n type: \"U\",\n action: \"insert\"\n };\n\n // Calls the registration method in the registration factory.\n RegistrationFactory.registration(data)\n .then(function(response) {\n if (response == true) {\n decrementCapacity();\n $scope.registrationOk = true;\n declare();\n\n $timeout(function() {\n $scope.registrationOk = false;\n }, 5000);\n }\n else if(typeof(response) == 'string') {\n $scope.registrationError = true;\n }\n });\n }", "function register(){\n\tusername = document.getElementById('usernameRegister').value;\n\temail = document.getElementById('emailRegister').value;\n\tpassword = document.getElementById('passwordRegister').value;\n\n\tvar registrationData = {\n \t\tdisplayName: username,\n \t\temail : email,\n \t\tpassword: password\n\t};\n\n\tvar newUser = new Stamplay.User().Model;\n\tnewUser.signup(registrationData).then(function(){\n\t\tdocument.getElementById('usernameRegister').value = \"\";\n\t\tdocument.getElementById('emailRegister').value = \"\";\n\t\tdocument.getElementById('passwordRegister').value = \"\";\n\t\twindow.location = \"home.html\";\n\t});\n}", "create({view}) {\n \n return view.render('user.create')\n }", "function createUser(firstname, lastname, username, password) {\n let person = new UserSignUp(firstname, lastname, username, password);\n ajax(\"PUT\", \"/auth\", isCreateUserOk, person);\n}", "AuthSignup(username, password) {\n let payload = {name: username, password: password};\n\n //execute post request to create a new user\n this.$http.post(SERVER + '/api/signup', payload)\n .then((res) => {\n let status = res.status;\n let success = res.data.success;\n let token = res.data.token;\n\n if (status === 200 && success) {\n //store token\n localStorage.setItem('reed-token', token);\n // go to dash\n this.$state.go('dashboard');\n } else {\n //handle err\n this.error = true;\n this.errorMessage = res.data.message;\n }\n });\n }", "function user()\n {\n\n }", "function clearsignup(){\n $scope.user.username = '';\n $scope.user.password = '';\n $scope.user.email = '';\n }", "insertCallback(error) {\n if (error) {\n Bert.alert({ type: 'danger', message: `Could not update the user profile: ${error.message}` });\n } else {\n Bert.alert({ type: 'success', message: 'User profile succesfully updated!' });\n this.formRef.reset();\n }\n }", "function User( $http, transformRequestAsFormPost ){\n\t\tvar self = this,\n\t\t\tregister_url = \"user/register/User\",\n\t\t\tlogin_url = \"login\";\n\t\tself.userdata = {};\n\t\tself.user = {};\n\t\tself.username = false;\n\t\tthis.createUser = function( name, mobile, sex, college, email, dob, city, refcode ) {\n\t\t\tself.userdata.name = name;\n\t\t\tself.userdata.mobile = mobile;\n\t\t\tself.userdata.sex = sex;\n\t\t\tself.userdata.college = college;\n\t\t\tself.userdata.email = email;\n\t\t\tself.userdata.dob = dob;\n\t\t\tself.userdata.city = city;\n\t\t\tself.userdata.refcode = refcode;\n\t\t\tself.userdata.anwId = \"\";\n\t\t\treturn self.insertUser( self.userdata );\n\t\t}\n\n\t\tthis.insertUser = function( userdata ) {\n\t\t\treturn $http({\n\t\t\t\tmethod: \"post\",\n\t\t\t\turl: register_url,\n\t\t\t\theaders: {'Content-type': 'application/x-www-form-urlencoded;charset=utf-8'},\n\t\t\t\ttransformRequest: transformRequestAsFormPost,\n\t\t\t\tdata: {\n\t\t\t\t\tname:userdata.name,\n\t\t\t\t\tmobile: userdata.mobile,\n\t\t\t\t\tsex: userdata.sex,\n\t\t\t\t\tcollege: userdata.college,\n\t\t\t\t\temail: userdata.email,\n\t\t\t\t\tdob: userdata.dob,\n\t\t\t\t\tcity: userdata.city\n\t\t\t\t}\n\t\t\t})/*.then( function( response ) {\n\t\t\t\tconsole.log(response);\n\t\t\t\tself.userdata.anwId = response.data[1].pId;\n\t\t\t}, function( errorResponse ) {\n\t\t\t\tconsole.log( errorResponse );\n\t\t\t} )*/;\n\t\t}\n /**\n * Set details of user on this object\n * @param string name of user\n */\n this.setDetails = function( name, data ){\n self.username = name;\n self.user = data;\n }\n\n this.loginUser = function( name, password ) {\n \treturn $http({\n\t\t\t\tmethod: \"post\",\n\t\t\t\turl: login_url,\n\t\t\t\theaders: {'Content-type': 'application/x-www-form-urlencoded;charset=utf-8'},\n\t\t\t\ttransformRequest: transformRequestAsFormPost,\n\t\t\t\tdata: {\n\t\t\t\t\tusername: name,\n\t\t\t\t\tpassword: password\n\t\t\t\t}\n\t\t\t});\n }\n }", "function selectUser(index) {\n vm.user = vm.users[index];\n }", "function handleCreateUser(event){\n if (DEBUG) {\n console.log (\"Triggered handleCreateUser\")\n }\n var data = [$(\"#firstname_add\").val(),\n $(\"#nickname_add\").val(),\n $(\"#email_add\").val(),\n $(\"#gender_add\").val(),\n $(\"#birthday_add\").val(),\n $(\"#password_add\").val()];\n\n for(var i = 0; i < data.length; ++i){\n if(data[i] == \"\"){\n alert (\"Could not create new user, some field is missing\");\n return false;\n }\n }\n var envelope={'template':{\n 'data':[]\n }};\n var userData = {};\n userData.name = \"firstname\";\n userData.value = data[0];\n envelope.template.data.push(userData);\n userData = {};\n userData.name = \"nickname\";\n userData.value = data[1];\n envelope.template.data.push(userData);\n userData = {};\n userData.name = \"email\";\n userData.value = data[2];\n envelope.template.data.push(userData);\n userData = {};\n userData.name = \"gender\";\n userData.value = data[3];\n envelope.template.data.push(userData);\n userData = {};\n userData.name = \"birthday\";\n userData.value = data[4];\n envelope.template.data.push(userData);\n userData = {};\n userData.name = \"password\";\n userData.value = data[5];\n envelope.template.data.push(userData);\n\n var url = \"/accounting/api/users/\";\n addUser(url, envelope);\n return false; //Avoid executing the default submit\n}", "function createUser(newUser) {\n var url = \"/api/assignment/user\";\n return $http.post(url, newUser)\n .then(function(response) {\n return response.data;\n });\n }", "function UsersCtrl($scope, User) {\n\n $scope.clearForm = function () {\n $scope.user = new User();\n $scope.user.id = \"\";\n $scope.user.userType = \"A\";\n };\n\n $scope.getUserById = function (userId) {\n User.query({userId: userId}, function (user) {\n $scope.user = user;\n });\n };\n\n $scope.userList = function () {\n User.list({},\n function (data) {\n //Success\n $scope.users = data.dteUser;\n }\n , function () {\n\n }\n );\n };\n\n $scope.save = function () {\n if ($scope.user.id === \"\") {\n User.insert({}, $scope.user, function () {\n $scope.userList();\n $scope.clearForm();\n }, function (data, status) {\n $scope.pushLog(\"Error Inserting User: \" + status, 0, $scope.user);\n })\n } else {\n User.update({}, $scope.user, function () {\n $scope.userList();\n $scope.clearForm();\n }, function (data, status) {\n switch (status) {\n case 404:\n alert(\"Record does not exist\");\n break;\n case 412:\n $scope.pushLog(\"Invalid Change Request: \" + data.status, 0, $scope.user);\n break;\n case 409:\n alert(\"Record changed by another user\");\n break;\n default:\n $scope.pushLog(\"Error Updating User: \" + data.status, 0, $scope.user);\n }\n\n $scope.userList();\n })\n }\n };\n\n $scope.userList();\n $scope.clearForm();\n}", "function CreateNewUser()\n{\n return { \n name: \"unset\",\n email: \"unset\",\n phone: \"unset\",\n wheelId: \"default-wheel-id\",\n prizeWon: null,\n numSpins: 0,\n \"timestamp\" : GetTimeStampNow()\n }\n}", "signUpUser(data) {\n return this.post('signup', data);\n }" ]
[ "0.6621564", "0.6533209", "0.65287954", "0.6415041", "0.6400795", "0.639848", "0.6242367", "0.62074", "0.6167305", "0.61491203", "0.61230946", "0.61079973", "0.60985684", "0.6049556", "0.59877026", "0.59850955", "0.59449065", "0.5940444", "0.593028", "0.59275997", "0.5915416", "0.5896297", "0.58833253", "0.5880524", "0.5863385", "0.5861034", "0.58581305", "0.585361", "0.583828", "0.58369386", "0.58369", "0.5818783", "0.57995397", "0.57994103", "0.57971734", "0.579448", "0.5789403", "0.5769167", "0.5764946", "0.5764358", "0.57604015", "0.5759347", "0.5758698", "0.57565856", "0.5755552", "0.57516766", "0.5728698", "0.572113", "0.5715635", "0.5709463", "0.56733364", "0.5670086", "0.5668989", "0.56664073", "0.5660505", "0.5655479", "0.5652821", "0.56374115", "0.5629368", "0.56231225", "0.5621711", "0.5621254", "0.56152445", "0.5613227", "0.5610781", "0.5609022", "0.5606099", "0.55991817", "0.559205", "0.5583495", "0.5577656", "0.55739826", "0.55671465", "0.55632955", "0.5554737", "0.5551057", "0.5547631", "0.55450565", "0.5544228", "0.55386454", "0.553411", "0.55335295", "0.5517039", "0.551339", "0.5505842", "0.55040383", "0.5503915", "0.55009407", "0.5494989", "0.54917175", "0.5486908", "0.5484034", "0.54778206", "0.5473516", "0.54704005", "0.5468061", "0.5467777", "0.54644716", "0.54643637", "0.54563725" ]
0.62028384
8
The load process: Get the value Validate with the schema If upgrade is required, upgrade it
load(dataKey) { return __awaiter(this, void 0, void 0, function* () { const key = `${this.schema}/${dataKey}`; let value = yield this.loadItem(key); if (!value) { return undefined; } const schemaVer = SchemaUtils_1.SchemaUtils.ver(value.version).major; const latestVer = this.schemaRegistry.getLastVersion(this.schema); if (latestVer > schemaVer) { // data upgrade is needed const newValue = yield this.upgradeData(value, schemaVer, latestVer); yield this.saveItem(`${key}.${schemaVer}.bak`, newValue); yield this.saveItem(key, value); // Save back the upgraded value } return value; }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get loadType() {}", "set loadType(value) {}", "function validateYupSchema(values,schema,sync,context){if(sync===void 0){sync=false;}if(context===void 0){context={};}var validateData=prepareDataForValidation(values);return schema[sync?'validateSync':'validate'](validateData,{abortEarly:false,context:context});}", "function getValidation(){\n\t\t\t\t\t\t\n\t\t\t\t\t}", "function loadValues() {\n\thiscore = parseInt(storage.hiscore2) || 0;\n\tlongest = parseInt(storage.longest2) || 1;\n\tspeed = parseInt(storage.speed2) || DEFAULT_SPEED;\n}", "_updateInternalSchemas () {\n this.get('getSchemaTask').perform()\n .then(({model, view, plugins, validators, propagateValidation}) => {\n this.setProperties({\n propagateValidation,\n validationResult: {}\n })\n\n if (model && !_.isEqual(this.get('internalBunsenModel'), model)) {\n this.set('internalBunsenModel', model)\n }\n\n if (view && !_.isEqual(this.get('internalBunsenView'), view)) {\n this.set('internalBunsenView', view)\n }\n\n this.setProperties({\n internalValidators: validators,\n internalPlugins: plugins\n })\n })\n .catch((err) => {\n this.set('localError', err.message)\n })\n }", "@action\n async validate() {\n if (this.args.parent === undefined) {\n if (this.args.alone) return; // if input is alone ignore\n }\n\n let value = this.args.value || this.args.selected;\n const res = await this.parent.state.validationSchema.validationFor(this.name,value,this);\n this.parent.updateState(); \n this.error = res;\n }", "_loadInfoFromDatabase() {\n // default values\n this._prefix = \"\";\n this._enabled = true;\n\n db.select(\"Plugins\", [\"prefix\", \"disabled\"], {\n id: this.id\n }).then((rows) => {\n if (rows.length > 0) {\n this._prefix = rows[0].prefix;\n this._enabled = (rows[0].disabled === 0);\n } else {\n return db.insert(\"Plugins\", {\n id: this.id,\n prefix: \"\",\n disabled: 0\n });\n }\n }).catch(Logger.err);\n }", "function handleLoadSync() {\n\t\t\t\t\tlogWithPhase( \"handleLoad - Sync\" );\n\t\t\t\t\t$scope.$eval( attributes.bnLoad );\n\t\t\t\t}", "getSchema(keyRef) {\n let sch;\n while (typeof (sch = getSchEnv.call(this, keyRef)) == \"string\")\n keyRef = sch;\n if (sch === undefined) {\n const { schemaId } = this.opts;\n const root = new compile_1.SchemaEnv({ schema: {}, schemaId });\n sch = compile_1.resolveSchema.call(this, root, keyRef);\n if (!sch)\n return;\n this.refs[keyRef] = sch;\n }\n return (sch.validate || this._compileSchemaEnv(sch));\n }", "getLoadData() {\n const { loadData, upperSearchValue } = this.$props;\n if (upperSearchValue) return null;\n return loadData;\n }", "loadResource() {\n // Load Selects\n this.loadStorageTierSelect(this.storage_tier)\n this.loadPublicAccessTypeSelect(this.public_access_type)\n this.loadAutoTieringSelect(this.auto_tiering)\n this.loadVersioningSelect(this.versioning)\n this.loadSelect(this.kms_key_id, 'key', true, () => true, 'Oracle-managed keys')\n // Assign Values\n this.storage_tier.property('value', this.resource.storage_tier)\n this.public_access_type.property('value', this.resource.public_access_type)\n this.auto_tiering.property('value', this.resource.auto_tiering)\n this.versioning.property('value', this.resource.versioning)\n this.object_events_enabled.property('checked', this.resource.object_events_enabled)\n this.kms_key_id.property('value', this.resource.kms_key_id)\n // Pricing Estimates\n this.estimated_monthly_capacity_gbs.property('value', this.resource.estimated_monthly_capacity_gbs)\n this.estimated_monthly_requests.property('value', this.resource.estimated_monthly_requests)\n }", "fromValidation(aValidation) {\n return require('folktale/data/conversions/validation-to-result')(aValidation);\n }", "'validateValue'(value) {}", "getVersionField(telegram) {\n let values = telegram.getValues();\n\n return values.has('BLOCK1_VERSION') ?\n values.get('BLOCK1_VERSION') : null;\n }", "_getValue_unavailable() {}", "readData( key, fallback ) {\n\t\tlet value = BdApi.loadData( this.getShortName(), key );\n\t\treturn typeof value !== 'undefined' ? value : fallback;\n\t}", "async validate () {\n\t\t// create a model from the attributes and let it do its own pre-save, this is where\n\t\t// validation happens ... note that since we're doing an update, we might not have\n\t\t// (and actually probably don't) have a complete model here\n\t\tthis.tempModel = new this.collection.modelClass(this.attributes, { dontSetDefaults: true });\n\t\ttry {\n\t\t\tawait this.tempModel.preSave();\n\t\t}\n\t\tcatch (error) {\n\t\t\tthrow this.request.errorHandler.error('validation', { info: error });\n\t\t}\n\t\tif (this.tempModel.validationWarnings instanceof Array) {\n\t\t\tthis.request.warn(`Validation warnings: \\n${this.tempModel.validationWarnings.join('\\n')}`);\n\t\t}\n\t\tObject.assign(this.attributes, this.tempModel.attributes);\n\t}", "async function load(req, res, next) {\n req.attribute = await Attribute.get(req.params.attributeId);\n return next();\n}", "getCurrentVersion() {\n let request = this._get('/classes/' + this.migrationVersionTable);\n return new Promise(function(resolve, reject) {\n request.query({ order: '-updatedAt' })\n .query({ limit: 1 })\n .end(function(err, res){\n if (res.ok) {\n let results = res['body'].results;\n // check if a version is available -> else set version to undefined\n let version = results.length > 0 ? results[0] : undefined;\n resolve(version);\n } else {\n reject(new Error('API Request failed: ' + res.body.error));\n }\n });\n });\n }", "_validateFieldCreation(name, value, schemaField) {\n\n\n if (!schemaField) schemaField = this._schema.fields[name];\n\n if (!schemaField || typeof schemaField !== \"object\")\n throw Error(\"Schema was not found\");\n\n //validate its type\n if (!schemaField.type || !defaultValuesExist[schemaField.type])\n throw Error(\"Type is invalid\");\n }", "loadValueProposition() {\n $(jqId(VALUE_PROPOSITION_PANEL)).load(\"valueproposition/network_load_balancer.html\");\n }", "async createOrUpdate(storage) {\n const v = await storage.userVersion();\n\n if (v === this.version) {\n return v;\n }\n\n if (v === 0) {\n return this.create(storage);\n }\n\n if (v < this.version) {\n return this.update(storage, v);\n }\n\n throw new Error(`Target version ${this.version} lower than DB version ${v}!`);\n }", "async function validateVehicle(vehicle, isUpdate = false, id = null) {\n const validation = await vehicleTypeModel\n .findById(vehicle.vehicle_type)\n .exec()\n .then(async (type) => {\n console.log(type);\n //checking for valid vehicle-type\n if (!type) {\n return { error: \"Invalid vehicle type selected\", value: {} };\n }\n\n let query = vehicleModel\n .where(\"license_plate\")\n .equals(vehicle.license_plate.trim().toUpperCase());\n\n //if validation for update then exclude current vehicle document while checking unique license no\n if (isUpdate) {\n query.where(\"_id\").ne(id);\n }\n\n let isVehicleAlreadyExist = await query\n .exec()\n .then((vehicles) => {\n if (vehicles.length >= 1)\n //return error if licensce no already exit else return false\n return { error: \"Licence plate no already exists\", value: {} };\n return false;\n })\n .catch((err) => {\n return { error: err, value: {} };\n });\n\n if (isVehicleAlreadyExist)\n // return the {error,value} object if vehicle already exists\n return isVehicleAlreadyExist;\n\n const schema = Joi.object().keys({\n vehicle_type: Joi.string().trim().required(),\n license_plate: Joi.string()\n .trim()\n .pattern(\n /^[A-Za-z]{2,3}[0-9]{4}$/, //regex for licence plate no\n )\n .uppercase()\n .required(),\n on_repair: Joi.bool(),\n // fuel_economy: Joi.number().min(1).required(),\n // load: Joi.number().min(1).required(),\n // capacity: Joi.number().min(1).required(),\n });\n\n return schema.validate(vehicle, { abortEarly: false });\n })\n .catch((err) => {\n return { error: err, value: {} };\n });\n return validation;\n}", "async getModelVersion () {\n\t\tconst model = await this.collection.getById(\n\t\t\tthis.id, \n\t\t\t{\n\t\t\t\tnoCache: true,\n\t\t\t\tfields: ['version'] \n\t\t\t}\n\t\t);\n\t\tif (!model) {\n\t\t\tthrow this.request.errorHandler.error('notFound');\n\t\t}\n\t\tthis.modelVersion = model.get('version') || 1;\n\t}", "validate(newValue, shouldBeDirty, forceExecution) {\n if ((!this.propertyResult.isDirty && shouldBeDirty) || this.latestValue !== newValue || forceExecution) {\n this.latestValue = newValue;\n return this.config.locale().then((locale) => {\n return this.collectionOfValidationRules.validate(newValue, locale)\n .then((validationResponse) => {\n if (this.latestValue === validationResponse.latestValue) {\n this.propertyResult.setValidity(validationResponse, shouldBeDirty);\n }\n return validationResponse.isValid;\n })\n .catch((err) => {\n throw Error('Unexpected behavior: a validation-rules-collection should always fulfil');\n });\n },\n () => {\n throw Error('An exception occurred while trying to load the locale');\n });\n }\n }", "load() {\n\t\tif (this.props.onDataRequire) {\n\t\t\tthis.props.onDataRequire.call(this, this, 0, 1048576, this.props.columns);\n\t\t}\n\t}", "loadResource() {\n // Load Selects\n const pool_filter = (ip) => !this.resource.getOkitJson().getAutoscalingConfigurations().map(a => a.resource.id).includes(ip.id)\n this.loadSelect(this.instance_pool_id, 'instance_pool', true, pool_filter)\n // Assign Values\n this.instance_pool_id.property('value', this.resource.auto_scaling_resources.id)\n this.cool_down_in_seconds.property('value', this.resource.cool_down_in_seconds)\n this.policy_type.property('value', this.resource.policy_type)\n this.showHidePolicyTypeRows(this.resource.policy_type)\n if (this.resource.policy_type === 'threshold') this.loadThresholdResources()\n else this.loadScheduledResources()\n }", "validate() {}", "async fetchAndSetMetaData() {\n const response = await this.apiCall(this.metaUrl);\n this.metaData = await this.readValue(response, this.fieldPath);\n this.isLoading = false;\n\n // if(this.validate && this.metaData.regex) {\n if(this.validate) {\n this.regex = new RegExp('^[a-z]*$');\n this.shadowRoot.querySelector('slot').addEventListener('keyup', e => this._handleValueChange(e))\n }\n }", "function validate(){\n\n\t\t//TODO: make this work\n\n\n\t}", "loadValue(register, value) {\n if (Object(_glimmer_vm__WEBPACK_IMPORTED_MODULE_1__[\"isLowLevelRegister\"])(register)) {\n this[_symbols__WEBPACK_IMPORTED_MODULE_7__[\"INNER_VM\"]].loadRegister(register, value);\n }\n\n switch (register) {\n case _glimmer_vm__WEBPACK_IMPORTED_MODULE_1__[\"$s0\"]:\n this.s0 = value;\n break;\n\n case _glimmer_vm__WEBPACK_IMPORTED_MODULE_1__[\"$s1\"]:\n this.s1 = value;\n break;\n\n case _glimmer_vm__WEBPACK_IMPORTED_MODULE_1__[\"$t0\"]:\n this.t0 = value;\n break;\n\n case _glimmer_vm__WEBPACK_IMPORTED_MODULE_1__[\"$t1\"]:\n this.t1 = value;\n break;\n\n case _glimmer_vm__WEBPACK_IMPORTED_MODULE_1__[\"$v0\"]:\n this.v0 = value;\n break;\n }\n }", "loadValue(register, value) {\n if (Object(_glimmer_vm__WEBPACK_IMPORTED_MODULE_1__[\"isLowLevelRegister\"])(register)) {\n this[_symbols__WEBPACK_IMPORTED_MODULE_7__[\"INNER_VM\"]].loadRegister(register, value);\n }\n\n switch (register) {\n case _glimmer_vm__WEBPACK_IMPORTED_MODULE_1__[\"$s0\"]:\n this.s0 = value;\n break;\n\n case _glimmer_vm__WEBPACK_IMPORTED_MODULE_1__[\"$s1\"]:\n this.s1 = value;\n break;\n\n case _glimmer_vm__WEBPACK_IMPORTED_MODULE_1__[\"$t0\"]:\n this.t0 = value;\n break;\n\n case _glimmer_vm__WEBPACK_IMPORTED_MODULE_1__[\"$t1\"]:\n this.t1 = value;\n break;\n\n case _glimmer_vm__WEBPACK_IMPORTED_MODULE_1__[\"$v0\"]:\n this.v0 = value;\n break;\n }\n }", "validate() {\n const that = this;\n _.keys(that._schema).forEach(function(key) {\n let value = that[key];\n if (value !== null && value !== undefined) {\n if (isEmbeddedDocument(value)) {\n value.validate();\n return;\n } else if (\n isArray(value) &&\n value.length > 0 &&\n isEmbeddedDocument(value[0])\n ) {\n value.forEach(function(v) {\n v.validate();\n });\n return;\n }\n }\n\n if (!isValidType(value, that._schema[key].type)) {\n // TODO: Formatting should probably be done somewhere else\n let typeName = null;\n let valueName = null;\n if (\n Array.isArray(that._schema[key].type) &&\n that._schema[key].type.length > 0\n ) {\n typeName = '[' + that._schema[key].type[0].name + ']';\n } else if (\n Array.isArray(that._schema[key].type) &&\n that._schema[key].type.length === 0\n ) {\n typeName = '[]';\n } else {\n typeName = that._schema[key].type.name;\n }\n\n if (Array.isArray(value)) {\n // TODO: Not descriptive enough! Strings can look like numbers\n valueName = '[' + value.toString() + ']';\n } else {\n valueName = typeof value;\n }\n throw new ValidationError(\n 'Value assigned to ' +\n that.collectionName() +\n '.' +\n key +\n ' should be ' +\n typeName +\n ', got ' +\n valueName\n );\n }\n if (\n !isSchema(that._schema[key]) &&\n that._schema[key].required &&\n isEmptyValue(value)\n ) {\n throw new ValidationError(\n 'Key ' +\n that.collectionName() +\n '.' +\n key +\n ' is required' +\n ', but got ' +\n value\n );\n }\n\n if (\n that._schema[key].match &&\n isString(value) &&\n !that._schema[key].match.test(value)\n ) {\n throw new ValidationError(\n 'Value assigned to ' +\n that.collectionName() +\n '.' +\n key +\n ' does not match the regex/string ' +\n that._schema[key].match.toString() +\n '. Value was ' +\n value\n );\n }\n\n if (!isInChoices(that._schema[key].choices, value)) {\n throw new ValidationError(\n 'Value assigned to ' +\n that.collectionName() +\n '.' +\n key +\n ' should be in choices [' +\n that._schema[key].choices.join(', ') +\n '], got ' +\n value\n );\n }\n\n if (isNumber(that._schema[key].min) && value < that._schema[key].min) {\n throw new ValidationError(\n 'Value assigned to ' +\n that.collectionName() +\n '.' +\n key +\n ' is less than min, ' +\n that._schema[key].min +\n ', got ' +\n value\n );\n }\n\n if (isNumber(that._schema[key].max) && value > that._schema[key].max) {\n throw new ValidationError(\n 'Value assigned to ' +\n that.collectionName() +\n '.' +\n key +\n ' is less than max, ' +\n that._schema[key].max +\n ', got ' +\n value\n );\n }\n\n if (\n isFunction(that._schema[key].validate) &&\n !that._schema[key].validate(value)\n ) {\n throw new ValidationError(\n 'Value assigned to ' +\n that.collectionName() +\n '.' +\n key +\n ' failed custom validator. Value was ' +\n value\n );\n }\n\n if (isSchema(that._schema[key].validate) || isSchema(that._schema[key])) {\n try {\n assert(\n value,\n isSchema(that._schema[key].validate)\n ? that._schema[key].validate\n : that._schema[key]\n );\n } catch (error) {\n if (error.details[0].path.length === 0) {\n throw new ValidationError(\n error.details[0].message.replace(\n 'value',\n `${that.collectionName()}.${key}`\n )\n );\n } else if (error.details[0].path[0] !== key) {\n throw new ValidationError(\n error.details[0].message.replace(\n error.details[0].path[0],\n `${that.collectionName()}.${key}.${error.details[0].path[0]}`\n )\n );\n } else {\n throw new ValidationError(\n error.details[0].message.replace(\n 'value',\n `${that.collectionName()}.${key}`\n )\n );\n }\n }\n }\n });\n }", "validate() { }", "_validate() {\n\t}", "async getLoadOperation() {}", "forceValidate() {\n this.setValue(this.getValue());\n }", "validate(key, value) { // eslint-disable-line class-methods-use-this\n return value;\n }", "preValidate() { }", "async createOrUpdate(storage) {\n const v = await storage.userVersion();\n\n if (v === this.version) {\n return v;\n }\n\n switch (v) {\n case 0:\n return this.create(storage);\n default:\n throw new Error(`Target version ${this.version} lower than DB version ${v}!`);\n }\n }", "function validate_data ( op, table_name, req_params ) {\n 'use strict';\n\tvar __FUNCTION__ = \"validate_data\";\n\tvar tn = find_table ( table_name, model );\n\t//debug_2(\".1.validate_data.m4.js\",__FUNCTION__,14,\"tn=\"+tn+\" op=\"+op );\n\t//debug_2(\".1.validate_data.m4.js\",__FUNCTION__,15,\"model.tables[\"+tn+\"].name = \"+model.tables[tn].name+\" desired table_name=\"+table_name );\n\tif ( typeof model.tables[tn].validate !== \"undefined\" ) {\t\t\t\t\t\t\t\t\t\t\t\t// If not specified then validation is true. (Think read-only views)\n\t\tif ( typeof model.tables[tn].validate[op] !== \"undefined\" ) {\n\t\t\tvar val = model.tables[tn].validate[op];\n\t\t\treturn validate.validate_object ( req_params, val );\n\t\t}\n\t}\n\treturn { \"ok\":true };\n}", "getFhirVersion() {\n return (0, lib_1.fetchConformanceStatement)(this.state.serverUrl).then(metadata => metadata.fhirVersion);\n }", "validate (){\n const that = this;\n return this\n ._validate(this.swaggerInput)\n .then((dereferencedSchema) => {\n that.swaggerObject = dereferencedSchema;\n return that;\n });\n }", "function validateProdOffline(){\n \n var prod = $('#prodtb').val();\n\n db.prods.get(prod, function (item) {\n currentProd = item;\n setStatLabel(\"info\", item.DESCRIP);\n\n setPriceSelect(item);\n\n saveState();\n })\n \n}", "get schemaVersion() {\n return this.getStringAttribute('schema_version');\n }", "toValidation(fallbackValue) {\n return require('folktale/conversions/maybe-to-validation')(this, fallbackValue);\n }", "function validateUpdate(item) {\n\n //Required schema of the input data\n const schema = {\n value: Joi.string().min(1).required(),\n ttl: Joi.number().required()\n\n };\n return Joi.validate(item, schema); //Return validation result\n}", "static async latestVersion() {\n // Load the latest migration details from the database.\n let latestMigration = await MigrationModel.find({})\n .sort({ version: -1 })\n .limit(1)\n .exec();\n\n // If there weren't any migrations at all, then error out.\n if (latestMigration.length === 0) {\n return null;\n }\n\n // If the latest migration does not match the required version, then error\n // out.\n return latestMigration[0].version;\n }", "function getDatabaseVersion() {\n return knex.schema.hasTable('settings').then(function (exists) {\n // Check for the current version from the settings table\n if (exists) {\n // Temporary code to deal with old databases with currentVersion settings\n return knex('settings')\n .where('key', 'databaseVersion')\n .orWhere('key', 'currentVersion')\n .select('value')\n .then(function (versions) {\n var databaseVersion = _.reduce(versions, function (memo, version) {\n if (isNaN(version.value)) {\n errors.throwError('Database version is not recognised');\n }\n return parseInt(version.value, 10) > parseInt(memo, 10) ? version.value : memo;\n }, initialVersion);\n\n if (!databaseVersion || databaseVersion.length === 0) {\n // we didn't get a response we understood, assume initialVersion\n databaseVersion = initialVersion;\n }\n\n return databaseVersion;\n });\n }\n throw new Error('Settings table does not exist');\n });\n}", "required(cb) {\n const { path: lodashPath, fieldSchema: appModelPart, handlerSpec, userContext, modelSchema, row } = this;\n const { schemaName } = modelSchema;\n const val = vutil.getValue(row, appModelPart, lodashPath);\n const { type } = appModelPart;\n const isMultipleType = type.endsWith('[]');\n const isAssociativeArray = type === 'AssociativeArray';\n const isArray = type === 'Array';\n const isMixedType = type === 'Mixed';\n const isString = type === 'String';\n const isBoolean = type === 'Boolean';\n const isEmptyVal =\n _.isNil(val) ||\n (isString && val === '') ||\n ((isArray || isAssociativeArray || isMultipleType) && _.isEmpty(val)) ||\n (isMixedType && _.isNil(val)) ||\n (isBoolean && val === false); // this is not supposed (agreement)\n\n let isRequired;\n\n if (_.isBoolean(appModelPart.required)) {\n const pathToParent = lodashPath.split('.').slice(0, -1);\n // if lodashPath is of 1 length, i.e. in root then count as parent presented\n const isParentPresented = _.isEmpty(pathToParent) ? true : !!_.get(row, pathToParent);\n isRequired = isParentPresented && appModelPart.required;\n } else if (_.isString(appModelPart.required)) {\n try {\n const { action } = userContext;\n\n if (appModelPart.required.includes('this.')) {\n const { indexes, index, parentData } = getParentInfo(appLib.appModel.models[schemaName], row, lodashPath);\n const context = {\n path: lodashPath,\n data: val,\n row,\n fieldSchema: appModelPart,\n action,\n indexes,\n index,\n parentData,\n };\n const inlineCode = appLib.butil.getDefaultArgsAndValuesForInlineCode();\n isRequired = new Function(inlineCode.args, `return ${appModelPart.required}`).apply(\n context,\n inlineCode.values\n );\n } else {\n const requiredFunc = new Function('data, row, modelSchema, $action', `return ${appModelPart.required}`);\n isRequired = requiredFunc(val, row, appModelPart, action);\n }\n } catch (e) {\n return cb(\n `Error occurred during validating required field ${appModelPart.fullName} for condition ${appModelPart.required}`\n );\n }\n }\n\n if (isRequired && isEmptyVal) {\n cb(vutil.replaceErrorTemplatePlaceholders(schemaName, handlerSpec, val, row, lodashPath, appModelPart));\n } else {\n cb();\n }\n }", "dynamic() {\n\t\tconst dynamicSchema = Object.keys(this.schema)\n\t\t\t.filter(key => this.field.includes(key))\n\t\t\t.reduce((obj, key) => {\n\t\t\t\tobj[key] = this.schema[key];\n\t\t\t\treturn obj;\n\t\t\t}, {});\n\t\t\t\n\t\tconst validate = Joi.object(dynamicSchema).validateAsync(this.fields);\n\t\treturn validate.then(() => {\n\t\t\treturn response({valid: true});\n\t\t}).catch(error => {\n\t\t\treturn response({invalid: true, message: joiError(error.toString())});\n\t\t})\n\t}", "coerce(keyPath, value, schema) {\n if (![undefined, null].includes(value)) {\n throw new Error(\n `Validation failed at ${keyPath}, ${JSON.stringify(\n value\n )} must be null`\n );\n }\n return value;\n }", "getOrLoad(key, cb) {\n const account = this.lookup(key);\n if (account) {\n asyncLib.nextTick(cb, null, account);\n }\n else {\n this._lookupAccount(key, (err, account) => {\n if (err)\n return cb(err);\n this._update(key, account, false, false);\n cb(null, account);\n });\n }\n }", "load() {\n\t\t\tlet storage = Storage.local.get('commander') || null;\n\t\t\tif (storage) {\n\t\t\t\tupdate(bs => {\n\t\t\t\t\tbs = storage;\n\t\t\t\t\treturn bs;\n\t\t\t\t});\n\t\t\t}\n\t\t}", "async createOrUpdate(storage: ProfileStorage): Promise<number> {\n const v = await storage.userVersion();\n\n if (v === this.version) {\n return v;\n }\n\n if (v === 0) {\n return this.create(storage);\n }\n\n if (v < this.version) {\n return this.update(storage, v);\n }\n\n throw new Error(`Target version ${this.version} lower than DB version ${v}!`);\n }", "static load (store) {\n if (!chrome.devtools) {\n _.each(['UserLevel', 'SwordLevel', 'Sword', 'Equip', 'Consumable', 'FieldSquare', \"Event\", \"EventLayer\", \"EventSquare\"], k => {\n store.commit('loadData', {\n key: k,\n loaded: true\n })\n })\n }\n return Promise.props({\n UserLevel: localforage.getItem('UserLevelMaster'),\n SwordLevel: localforage.getItem('SwordLevelMaster'),\n Sword: localforage.getItem('SwordMaster'),\n Equip: localforage.getItem('EquipMaster'),\n Consumable: localforage.getItem('ConsumableMaster'),\n FieldSquare: localforage.getItem('FieldSquareMaster'),\n Event: localforage.getItem('EventMaster'),\n EventLayer: localforage.getItem('EventLayerMaster'),\n EventSquare: localforage.getItem('EventSquareMaster')\n }).then((saved) => {\n console.log('loadLocal')\n _.each(saved, (v, k) => {\n TRHMasterData[k] = v\n console.log(TRHMasterData[k])\n store.commit('loadData', {\n key: k,\n loaded: !_.isNull(v)\n })\n })\n })\n }", "async getVersion (): Promise<?number> {\n let version = null\n const { rows: versions, rowCount } = await this.db.query(`\n select version\n from version\n order by deployed_ts desc nulls last\n limit 1\n `)\n /* istanbul ignore else */\n if (rowCount && rowCount > 0) {\n version = parseFloat(versions[0].version)\n if (isNaN(version)) {\n return null\n }\n }\n return version\n }", "validateSysCheck() {\n const result = this.commonData.validateRange(this.$scope.agent.syscheck);\n this.$scope.agent.syscheck = result;\n }", "_validate(initialValidation, programmaticValue, coerced, programmaticValueIsSet) {\n const that = this;\n let value;\n\n that._programmaticValueIsSet = programmaticValueIsSet && that.validation === 'interaction';\n\n if (initialValidation) {\n value = that.value;\n }\n else {\n value = programmaticValue;\n }\n\n let actualValue, validNumber;\n\n if (coerced !== true && that.coerce) {\n actualValue = that._numericProcessor.createDescriptor(value, true, true, true);\n actualValue = that.logarithmicScale ? Math.pow(10, that._numericProcessor.getCoercedValue(Math.log10(actualValue))) : that._numericProcessor.getCoercedValue(actualValue);\n validNumber = actualValue;\n }\n else if (that.validation === 'strict' || !initialValidation && !that._programmaticValueIsSet) {\n actualValue = that._numericProcessor.createDescriptor(value, true, true, true);\n validNumber = actualValue;\n }\n else {\n actualValue = that._numericProcessor.createDescriptor(value, true, true, false);\n validNumber = that._numericProcessor.validate(actualValue, that._minObject, that._maxObject);\n }\n\n if (that._numericProcessor.regexScientificNotation.test(validNumber)) {\n validNumber = that._numericProcessor.scientificToDecimal(validNumber);\n }\n\n validNumber = that._discardDecimalSeparator(validNumber, that.decimalSeparator);\n\n if (initialValidation) {\n that._number = validNumber;\n that._drawValue = that.logarithmicScale ? Math.log10(validNumber) : validNumber;\n\n if (that.mode === 'numeric') {\n that.value = actualValue.toString();\n }\n else {\n that._valueDate = JQX.Utilities.DateTime.fromFullTimeStamp(actualValue);\n that.value = actualValue;\n }\n\n delete that._valueBeforeCoercion;\n that._moveThumbBasedOnValue(that._drawValue);\n }\n else {\n that._numericProcessor.updateValue(actualValue);\n }\n\n that._programmaticValueIsSet = false;\n }", "get() {\n // The value here is already loaded, return it synchronously.\n if (this.loaded) return this._value;\n\n // The value here hasn't been loaded yet, load it and return the\n // asynchronous work.\n return new Promise(resolve => {\n // Load the target, set the value here and resolve with it.\n this.host._session.query(this.friendM).where({\n [this.destinationAttribute]: this.host[this.sourceAttribute]\n }).first().then(value => {\n this._value = value;\n\n resolve(value);\n });\n });\n }", "get() {\r\n //搜集依赖\r\n dep.depend()\r\n return val\r\n }", "validate() {\n return null;\n }", "loadValueProposition() {\n $(jqId(VALUE_PROPOSITION_PANEL)).load(\"valueproposition/instance.html\");\n }", "GetVersion(){\n return localStorage.getItem(this._DBKeyVersion) // Recuperer la version de la DB du browser\n }", "get engineVersionActual() {\n return this.getStringAttribute('engine_version_actual');\n }", "async validate() {\n return true\n }", "function defaultValidate() {\n if (this.args.column.validator) {\n var validationResults = this.args.column.validator(this.serializeValue());\n if (!validationResults.valid) {\n return validationResults;\n }\n }\n\n return {\n valid: true,\n msg: null,\n };\n }", "function loadLDB() {\n\t\t\tconsole.log(\"loadLDB()\");\n\t\t\tif (vm.results.length == 0) { // this works coming from create\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (vm.selectedIndex < 0) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// api get object by primary key\n\t\t\tconsole.log(\"vm.results[vm.selectedIndex].logicalDBKey: \" + vm.results[vm.selectedIndex].logicalDBKey); //this works from create\n\t\t\tLDBGetAPI.get({ key: vm.results[vm.selectedIndex].logicalDBKey }, function(data) { // this works from create\n\n\t\t\t\tvm.apiDomain = data;\n\t\t\t\tvm.apiDomain.logicalDBKey = vm.results[vm.selectedIndex].logicalDBKey; // this works from create\n\t\t\t\tselectLDB(vm.selectedIndex);\n\t\t\t\taddAdbRow()\n\n\t\t\t}, function(err) {\n\t\t\t\tpageScope.handleError(vm, \"Error retrieving data object.\");\n\t\t\t});\n\t\t}", "load(field) {\n return new code.Load(field);\n }", "_getDatabaseVersion(database: SQLite.SQLiteDatabase): Promise<number> {\n // Select the highest version number from the version table\n return database\n .executeSql('SELECT version FROM Version ORDER BY version DESC LIMIT 1;')\n .then(([results]) => {\n if (results.rows && results.rows.length > 0) {\n const version = results.rows.item(0).version;\n return version;\n } else {\n return 0;\n }\n })\n .catch((error) => {\n console.log(`No version set. Returning 0. Details: ${error}`);\n return 0;\n });\n }", "function gvpLoadPromise () {\n if (context.uriAddressableDefsEnabled) {\n return Promise[\"resolve\"]();\n } else {\n return context.globalValueProviders.loadFromStorage();\n }\n }", "loadResource() {\n // Load Reference Selects\n this.loadSelect(this.vcn_id, 'virtual_cloud_network', false)\n this.loadSelect(this.drg_id, 'drg', true)\n this.loadSelect(this.route_table_id, 'route_table', true, this.vcn_filter)\n this.loadDrgRouteRulesSelect()\n // Assign Values\n this.vcn_id.property('value', this.resource.vcn_id)\n this.drg_id.property('value', this.resource.drg_id)\n this.route_table_id.property('value', this.resource.route_table_id)\n this.drg_route_table_id.property('value', this.resource.drg_route_table_id)\n }", "applyBackendResult(data) {\n this.setValues(data.new_values);\n\n const roChanges = Immutable.fromJS(data.ro_changes);\n roChanges.forEach((new_ro, id) => {\n this.setReadability(id, new_ro);\n });\n\n const mandChanges = Immutable.fromJS(data.mandatory_changes);\n mandChanges.forEach((new_mand, id) => {\n this.setFieldMandatory(id, new_mand === 1);\n });\n\n this.wizardProgress = Immutable.fromJS(data.wizard_progress);\n }", "_validateValue(value, oldValue) {\n const that = this,\n numericProcessor = that._numericProcessor,\n logarithmicGauge = that.logarithmicScale,\n strictValidation = that.validation === 'strict';\n let fireEvent = strictValidation && oldValue !== undefined;\n\n if (value === undefined) {\n fireEvent = false;\n value = that.value;\n }\n else {\n value = value.toString();\n }\n\n if (numericProcessor.regexScientificNotation.test(value)) {\n value = numericProcessor.scientificToDecimal(value);\n }\n\n if (isNaN(value)) {\n value = oldValue || 0;\n }\n\n let valueNoRangeValidation, stringValueNoRangeValidation, stringValue;\n\n if (that.coerce) {\n valueNoRangeValidation = numericProcessor.getCoercedValue(numericProcessor.createDescriptor(value, true, true, true), false, logarithmicGauge);\n that._number = valueNoRangeValidation;\n stringValueNoRangeValidation = valueNoRangeValidation.toString();\n stringValue = stringValueNoRangeValidation;\n }\n else if (strictValidation) {\n valueNoRangeValidation = numericProcessor.getCoercedValue(numericProcessor.createDescriptor(value, true, true, true), false, logarithmicGauge);\n that._number = valueNoRangeValidation;\n stringValueNoRangeValidation = valueNoRangeValidation.toString();\n stringValue = stringValueNoRangeValidation;\n }\n else {\n fireEvent = false;\n valueNoRangeValidation = numericProcessor.getCoercedValue(numericProcessor.createDescriptor(value, true, true, false), false, logarithmicGauge);\n that._number = numericProcessor.validate(valueNoRangeValidation, numericProcessor.createDescriptor(that._minObject), numericProcessor.createDescriptor(that._maxObject));\n stringValueNoRangeValidation = valueNoRangeValidation.toString();\n stringValue = that._number.toString();\n }\n\n let oldValueDetail, valueDetail;\n\n if (that.mode === 'numeric') {\n oldValueDetail = oldValue;\n valueDetail = stringValueNoRangeValidation;\n that.value = stringValueNoRangeValidation; // the \"value\" property continues to return the value set by the user\n that.$.digitalDisplay.value = stringValueNoRangeValidation;\n }\n else {\n oldValueDetail = that._valueDate;\n that._valueDate = JQX.Utilities.DateTime.fromFullTimeStamp(stringValueNoRangeValidation);\n valueDetail = that._valueDate;\n that.value = valueNoRangeValidation;\n that.$.digitalDisplay.$.input.value = that._valueDate;\n }\n\n that._drawValue = logarithmicGauge ? Math.log10(stringValue).toString() : stringValue;\n\n if (fireEvent && (numericProcessor.compare(that._number, oldValue))) {\n that.$.fireEvent('change', { 'value': valueDetail, 'oldValue': oldValueDetail });\n }\n\n delete that._valueBeforeCoercion;\n }", "function syncValidator(schema, data, _) {\n console.log('**** syncValidator got schema=', schema);\n console.log('**** syncValidator got data=', data);\n return true;\n}", "get DataVersion() {\n return this[sDataVersion];\n }", "function getVersionData (version, callback) {\n if (RUNTIME_CACHE[version]) {\n return callback(null, RUNTIME_CACHE[version]);\n }\n\n if (version && typeof version !== 'string') {\n return callback(errorMsgs.incorrectVersionParam);\n }\n\n var url = version ? '/version/' + version : '/latest';\n\n request({url: API_URL + url}, function (err, response, body) {\n if (err) {\n return callback(errorMsgs.connectionIssues);\n }\n\n if (body === '404') {\n return callback(errorMsgs.notFound);\n }\n\n try {\n var parsed = JSON.parse(body.toString());\n } catch (e) {\n return callback(errorMsgs.parsingVersionData);\n }\n\n RUNTIME_CACHE[version] = parsed;\n return callback(null, parsed);\n });\n}", "loadValueProposition() {\n $(jqId(VALUE_PROPOSITION_PANEL)).load(\"valueproposition/dynamic_routing_gateway.html\");\n }", "get validated() {\n return this.sizeValidator.validated && this.extensionValidator.validated;\n }", "async load() {\n const configFromDB = await this.loadFromDB();\n const configFromEnvVars = this.loadFromEnvVars();\n\n // merge defaults per ns\n const mergedConfigFromDB = {\n crowi: Object.assign(this.configModel.getDefaultCrowiConfigsObject(), configFromDB.crowi),\n markdown: Object.assign(this.configModel.getDefaultMarkdownConfigsObject(), configFromDB.markdown),\n notification: Object.assign(this.configModel.getDefaultNotificationConfigsObject(), configFromDB.notification),\n };\n\n // In getConfig API, only null is used as a value to indicate that a config is not set.\n // So, if a value loaded from the database is emtpy,\n // it is converted to null because an empty string is used as the same meaning in the config model.\n // By this processing, whether a value is loaded from the database or from the environment variable,\n // only null indicates a config is not set.\n for (const namespace of Object.keys(mergedConfigFromDB)) {\n for (const key of Object.keys(mergedConfigFromDB[namespace])) {\n if (mergedConfigFromDB[namespace][key] === '') {\n mergedConfigFromDB[namespace][key] = null;\n }\n }\n }\n\n return {\n fromDB: mergedConfigFromDB,\n fromEnvVars: configFromEnvVars,\n };\n }", "loadValueProposition() {\n $(jqId(VALUE_PROPOSITION_PANEL)).load(\"valueproposition/vm_cluster.html\");\n }", "function LoadDB(callback) {\n\tif(\"indexedDB\" in window) {\n\t\tconsole.log(\"IndexedDB is supported!!\");\n\t\t//indexedDB.deleteDatabase(dbname);\n\t\tlet openRequest = indexedDB.open(dbname);\n\n\t\topenRequest.onupgradeneeded = e => {\n\t\t\tconsole.log(\"Upgrading...\");\n\t\t\tdb = e.target.result;\n\n\t\t\t//Upgrading users\n\t\t let objectStore = db.createObjectStore(\"users\", {keyPath: \"iduser\"});\n\t\t\tobjectStore.createIndex(\"login\", \"login\", { unique: true });\n\t\t for (let i in usersData) {\n\t\t objectStore.add(usersData[i]);\n\t\t }\n\t\t\t//Upgrading pets\n\t\t objectStore = db.createObjectStore(\"pets\", {keyPath: \"idpet\", autoIncrement : true});\n\t\t for (i in petsData) {\n\t\t objectStore.add(petsData[i]);\n\t\t }\n\t\t\t//Upgrading services\n\t\t objectStore = db.createObjectStore(\"servs\", {keyPath: \"idserv\"});\n\t\t\tobjectStore.createIndex(\"idserv\", \"idserv\", { unique: true });\n\t\t for (i in servicesData) {\n\t\t objectStore.add(servicesData[i]);\n\t\t }\n\t\t\t//Upgrading products\n\t\t objectStore = db.createObjectStore(\"products\", {keyPath: \"idprod\"});\n\t\t for (i in productsData) {\n\t\t objectStore.add(productsData[i]);\n\t\t }\n\t\t\t//Upgrading sales services\n\t\t objectStore = db.createObjectStore(\"saleservice\", {keyPath: \"idsales\", autoIncrement: true});\n\t\t for (i in salesServices) {\n\t\t objectStore.add(salesServices[i]);\n\t\t }\n\t\t\t//Upgrading sales products\n\t\t objectStore = db.createObjectStore(\"saleproducts\", {keyPath: \"idsalep\", autoIncrement: true});\n\t\t for (i in salesProducts) {\n\t\t objectStore.add(salesProducts[i]);\n\t\t }\t\t\n\t\t}\n\t\topenRequest.onsuccess = e => {\n\t\t\tdb = openRequest.result;\n\t\t\tconsole.log(\"success: \"+ db);\n\t\t\tcallback(db);\n\t\t}\n\t\topenRequest.onerror = e => {\n\t\t\tconsole.log(\"Error\");\n\t\t\tconsole.dir(e);\n\t\t}\n\t} else {\n\t\twindow.alert(\"PetShop requires IndexedDB and it isn't available in your browser :( \");\n\t}\n}", "function validate() {\n //always valid\n return null;\n }", "async initializeDataLoad(schema) {\n await this.createTargetDatabase(schema);\n }", "function doValidation() {\n //If the step required is not in the checked steps and the value is undefined, so don't validate it\n if (!rule.global && (currentValue === undefined || currentValue === null)) {\n return;\n }\n\n for (var keyPropRule in rule.validationRules) {\n if (rule.validationRules.hasOwnProperty(keyPropRule)) {\n if (isContainsSteps(steps, rule.validationRules[keyPropRule].steps)) {\n var fn = _functions[rule.validationRules[keyPropRule].fn];\n\n if (common.isFunction(rule.validationRules[keyPropRule].params.value)) {\n validationResult = fn.call(this, currentValue, rule.validationRules[keyPropRule].params.value.call(this));\n } else {\n validationResult = fn.call(this, currentValue, rule.validationRules[keyPropRule].params);\n }\n\n if (common.isObject(validationResult)) {\n if (!validationResult.result) {\n if (validationResult.error) {\n error = validationResult.error;\n } else {\n error = keyPropRule;\n }\n\n params = rule.validationRules[keyPropRule].params;\n\n validationResult = validationResult.result;\n\n return;\n }\n\n validationResult = true;\n } else if (!validationResult) {\n error = keyPropRule;\n params = rule.validationRules[keyPropRule].params;\n\n return;\n }\n }\n }\n }\n }", "function getVersionData() {\n // Prepping vars & checking if there is data available\n const curr = GlobalData.fxServerVersion;\n const rVer = globals.databus.updateChecker;\n if(!rVer){\n return {\n artifactsLink: false,\n color: false,\n message: false,\n subtext: false,\n };\n }\n const versionData = {\n artifactsLink: rVer.artifactsLink,\n color: false,\n message: false,\n subtext: false,\n };\n\n //Processing version data\n try {\n if(curr < rVer.critical){\n versionData.color = 'danger';\n versionData.message = 'A critical update is available for FXServer, you should update now.';\n versionData.subtext = (rVer.critical > rVer.recommended)\n ? `(critical update ${curr} ➤ ${rVer.critical})`\n : `(recommended update ${curr} ➤ ${rVer.recommended})`;\n \n }else if(curr < rVer.recommended){\n versionData.color = 'warning';\n versionData.message = 'A recommended update is available for FXServer, you should update.';\n versionData.subtext = `(recommended update ${curr} ➤ ${rVer.recommended})`;\n \n }else if(curr < rVer.optional){\n versionData.color = 'info';\n versionData.message = 'An optional update is available for FXServer.';\n versionData.subtext = `(optional update ${curr} ➤ ${rVer.optional})`;\n }\n\n } catch (error) {\n logError(`Error while processing changelog. Enable verbosity for more information.`);\n if(GlobalData.verbose) dir(error);\n }\n\n return versionData;\n}", "fromValidation(aValidation) {\n return require('folktale/conversions/validation-to-maybe')(aValidation);\n }", "preValidate(key, value, errors, values) {}", "function UploadInputChange(el_input) {\n console.log( \" ==== UploadInputChange ====\");\n console.log(\"el_input: \", el_input);\n // only input fields are: \"uc_corr_amount\", \"uc_corr_meetings\"\n\n// --- upload changes\n if (permit_dict.permit_crud){\n const tblRow = t_get_tablerow_selected(el_input);\n const data_field = get_attr_from_el(el_input, \"data-field\");\n console.log(\"data_field: \", data_field);\n if(tblRow){\n const data_dict = usercompensation_dicts[tblRow.id];\n if (data_dict){\n const new_value = (el_input.value && Number(el_input.value)) ? Number(el_input.value) : 0;\n const old_value = (data_dict[data_field]) ? data_dict[data_field] : null;\n // ??? (data_field === \"uc_corr_meetings\") ? data_dict.uc_meetings : 0;\n\n console.log(\"old_value: \", old_value);\n console.log(\"data_dict: \", data_dict);\n const max_meetings = 2;\n const amount_or_meetings = (data_field === \"uc_corr_amount\") ? data_dict.uc_amount :\n (data_field === \"uc_corr_meetings\") ? data_dict.uc_meetings : 0\n\n const not_valid_txt = [loc.Correction, \" '\", el_input.value, \"'\", loc.is_not_valid, \"<br>\"].join(\"\");\n let msg_txt = null;\n if (el_input.value && !Number(el_input.value)){\n msg_txt = [not_valid_txt, loc.must_enter_whole_number].join(\"\");\n\n // the remainder / modulus operator (%) returns the remainder after (integer) division.\n } else if(new_value % 1) {\n msg_txt = [not_valid_txt, loc.must_enter_whole_number].join(\"\");\n\n } else if (amount_or_meetings + new_value < 0 ){\n msg_txt = [not_valid_txt, loc.cannot_deduct_more_than_original_number].join(\"\");\n\n } else if (data_field === \"uc_corr_meetings\" && amount_or_meetings + new_value > max_meetings ) {\n msg_txt = [not_valid_txt, loc.Total_number_meetings_cannot_be_greater_than, max_meetings, \".\"].join(\"\");\n };\n\n if (msg_txt){\n const msg_html = [\"<p class='border_bg_invalid p-2'>\", msg_txt, \"</p>\"].join(\"\");\n b_show_mod_message_html(msg_html);\n el_input.value = old_value;\n\n } else {\n let upload_dict = {\n table: \"usercompensation\",\n mode: \"update\",\n usercompensation_pk: data_dict.uc_id\n };\n const db_field = (data_field === \"uc_corr_amount\") ? \"correction_amount\" :\n (data_field === \"uc_corr_meetings\") ? \"correction_meetings\" : \"-\";\n upload_dict[db_field] = new_value;\n UploadChanges(upload_dict, urls.url_usercompensation_upload);\n };\n };\n };\n };\n } // UploadInputChange", "validateOnChange(e) {\n // only update the validation for this field\n return this.validate(e, true);\n }", "function validateChange (input) {\n const schema = Joi.object({\n nameOfCollector: Joi.string()\n .required()\n .min(3)\n .max(50),\n\n amount: Joi.number()\n .required()\n .min(0),\n\n genderOfCollector: Joi.string()\n .required()\n .min(4)\n .max(6)\n });\n\n const result = schema.validate(input);\n return result;\n}", "_validate(initialValidation, programmaticValue, coerced, programmaticValueIsSet) {\n this._valuesHandler.validate(initialValidation, programmaticValue, programmaticValueIsSet);\n }", "get value() {\n this._maybeCompute();\n return this._state = 'complete' ? this._value : undefined;\n }", "async get(key) {\n // Lookup the value in our cache. We return the latest checkpointed value (which should be the value on disk)\n for (let index = this.checkpoints.length - 1; index >= 0; index--) {\n const value = this.checkpoints[index].keyValueMap.get(key.toString('binary'));\n if (value !== undefined) {\n return value;\n }\n }\n // Nothing has been found in cache, look up from disk\n const value = await super.get(key);\n if (this.isCheckpoint) {\n // Since we are a checkpoint, put this value in cache, so future `get` calls will not look the key up again from disk.\n this.checkpoints[this.checkpoints.length - 1].keyValueMap.set(key.toString('binary'), value);\n }\n return value;\n }", "function validateYupSchema(values, schema, sync, context) {\n if (sync === void 0) {\n sync = false;\n }\n\n if (context === void 0) {\n context = {};\n }\n\n var validateData = prepareDataForValidation(values);\n return schema[sync ? 'validateSync' : 'validate'](validateData, {\n abortEarly: false,\n context: context\n });\n}", "function validateYupSchema(values, schema, sync, context) {\n if (sync === void 0) {\n sync = false;\n }\n\n if (context === void 0) {\n context = {};\n }\n\n var validateData = prepareDataForValidation(values);\n return schema[sync ? 'validateSync' : 'validate'](validateData, {\n abortEarly: false,\n context: context\n });\n}", "function validateYupSchema(values, schema, sync, context) {\n if (sync === void 0) {\n sync = false;\n }\n\n if (context === void 0) {\n context = {};\n }\n\n var validateData = prepareDataForValidation(values);\n return schema[sync ? 'validateSync' : 'validate'](validateData, {\n abortEarly: false,\n context: context\n });\n}", "function validateYupSchema(values, schema, sync, context) {\n if (sync === void 0) {\n sync = false;\n }\n\n if (context === void 0) {\n context = {};\n }\n\n var validateData = prepareDataForValidation(values);\n return schema[sync ? 'validateSync' : 'validate'](validateData, {\n abortEarly: false,\n context: context\n });\n}", "function validateYupSchema(values, schema, sync, context) {\n if (sync === void 0) {\n sync = false;\n }\n\n if (context === void 0) {\n context = {};\n }\n\n var validateData = prepareDataForValidation(values);\n return schema[sync ? 'validateSync' : 'validate'](validateData, {\n abortEarly: false,\n context: context\n });\n}" ]
[ "0.51111925", "0.50718504", "0.4980221", "0.49248552", "0.48824722", "0.4878055", "0.48144794", "0.47584155", "0.47560233", "0.47282618", "0.47135982", "0.47014138", "0.46864286", "0.4670959", "0.46695036", "0.46513745", "0.46497405", "0.46280164", "0.46182457", "0.46181858", "0.4616731", "0.46159518", "0.4606562", "0.45818767", "0.45776573", "0.45613226", "0.45442978", "0.45315385", "0.4522235", "0.45178252", "0.45175982", "0.45091638", "0.45091638", "0.45054433", "0.44986102", "0.44869465", "0.4483772", "0.44798434", "0.4475074", "0.4473072", "0.44562244", "0.44361666", "0.44358647", "0.4434104", "0.44310114", "0.44294", "0.4427187", "0.44182718", "0.4416008", "0.44154802", "0.44132903", "0.44117373", "0.4409348", "0.4406786", "0.44065437", "0.4400306", "0.43997365", "0.4399281", "0.43939197", "0.43869618", "0.4383207", "0.43753016", "0.43750226", "0.43734723", "0.43669733", "0.43617785", "0.4357985", "0.43559822", "0.43519706", "0.4351011", "0.4349811", "0.43494633", "0.4349019", "0.43441674", "0.43433967", "0.43431306", "0.43416065", "0.43399033", "0.4333084", "0.43296492", "0.43232694", "0.43230388", "0.43226054", "0.43129063", "0.4311503", "0.43094048", "0.42951107", "0.4295039", "0.42840433", "0.4282353", "0.42808637", "0.42798546", "0.42795932", "0.4271786", "0.42670736", "0.42663935", "0.42663935", "0.42663935", "0.42663935", "0.42663935" ]
0.6279358
0
Save process: Validate the value
save(key, val) { return __awaiter(this, void 0, void 0, function* () { this.schemaRegistry.validate(val); yield this.saveItem(key, val); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "save() {\n try{\n validateUserData()\n }catch(err) {\n \n }\n }", "function save() {\n validateFinanceCube();\n }", "function saveValidity()\r\n{\r\n\tupdateGateKpr(arrEntp[gArrayIndex]);\r\n}", "function onSave(type){\r\n\t//validating Cheque Number\r\n\tconsole.log(\"***** on Save fired ****\");\r\n\tvar okToSave=true;\r\n var sentby_cheque = nlapiGetFieldValue(\"custbody_tsa_sentbycheque\");\r\n \tvar sentby_cash = nlapiGetFieldValue(\"custbodytsa_sentbycash\");\r\n var sentby_bank = nlapiGetFieldValue(\"custbody_tsa_sentbybankcr\");\r\n \r\n var chequeNr = nlapiGetFieldValue(\"custbody_tsa_nsichequenum\");\r\n\tvar chequeNr_Field = nlapiGetField('custbody_tsa_nsichequenum');\r\n \r\n \tvar bank_acc = nlapiGetFieldValue(\"custpage_first_line_account\");\r\n\t\r\n \r\n if ( sentby_cheque==\"F\" && sentby_cash==\"F\" && sentby_bank==\"F\" ) {\r\n\t window.require(['N/translation'], function (translation) { // translations added by Viktor S. 04/2019\r\n\t\t\tvar msg_sentby_not_ticked = translation.get({collection: 'custcollection__tsa_collection_01', key: 'MSG_SENTBY_NOT_TICKED', locale: translation.Locale.CURRENT })();\r\n\t\t\talert(msg_sentby_not_ticked);\r\n\t\t});\r\n return false;\r\n }\r\n \r\n if(sentby_cheque==\"T\"){\r\n\t\tconsole.log(\"sentby is cheque\");\r\n\t\tokToSave= !!chequeNr;\r\n\t\t \r\n\t\tlocalStorage.setItem(\"field_label\", chequeNr_Field.getLabel() );\r\n\t\tif(!okToSave){\r\n\t\t\twindow.require(['N/translation'], function (translation) { \r\n\t\t\t\tvar msg_pls_enter_value = translation.get({collection: 'custcollection__tsa_collection_01', key: 'MSG_PLS_ENTER_VALUE', locale: translation.Locale.CURRENT })();\r\n\t\t\t\tvar field_label=localStorage.getItem(\"field_label\");\r\n\t\t\t\tconsole.log(\"in the window...\");\r\n\t\t\t\talert(msg_pls_enter_value+\" \"+field_label);\r\n\t\t\t});\r\n\t\t} \r\n }\r\n else{\r\n nlapiSetFieldValue(\"custbody_tsa_nsichequenum\",\"\",false,false);\r\n }\r\n\r\n if(sentby_bank==\"T\"){\r\n\t\tconsole.log(\"sentby is bank\");\r\n\t\tokToSave= !!bank_acc;\r\n\t\tif(!okToSave){\r\n\t\t\twindow.require(['N/translation'], function (translation) { \r\n\t\t\t\tvar msg_pls_enter_value = translation.get({collection: 'custcollection__tsa_collection_01', key: 'MSG_PLS_SELECT_BANK', locale: translation.Locale.CURRENT })();\r\n\t\t\t\tconsole.log(\"in the window...\");\r\n\t\t\t\talert(msg_pls_enter_value);\r\n\t\t\t});\r\n\t\t}\r\n }\r\n else{ }\r\n \r\n return okToSave;\r\n}", "save() {\n this._requireSave = true;\n }", "function validateSave() {\n savedTotal += saveAll;\n let savedNumber = document.getElementById(\"saved-number\");\n savedNumber.innerHTML = `${savedTotal} rescued`;\n }", "save() {}", "function SaveForm() {\n debugger;\n \n ValidateChequeNo();\n}", "function saveValue() {\r\n\tvar attrDescText = document.getElementById(\"attrDescInptId\").value;\r\n\tvar attrFullDescText = document.getElementById(\"attrFullDescInptId\").value;\r\n\t//var attributeOrder = document.getElementById(\"attrOrderInptId\").value;\r\n\tvar userProfile = document.getElementById(\"inputUserProfileInpt\").options[document.getElementById(\"inputUserProfileInpt\").selectedIndex].value;\r\n\tvar userProfileText = document.getElementById(\"inputUserProfileInpt\").options[document.getElementById(\"inputUserProfileInpt\").selectedIndex].text;\r\n\tif(validateValue(attrDescText, attrFullDescText, \"VAL\")) {\r\n\t\tvar newUserProf = Spine.Model.sub();\r\n\t\tnewUserProf.configure(\"/admin/contentconfig/saveValue\", \"attrDescTextVal\", \"userProfileVal\", \"userProfileId\", \"attrFullDescText\", \"createdBy\");\r\n\t\tnewUserProf.extend( Spine.Model.Ajax );\r\n\t\t//Populate the model with data to transfer\r\n\t\tvar modelPopulator = new newUserProf({ \r\n\t\t\tattrDescTextVal: attrDescText,\r\n\t\t\tuserProfileVal: userProfileText,\r\n\t\t\tuserProfileId: userProfile,\r\n\t\t\tattrFullDescText: attrFullDescText,\t\t\t\r\n\t\t\tcreatedBy: sessionStorage.getItem(\"jctEmail\")\r\n\t\t});\r\n\t\tmodelPopulator.save(); //POST\r\n\t\tnewUserProf.bind(\"ajaxError\", function(record, xhr, settings, error) {\r\n\t\t\talertify.alert(\"Unable to connect to the server.\");\r\n\t\t});\r\n\t\tnewUserProf.bind(\"ajaxSuccess\", function(record, xhr, settings, error) {\r\n\t\t\tvar jsonStr = JSON.stringify(xhr);\r\n\t\t\tvar obj = jQuery.parseJSON(jsonStr);\r\n\t\t\tvar statusCode = obj.statusCode;\r\n\t\t\tif(statusCode == 200) {\r\n\t\t\t\t//alertify.set({ delay: 2700 });\r\n\t\t\t\talertify.alert(\"Value has been successfully created.\");\r\n\t\t\t\tpopulateValueTable(obj.existingMappingList, \"ADD\");\t\t\r\n\t\t\t\tdocument.getElementById(\"attrDescInptId\").value = \"\";\r\n\t\t\t\tdocument.getElementById(\"attrFullDescInptId\").value = \"\";\r\n\t\t\t\t//disableAllfield();\r\n\t\t\t} else if(statusCode == 600) {\r\n\t\t\t\talertify.alert(\"Value already exists.\");\r\n\t\t\t} else if(statusCode == 602) {\r\n\t\t\t\talertify.alert(\"One profile should have maximum of 24 Values.\");\r\n\t\t\t} else if(statusCode == 500) {\r\n\t\t\t\t// Error Message\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n}", "'validateValue'(value) {}", "save () { if (this.name) saveValue(this.name, this.items); }", "function Save() {\n if ($('#ab041AddEdit').valid()) {\n if (vm.isNew) {\n dataContext.add(\"/api/ab041\",vm.ab041).then(function (data) {\n notify.showMessage('success', \"ab041 record added successfully!\");\n\t\t\t\t\t\twindow.location.hash = \"/ab041/\";\n });\n } else {\n dataContext.upDate(\"/api/ab041\", vm.ab041).then(function (data) {\n notify.showMessage('success', \"ab041 record updated successfully!\");\n\t\t\t\t\t\twindow.location.hash = \"/ab041/\";\n });\n }\n }\n }", "function Save() {\n if ($('#ab121sgAddEdit').valid()) {\n if (vm.isNew) {\n dataContext.add(\"/api/ab121sg\",vm.ab121sg).then(function (data) {\n notify.showMessage('success', \"ab121sg record added successfully!\");\n\t\t\t\t\t\twindow.location.hash = \"/ab121sg/\";\n });\n } else {\n dataContext.upDate(\"/api/ab121sg\", vm.ab121sg).then(function (data) {\n notify.showMessage('success', \"ab121sg record updated successfully!\");\n\t\t\t\t\t\twindow.location.hash = \"/ab121sg/\";\n });\n }\n }\n }", "save () {\n\n // Validate\n if (this.checkValidity()) {\n\n // Collect input\n this.info.item = this.collectInput();\n\n // Show modal\n this.modal.show();\n }\n }", "function save(onSaved) {\n\t\t// store as an object\n\t\tvar store = {};\n\n\t\t//required inputs\n\t\tif (!birthDateInput.value || !lifeInput.value) {\n\t\t\treturn;\n\t\t}\n\n\t\tstore[STORAGE_BIRTH_NAME] = birthDateInput.value;\n\t\tstore[STORAGE_LIFE_NAME] = parseInt(lifeInput.value);\n\t\tstore[STORAGE_FASTCOUNT_NAME] = fastCountInput.checked;\n\t\tstore[STORAGE_COLORS_NAME] = [backColInput.value, textColInput.value, numColInput.value];\n\n\t\t//CALLBACK TO FINISH UP\n\t\tchrome.storage.sync.set({data: store}, onSaved);\n\t}", "validateData(){\n this.hasSavedValues = false\n\n this.publicoAlvoSim > 0 ? this.hasSavedValues = true : null\n this.publicoAlvoALVA > 0 ? this.hasSavedValues = true : null\n this.publicoAlvoALVA > 0 ? this.hasSavedValues = true : null\n\n this.XER > 0 ? this.hasSavedValues = true : null\n this.COP > 0 ? this.hasSavedValues = true : null\n\n this.listaPrefixos.length > 0 ? this.hasSavedValues = true : null\n\n this.operacaoNaoVinculada > 0 ? this.hasSavedValues = true : null\n this.operacaoVinculada > 0 ? this.hasSavedValues = true : null\n this.operacaoVinculadaEmOutroNPJ > 0 ? this.hasSavedValues = true : null\n\n this.acordoRegPortalSim > 0 ? this.hasSavedValues = true : null\n this.acordoRegPortalNao > 0 ? this.hasSavedValues = true : null\n //this.acordoRegPortalDuplicados > 0 ? this.hasSavedValues = true : null\n\n this.estoqueNumber > 0 ? this.hasSavedValues = true : null\n this.fluxoNumber > 0 ? this.hasSavedValues = true : null\n \n this.duplicadoSimNao > 0 ? this.hasSavedValues = true : null\n this.analisadoSimNao > 0 ? this.hasSavedValues = true : null\n }", "function valid(){return validated}", "onSavePress() {\n\t\t\tvar sUrl = this._buildPreviewURL(this._buildReturnedURL());\n\t\t\tif (isValidUrl(sUrl) && this._areAllTextFieldsValid() && this._areAllValueStateNones()) {\n\t\t\t\tthis._close(this._buildReturnedSettings());\n\t\t\t} else {\n\t\t\t\tthis._setFocusOnInvalidInput();\n\t\t\t}\n\t\t}", "function save(value) {\n\t// handles domain parsing\n\tif(value == 'domains') {\n\t\tvar domains = [];\n\t\t//split values into array of values\n\t\tvar lines = $scope.data.domains.split('\\n');\n\t\tconsole.log(lines);\n\t\tfor(var i = 0;i < lines.length;i++){\n\t\t //code here using lines[i] which will give you each line\n\t\t //only pushes unique values\n\t\t if(!_.includes(domains, lines[i])){\n\t\t \tdomains.push(lines[i])\n\t\t }\n\t\t}\n\n\t\t$scope.data.thisOrg.domains = domains;\n\t}\n\n\t//save values\n\t$scope.data.thisOrg\n\t.$save()\n\t.then(function(){\n\t\tLogger.info('Successfully Updated')\n\t})\n}", "function SaveForm() {\n debugger;\n\n ValidateChequeNo();\n}", "forceValidate() {\n this.setValue(this.getValue());\n }", "save() {\n let value = this.state.value;\n if (value && value.length && typeof value === 'string') {\n this.props.onSave(this.state.value);\n this.setState({\n value: ''\n });\n }\n\n }", "function SaveValidation() {\n\n let valid = true;\n if ($('#txtComboName').val() == '') {\n $('#txtComboName').css({ 'border': '1px solid red' });\n $.pnotify({ text: 'Combo Code Requried', type: 'error' });\n $('#txtComboName').focus();\n valid = false;\n return valid;\n } else { $('#txtComboName').css({ 'border': '1px solid #aaa' }); }\n\n if ($('#txtDescription').val() == '') {\n $('#txtDescription').css({ 'border': '1px solid red' });\n $.pnotify({ text: 'Description Requried', type: 'error' });\n $('#txtDescription').focus();\n valid = false;\n return valid;\n } else { $('#txtDescription').css({ 'border': '1px solid #aaa' }); }\n\n //if ($(\"#ddlItemHead\").multipleSelect('getSelects').join(',') == \"\") {\n // $.pnotify({ text: 'Head Name Requried', type: 'error' });\n // valid = false;\n // return valid;\n //}\n let rowId = $(this).find('.delete').attr('data-id');\n let hdId = $('#ComboSetId').val();\n if (rowId != hdId) {\n let name = $(this).find('.name').text().toLowerCase().trim();\n let txtComboName = $('#txtComboName').val().toLowerCase().trim();\n if (name == txtComboName) {\n $.pnotify({ text: 'Name Already Exist', type: 'error' });\n valid = false;\n return valid;\n }\n }\n\n return valid;\n }", "save() {\n }", "onBeforeSaveEntity() {\n\t\tthis.resetValidation();\n\t\treturn this.validateEntity();\n\t}", "function save() {\n if (!pro) {\n $ionicPopup.alert({\n title: 'Pro Feature',\n template: 'Workouts can only be saved in Ruckus Pro. You can however still share!'\n });\n return false;\n }\n\n if (vm.saved) {\n return false;\n }\n workoutService.editOrCreate(saveSnapShot.date, saveSnapShot).then(function(res) {\n vm.saved = true;\n }, function(err) {\n log.log('there was an error with saving to the datastore' + err);\n });\n }", "save() {\n this._toggleSaveThrobber();\n try {\n this._readFromForm();\n var resp = this.dao.save();\n if (!resp) {\n alert(\"Error while saving taxon.\")\n } else {\n var jsonObj = JSON.parse(resp);\n if (jsonObj[0].response == false ) {\n alert(jsonObj[1].response);\n } else {\n console.log(this.dao)\n // make sure the latin name input field is showing the correct name, reload data from server\n document.getElementById('latin_name').value = this.dao.unique_name;\n alert('Saved');\n }\n }\n } catch(e) {\n alert(e);\n console.log(e);\n }\n this._toggleSaveThrobber();\n }", "function ProcessSave() {\n\n var Validate = CamposObligatorios();\n\n if (Validate == 0) {\n\n if ($(\"#BtnSave\").val() == \"Crear\") {\n transacionAjax_C_reate_And_U_pdate(\"C_reate\");\n }\n else {\n transacionAjax_C_reate_And_U_pdate(\"U_pdate\");\n }\n\n }\n}", "function form_saveRecord()\n{\n var valid = true;\n valid = hasClientAgreedToTerms();\n\treturn valid;\n}", "function IsSaveOkay() {\n var IsSaveOk = true;\n var RetentionCode = $(\"#txtRetentionCode\").val();\n var InActivityPeriod = $(\"#txtInactivityPeriod\").val() == \"\" ? 0 : $(\"#txtInactivityPeriod\").val();\n var OffitialLegalPeriod = $(\"#txtLegalPeriod\").val() == \"\" ? 0 : $(\"#txtLegalPeriod\").val();\n var OffitialRetentionPeriodUser = $(\"#txtRetentionPeriodUser\").val() == \"\" ? 0 : $(\"#txtRetentionPeriodUser\").val();\n var RetentionPeriodTotal = $(\"#txtRetentionPeriodTotal\").val() == \"\" ? 0 : $(\"#txtRetentionPeriodTotal\").val();\n\n var lstEventTypeList = $(\"#lstEventTypeList\").val();\n var lstEventTypeListOfficialRcd = $(\"#lstEventTypeListOfficialRcd\").val();\n\n if (InActivityPeriod == 0)\n $(\"#txtInactivityPeriod\").val(0);\n if (OffitialLegalPeriod == 0)\n $(\"#txtLegalPeriod\").val(0);\n if (OffitialRetentionPeriodUser == 0)\n $(\"#txtRetentionPeriodUser\").val(0);\n if (RetentionPeriodTotal == 0)\n $(\"#txtRetentionPeriodTotal\").val(0);\n\n\n if (RetentionCode.substring(1, 0) == \" \" && IsSaveOk == true) {\n showAjaxReturnMessage(vrRetentionRes[\"msgJsRetentionRetCodeCantBeginWithSpace\"], 'w');\n IsSaveOk = false;\n }\n\n if (((((parseFloat(InActivityPeriod) * 100) % 25) != 0) || parseFloat(InActivityPeriod) < 0 || parseFloat(InActivityPeriod) > 1000) && IsSaveOk == true) {\n showAjaxReturnMessage(vrRetentionRes[\"msgJsRetentionInActivityPeriodBet0To1000\"], 'w');\n IsSaveOk = false;\n }\n if (((((parseFloat(OffitialLegalPeriod) * 100) % 25) != 0) || parseFloat(OffitialLegalPeriod) < 0 || parseFloat(OffitialLegalPeriod) > 1000) && IsSaveOk == true) {\n showAjaxReturnMessage(vrRetentionRes[\"msgJsRetentionLegalRetPeriodBet0To1000\"], 'w');\n IsSaveOk = false;\n }\n if (((((parseFloat(OffitialRetentionPeriodUser) * 100) % 25) != 0) || parseFloat(OffitialRetentionPeriodUser) < 0 || parseFloat(OffitialRetentionPeriodUser) > 1000) && IsSaveOk == true) {\n showAjaxReturnMessage(vrRetentionRes[\"msgJsRetentionUserRetPeriodBet0To1000\"], 'w');\n IsSaveOk = false;\n }\n if (((lstEventTypeList == \"\" || lstEventTypeList == null) && parseFloat(InActivityPeriod) > 0) && IsSaveOk == true) {\n showAjaxReturnMessage(vrRetentionRes[\"msgJsRetentionInActivityEventTypeReqIfInAct\"], 'w');\n IsSaveOk = false;\n }\n if (((lstEventTypeListOfficialRcd == \"\" || lstEventTypeListOfficialRcd == null) && parseFloat(RetentionPeriodTotal) > 0) && IsSaveOk == true) {\n showAjaxReturnMessage(vrRetentionRes[\"msgJsRetentionRetEventTypeReqIfLegalOrUser\"], 'w');\n IsSaveOk = false;\n }\n\n return IsSaveOk;\n}", "static async saveValidation(resp, key){\n return new Promise ((resolve, reject) => {\n dbVal.put(key,resp,(err)=>{\n if (err){\n reject(err);\n }\n resolve(resp);\n })\n })\n }", "function saveBookingInfo() {\n\n // Make sure all default values are set.\n EventFormData.bookingInfo = angular.extend({}, {\n url : '',\n urlLabel : 'Reserveer plaatsen',\n email : '',\n phone : '',\n availabilityStarts : EventFormData.bookingInfo.availabilityStarts,\n availabilityEnds : EventFormData.bookingInfo.availabilityEnds\n }, $scope.bookingModel);\n\n $scope.savingBookingInfo = true;\n $scope.bookingInfoError = false;\n\n var promise = eventCrud.updateBookingInfo(EventFormData);\n promise.then(function() {\n controller.eventFormSaved();\n $scope.bookingInfoCssClass = 'state-complete';\n $scope.savingBookingInfo = false;\n $scope.bookingInfoError = false;\n }, function() {\n $scope.savingBookingInfo = false;\n $scope.bookingInfoError = true;\n });\n }", "async save() {\n\n await this.validate()\n\n let result\n\n if (this.doc._id)\n result = await Model._update(this.doc)\n else\n result = await Model._store(this.doc)\n \n this.doc = {\n ...this.doc,\n _id: result.id,\n _rev: result.rev,\n }\n\n return result.ok\n }", "save(){\n //\n }", "validate( _value, _utils ) {\n\t\t\treturn false;\n\t\t}", "function validate(){\n\n\t\t//TODO: make this work\n\n\n\t}", "saveData() {\n if (this.s.unavailable()) {\n return;\n }\n\n for (const val of this.dispField.items) {\n this.s.set(val, this.dispField.checked(val));\n }\n\n this.s.set(\"unit\", this.unitField.get());\n this.s.set(\"format\", this.formatField.get());\n this.s.set(\"sort\", this.sortableField.toArray());\n }", "handleSave() {\n if (this.checkModified()) {\n const userId = localStorage.getItem(\"userId\");\n const data = {\n user_id: userId,\n sex: this.state.value\n };\n this.setState({ isSaving: true });\n this.props\n .setSex(this.state.survivorId, data)\n .then(() => {\n this.handleClose();\n })\n .catch(err => {\n this.setState({ isSaving: false });\n console.warn(\"error\", err);\n });\n } else {\n this.handleClose();\n }\n }", "async save() {\n // Check if anything has changed or stop here.\n const originData = await loadDataObject(this.dataKey)\n\n if (this.data === originData) {\n console.log('Nothing changed here for ' + this.dataKey)\n return\n }\n\n // Convert the modified data for the backend.\n const convertedData = await convertNewData(\n this.dataKey,\n JSON.parse(JSON.stringify(this.data))\n )\n\n // Update the data on the backend.\n try {\n await ApiConnector.update(this.dataKey, convertedData)\n } catch (err) {\n // TODO: Show the error to the user.\n console.log('Message: ' + err.message)\n }\n }", "_save() {\n // fixme it's calling blur & create at same time\n this.props.onSave(this.state.value);\n }", "function trySave() {\n exam.display && exam.display.saving(true);\n var saved = pipwerks.SCORM.save();\n if(!saved) {\n Numbas.display.showAlert(R('scorm.failed save'),function(){\n setTimeout(trySave,1);\n });\n }\n else {\n exam.display && exam.display.saving(false);\n }\n }", "afterValidChange() { }", "function Save() {\n debugger;\n var $form = $('#SupplierPaymentForm');\n if ($form.valid()) {\n ValidatePaymentRefNo();\n }\n else {\n notyAlert('warning', \"Please Fill Required Fields,To Add Items \");\n }\n}", "function save() {\n var dfd = $.Deferred();\n model.proxy.write(data).done(function (value) {\n $.extend(true, data, value, readOnlyData);\n dfd.resolve(data);\n }).fail(function (e) {\n dfd.reject();\n });\n return dfd.promise();\n }", "save(num) {\n this.num = num;\n return `${num} is saved`;\n }", "onSaving() {\n var ptr = this;\n this.formView.applyValues();\n this.record.save(function () {\n ptr.onSaved();\n });\n this.saving.raise();\n }", "function btnSaveOnClickEvent() {\n $('#btnSave').click(function() {\n// var in_additional_remarks = $('#txtInvoiceAdditionalRemarks');\n// if(in_additional_remarks.val() === '') {\n// alert('Please Enter Invoice Additional Remark Before Save!');\n// scrollTo(in_additional_remarks.attr('id'));\n// in_additional_remarks.focus();\n// return false;\n// }\n \n var confirm = window.confirm('Are You Sure Wanna Save This Form?');\n if(!confirm) {\n return false;\n }\n $('input.fromDO, select.fromDO, textarea.fromDO').attr('disabled', false);\n // for change gst hidden value base on display setting invoice gst element\n var invoiceGstDisplay = removeNumberFormat($('#txtInvoiceGST').val());\n var gstHidden = $('#txtGST');\n gstHidden.val(parseFloat(invoiceGstDisplay));\n // alert(gstHidden.val());\n \n injectIntentionInputElementIntoForm('Save');\n $('#frm').submit();\n });\n}", "@action\n setSaving(id, value) {\n // When saving, reset error state\n this.setError(id, false);\n this.setFieldState(id, FormState.SAVING, value);\n this.setFieldState(id, FormState.READY, !value);\n }", "function save() {\n //验证表单\n if (!$(\"#editForm\").validate())\n return false;\n var strData = \"{\";\n strData += \"'strItemID':'\" + $(\"#ItemID\").val() + \"',\";\n strData += \"'strCharge':'\" + $(\"#CHARGE\").val() + \"',\";\n strData += \"'strPowerFee':'\" + $(\"#TEST_POWER_FEE\").val() + \"',\";\n strData += \"'strPreFree':'\" + $(\"#PRETREATMENT_FEE\").val() + \"',\";\n strData += \"'strTestAnsyFree':'\" + $(\"#TEST_ANSY_FEE\").val() + \"',\";\n strData += \"'strTestPointNum':'\" + $(\"#TEST_POINT_NUM\").val() + \"',\";\n strData += \"'strAnsyNum':'\" + $(\"#ANALYSE_NUM\").val() + \"'\";\n strData += \"}\";\n\n $.ajax({\n cache: false,\n type: \"POST\",\n url: \"ItemPrice.aspx/EditItem\",\n data: strData,\n contentType: \"application/json; charset=utf-8\",\n dataType: \"json\",\n success: function (data, textStatus) {\n if (data.d == \"1\") {\n detailWin.hidden();\n manager.loadData();\n clearDialogValue();\n }\n else {\n $.ligerDialog.warn('保存项目数据失败!');\n }\n }\n });\n }", "validate(_value, _utils) {\n return false;\n }", "save() {\n return null;\n }", "function setSave(e) {\n e.preventDefault();\n character.savingThrowModifier.strength = document.getElementById('strSave').value;\n character.savingThrowModifier.dexterity = document.getElementById('dexSave').value;\n character.savingThrowModifier.constitution = document.getElementById('conSave').value;\n character.savingThrowModifier.intelligence = document.getElementById('intSave').value;\n character.savingThrowModifier.wisdom = document.getElementById('wisSave').value;\n character.savingThrowModifier.charisma = document.getElementById('chaSave').value;\n}", "function saveObjectIntoDB(Object){\r\n\r\nconsole.log(\"saved: \"+Object);\r\nObject.save(function(error) {\r\n if (error) {\r\n console.error(error);\r\n return false;\r\n }\r\n })\r\n return true;\r\n \r\n}", "function saveObjectIntoDB(Object){\r\n\r\nconsole.log(\"saved: \"+Object);\r\nObject.save(function(error) {\r\n if (error) {\r\n console.error(error);\r\n return false;\r\n }\r\n })\r\n return true;\r\n \r\n}", "save() {\n return null;\n }", "saveUpdatedSettings(event) {\n let inputElement = event.target;\n if (inputElement.getAttribute(\"type\") === \"number\") {\n if (inputElement.value.match(/[0-9]+/)) {\n inputElement.removeAttribute(\"invalidInput\");\n }\n else {\n inputElement.setAttribute(\"invalidInput\", \"true\");\n return;\n }\n }\n if (inputElement.getAttribute(\"type\") === \"checkbox\") {\n RoKA.Preferences.set(inputElement.id, inputElement.checked);\n }\n else {\n RoKA.Preferences.set(inputElement.id, inputElement.value);\n }\n }", "async save() {\n return;\n }", "function validateCheck() {\n\n setActivityCardRules($scope.cardRules.value());\n setSpecialUsePackages($scope.specialPackages.value());\n generateCodeAuto();\n service.validate($scope.activity).success(function () {\n $scope.save();\n }).error(function (error) {\n console.log('error -> ', error);\n });\n }", "function save() {\n Bar.createWithConfig(dataForm.name, dataForm.frequency, PoP.getFinalStatements().getItem(dataForm.final_statement))\n .then(() => {\n goBack();\n return Promise.resolve()\n })\n .catch(error => {\n console.log(error);\n console.dir(error);\n console.trace();\n\n Dialog.alert({\n title: \"Error\",\n message: error,\n okButtonText: \"Ok\"\n });\n\n return Promise.reject(error);\n });\n\n\n\n\n}", "function actuallySave() {\n var inputs = document.getElementsByTagName('input');\n var data = {\n details: details\n };\n var isDefault = true;\n for(var i = 0; i < inputs.length; ++i) {\n if(inputs[i].type == 'checkbox') {\n data[inputs[i].id] = inputs[i].checked;\n if(isDefault && inputs[i].checked != (DEFAULT_FALSE.indexOf(inputs[i].id) === -1)) {\n isDefault = false;\n }\n }\n else {\n data[inputs[i].id] = inputs[i].value;\n if(isDefault && inputs[i].value) {\n isDefault = false;\n }\n }\n }\n twitch.configuration.set('broadcaster', CONFIG_VERSION, JSON.stringify(data));\n document.getElementById(\"reset\").disabled = isDefault;\n if(saveCallTimeout) {\n clearTimeout(saveCallTimeout);\n }\n saveCallTimeout = undefined;\n hideUnsaved();\n }", "function onSaveSuccess(data, response, xhr)\n\t{\n\t\tthis.sidebar.layout.removeClass('saving');\n\t\tthis.data.field = data.field;\n\t\tLiveUpdater.changedModel(this.data.field);\n\t}", "updateToStore() {\r\n if (this.props.formSetValue)\r\n this.props.formSetValue(this.props.inputProps.name, this.fieldStatus.value, this.fieldStatus.valid, this.fieldStatus.dirty, this.fieldStatus.visited);\r\n }", "updateToStore() {\r\n if (this.props.formSetValue)\r\n this.props.formSetValue(this.props.inputProps.name, this.fieldStatus.value, this.fieldStatus.valid, this.fieldStatus.dirty, this.fieldStatus.visited);\r\n }", "saveDegreeRecord() {\n this.$validator.validate('name_degree')\n .then(result => {\n if (result) {\n // Prepare data\n let data = {\n id: this.tempRecord.id,\n name: this.tempRecord.name,\n url: '/degrees',\n function: 'createDegrees',\n };\n\n this.isLoading = true;\n if (0 == data.id) {\n this.createRecord(data);\n } else {\n data.url = '/degrees/' + data.id;\n data.function = 'updateDegrees';\n this.updateRecord(data);\n }\n\n return;\n }\n let err = Helper.generateErrorString();\n demo.showNotification(err, 'warning');\n });\n }", "async postSave () {\n\t}", "function save_form_field(field) {\n\n\tvar obj= {};\n\tobj[field] = document.getElementById(field).value;\n\tif (obj[field].length > 0) {\n\t\tchrome.storage.local.set(obj, function () {console.log(\"saved \" + field + \"/ value = \" + document.getElementById(field).value);});\n\t}\n\n}", "function onSaveSuccess(data, response, xhr)\n\t{\n\t\t// update id's and scope in case they change\n\t\t// this happens when switching from global\n\t\t// to page specific fields (switching scope)\n\t\tthis.data.node.data = data;\n\t\tthis.data.node.data.originals = this.originals;\n\t\tthis.data.field = this.data.node.data;\n\n\t\tthis.view.empty();\n\t\tthis.view.append(this.renderField(this.data.field, true));\n\t\tthis.sidebar.layout.removeClass('saving');\n\t\tLiveUpdater.changedField(this.data.field);\n\t}", "validate() { }", "function saveChanges() {\n $(\"form\").children().prop(\"disabled\", false);\n // TODO: send the modified info to webserver.\n $(\"form\").validate({\n rules: {\n Name: {\n required: true,\n minlength: 3,\n notEqualTo: invalidStrings\n },\n Surname: {\n required: true,\n minlength: 3,\n notEqualTo: invalidStrings\n },\n Birthdate: {\n required: true,\n date: true\n },\n PhoneNumber: {\n required: true,\n number: true,\n minlength: 5,\n maxlength: 10\n },\n Email: {\n required: true,\n email: true\n },\n IVA: {\n required: true,\n minlength: 5,\n maxlength: 20,\n notEqualTo: invalidStrings\n }\n }\n });\n }", "async handleSave() {\n\n console.log(\"HANDLE!\")\n await this.setState({eroareValidare: \"\"})\n\n if (!this.state.intrebare || this.state.intrebare.length < 5) {\n await this.setState({eroareValidare: \"Intrebarea trebuie sa aiba cel putin 5 caractere!\"})\n }\n\n //Verificare daca exista cel putin 2 variante de raspuns\n if (this.state.varianteRaspuns.length < 2){\n await this.setState({eroareValidare: \"Trebuie cel putin 2 variante de raspuns!\"})\n }\n\n if (this.state.eroareValidare.length === 0) {\n //Este ok\n //Construim intrebarea asa cum trebe\n //Si dam mai departe prin callbackul (functia stabilita de parinte prin care poate fi notificat) din props catre parinte\n\n this.props.onSave({\n tip: this.getTipIntrebare(),\n detalii: {\n titlu: this.state.intrebare,\n optiuni: this.state.varianteRaspuns\n }\n })\n }\n else{\n this.setState({snackbar: true});\n }\n\n }", "save(saveVal) {\n var that = this\n\n this.dataCache = saveVal\n\n if(this.defaultValues[this.saveKey].type === 'int') {\n saveVal = parseInt(saveVal)\n } else if(this.defaultValues[this.saveKey].type === 'array') {\n saveVal = JSON.stringify(saveVal)\n }\n\n return new Promise(function(resolve, reject) {\n if(cc.sys.isNative) {\n var path = jsb.fileUtils.getWritablePath()\n jsb.fileUtils.writeToFile({data: saveVal}, path + that.saveKey)\n } else {\n cc.sys.localStorage.setItem(that.saveKey, saveVal)\n }\n return resolve()\n })\n }", "function saveForm() {\n if (isNaN(inputTel.value)) {\n const newP = document.createElement('p');\n const textVal = document.createTextNode('Solo se aceptan números en el campo de Telefono');\n newP.appendChild(textVal);\n formContainer.appendChild(newP);\n } else {\n console.log('inside save funct');\n localStorage.setItem('nombre', inputNombre.value);\n localStorage.setItem('apellido', inputApellido.value);\n localStorage.setItem('tel', inputTel.value);\n localStorage.setItem('dir', inputDir.value);\n localStorage.setItem('obs', inputObs.value);\n console.log('data saved');\n }\n}", "processSid() {\n let input = this.sid\n resetError(input)\n this.changed = true\n\n if (isEmpty(input)) {\n this.valid = false\n } else if (isNumber(input)) {\n this.valid = false\n } else if (exact(input, 10)) {\n this.valid = false\n } else {\n input.success = true\n this.valid = true\n }\n }", "function saveEmployee() {\n\tif(!document.getElementById(\"hiddenRefid\"))\n\t\treturn;\n\tif(!confirm(_(\"Are you sure you want to update this employee's information?\")))\n\t\treturn;\n\t\n\tvar inpToilAdjustment = document.getElementById(\"toilAdjustment\"); \t\n\tvar inpHolsAdjustment= document.getElementById(\"holsAdjustment\");\n\t\t\n\tvar employee = new Employee();\n\temployee.refid = parseInt(document.getElementById(\"hiddenRefid\").value);\n\temployee.userType = parseInt(document.getElementById(\"userType\").value);\n\temployee.minHours = parseFloat(document.getElementById(\"minHours\").value);\n\temployee.variable = document.getElementById(\"variable\").checked;\n\temployee.toilAdjustment = parseFloat(inpToilAdjustment.value);\n\temployee.toilAdjustmentDate = trim(document.getElementById(\"toilAdjustmentDate\").value);\n\temployee.toilAdjustmentComment = trim(document.getElementById(\"toilAdjustmentComment\").value);\n\temployee.holsAdjustment = parseFloat(inpHolsAdjustment.value);\n\temployee.holsAdjustmentComment = trim(document.getElementById(\"holsAdjustmentComment\").value);\n\temployee.authorizes_subordinates = document.getElementById(\"authorizes_subordinates\").checked;\n\temployee.authorizes_invoice_codes = document.getElementById(\"authorizes_invoice_codes\").checked;\n\temployee.enrolled = document.getElementById(\"enrolled\").checked;\n\temployee.save();\n}", "function check_save_required(){\n\tif(save_required){\n\t\treturn 'Please note that you have unsaved data. If you leave this page, you will lose all changes that took place after your last save.';\n\t}\n}", "function validate(){\n let errors = {}\n if (error && values !== stateValues){\n setSavingStarted(false)\n setStateValues(values)\n }\n \n return errors\n }", "function setPurchase() {\r\n\tif (validateForm() == true) {\r\n\t\tif (validateLength() == true) {\r\n\t\t\t\r\n\t\t\tvar data = savePurchaseOrder();\r\n\t\t\tconsole.log(data);\r\n\t\t\t\tif (data == \"\") {\r\n\t\t\t\t\tbootstarpAlert('', 'Error while saving Purchase order', true,\r\n\t\t\t\t\t'danger',3000);\r\n\t\t\t\t}\r\n\t\t\t\t// for data saved successfully\r\n\t\t\t\telse {\r\n\t\t\t\t\tbootstarpAlert('', 'Data saved successfully for purchase order Id '+data+' please use save and process button to process order at WMS', true,\r\n\t\t\t\t\t'success',6000);\r\n\t\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n}", "function validate_variablesOnSave(){\n\tdocument.getElementById(\"errorMessage\").innerHTML=''\n\tvalid = true;\n\ttry {\n\t\tif (!validateTextareaSize()) {valid = false;}\n\t\tif (!validateIndrateUniq()) {valid = false;}\n\t\tvar isLimitIssue = document.getElementById(\"isLimitIssue\");\n\t\tvar isLimitIssueChk = document.getElementById(\"isLimitIssue\").checked;\n\t\tvar isDebtLimitChk = document.getElementById('isDebtLimit').checked;\n\t\t\n\t\tvar limitSum = document.getElementById('limit_sum');\n\t\tvar limitIssue = document.getElementById('limitIssue');\n\t\tvar debtLimit = document.getElementById('debtLimit');\n\t\t\n\t\tif ((!isLimitIssueChk) && (!isDebtLimitChk) && (limitSum.value == \"\")) {\n\t\t\tdocument.getElementById(\"errorMessage\").style.display = \"inline\";\n\t\t\tdocument.getElementById(\"errorMessage\").innerHTML=document.getElementById(\"errorMessage\").innerHTML+\n\t\t\t\t'Необходимо заполнить поле \"Сумма сделки\" в секции \"Основные параметры сделки\"<br /><br />';\n\t\t\tvalid = false;\t\n\t\t}\n\t\tif ((isLimitIssueChk) && (limitIssue.value == \"\")) {\n\t\t\tdocument.getElementById(\"errorMessage\").style.display = \"inline\";\n\t\t\tdocument.getElementById(\"errorMessage\").innerHTML=document.getElementById(\"errorMessage\").innerHTML+\n\t\t\t\t'Необходимо заполнить поле \"Сумма лимита выдачи\" в секции \"Основные параметры сделки\"<br /><br />';\n\t\t\tvalid = false;\t\n\t\t}\n\t\tif ((isDebtLimitChk) && (debtLimit.value == \"\")) {\n\t\t\tdocument.getElementById(\"errorMessage\").style.display = \"inline\";\n\t\t\tdocument.getElementById(\"errorMessage\").innerHTML=document.getElementById(\"errorMessage\").innerHTML+\n\t\t\t\t'Необходимо заполнить поле \"Сумма лимита задолженности\" в секции \"Основные параметры сделки\"<br /><br />';\n\t\t\tvalid = false;\t\n\t\t}\n\t} catch (Err) {\t} \n\n//\ttry {\n//\t\tvar proposedDateSigningAgreement = document.getElementById('proposedDateSigningAgreement');\n//\t\tif (proposedDateSigningAgreement.value == \"\") {\n//\t\t\tdocument.getElementById(\"errorMessage\").style.display = \"inline\";\n//\t\t\tdocument.getElementById(\"errorMessage\").innerHTML=document.getElementById(\"errorMessage\").innerHTML+\n//\t\t\t'Необходимо заполнить поле \"Планируемая дата подписания Кредитного соглашения\" в секции \"Основные параметры сделки\"<br /><br />';\n//\t\t\tvalid = false;\t\n//\t\t}\t\n//\t} catch (Err) {\t}\n\n\tvalid = valid && validateOnServer(valid); \n\tif(!valid)$('#redirecturl').val($('#redirecturl_original').val());\n\tenableSubmitButton();\n\treturn valid;\n}", "saveCase() {\n try {\n if (this.validateInputs()) {\n if ((this.valuesObj.primaryCategoryName === 'EW' && this.sourceCmp !== 'EW Calculator') || (this.valuesObj.primaryCategoryName === 'MCP' && this.sourceCmp !== 'MCP Calculator')) {\n this.showErrorMessage(emMCPerrMsg);\n } else {\n if (this.valuesObj.businessArea === 'MIBPL (Insurance)') { //!this.caseOwnerId\n let autoassignOwner = false;\n if (this.valuesObj.tertiaryCategoryValue && (this.tertiarycategoryData.find(item => item.Id === this.valuesObj.tertiaryCategoryValue).Direct_Case_Closure__c) === true) {\n autoassignOwner = true;\n } else if (this.valuesObj.secondaryCategoryValue && (this.seconcategoryData.find(item => item.Id === this.valuesObj.secondaryCategoryValue).Direct_Case_Closure__c) === true) {\n autoassignOwner = true;\n } else if (this.valuesObj.primaryCategoryValue && (this.primcategoryData.find(item => item.Id === this.valuesObj.primaryCategoryValue).Direct_Case_Closure__c) === true) {\n autoassignOwner = true;\n }\n if (autoassignOwner === true || this.fcrResponse === 'Yes') {\n this.insuranceDirectCaseClosure = autoassignOwner === true ? autoassignOwner : false;\n this.insuranceDirectCaseClosureEmail = autoassignOwner === true ? miEmail : '';\n this.insuranceAutoClosure = true;\n this.isSpinnerShow = true;\n const submitBtn = this.template.querySelector('.submit-btn');\n submitBtn.click();\n } else if (autoassignOwner === false && this.fcrResponse === 'No' && !this.caseOwnerId) {\n this.handleSalesAccessorydata('MIBPL (Insurance)');\n } else {\n this.isSpinnerShow = true;\n const submitBtn = this.template.querySelector('.submit-btn');\n submitBtn.click();\n }\n } else if (this.valuesObj.businessArea === 'Sales' || this.valuesObj.businessArea === 'Finance') {\n if (!this.valuesObj.enquiryId && this.valuesObj.dealerOutletName && (this.valuesObj.caseType === 'Dealer Internal Complaint' || this.valuesObj.caseType === 'Dealer Internal Feedback') && !this.caseOwnerId) {\n this.showErrorMessage('Please select Case Owner');\n } else if (this.valuesObj.caseType === 'Dealer Internal Query' || this.valuesObj.enquiryId && (this.valuesObj.caseType === 'Dealer Internal Complaint' || this.valuesObj.caseType === 'Dealer Internal Feedback')) {\n this.handleSalesAccessorydata('Sales');\n } else {\n this.isSpinnerShow = true;\n const submitBtn = this.template.querySelector('.submit-btn');\n submitBtn.click();\n }\n } else if (this.valuesObj.businessArea === 'Accessories' && this.fcrResponse === 'No') {\n this.handleSalesAccessorydata('Accessories');\n } else if ((this.valuesObj.businessArea === 'Service-Workshop' || this.valuesObj.businessArea === 'Service-Bodyshop') && !this.caseOwnerId) {\n let profileName = caseAutoAssignService.split(';');\n let serviceCCM = (this.dealerData.find(item => item.Id === this.valuesObj.dealerOutletName).Service_CCM__c);\n if (profileName.includes(this.agentProfileName) && serviceCCM) {\n this.serviceAutoAssign = serviceCCM;\n this.isSpinnerShow = true;\n const submitBtn = this.template.querySelector('.submit-btn');\n submitBtn.click();\n } else {\n this.manulOwnerAssign = true;\n this.showErrorMessage('Please select Case Owner');\n }\n } else {\n this.isSpinnerShow = true;\n const submitBtn = this.template.querySelector('.submit-btn');\n submitBtn.click();\n }\n }\n } else {\n this.showErrorMessage('Required Fields are missing');\n }\n } catch (error) {\n this.handleServerError(error);\n }\n\n }", "function save() {\n $log.log('CollegeFundPaymentDialogController::save called');\n if (vm.collegeFundPayment.id) {\n //update the collegeFundPayment information\n CollegeFundPayment.save(vm.collegeFundPayment, onSaveFinished);\n } else {\n // Create New CollegeFundPayment\n if (vm.collegeFundPayment.id !== null) {\n CollegeFundPayment.create(vm.collegeFundPayment, onSaveFinished);\n }\n }\n }", "onSaving() {\n if (this._saving) {\n this._saving.raise();\n }\n }", "function saveForm()\r\n{ \r\n let address = addressRef.value.trim();\r\n let roomNumber = roomNumberRef.value.trim();\r\n let seatsUsed = Number(seatsUsedRef.value);\r\n let seatsTotal = Number(seatsTotalRef.value);\r\n let lightsOn = lightsClassRef.MaterialSwitch.inputElement_.checked;\r\n let heatingCoolingOn = heatingCoolingClassRef.MaterialSwitch.inputElement_.checked;\r\n \r\n if(address && roomNumber && seatsUsed && seatsTotal && seatsUsed>=0 && seatsTotal>=0) \r\n {\r\n if(seatsUsed <= seatsTotal)\r\n {\r\n let newObservation = new RoomUsage(roomNumber, address, lightsOn, heatingCoolingOn, seatsUsed, seatsTotal)\r\n roomUsageList.addObservation(newObservation);\r\n\r\n errorMessagesRef.innerHTML = \"\";\r\n cleanUpToast();\r\n displayMessage(\"Your observation has been saved.\");\r\n \r\n storeList();\r\n return; // Skips the part which displays the error since there's none.\r\n }\r\n } \r\n \r\n errorMessagesRef.innerHTML = \"Incorrect inputs.\";\r\n}", "function save() {\n if(check_web_storage_support() == true) {\n var area = document.getElementById(\"area\");\n if(area.value != '') {\n localStorage.setItem(\"note\", area.value);\n }\n else {\n alert(\"Write someting to save\");\n }\n }\n}", "validate() {}", "checkValidity(event) {\n event.preventDefault();\n\n this.attemptedSave = true;\n\n if (this.$v.$invalid) {\n console.log(\"something is invalid\", this.$v);\n } else {\n console.log(\"all good!\");\n this.saveFieldForm(event);\n\t\t\t\t}\n\n }", "function MUD_Save() {\n console.log(\"=== MUD_Save === \");\n\n const new_idnumber = (el_MUD_idnumber.value) ? el_MUD_idnumber.value : null;\n const new_cribnumber = (el_MUD_cribnumber.value) ? el_MUD_cribnumber.value : null;\n const new_bankname = (el_MUD_bankname.value) ? el_MUD_bankname.value : null;\n const new_bankaccount = (el_MUD_bankaccount.value) ? el_MUD_bankaccount.value : null;\n const new_beneficiary = (el_MUD_beneficiary.value) ? el_MUD_beneficiary.value : null;\n\n const upload_dict = {\n user_id: mod_MUD_dict.user_id,\n userdata_id: mod_MUD_dict.userdata_id\n };\n if(new_idnumber !== mod_MUD_dict.idnumber ){\n upload_dict.idnumber = new_idnumber;\n };\n if(new_cribnumber !== mod_MUD_dict.cribnumber ){\n upload_dict.cribnumber = new_cribnumber\n };\n if(new_bankname !== mod_MUD_dict.bankname ){\n upload_dict.bankname = new_bankname\n };\n if(new_bankaccount !== mod_MUD_dict.bankaccount ){\n upload_dict.bankaccount = new_bankaccount\n };\n if(new_beneficiary !== mod_MUD_dict.beneficiary ){\n upload_dict.beneficiary = new_beneficiary\n };\n\n if (!isEmpty(upload_dict)){\n UploadChanges(upload_dict, urls.url_userdata_upload);\n };\n\n $(\"#id_mod_userdata\").modal(\"hide\");\n}", "handleSave() {\n this.isLoading = true;\n\n console.log('== Final Parts List ', this.accesList);\n if (this.validateInputs(\".inputCmp\") & this.validateInputs(\".checkValid\")) {\n ceratePartLineItemDetails({\n recordList : JSON.stringify(this.accesList),\n recordId : this.recordId,\n opportunityData : JSON.stringify(this.opportunityData),\n formType : this.formType,\n msgpaSelected : this.msgpaSelected,\n partOfferAmount : this.partOfferAmount\n }).then(result => {\n \n console.log('== load result ', result);\n if (result === 'success' && this.msgpaSelected) {\n this.handleReload();\n } else if (result === 'success' && !this.msgpaSelected) {\n this.showToast({ message: 'Line Item Added Successfully !', variant : 'success' });\n this.handleReload();\n }else{\n this.showToast({ message: 'Insufficient privileges. Please contact your administration.'});\n }\n this.isLoading = false;\n }).catch(error => {\n this.isLoading = false;\n console.log('== On load ',error);\n })\n }\n\n }", "function validateModifyExistingStorage(){\n\tif( document.getElementById(\"actionFormId:existingVolId:0\").checked == true){\n \t \tvar actionOnStorageSave = new Hashtable();\n \t \tactionOnStorageSave.put(\"actionFormId:newTargetVolId\", \"Volume,required\");\n \t \treturn validateFormData(MessageTypeEnum.ERROR,actionOnStorageSave);\n }\n return true;\n}", "function saveSpec() {\n updateGeneralspe();\n if (!iserror && !iserrorOwnpanel && !iserrorGeneralSpec && !isSingleError) {\n document.forms['specForm'].action = '${pageContext.request.contextPath}/specification/Specification.action?saveandBack=';\n document.forms['specForm'].submit();\n }\n }", "save() {\n try {\n this._toggleSaveThrobber();\n this._readFromForm();\n this.dao.save();\n\n // make sure the edit input is showing the correct id, reload data from server\n document.getElementById('edit_id').value = this.dao.id;\n this.read();\n \n } catch(e) {\n console.log(e);\n alert(e);\n }\n this._toggleSaveThrobber();\n }", "function validation() {\r\n\t\t\r\n\t}", "_save() {\n\t\tconst version = this._editor.model.document.version;\n\n\t\t// Operation may not result in a model change, so the document's version can be the same.\n\t\tif ( version === this._lastDocumentVersion ) {\n\t\t\treturn;\n\t\t}\n\n\t\ttry {\n\t\t\tthis._data = this._getData();\n\t\t\tthis._lastDocumentVersion = version;\n\t\t} catch ( err ) {\n\t\t\tconsole.error(\n\t\t\t\terr,\n\t\t\t\t'An error happened during restoring editor data. ' +\n\t\t\t\t'Editor will be restored from the previously saved data.'\n\t\t\t);\n\t\t}\n\t}", "function ep_Save() {\n\tvar bankAccount = nlapiGetFieldValue('custpage_2663_bank_account');\n\tvar batchId = nlapiGetFieldValue('custpage_2663_batchid');\n\tif (bankAccount && batchId) {\n\t\tif (!document.forms['main_form'].onsubmit || document.forms['main_form'].onsubmit()) {\n\t\t\tupsertBatch(bankAccount, batchId);\n\t\t\t\n\t\t\t// set the refresh flag\n\t\t nlapiSetFieldValue('custpage_2663_refresh_page', 'T', false);\n\n // set to view mode\n nlapiSetFieldValue('custpage_2663_edit_mode', 'F', false);\n \n\t\t // suppress the alert\n\t\t setWindowChanged(window, false);\n\t\t \n\t\t // submit the form -- calls submitForm function\n\t\t document.forms.main_form.submit();\n\t\t}\n\t}\n}", "function saveForm() {\n return saveCompanySite()\n .then(saveInternalNumbers);\n }", "function saveStage(stateNum)\n {\n try\n {\n document.getElementById('longName').value = trim(document.getElementById('longName').value);\n if(document.getElementById('longName').value.match('#'))\n {\n document.getElementById('longName').value = document.getElementById('longName').value.replace(/#/g,\"\");\n } \n warn(stateNum);\n \n }\n catch(ex)\n {}\n \n }", "function saveVehicle() {\n\n let type = \"\"\n let fuelType = \"\"\n let transmission = \"\"\n\n if ($(\"#chkPetrol\").is(\":checked\")) fuelType = \"petrol\"\n else if ($(\"#chkDiesal\").is(\":checked\")) fuelType = \"diesel\"\n\n if ($(\"#chkLuxury\").is(\":checked\")) type = \"luxury\"\n else if ($(\"#chkPremium\").is(\":checked\")) type = \"premium\"\n else if ($(\"#chkGeneral\").is(\":checked\")) type = \"general\"\n\n if ($(\"#chkGear\").is(\":checked\")) transmission = \"gear\"\n else if ($(\"#chkManual\").is(\":checked\")) transmission = \"manual\"\n\n const data = {\n \"vehicleNumber\": $(\"#inptVehicleNumber\").val(),\n \"vehicleCount\": 1,\n \"type\": type,\n \"fuelType\": fuelType,\n \"damageWaiver\": $(\"#inptDamagewaiver\").val(),\n \"freeMileageForMonth\": $(\"#inptFreeMilgForMonth\").val(),\n \"freeMileageForDay\": $(\"#inptFreeMilgForDay\").val(),\n \"monthlyRental\": $(\"#inptMonthlyRental\").val(),\n \"dailyRental\": $(\"#inptDailyRental\").val(),\n \"excessForMonth\": $(\"#inptExcessAmount\").val(),\n \"numberOfPassengers\": $(\"#inptNumberOfPasseneger\").val(),\n \"brandName\": $(\"#inptBrandName\").val(),\n \"frontImg\": \"asdasd\",\n \"backImg\": \"adasd\",\n \"leftImg\": \"adasd\",\n \"rightImg\": \"asdasdas\",\n \"transmission\": transmission,\n \"color\": $(\"#inptColor\").val(),\n \"vehicleStatus\": \"open\"\n }\n\n addNewVehicleOrUpdate(data)\n loadAllVehicleCountData()\n}", "function save() {\r\n \t\t// get busy\r\n \t\tgetBusy();\r\n \t\t\r\n \t\t/****/\r\n \t\t\r\n \t\t\r\n \t\t/*****/\r\n \t\t\r\n \t\tangular.forEach(vm.examenes, function(examen, key) {\r\n \t\t\tif(examen.create) {\r\n \t\t\t\tcreate({\r\n\t\t\t\t\t\ttmp: {\r\n\t\t\t\t\t\t\tcodigoCausaExterna: vm.examenDetail.codigoCausaExterna,\r\n\t\t\t\t\t\t\tcodigoClaseServicio: vm.examenDetail.codigoClaseServicio,\r\n\t\t\t\t\t\t\tvalorCostoEps: '',\r\n\t\t\t\t\t\t\tvalorCuotaModeradora: ''\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\t_embedded: {\r\n\t\t\t\t\t\t\texamenTipo:{\r\n\t\t\t\t\t\t\t\tid: examen.tipo,\r\n\t\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\tafiliado: {\r\n\t\t\t\t\t\t\t\tid: $stateParams.afiliadoId\r\n\t\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\tmedico: vm.examenDetail.medico\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\texamen: {}\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n \t\t\t}\r\n \t\t})\r\n\t\t\t$state.go('main.afiliado.edit.examen.list', {afiliadoId: $stateParams.afiliadoId});\r\n \t\t\r\n \t}", "function onSave(selectedDate, selectedVisitor,selectedTrail, guestState) {\n const passentry = {\n visitorId: selectedVisitor.id,\n date: selectedDate,\n guests: guestState,\n trailId: selectedTrail.id\n }\n // transition(SAVING);\n console.log('passentry...........', passentry)\n\n // if (mode === EDIT) {\n // props\n // .editInterview(props.id, interview)\n // .then(() => transition(SHOW))\n // .catch(error => {\n // transition(ERROR_SAVE, true)\n // }); \n // } else { \n props.newPass(passentry)\n props.onSetVerify()\n }", "function savePassion() {\r\n\tvar attrDescText = document.getElementById(\"attrDescInptId\").value;\r\n\tvar attrFullDescText = document.getElementById(\"attrFullDescInptId\").value;\r\n\t//var attributeOrder = document.getElementById(\"attrOrderInptId\").value;\r\n\tvar userProfile = document.getElementById(\"inputUserProfileInpt\").options[document.getElementById(\"inputUserProfileInpt\").selectedIndex].value;\r\n\tvar userProfileText = document.getElementById(\"inputUserProfileInpt\").options[document.getElementById(\"inputUserProfileInpt\").selectedIndex].text;\r\n\tif(validateValue(attrDescText, attrFullDescText, \"PAS\")) {\r\n\t\tvar newUserProf = Spine.Model.sub();\r\n\t\tnewUserProf.configure(\"/admin/contentconfig/savePassion\", \"attrDescTextVal\", \"userProfileVal\", \"userProfileId\", \"attrFullDescText\", \"createdBy\");\r\n\t\tnewUserProf.extend( Spine.Model.Ajax );\r\n\t\t//Populate the model with data to transfer\r\n\t\tvar modelPopulator = new newUserProf({ \r\n\t\t\tattrDescTextVal: attrDescText,\r\n\t\t\tuserProfileVal: userProfileText,\r\n\t\t\tuserProfileId: userProfile,\r\n\t\t\tattrFullDescText: attrFullDescText,\r\n\t\t\tcreatedBy: sessionStorage.getItem(\"jctEmail\")\r\n\t\t});\r\n\t\tmodelPopulator.save(); //POST\r\n\t\tnewUserProf.bind(\"ajaxError\", function(record, xhr, settings, error) {\r\n\t\t\talertify.alert(\"Unable to connect to the server.\");\r\n\t\t});\r\n\t\tnewUserProf.bind(\"ajaxSuccess\", function(record, xhr, settings, error) {\r\n\t\t\tvar jsonStr = JSON.stringify(xhr);\r\n\t\t\tvar obj = jQuery.parseJSON(jsonStr);\r\n\t\t\tvar statusCode = obj.statusCode;\r\n\t\t\tif(statusCode == 200) {\r\n\t\t\t\t//alertify.set({ delay: 2700 });\r\n\t\t\t\talertify.alert(\"Passion has been successfully created.\");\r\n\t\t\t\tpopulatePassionTable(obj.existingMappingList, \"ADD\");\t\r\n\t\t\t\tdocument.getElementById(\"attrDescInptId\").value = \"\";\r\n\t\t\t\tdocument.getElementById(\"attrFullDescInptId\").value = \"\";\r\n\t\t\t\t//disableAllfield();\r\n\t\t\t} else if(statusCode == 600) {\r\n\t\t\t\talertify.alert(\"Passion already exists.\");\r\n\t\t\t} else if(statusCode == 602) {\r\n\t\t\t\talertify.alert(\"One profile should have maximum of 24 Passions.\");\r\n\t\t\t} else if(statusCode == 500) {\r\n\t\t\t\t// Error Message\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n}", "static canSave(){\n\t\tif(this.clearLevelFileLater || this.saving || this.writing || !this.needsSave){\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\telse{\n\t\t\treturn this.levelFile != undefined;\n\t\t}\n\t}" ]
[ "0.68890053", "0.6775445", "0.6526655", "0.649317", "0.6380804", "0.6298428", "0.6252582", "0.6233055", "0.6195486", "0.6144762", "0.61402774", "0.61280507", "0.61095124", "0.6065495", "0.6036816", "0.60298526", "0.6008435", "0.59997404", "0.59970754", "0.5986393", "0.59618276", "0.5958497", "0.5945005", "0.59299433", "0.59247524", "0.5915774", "0.59151214", "0.58669496", "0.5848237", "0.584451", "0.57767564", "0.577443", "0.5765548", "0.5760769", "0.5751893", "0.5746213", "0.57434636", "0.5728696", "0.57236576", "0.571086", "0.5708722", "0.570859", "0.57045263", "0.56810427", "0.5680701", "0.5671937", "0.5657959", "0.56533694", "0.5650805", "0.5649998", "0.5640852", "0.56375253", "0.56348747", "0.56348747", "0.5634083", "0.56325084", "0.56284976", "0.5627016", "0.56204814", "0.56053483", "0.5602868", "0.5599934", "0.5599934", "0.55844593", "0.55712306", "0.5560257", "0.5558827", "0.5551917", "0.55476236", "0.5546329", "0.55446005", "0.554034", "0.5539308", "0.5538283", "0.5536541", "0.5534805", "0.55228186", "0.551261", "0.5506303", "0.549585", "0.54937077", "0.5492392", "0.5489552", "0.5480422", "0.54769784", "0.54670817", "0.5461256", "0.5448089", "0.54465777", "0.5435857", "0.5434792", "0.5430878", "0.5429283", "0.54256546", "0.542054", "0.54191375", "0.54146755", "0.54140407", "0.5412019", "0.54104924" ]
0.55448174
70
called when location suggestion is clicked.
setLocation(event){ const get_started = this, updated_params = { zipcode: event.target.dataset.zipcode, suggestion: event.target.dataset.suggestion }; if (get_started.userApiValue('input_changed')) { get_started.showUpdateConfirmation(); const ui = { id: 'update_to_confirm', data: { type: 'location', params: updated_params } }; get_started.props.updateUI(ui); } else { get_started.setLocationConfirmed(updated_params); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "onLocationClicked(){}", "onSuggestSelect({ label, location }) {\n this.props.onSuggest(label, location);\n this._geoSuggest.clear();\n }", "function onLocationFound(e) {\n onClick(e)\n}", "function selectedSuggestion(suggestionResult)\n {\n //document.getElementById('printoutPanel').innerHTML = 'Suggestion: ' + suggestionResult.formattedSuggestion;\n searchedLocation = suggestionResult.formattedSuggestion;\n }", "chooseLoc(event) {\n\t\tevent.preventDefault();\n\t\tthis.showMap = true; // Display the google map component to select a location\n\t}", "function clickSearchButton(e){\n _self.getDefaultPlace(_self.scope.inputSearch.value); \n }", "chooseLocation() {\n \n }", "onSuggestionSelected (event, {suggestion, suggestionValue, suggestionIndex, sectionIndex, method}) {\n\t\tconst latlng = [suggestion['geom:latitude'], suggestion['geom:longitude']]\n\t\tthis.props.setMapView(latlng, 15)\n\t\tthis.setState({ value: '' })\n\t\tthis.onSuggestionsClearRequested()\n\t\tthis.props.clearDirections()\n\t\tthis.props.setVenue()\n\t\tthis.props.clearCategory()\n\n\t}", "function handleGeolocationClick(e) {\n\t\t\ttheInterface.emit('ui:geolocationRequest');\n\t\t}", "function onClick() {\n\t\tshowAllSuggestions();\n\t\tsetSelectionToCurrentValue();\n\t}", "function onLocationFound(e) {\n\t\t\n\t\t//Coordinates of location for marker:\n\t\tvar latLon = e.latlng;\n\t\t\n\t\t//Creation of the marker:\n\t\tvar marker = $scope.createMarker(latLon.lat,latLon.lng,parseInt(0),\"default\",$rootScope.username);\n\t\t\t\n\t\t//If marker creation was successful show input dialog:\n\t\tif (marker) {\n\t\t\t\t\n\t\t\t//Add marker to editItems:\n\t\t\t$rootScope.editItems.addLayer(marker);\n\t\t\t\t\n\t\t\t// Show input dialog\n\t\t\t$rootScope.$broadcast(\"startedit\", {feature: marker});\n\t\t}\n\t\t\n\t\t//return button state to default state:\n\t\t$scope.locateButton.state('un_loaded');\n\t}", "function placeChangedHandler() {\n var place = autocomplete.getPlace();\n if (!place.geometry) {\n // User entered the name of a Place that was not suggested and\n // pressed the Enter key, or the Place Details request failed.\n program.showMessage(\"\", \"Staðsetning finnst ekki, reyndu aftur\");\n } \n else {\n program.addAllInfo(place);\n }\n }", "function onClick(loc) {\n myCity.bindPopup(myText + ' : '+ loc.latlng)\n // console.log(\"my city location is \" + loc.latlng);\n }", "function onTypeaheadSelected(event, key, location) {\n if (!location) {\n UserPreferences.clearLocation(key);\n } else {\n UserPreferences.setLocation(key, location);\n\n if (key === 'origin') {\n // shift focus to destination after origin selected\n $(options.selectors.typeaheadTo).focus();\n }\n }\n\n events.trigger(eventNames.selected, [key, location]);\n }", "function geolocate() {\r\n\t// Hard code for Canada\r\n\tvar geolocation = new google.maps.LatLng(62, -110.0);\r\n\tautocomplete.setBounds(new google.maps.LatLngBounds(geolocation,\r\n\t\t\tgeolocation));\r\n}", "appendSuggestion(suggestion) {\n const result = document.createElement('li');\n result.className = \"result\";\n result.appendChild(document.createTextNode(suggestion.name));\n document.getElementById('results-container').appendChild(result);\n result.onclick = () => {\n clearResults();\n if (this.focusedInput.id === \"origin\"){\n this.setStart(suggestion);\n this.startMarker = positionMap(this.startMarker, this.map, suggestion);\n } else {\n this.setEnd(suggestion);\n this.endMarker = positionMap(this.endMarker, this.map, suggestion);\n }\n this.computeRoute();\n };\n }", "function onPlaceChanged() {\n var place = autocomplete.getPlace();\n if (place.geometry) {\n map.panTo(place.geometry.location);\n map.setZoom(12);\n // Sets the class's from display =none to =inline block.\n showMAP();\n showDisplayOne();\n searchLodging();\n }\n else {\n document.getElementById('locationSearch').placeholder = 'Enter a city';\n }\n}", "function onPlaceChanged(){\n\n\tvar place= autocomplete.getPlace();\n\n\t// var to get latitude and longitude of city to map using google maps API\n\tloc= new google.maps.LatLng(place.geometry.location.lat(), place.geometry.location.lng());\n\n\t// variable to store city,state and country for yelp matching\n\tcityName = place.formatted_address;\n\n\t//Empty previous list and markers\n\tplaceArray([]);\n\tmarker([]);\n\n\t// set heading based on place \n\t$('#heading').html(\"Restaurants around \" + place.name);\n\n\t// if place found zoom to place else ask user to enter a valid city\n\tif (place.geometry) {\n\t\tmap.panTo(place.geometry.location);\n\t\tif (screen.width < 600) {\n\t\t\tmap.setZoom(12);\n\t\t} else {\n \t\tmap.setZoom(15);\n \t}\n\n \t//hide citysearch input field\n\t\t$('.csearch').toggleClass(\"hidden\");\n\n\t\t//perform location search\n \tsearch();\n \t\n \tvar check = $('.menu').hasClass('closed');\n \tif (screen.width > 600 && check) {\n \t\ttoggleMenu();\n \t}\n\t} else {\n\t\talert(\"Enter a valid city\");\n\t\tgetCityInput();\n\t}\n}", "async function onLocationFound(e) {\n const { map, getCountyIDFromLatLng, stateLayer, countyLayer, updateSidebarOnHover, openSidebar } = app;\n let latitude = e.latitude\n let longitude = e.longitude\n const countyID = await getCountyIDFromLatLng(latitude, longitude)\n window.clickCounty = countyID\n \n map.removeLayer(stateLayer)\n map.addLayer(countyLayer)\n updateSidebarOnHover()\n openSidebar()\n }", "function initAutocomplete() {\n map = new google.maps.Map(document.getElementById('map'), {\n center: userPosition,\n zoom: 13,\n mapTypeId: 'roadmap'\n });\n\n infoWindow = new google.maps.InfoWindow;\n infoWindow.setPosition(userPosition);\n infoWindow.setContent('You are Here');\n infoWindow.open(map);\n map.setCenter(userPosition);\n previousInfoWindow = infoWindow;\n () => {\n handleLocationError(true, infoWindow, map.getCenter());\n };\n \n // Create the search box and link it to the search bar element with the id of pac-input.\n let input = document.getElementById('food');\n let searchBox = new google.maps.places.SearchBox(input);\n\n map.controls[google.maps.ControlPosition.TOP_LEFT].push(input);\n\n // Bias the SearchBox results towards current map's viewport.\n map.addListener('bounds_changed', function() {\n searchBox.setBounds(map.getBounds());\n });\n\n let markers = [];\n\n var marker, i;\n\n\n\n // Listen for the event fired when the user selects a prediction and retrieve\n // more details for that place.\n searchBox.addListener('places_changed', function() {\n let places = searchBox.getPlaces();\n if (places.length == 0) {\n let noRestaurantFound = $('<li>').text(\"No locations found\");\n $('.marker-list').append(noRestaurantFound);\n return;\n }\n // Clear out the old markers.\n markers.forEach(function(marker) {\n marker.setMap(null);\n });\n markers = [];\n let bounds = new google.maps.LatLngBounds();\n places.forEach(function(place, index) {\n if (!place.geometry) {\n \n return;\n }\n\n let infoWindow = new google.maps.InfoWindow({\n content: `${place.name}`,\n pixelOffset: new google.maps.Size(0, 0)\n });\n markerMap[ \"marker-\" + labelIndex ] = marker \n var marker = new google.maps.Marker({\n map: map,\n label: labels[labelIndex++ % labels.length],\n title: place.name,\n position: place.geometry.location\n });\n\n marker.addListener('click', openInfoAndDisplayRoute);\n\n function openInfoAndDisplayRoute() {\n previousInfoWindow.close();\n showRestaurantInfo();\n infoWindow.open(map, marker);\n previousInfoWindow = infoWindow;\n // break the address up into street address , cit\n const arrayOfString = place.formatted_address.split(',');\n const address = arrayOfString[0];\n const cityName = arrayOfString[1];\n const name = place.name;\n //send name to \n loveIt(name);\n removeFromFavorites(name);\n // send the relevant data to make the Yelp ajax call\n // send the relevant info to Google Directions\n requestYelpData(name , address, cityName);\n displayRoute( '', place.formatted_address);\n }\n // Get the Favorites string from local storage and covert it into an array\n let favoritesArray, localStorageString, foodEstablishmentName;\n localStorageString = localStorage.getItem(\"favoritesArray\");\n if (localStorageString === null){\n favoritesArray = [];\n } else {\n favoritesArray = localStorageString.split(',');\n }\n \n // Get the location Name\n let locationName = place.name;\n\n if(favoritesArray.includes(locationName)){\n favoriteLocation = true;\n let favoriteSymbol = $('<i>').addClass(\"material-icons favIcon pink-text darken-2\").text(\"favorite\").css(\"font-size\",\"inherit\");\n foodEstablishmentName = $('<li>').text(`${labels[index]}. ${place.name}`).attr('data-id', `marker-${index}`);\n foodEstablishmentName.append(favoriteSymbol);\n } else {\n favoriteLocation = false;\n foodEstablishmentName = $('<li>').text(`${labels[index]}. ${place.name}`).attr('data-id', `marker-${index}`);\n }\n foodEstablishmentName.on('click', openInfoAndDisplayRoute);\n $('.marker-list').append(foodEstablishmentName);\n // Create a marker for each place.\n markers.push(marker);\n \n if (place.geometry.viewport) {\n bounds.union(place.geometry.viewport);\n } else {\n bounds.extend(place.geometry.location);\n }\n });\n map.fitBounds(bounds);\n });\n}", "handlePlaceSelect() {\n this.props.onUpdatePosition({\n latitude: this.autocomplete.getPlace().geometry.location.lat(),\n longitude: this.autocomplete.getPlace().geometry.location.lng(),\n address:\n this.autocomplete.getPlace().address_components[0].short_name +\n \" \" +\n this.autocomplete.getPlace().address_components[1].short_name,\n home: this.autocomplete.getPlace().address_components[0].short_name\n });\n }", "activateLocation (locationName) {\n const { markers } = this.props\n markers.forEach(function (marker) {\n marker.title === locationName ? window.google.maps.event.trigger(marker, 'click') : ''\n })\n }", "biasAutocompleteLocation () {\n if (this.enableGeolocation) {\n this.updateGeolocation((geolocation, position) => {\n let circle = new google.maps.Circle({\n center: geolocation,\n radius: position.coords.accuracy\n });\n this.autocomplete.setBounds(circle.getBounds());\n })\n }\n }", "function getLocation(evt) {\n evt.preventDefault();\n $('#search-results').empty();\n $('#search-results').css('display', 'inline');\n $('#map').removeClass('col-md-offset-3');\n\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(submitCoords);\n }\n}", "detectWaypointChangedListener(autocompletedInput) {\n autocompletedInput.bindTo(\"bounds\", this.map);\n autocompletedInput.addListener(\"place_changed\", () => {\n const place = autocompletedInput.getPlace();\n\n if (!place.place_id) {\n window.alert(\"Please select an option from the dropdown list.\");\n return;\n }\n\n this.calculateAndDisplayRoute();\n });\n }", "onSuggestSelect(suggest) {\n console.log(suggest);\n }", "function showLocation(evt) {\n \n searchPnt = evt.result.feature.geometry;\n findProviders(providerFS,searchPnt);\n }", "function onLocationFound(e) {\n current_pos = e.latlng;\n var radius = e.accuracy / 2;\n// L.marker(e.latlng, {icon: icon_you}).addTo(map).bindPopup(\"<h4>You are here</h4>\").openPopup(); // open pop up kinda annoying <-- I agree\n var mylocation = L.marker(e.latlng, {icon: icon_you}).addTo(map); //.bindPopup(\"<h4>You are here</h4>\");\n\n mylocation.on('click', function (e) {\n var customPopup = $(\"<div>\").addClass('popup-inner')\n .append( \"<h3 class='popup-votes'>Would you like to post a pintura at your current location?</h3>\" );\n\n bootbox.confirm({\n size: 'large',\n title: 'Your Location',\n message: customPopup.html(),\n buttons: {\n confirm: {\n label: 'Post',\n className: 'btn-success'\n },\n cancel: {\n label: 'Close',\n className: 'btn-danger'\n }\n },\n callback: function (result) {\n if (result) {\n document.location.href =\"/post\";\n }\n },\n backdrop: true\n });\n }).on('popupclose', function (e) { });\n\n //L.circle(e.latlng, radius).addTo(map); //this is kinda pointless right?\n setupFeatures();\n\n console.log('post hidden: ' + post_hidden);\n }", "handleLocationAutoCompleteSelect(chosenRequest) {\r\n this.setState({location: chosenRequest}, () => this.handleSubmit());\r\n }", "function clickHandler(e) {\n\t\tvar $input = $(this).parents(\".dropdown\").siblings(\".location\");\n\t\t$input.val(this.textContent);\n\t\t$input.focus();\n\t\tvar $menu = $(this).parent();\n\t\t$menu.hide().empty();\n\t}", "function searchLoc(){\n selectedPlace = document.getElementById('place');\n deleteAllMarkers();\n searchNearLocs(map, curPos);\n }", "function autosuggest() {\n /** Variables for Autocomplete */\n var input = document.getElementById('searchTextField');\n var options = {componentRestrictions: {country: 'US'}};\n var autocomplete = new google.maps.places.Autocomplete(input, options);\n\n /** Creates listener for when place changes */\n google.maps.event.addListener(autocomplete, 'place_changed', function (){\n /** Initialize variable to store formatted input address */\n address = autocomplete.getPlace().formatted_address;\n /** Convert given address to geocode */\n geocoder.geocode({address: address}, function(results, status){\n if (status == google.maps.GeocoderStatus.OK){\n /** Get first result */\n var locData = results[0].geometry.location;\n /** Set new geocode based off of location input */\n var lat = String(locData.lat());\n var lng = String(locData.lng());\n /** Set new location */\n loc = new google.maps.LatLng(lat, lng);\n /** Perform new search with given location */\n initialize(loc);\n /** Pins the given location with a blue marker */\n pin(loc);\n }\n });\n });\n}", "function highlightLocationOnMap() {\n //get current location id\n var attrLocationId = this.getAttribute('data-location-id');\n\n //if location is hided on map\n if (this.textContent == 'location_off') {\n //show location on map\n document.getElementById('label-for-checkbox-location' + attrLocationId).click();\n }\n\n //set scope to location on map\n //@TODO: add focusing and highlighting location on map\n}", "function onPlaceChanged() {\n var place = autocomplete.getPlace()\n if (place.geometry) {\n map.panTo(place.geometry.location)\n map.setZoom(15)\n search()\n allGatherings()\n myGatherings()\n } else {\n document.getElementById(\"autocomplete\").placeholder = \"Enter a city\"\n }\n}", "#onPromptItemSelected(event: BaseEvent): void\n\t{\n\t\tif (event.data.location)\n\t\t{\n\t\t\tthis.#fulfillSelection(event.data.location);\n\t\t}\n\t}", "function focusLocation() {\n if ($scope.view.selectedPlace !== undefined & $scope.view.selectedPlace !== '') {\n var location = _.result(_.find($scope.view.places, function (x) { return x.place_id === $scope.view.selectedPlace; }), 'geometry.location');\n if (location !== undefined) {\n\n mapa.setCenter(location);\n mapa.setZoom(8);\n }\n else {\n showMessage('No se pudo mostrar la ubicación');\n }\n }\n }", "function onPlaceChanged() {\n var place = autocomplete.getPlace();\n if (place.geometry) {\n map.panTo(place.geometry.location);\n map.setZoom(15);\n search(\"bike share\");\n search(\"food\");\n search(\"coworking space\");\n } else {\n document.getElementById(\"autocomplete\").placeholder = \"Enter a city\";\n }\n}", "function onClickTreeNode(){\n View.controllers.get('defineLocationFL').curTreeNode = View.panels.get(\"site_tree\").lastNodeClicked;\n //kb#3047415: the Ab.arcgis.Geocoder control\n setButtonLabels(new Array('geocode','locate'), new Array('geocode','locate'));\n}", "setLocationSuggestions(event){\n if (this.country_mode) return false;\n let display_location_mode = this.input_location_mode_changed ? this.input_location_mode : 1;\n let get_started = this,\n new_location = {\n input_location_mode: display_location_mode,\n input_location: event.target.value\n };\n\n get_started.setState({\n input_location: event.target.value,\n show_location_suggestions: true\n });\n\n if (get_started.$set_location_suggestions){\n clearTimeout(get_started.$set_location_suggestions);\n }\n\n // debounce location suggestions by 500ms.\n get_started.$set_location_suggestions = setTimeout(()=>{\n CalculatorApi.getAutoComplete(new_location)\n .then((locations)=>{\n get_started.setState({\n locations: locations,\n show_location_suggestions: true\n });\n });\n }, 500);\n }", "autocompleteHandler(placeResult) {\n\n if (!placeResult.geometry) {\n window.alert(\"Autocomplete's returned place contains no geometry\");\n return;\n }\n\n // If the place has a geometry, then present it on a map.\n if (placeResult.geometry.viewport) {\n this.map.fitBounds(placeResult.geometry.viewport);\n } else {\n this.map.setCenter(placeResult.geometry.location);\n this.map.setZoom(17); // Why 17? Because it looks good.\n }\n\n if (placeResult.address_components) {\n if (placeResult.inputId == 'origin') {\n HomeActions.updateOrigin(placeResult);\n } else if (placeResult.inputId == 'destination') {\n HomeActions.updateDestination(placeResult);\n } else {\n HomeActions.updateStops(placeResult);\n }\n }\n }", "function initMap(initData){\n \n var approximateLocation = new google.maps.places.Autocomplete(location, {types: ['geocode']});\n google.maps.event.addListener(location, 'keydown', function(e) { \n if (e.keyCode == 13 && $('.pac-container:visible').length) { \n e.preventDefault();\n e.stopPropagation(); \n }\n });\n \n google.maps.event.addListener(approximateLocation, 'place_changed', \n function(place){\n \n \t\t\tvar place = approximateLocation.getPlace();\n \t\t\t$('#suggested_location').text(place.geometry.location);\n \t\t\t\n \t\t\tif(!place.geometry){\n \t\t\t window.alert(\"No details available for input: '\" + place.name + \"'\");\n \t\t\t}\n \t\t\telse{\n \t\t\t //console.log(\"Change is catched.\", place.geometry.location);\n \t\t\t}\n });\n }", "function handleSearchResultClick(e) {\n\t\t\ttheInterface.emit('ui:zoomToMarker', {\n\t\t\t\tposition : e.currentTarget.getAttribute('data-position'),\n\t\t\t\tlayer : e.currentTarget.getAttribute('data-layer')\n\t\t\t});\n\t\t}", "renderSearch() {\n return <Autocomplete\n onPlaceSelected={ (place) => {\n this.props.receiveSearch(place.formatted_address);\n hashHistory.push(`/restaurants/index/${place.formatted_address}`);\n }}\n placeholder={'Enter a Location'}\n types={['address']}\n id='nav-auto' />;\n }", "function focusEvents() {\n setSuggestionBoxPosition();\n active = true;\n if ($(this).val()) {\n showSuggestions(jsonData);\n }\n }", "function placesCallback(results, status) {\n console.log(\"placesCallback\", status);\n for (let i = 0; i < results.length; i++) {\n console.log(results[i].name, results[i].types);\n }\n \n //Put the clicked location in the input field\n document.getElementById(\"locationInput\").value = results[0].name;\n }", "function autocomplete() {\n\n // Autocomplete for search location\n let autocompleteSearch = $(\"#search-location\")[0];\n var autocompletedSearch = new google.maps.places.Autocomplete(autocompleteSearch);\n\n}", "function onLocationFound(e) {\n if (!acceptsLocation) {\n acceptsLocation = true\n }\n \n userGroup.clearLayers()\n var radius = 1609; // 1 mile in meters\n userMarker = L.marker(e.latlng).addTo(userGroup)\n \n L.circle(e.latlng, radius).addTo(userGroup);\n \n if (!searchOnLocationFound) {\n if (Object.keys(allBusinesses).length > 0) {\n createMarkers(allBusinesses, {modifyAll: true})\n }\n map.setView(e.latlng, 14)\n fetchPlaces();\n searchOnLocationFound = true;\n }\n }", "function suggestionSuccessCallback(response) {\n // TODO: Some code to refresh the page\n alert(\"woo\");\n }", "function placesCallback(results, status) {\n console.log(\"placesCallback\", status);\n for (let i = 0; i < results.length; i++) {\n console.log(results[i].name, results[i].types);\n }\n \n //Put the clicked location in the input field\n document.getElementById(\"locationInput2\").value = results[0].name;\n }", "function onPlaceSelect(element) {\r\n\t\t\tvar $root = element.parents(\".mapsed-root\");\r\n\t\t\tvar $vw = element.parents(\".mapsed-view\");\r\n\t\t\tvar model = getViewModel($vw);\r\n\r\n\t\t\tif (settings.onSelect(_plugIn, model)) {\r\n\t\t\t\tcloseTooltips();\r\n\t\t\t}\r\n\r\n\t\t} // onPlaceSelect", "function handleSearchWaypointResultClick(e) {\n\t\t\tvar rootElement = $(e.currentTarget).parent().parent().parent().parent();\n\t\t\tvar index = rootElement.attr('id');\n\t\t\trootElement.removeClass('unset');\n\t\t\trootElement = rootElement.get(0);\n\n\t\t\trootElement.querySelector('.searchAgainButton').show();\n\t\t\trootElement.querySelector('.guiComponent').hide();\n\n\t\t\tvar waypointResultElement = rootElement.querySelector('.waypointResult');\n\t\t\t//remove older entries:\n\t\t\twhile (waypointResultElement.firstChild) {\n\t\t\t\twaypointResultElement.removeChild(waypointResultElement.firstChild);\n\t\t\t}\n\t\t\twaypointResultElement.insert(e.currentTarget);\n\t\t\twaypointResultElement.show();\n\n\t\t\t//remove search markers and add a new waypoint marker\n\t\t\ttheInterface.emit('ui:waypointResultClick', {\n\t\t\t\twpIndex : index,\n\t\t\t\tfeatureId : e.currentTarget.id,\n\t\t\t\tsearchIds : rootElement.getAttribute('data-search')\n\t\t\t});\n\t\t}", "locationSearch() {\n if (this.$locationInput.val()) {\n $('.spinner-zone').show();\n IndexSearchObj.searchYelp();\n this.focusBlur();\n }\n }", "handleFormLocAutoComplete(searchText) {\r\n this.setState({location: searchText});\r\n this.handleLocationAutoComplete(searchText);\r\n this.handleLocationAutoCompleteSelect(searchText);\r\n }", "function onSearchSuggestionItemClick(e) { \r\n e.preventDefault();\r\n e.stopPropagation();\r\n var searchInput = $(\"#search-input\").focus().val('');\r\n searchInput.parent().addClass(\"active\");\r\n var searchInputText = $(this).attr(\"data-search-text\");\r\n var searchInputUrl = $(this).attr(\"data-search-url\");\r\n var searchInputUseGoogleSearch = $(this).attr(\"data-use-google-search\");\r\n searchInput.attr(\"data-search-url\", searchInputUrl);\r\n searchInput.attr(\"data-use-google-search\", searchInputUseGoogleSearch);\r\n searchInput.val(searchInputText).off(\"keyup\", makeGoogleSearch);\r\n $(\"#search-form\").submit();\r\n $(\"#search-suggestion\").hide();\r\n $(\"#search-input-box\").removeClass('with-suggestions');\r\n }", "function searchButtonClick() {\n searchLocation = $('#zoom-to-location-txt').val();\n zoomToArea();\n}", "function populateMap(location, locationText) {\n let city = $('#search-term').val();\n let state = $('#state option:selected').val();\n let ytURL = encodeURI(`https://www.youtube.com/results?search_query=best+place+to+eat+in+${city.toUpperCase()}+${state.toUpperCase()}`);\n L.marker([location.latLng.lat, location.latLng.lng], {\n text: locationText,\n type: 'marker',\n position: 'bottom',\n // className: 'popupCustom',\n alt: locationText + 'Learn more about' + locationText + 'on YouTube',\n }).bindPopup(`${locationText} <br><a class=\"markerPopup\" target='_blank' aria-label='Read more about <span class=\"cityName\">${locationText}</span> on YouTube' href=${ytURL}>YouTube</a>`).openPopup().addTo(map);\n map.panTo([location.latLng.lat, location.latLng.lng]);\n}", "function displaySearchResults(results) {\n var addressClickHandler = function() {\n var location = $(this).data('location');\n $('#directions').empty();\n findPollingLocationFor(location);\n };\n if (results.length === 1) {\n findPollingLocationFor(results[0].geometry.location);\n } else {\n var $ul = $('<ul>').addClass('location-choices').appendTo('#directions');\n for (var i = 0; i < results.length; i++) {\n var result = results[i];\n var link = $('<a>').text(result.formatted_address).data('location', result.geometry.location).on('click', addressClickHandler);\n $('<li>').append(link).appendTo($ul);\n }\n $('.modal').modal('hide');\n }\n }", "function clickEvents(e) {\n if (isSuggestion(e)) {\n e.preventDefault();\n doClick(e);\n }\n }", "function onLocationFound(e) {\n\tvar radius = e.accuracy / 2;\n\tL.marker(e.latlng).addTo(map)\n .bindPopup(\"You are within \" + radius +\n\t\t \" meters from this point<br/>\" +\n\t\t \"Coordinates: \" + e.latlng.toString())\n\t .openPopup();\n\tL.circle(e.latlng, radius).addTo(map);\n }", "addDetectLocationListener() {\n $('#detect-location').on('click', function (e) {\n $(this).children().removeClass('pulse-5');\n Geolocation_Obj.detectLocation(e);\n });\n }", "handleSurveyLocAutoComplete(searchText) {\n var surveyData = this.state.surveyData;\n surveyData[\"location\"] = searchText;\n this.setState({ surveyData });\n this.handleLocationAutoComplete(searchText);\n }", "function initAutoComplete() {\n\n autocomplete = new google.maps.places.Autocomplete(heroSearchEle, {\n types: ['geocode']\n });\n\n //Get Lat, Lng: When user selects from dropdown\n google.maps.event.addListener(autocomplete, 'place_changed', function() {\n getLatLng();\n });\n}", "function initAutocomplete() \r\n {\r\n map = new google.maps.Map(document.getElementById('map'), {\r\n center: {lat: -37.9115568, lng: 145.1340114},\r\n zoom: 15\r\n \r\n });\r\n var input = document.getElementById('location_name');\r\n var searchBox = new google.maps.places.SearchBox(input);\r\n geocoder = new google.maps.Geocoder();\r\n \r\n map.addListener('bounds_changed', function() {\r\n searchBox.setBounds(map.getBounds());\r\n });\r\n \r\n var markers = [];\r\n // Listen for the event fired when the user selects a prediction and retrieve\r\n // more details for that place.\r\n searchBox.addListener('places_changed', function() {\r\n var places = searchBox.getPlaces();\r\n \r\n\r\n if (places.length == 0) {\r\n return;\r\n }\r\n\r\n // Clear out the old markers.\r\n /*markers.forEach(function(marker) {\r\n marker.setMap(null);\r\n });\r\n markers = [];\r\n // For each place, get the icon, name and location.\r\n var bounds = new google.maps.LatLngBounds();\r\n places.forEach(function(place) {\r\n var icon = {\r\n url: place.icon,\r\n size: new google.maps.Size(71, 71),\r\n origin: new google.maps.Point(0, 0),\r\n anchor: new google.maps.Point(17, 34),\r\n scaledSize: new google.maps.Size(25, 25)\r\n };\r\n \r\n\r\n // Create a marker for each place.\r\n markers.push(new google.maps.Marker({\r\n map: map,\r\n icon: icon,\r\n title: place.name,\r\n position: place.geometry.location\r\n }));\r\n\r\n if (place.geometry.viewport) {\r\n // Only geocodes have viewport.\r\n bounds.union(place.geometry.viewport);\r\n } else {\r\n bounds.extend(place.geometry.location);\r\n }\r\n });\r\n \r\n map.fitBounds(bounds);*/\r\n });\r\n \r\n \r\n }", "function userMarkerClickListener(event) {\n lastLocation = event.latLng;\n return dropClick();\n}", "function assignGeoListClick($target){\r\n\t$(\"#geoSearchList li\").click(function(){\r\n\t\tsetGeoSelection($target, $(this));\r\n\t});\r\n}", "function onAutoCompleteSuccess() {\n\tclearOldSuggestions();\n \t// In this context, 'this' means the XMLHttpRequest itself.\n \taddSuggestionsToPanel(this.response);\n}", "function suggestItemHandler(trackingVersion, suggestItems) {\n\n \n\n // bind mouseenter/mouseleave to suggest options\n\n \n\n // toggles active state on mouseenter\n\n \n\n suggestItems.on(\"mouseenter mouseleave\", function (e) {\n\n \n\n var sqItem = $(e.currentTarget);\n\n \n\n if (e.type === \"mouseenter\") {\n\n \n\n highlightResult(sqItem);\n\n \n\n } else {\n\n \n\n unhighlightResult(sqItem);\n\n \n\n }\n\n \n\n });\n\n \n\n \n\n \n\n // bind 'mousedown' event to suggest options to go to url\n\n \n\n // using 'mousedown' instead of 'click' due to 'blur' event blocking the 'click' event from firing\n\n \n\n suggestItems.off('click').on(\"click\", function (e) {\n\n \n\n SuggestedItemClick(trackingVersion, e);\n\n \n\n });\n\n \n\n }", "suggestion() {\n this.agent.suggestion.apply(this.agent, arguments);\n }", "handleResultClick(value) {\n let self = this;\n let geocoder = new google.maps.Geocoder();\n self.$scope.$evalAsync(()=> {\n self.resultList = [];\n });\n geocoder.geocode({address: value.description}, (result, status)=> {\n if (status === \"OK\") {\n self.$scope.$evalAsync(()=> {\n self.removeAllMarkers();\n self.map.setCenter(result[0].geometry.location);\n });\n }\n });\n }", "function onLocationAvailable(){\n if (!self.nf_locationText.value){\n self.updateLocation();\n } else {\n if (self.nf_locationText.value !== self.location.formattedAddress){\n self.nf.newLocation = true;\n }\n }\n }", "function onLocationFound(e) {\n myLocation = L.marker(e.latlng).remove();\n var radius = e.accuracy / 2;\n\n myLocation = L.marker(e.latlng).addTo(map).bindPopup(\"You are within \" + radius + \" meters from this point\").openPopup();\n L.circle(e.latlng, radius).addTo(map);\n myCoordinates = e.latlng;\n myCoordinates = Object.values(myCoordinates);\n }", "onFocus() {\n this.biasAutocompleteLocation();\n this.$emit('focus');\n }", "function whatToSearch(){\n $(`.js-search`).on('click',function(){\n //will eventually ask to allow for location\n // make an if statement to set a global variable to winerie or taste room depending on which button was pressed.\n $(`.js-where`).removeClass('hidden')\n\n })\n}", "geolocate() {\n\t\tif (navigator.geolocation) {\n\t\t\tnavigator.geolocation.getCurrentPosition((position) => {\n\t\t\t\tvar geolocation = {\n\t\t\t\t\tlat: position.coords.latitude,\n\t\t\t\t\tlng: position.coords.longitude\n\t\t\t\t};\n\t\t\t\tvar circle = new google.maps.Circle({\n\t\t\t\t\tcenter: geolocation,\n\t\t\t\t\tradius: position.coords.accuracy\n\t\t\t\t});\n\t\t\t\tthis.autocomplete.setBounds(circle.getBounds());\n\t\t\t});\n\t\t}\n\t}", "_customLocation() {\n if (this.state.somewhereElse) {\n this.getCoordsByAddress();\n } else {\n this._onForward();\n }\n }", "function MatAutocompleteActivatedEvent() {}", "function initAutocomplete() {\n //creating lat/long object called chicago - using this to center map at this location\n var chicago = {lat: 41.896, lng: -87.621};\n //Initializing the map - calling the map div in the HTML file\n var map = new google.maps.Map(document.getElementById('map'), {\n center: chicago,\n zoom: 14,\n mapTypeId: 'roadmap'\n });\n\n //create empty marker to place user location once they click or enter a locaiton\n var myMarker = new google.maps.Marker({\n map: map\n });\n //creat empty marker to place the group center location\n centerMarker = new google.maps.Marker({\n map: map\n });\n\n // Create the search box and link it to the UI element.\n var input = document.getElementById('pac-input');\n var searchBox = new google.maps.places.SearchBox(input);\n //map.controls[google.maps.ControlPosition.LEFT_CENTER].push(input);\n\n // Bias the SearchBox results towards current map's viewport.\n map.addListener('bounds_changed', function() {\n searchBox.setBounds(map.getBounds());\n });\n \n\n // Maps Search Box\n // Listen for the event fired when the user submits a search\n searchBox.addListener('places_changed', function() {\n console.log(\"EVENT: you entered something in the searchbox!\")\n \n var places = searchBox.getPlaces();\n if (places.length == 0) {\n return;\n }\n console.log(\"Search Result (places): \", places);\n console.log(\"# of Results (places.length): \", places.length);\n //the getPlaces() event will return an array of places that match the serach terms entered\n // -if an address is added, there is typically only one locaiton in the result array\n // -if a more generic term (e.g. cafe) is entered, the result will return multiple locations\n // ---for our purposes we will only take the first result\n var searchResult = places[0];\n // setting bounds of map based on search result\n var bounds = new google.maps.LatLngBounds();\n if (!searchResult.geometry) {\n console.log(\"Returned place contains no geometry\");\n return;\n }\n if (searchResult.geometry.viewport) {\n // Only geocodes have viewport.\n bounds.union(searchResult.geometry.viewport);\n } else {\n bounds.extend(searchResult.geometry.location);\n }\n map.fitBounds(bounds);\n //------------------------------------------------------\n myMarker.setPosition(searchResult.geometry.location)\n coords = searchResult.geometry.location;\n console.log(\"Chosen Lat/Lng: \",myMarker.getPosition().lat(),myMarker.getPosition().lng())\n \n });\n\n // Click to add location\n // Listen for clicks on the map and get the location of the click\n map.addListener(\"click\", function(e) {\n console.log(\"EVENT: you clicked the map!\");\n var lat = e.latLng.lat();\n var lng = e.latLng.lng();\n console.log(\"Chosen Lat/Lng: \",lat,lng);\n coords = new google.maps.LatLng(lat,lng);\n myMarker.setPosition(coords);\n });\n}", "function handleClick() {\n\t\thistory.push({\n\t\t\tpathname: '/search/' + recentSearch.city.replaceAll(' ', '_').trim().toLowerCase(),\n\t\t\tstate: {\n\t\t\t\tlatLng: { city: recentSearch.city, lat: recentSearch.lat, lng: recentSearch.lng },\n\t\t\t},\n\t\t})\n\t}", "function handleSuggestionClick(e) {\n\n if (e.target.closest('.suggestion')) {\n var targetDiv = e.target.closest('.suggestion');\n\n var trackInfo = {\n artist_musix_id: targetDiv.dataset.artistid,\n track_musix_id: targetDiv.dataset.trackid,\n track_name: targetDiv.querySelector('.track-name').textContent,\n artist_name: targetDiv.querySelector('.artist-name').textContent\n }\n\n //search track lyric and spotify info\n get_complete_track(trackInfo)\n .then(res => {\n var completeTrackInfo = JSON.parse(res);\n\n if (completeTrackInfo.spotify == false) {\n\n console.error('Error in Spotify call');\n\n $('#suggestion-container').empty();\n $('#suggestion-container').hide();\n\n return;\n };\n\n createResultCard(completeTrackInfo);\n\n currentResults[completeTrackInfo.musix.track_id] = completeTrackInfo;\n\n $('#after-lyric-tracking').attr('src', completeTrackInfo.musix.script_tracking_url);\n $('#suggestion-container').empty();\n $('#suggestion-container').hide();\n });\n return;\n }\n\n console.log('not single suggestion clicked');\n}", "function showLocation(e) {\n let ix = findLocation(e.latlng.lat, e.latlng.lng);\n if (ix >= 0) {\n elImage.src = places[ix].gambar;\n elPara.textContent = places[ix].review;\n }\n}", "function oab_getLocationsCallback(response) {\n //Update message if not empty\n if (response.message !== '') {\n oab_updateMessage(response.message);\n }\n \n if (response.newNonce) {\n oabUpdateNonceToken(response.newNonce);\n }\n\n //New autocompmlete options\n $('.location-autocomplete-option').detach();\n\n var i;\n for (i=0; i<response.locations.length; i++) { \n $('#top-location-container').append(\n '<span class=\\\"location-autocomplete-option\\\"'\n + 'cityID=\\\"' + response.locations[i].city.id\n + '\\\" provinceID=\\\"' + response.locations[i].province.id\n + '\\\" nationID=\\\"' + response.locations[i].nation.id\n + '\\\" cityName=\\\"' + response.locations[i].city.name\n + '\\\" provinceName=\\\"' + response.locations[i].province.name\n + '\\\" nationName=\\\"' + response.locations[i].nation.name\n + '\\\">'\n + response.locations[i].city.name + ', '\n + response.locations[i].province.name + ', '\n + response.locations[i].nation.name\n + '</span>' \n );\n }\n \n $('.location-autocomplete-option').hover(\n function() {\n $(this).css('background', '#cccccc');\n },\n function() {\n $(this).css('background', '#ffffff');\n }\n );\n \n $('.location-autocomplete-option').click(function() {\n oab_selectedLocation = $(this).attr('cityname') + ', ' + $(this).attr('provincename') + ', ' + $(this).attr('nationname');\n oab_selectedCityID = $(this).attr('cityid');\n oab_selectedNationID = $(this).attr('nationid');\n oab_selectedProvinceID = $(this).attr('provinceid');\n\n oab_setLocation(\n oab_selectedCityID,\n oab_selectedProvinceID,\n oab_selectedNationID,\n oab_setLocationCallback\n );\n });\n}", "function onGo () {\n var $input = $(\"#input-location\"), address = $input.val();\n geocodeByAddress(address);\n return false;\n}", "function locationCallback(element, results) {\n\tloadDropdown(element, results);\n\tcheckPreferences();\n}", "onPlaceChanged() {\n let place = this.autocomplete.getPlace();\n\n if (!place.geometry) {\n // User entered the name of a Place that was not suggested and\n // pressed the Enter key, or the Place Details request failed.\n this.$emit('no-results-found', place, this.id);\n return;\n }\n\n if (place.address_components !== undefined) {\n // return returnData object and PlaceResult object\n this.$emit('placechanged', this.formatResult(place), place, this.id);\n\n // update autocompleteText then emit change event\n this.autocompleteText = document.getElementById(this.id).value\n this.onChange()\n }\n }", "function finishGeo(addr){\n\tsearchbarInput.value = addr;\n}", "[enterHandler]() {\n if (this.suggestionsOpened) {\n return;\n }\n ArcNavigationEvents.navigateExternal(this, this.value, {\n purpose: this.purpose,\n });\n this.opened = false;\n }", "function geolocate() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(function(position) {\n var geolocation = {\n lat: position.coords.latitude,\n lng: position.coords.longitude\n };\n var circle = new google.maps.Circle({\n center: geolocation,\n radius: position.coords.accuracy\n });\n autocomplete.setBounds(circle.getBounds());\n });\n }\n }", "function watchUseYourLocation() {\n $('.your-location').on('click', function(event) {\n getLocation();\n });\n}", "function mapOnClick(e) {\n var coords = e.latLng;\n \n geocoder.geocode({'location': coords}, function(results, status) {\n if (status === 'OK') {\n if (program.addAllInfo(results[0])) { setMarkerPosition(coords); }\n } else {\n program.showMessage(\"\", \"Óþekkt villa. Ekki tókst að sækja staðsetninguna\");\n }\n });\n }", "function bindSearchSuggestionEvents() {\n var highlightedLink, trigger, searchType, parentUL;\n $('.search-results').on('mouseenter', 'li', function() {\n $('.search-results span').removeClass('highlight');\n $(this).find('span').addClass('highlight');\n });\n\n $('.search-results').on('mouseleave', 'li', function() {\n $(this).find('span').removeClass('highlight');\n });\n $(\".search-results\").on('click', '.is-opened li a', function(event) {\n trigger = SN.Constant.GTM_SEARCH_EVENT_SUGGESTIONS;\n searchType = getSearchType();\n highlightedLink = $('.search-results .is-opened li span.highlight');\n parentUL = $('.search-results .is-opened li span.highlight').closest('ul').attr('id');\n\n if (highlightedLink.length === 1) {\n searchBox.val(highlightedLink.text());\n $(\".search-wrapper\").hide();\n $(\".searchfn\").show();\n search(searchBox.val(), trigger, searchType, parentUL);\n\n }\n });\n }", "function configure(){\n // updating ui if map dragged\n google.maps.event.addListener(map, \"dragend\", function(){\n // if info is opened\n if (!info.getMap || !info.getMap()){\n update();\n }\n });\n\n // update if zoom changed\n google.maps.event.addListener(map, \"zoom_changed\", function(){\n update();\n });\n\n $(\"#q\").typeahead({\n highlight: false,\n minLength: 1\n },\n {\n display: function(suggestion) {return null;},\n limit: 10,\n source: search,\n templates: {\n suggestion: Handlebars.compile(\n \"<div>\" +\n \"{{ place_name }}, {{ admin_name1 }}, {{ postal_code }}\" +\n \"</div>\"\n )\n }\n });\n\n // re-center the map after the place is selected\n $(\"#q\").on(\"typeahead:selected\", function(eventObject, suggestion, name) {\n // setting the map center as selected name\n map.setCenter({lat: parseFloat(suggestion.latitude), lng: parseFloat(suggestion.longitude)});\n\n // then update the ui again\n update();\n });\n\n // hide when block has the focus\n $(\"#q\").focus(function(eventData){\n // close\n info.close();\n });\n\n // to enable right click so that we can inspect element\n document.addEventListener(\"contextmenu\", function(event) {\n event.returValue = true;\n event.stopPropagation && event.stopPropagation();\n event.cancelBubble && event.cancelBubble();\n }, true);\n\n update();\n\n // again focus\n $(\"#q\").focus();\n\n}", "geolocate() {\n const geolocation = {\n // lat: position.coords.latitude,\n // lng: position.coords.longitude,\n lat: -37.881812,\n lng: 145.058236,\n };\n const circle = new google.maps.Circle({\n center: geolocation,\n radius: 250000,\n // radius: 50,\n // language: en,\n });\n this.autocomplete.setBounds(circle.getBounds());\n }", "setRecentLocation(data) {\n data = JSON.parse(JSON.stringify(data));\n data.description = data.description ? data.description : data.formatted_address;\n data.active = false;\n this.selectedDataIndex = -1;\n this.locationInput = data.description;\n if (this.settings.showRecentSearch) {\n this._googlePlacesService.addRecentList(this.settings.recentStorageName, data, this.settings.noOfRecentSearchSave);\n this.getRecentLocations();\n }\n this.userSelectedOption = data;\n // below code will execute only when user press enter or select any option selection and it emit a callback to the parent component.\n if (!this.settings.resOnSearchButtonClickOnly) {\n this.select.emit(data);\n this.termChange.emit(data);\n }\n }", "function getLocation(jData) {\n if (jData == null) {\n // There was a problem parsing search results\n return;\n }\n\n // save place array in 'postalcodes' to make it accessible from mouse event handlers\n postalcodes = jData.postalcodes;\n\n postalcodes[0].postalcode = parseInt(postalcodes[0].postalcode);\n\n //alert(typeof(postalcodes[0].postalcode));\n\n if (postalcodes.length > 1) {\n // we got several places for the postalcode\n // make suggest box visible\n document.getElementById('suggestBoxElement').style.visibility = 'visible';\n var suggestBoxHTML = '';\n // iterate over places and build suggest box content\n for (i=0;i< jData.postalcodes.length;i++) {\n // for every postalcode record we create a html div\n // each div gets an id using the array index for later retrieval\n // define mouse event handlers to highlight places on mouseover\n // and to select a place on click\n // all events receive the postalcode array index as input parameter\n suggestBoxHTML += \"<div class='suggestions' id=pcId\" + i + \" onmousedown='suggestBoxMouseDown(\" + i +\")' onmouseover='suggestBoxMouseOver(\" + i +\")' onmouseout='suggestBoxMouseOut(\" + i +\")'> \" + postalcodes[i].countryCode + ' ' + postalcodes[i].postalcode + ' - ' + postalcodes[i].placeName +'</div>';\n }\n // display suggest box\n document.getElementById('suggestBoxElement').innerHTML = suggestBoxHTML;\n } else {\n if (postalcodes.length == 1) {\n\n\n if (postalcodes[0].postalcode > 9999 && postalcodes[0].postalcode < 10999){\n\n document.getElementById('state').value = 'Caceres';\n } else {\n\n // Si comento esta Sale provincia=cataluna en vez de barcelona para el 08170\n // y para 08005 la Poblacion viene vacia y provincia= cataluna\n document.getElementById('state').value = postalcodes[0].adminName1;\n /*document.getElementById('state').value = postalcodes[0].adminName2;\n document.getElementById('state').value = postalcodes[0].adminName3;*/\n\n\n vlen1 = document.getElementById('state');\n vlen2 = document.getElementById('state');\n vlen3 = document.getElementById('state');\n vlen4 = '';\n\n //alert (\"ad1 fuera\"+vlen1);\n\n /*if (vlen1.length > 1){\n // alert (\"ad1 mayor a 1\"+vlen1);\n }\n\n if (vlen2.length > 1){\n // alert (\"ad2 mayor a 1\"+vlen2);\n }\n\n if (vlen3.length > 1){\n // alert (\"ad3 mayor a 1\"+vlen3);\n }\n\n if (vlen4.length == 0){\n // alert (\"ad4 mayor a 1\"+vlen4);\n }*/\n\n\n\n /* alert(\"fuera admin1: \"+postalcodes[0].adminName1);\n alert(\"fuera admin2: \"+postalcodes[0].adminName2);\n\t alert(\"fuera admin3: \"+postalcodes[0].adminName3); */\n\n if (postalcodes[0].adminName2 == 'undefined'){\n alert(\"dentro adminname undefined: \"+postalcodes[0].adminName3);\n document.getElementById('state').value = postalcodes[0].adminName3;\n }\n\n if (postalcodes[0].adminName3 == 'undefined'){\n alert(\"dentro adminname undefined: \"+postalcodes[0].adminName3);\n document.getElementById('state').value = postalcodes[0].adminName3;\n }\n\n\n }\n\n\n // Poblacion\n document.getElementById('city').value = postalcodes[0].placeName;\n\n\n // 03001\n if (postalcodes[0].postalcode > 3000 && postalcodes[0].postalcode < 4000){\n document.getElementById('state').value = 'Alicante';\n }\n\n\n\n //04006 ?\n if (postalcodes[0].postalcode > 4000 && postalcodes[0].postalcode < 5000){\n document.getElementById('state').value = 'Almeria';\n }\n\n if (postalcodes[0].postalcode > 8000 && postalcodes[0].postalcode < 9000){\n document.getElementById('state').value = 'Barcelona';\n //alert('es barcelona'):\n }\n\n\n\n\n //12006 ?\n if (postalcodes[0].postalcode > 12000 && postalcodes[0].postalcode < 13000){\n document.getElementById('state').value = 'Castellon';\n }\n\n //15010 OK\n if (postalcodes[0].postalcode > 15000 && postalcodes[0].postalcode < 16000){\n document.getElementById('state').value = 'A Coruna';\n }\n\n\t //23760 OK\n if (postalcodes[0].postalcode > 23000 && postalcodes[0].postalcode < 24000){\n document.getElementById('state').value = 'Jaen';\n }\n\n //23760 OK\n if (postalcodes[0].postalcode > 25000 && postalcodes[0].postalcode < 26000){\n document.getElementById('state').value = 'Lleida';\n }\n\n // 11400 OK\n if (postalcodes[0].postalcode > 10999 && postalcodes[0].postalcode < 11999){\n document.getElementById('state').value = 'Cadiz';\n }\n\n // 45250 OK\n if (postalcodes[0].postalcode > 45000 && postalcodes[0].postalcode < 46000){\n document.getElementById('state').value = 'Toledo';\n }\n\n// 45250 OK\n if (postalcodes[0].postalcode > 51000 && postalcodes[0].postalcode < 52000){\n document.getElementById('state').value = 'Ceuta';\n }\n// 45250 OK\n if (postalcodes[0].postalcode > 52000 && postalcodes[0].postalcode < 53000){\n document.getElementById('state').value = 'Melilla';\n }\n\n\n\n\n\n // 05003 OK\n if (postalcodes[0].postalcode > 04999 && postalcodes[0].postalcode < 05999){\n document.getElementById('state').value = 'Avila';\n }\n\n // 05003 OK\n if (postalcodes[0].postalcode > 7000 && postalcodes[0].postalcode < 8000){\n document.getElementById('state').value = 'Baleares';\n //alert('codigo postal de baleares');\n }\n\n\n //33012 - Asturias-Oviedo-Gijon\n if (postalcodes[0].postalcode > 33000 && postalcodes[0].postalcode < 34000){\n document.getElementById('state').value = 'Asturias';\n }\n //33012 - Asturias-Oviedo-Gijon\n if (postalcodes[0].postalcode > 35000 && postalcodes[0].postalcode < 36000){\n document.getElementById('state').value = 'Las Palmas';\n }\n\n\n //39001 - Santander-Cantabria\n if (postalcodes[0].postalcode > 39000 && postalcodes[0].postalcode < 40000){\n document.getElementById('state').value = 'Cantabria';\n }\n\n // 48001 OK\n if (postalcodes[0].postalcode > 48000 && postalcodes[0].postalcode < 49000){\n document.getElementById('state').value = 'Vizcaya';\n }\n\n // 48001 OK\n if (postalcodes[0].postalcode > 20000 && postalcodes[0].postalcode < 21000){\n document.getElementById('state').value = 'Guipuzcoa';\n }\n\n // 48001 OK\n if (postalcodes[0].postalcode > 22000 && postalcodes[0].postalcode < 23000){\n document.getElementById('state').value = 'Huesca';\n }\n\n if (postalcodes[0].postalcode > 26000 && postalcodes[0].postalcode < 27000){\n document.getElementById('state').value = 'La Rioja';\n }\n\n if (postalcodes[0].postalcode > 29000 && postalcodes[0].postalcode < 30000){\n document.getElementById('state').value = 'Malaga';\n }\n\n\n\n }\n closeSuggestBox();\n }\n}", "function initialize() {\n let input = document.getElementById('location-input');\n let autocomplete = new google.maps.places.Autocomplete(input);\n autocomplete.addListener('place_changed', function() {\n let place = autocomplete.getPlace();\n // place variable will have the info we are looking for \n $('#lat').val(place.geometry['location'].lat());\n $('#long').val(place.geometry['location'].lng());\n \n \n })\n}", "function onPlaceChanged() {\n const place = autocomplete.getPlace();\n if (place.geometry) {\n map.panTo(place.geometry.location);\n map.setZoom(11);\n } else {\n cityField.placeholder = \"Enter a city\";\n }\n let activityField = document.getElementById(\"activity\");\n activityField.focus();\n}", "function renderHistoryLocationInfo() {\n var li = $('.list-group').children(\".list-group-item\");\n for (var i = 0; i < li.length; i++) {\n li[i].addEventListener(\"click\", function (event) {\n var loc = event.target.textContent\n searchCity(loc);\n });\n }\n}", "search(event){\n this.placeService.textSearch({\n query: `${event.target.value}`,\n type: 'airport'\n }, this.handleSuggestions);\n }", "function activatePlacesSearch() {\n console.log(\"In activatePlacesSearch function\");\n let options = {\n types: ['(regions)']\n };\n let input = document.getElementById('search-term');\n let autocomplete = new google.maps.places.Autocomplete(input, options);\n}", "onResultsOpen() {\n state = 'opened';\n\n run(() => {\n debug(`Flexberry Lookup::autocomplete state = ${state}`);\n });\n }" ]
[ "0.76117635", "0.73072565", "0.7094965", "0.6916108", "0.68464005", "0.6751825", "0.6746362", "0.67334753", "0.66997117", "0.6647827", "0.66275346", "0.65293723", "0.6416085", "0.6389459", "0.63424516", "0.6307688", "0.6306134", "0.63004565", "0.62713915", "0.62515354", "0.6248659", "0.6235625", "0.6224697", "0.62110895", "0.6208853", "0.6171786", "0.6167042", "0.6160689", "0.6147457", "0.6139277", "0.6136595", "0.6122302", "0.609428", "0.6091525", "0.6089521", "0.607926", "0.6076982", "0.60720646", "0.6071971", "0.6063938", "0.60328716", "0.6032369", "0.60293645", "0.60139585", "0.60102004", "0.600161", "0.59845513", "0.5977353", "0.5971867", "0.59680384", "0.5965351", "0.5964151", "0.59639317", "0.594844", "0.5946351", "0.59453076", "0.5935983", "0.5933602", "0.59205246", "0.59192926", "0.5917023", "0.5912756", "0.59087986", "0.5905409", "0.5905029", "0.59013945", "0.5900519", "0.5900179", "0.58961236", "0.5882969", "0.58811265", "0.58745146", "0.5872518", "0.587088", "0.58677113", "0.58666855", "0.5860143", "0.5845116", "0.5838337", "0.58326095", "0.5832496", "0.58317965", "0.5825454", "0.58220124", "0.58216786", "0.58154976", "0.58139783", "0.58115345", "0.58033174", "0.58018446", "0.58009267", "0.5800105", "0.5795864", "0.57951933", "0.5795067", "0.57944536", "0.5794421", "0.5787094", "0.57839173", "0.5781801" ]
0.63713294
14
called when input_location input changed.
setLocationSuggestions(event){ if (this.country_mode) return false; let display_location_mode = this.input_location_mode_changed ? this.input_location_mode : 1; let get_started = this, new_location = { input_location_mode: display_location_mode, input_location: event.target.value }; get_started.setState({ input_location: event.target.value, show_location_suggestions: true }); if (get_started.$set_location_suggestions){ clearTimeout(get_started.$set_location_suggestions); } // debounce location suggestions by 500ms. get_started.$set_location_suggestions = setTimeout(()=>{ CalculatorApi.getAutoComplete(new_location) .then((locations)=>{ get_started.setState({ locations: locations, show_location_suggestions: true }); }); }, 500); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "LocationSelectChanged() {\n this.fieldsetElement.disabled = false;\n this.timezoneError.textContent = '';\n const value = this.locationSelectElement.options[this.locationSelectElement.selectedIndex].value;\n if (value === NonPresetOptions.NoOverride) {\n this.LocationOverrideEnabled = false;\n this.clearFieldsetElementInputs();\n this.fieldsetElement.disabled = true;\n }\n else if (value === NonPresetOptions.Custom) {\n this.LocationOverrideEnabled = true;\n const location = SDK.EmulationModel.Location.parseUserInput(this.latitudeInput.value.trim(), this.longitudeInput.value.trim(), this.timezoneInput.value.trim(), this.localeInput.value.trim());\n if (!location) {\n return;\n }\n this.Location = location;\n }\n else if (value === NonPresetOptions.Unavailable) {\n this.LocationOverrideEnabled = true;\n this.Location = new SDK.EmulationModel.Location(0, 0, '', '', true);\n }\n else {\n this.LocationOverrideEnabled = true;\n const coordinates = JSON.parse(value);\n this.Location = new SDK.EmulationModel.Location(coordinates.lat, coordinates.long, coordinates.timezoneId, coordinates.locale, false);\n this.latitudeSetter(coordinates.lat);\n this.longitudeSetter(coordinates.long);\n this.timezoneSetter(coordinates.timezoneId);\n this.localeSetter(coordinates.locale);\n }\n this.applyLocation();\n if (value === NonPresetOptions.Custom) {\n this.latitudeInput.focus();\n }\n }", "function changeValueLocation(event) {\n setLocation(event.target.value);\n }", "function _changedLocationField () {\n /**\n * Enable/disable 'go' button based on current user location value\n */ \n if ($location_field.val() !== '') {\n $directions_form.find('button').removeAttr('disabled');\n } else {\n $directions_form.find('button').attr('disabled', '');\n }\n\n \n /**\n * If the user enters their location manually remove the geocoded cache\n * (this is used to reduce Google Map directions requests/limits)\n */ \n if ($location_field.val() !== current_visitor_location) {\n $location_field.removeAttr('data-geocoded');\n current_visitor_location = '';\n }\n\n locked = false;\n }", "setLocation(event){\n const get_started = this,\n updated_params = {\n zipcode: event.target.dataset.zipcode,\n suggestion: event.target.dataset.suggestion\n };\n if (get_started.userApiValue('input_changed')) {\n get_started.showUpdateConfirmation();\n const ui = {\n id: 'update_to_confirm',\n data: {\n type: 'location',\n params: updated_params\n }\n };\n get_started.props.updateUI(ui);\n } else {\n get_started.setLocationConfirmed(updated_params);\n }\n\n }", "function changeLocation(newValue){\n setLoc(newValue);\n }", "function inputChanged() {\n parseInput(this);\n getDataFromTable();\n }", "function onLocationAvailable(){\n if (!self.nf_locationText.value){\n self.updateLocation();\n } else {\n if (self.nf_locationText.value !== self.location.formattedAddress){\n self.nf.newLocation = true;\n }\n }\n }", "detectWaypointChangedListener(autocompletedInput) {\n autocompletedInput.bindTo(\"bounds\", this.map);\n autocompletedInput.addListener(\"place_changed\", () => {\n const place = autocompletedInput.getPlace();\n\n if (!place.place_id) {\n window.alert(\"Please select an option from the dropdown list.\");\n return;\n }\n\n this.calculateAndDisplayRoute();\n });\n }", "onLocChange(e) {\n this.setState({\n location: e.target.value\n })\n }", "function useCurrentLocation() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(function (position) {\n state.location1 = [position.coords.longitude, position.coords.latitude];\n showLocationsOnMap();\n reverseGeocode(state.location1, function (address) {\n $(\"#fromInput\").val(address);\n //fromFieldInputDetected(document.getElementById(\"fromInput\"));\n });\n }, function (error) {\n if (error.code === error.PERMISSION_DENIED) {\n if (typeof (Storage) !== \"undefined\") {\n localStorage.setItem(\"geolocation.permission.denieddate\", new Date());\n }\n } else {\n console.warn(\"Accessing geolocation failed.\", error);\n }\n });\n if (typeof (Storage) !== \"undefined\") {\n localStorage.removeItem(\"geolocation.permission.denieddate\");\n }\n } else {\n console.warn(\"Geolocation is not supported by this browser.\");\n }\n}", "changedInput() {\n\n\t\tlet {isValid, error} = this.state.wasInvalid ? this.validate() : this.state;\n\t\tlet onChange = this.props.onChange;\n\t\tif (onChange) {\n\t\t\tonChange(this.getValue(), isValid, error);\n\t\t}\n\t\tif (this.context.validationSchema) {\n\t\t\tlet value = this.getValue();\n\t\t\tif (this.state.isMultiSelect && value === '') {\n\t\t\t\tvalue = [];\n\t\t\t}\n\t\t\tif (this.shouldTypeBeNumberBySchemeDefinition(this.props.pointer)) {\n\t\t\t\tvalue = Number(value);\n\t\t\t}\n\t\t\tthis.context.validationParent.onValueChanged(this.props.pointer, value, isValid, error);\n\t\t}\n\t}", "searchinputCallback(event) {\n const inputVal = this.locationInput;\n if (inputVal) {\n this.getListQuery(inputVal);\n }\n else {\n this.queryItems = [];\n if (this.userSelectedOption) {\n this.userQuerySubmit('false');\n }\n this.userSelectedOption = '';\n if (this.settings.showRecentSearch) {\n this.showRecentSearch();\n }\n else {\n this.dropdownOpen = false;\n }\n }\n }", "function handleUpadateLocation() {\n resetMap();\n}", "internalOnInput(event) {\n const me = this; // Keep the value synced with the inputValue at all times.\n\n me.inputting = true;\n me.value = me.input.value;\n me.inputting = false;\n me.trigger('input', {\n value: me.value,\n event\n });\n me.changeOnKeyStroke && me.changeOnKeyStroke(event); // since Widget has Events mixed in configured with 'callOnFunctions' this will also call onInput\n }", "handleChange(event) {\n let { location } = this.state.location\n location = event.target.value\n this.setState({ location: location })\n }", "_setLocation(location){\n this.location = location;\n this.notify(UpdateMessage.Relocated);\n }", "updateLocation (e) {\n e.preventDefault()\n this.setState({\n locationFound: false,\n geoRecieved: false\n })\n }", "handleChange(input) {\n if (!input && this.props.searchedLocation) {\n this.props.searchedLocation(null);\n // set state in RideTableContainer to null to remove waypoints\n }\n\n this.setState({\n address: input,\n });\n }", "changeLocation(newLocation) {\n this.locationEl.text(newLocation);\n }", "function processUpdate(oldLocation, newLocation, didCapture) {\n checkerState.board[convertSides(newLocation)] = checkerState.board[convertSides(oldLocation)]\n checkerState.board[convertSides(oldLocation)] = \"empty\"\n checkRemoteKingMe();\n\n\n //Ready to own selection\n if (!didCapture) {\n checkerState.State = \"waiting_selection\";\n }\n //Lastly update board\n\n updateBoard();\n \n \n }", "function checkInput(){\n \n if (searchInp.value != \"\"){\n initialLocation = false;\n console.log(\"init\", initialLocation);\n }\n \n else {\n initialLocation = true;\n console.log(\"init\", initialLocation); \n }\n }", "function updatedLocation() { \n console.log(\"now checking for location changes\"); //needs to write to DOM??\n navigator.geolocation.watchPosition(onGetGeolocationSuccess, onGetGeolocationError); \n}", "function updateLocation(event) {\n var id = event.currentTarget.parentElement.parentElement.id;\n allUnicorns[id].location = event.currentTarget.value;\n //Refreshes display on update\n displayUnicornInformation();\n}", "onUpdateUserLocation(location) {\n // We will emit a socket event 'change location' to the digital ocean server at 107.170.3.84:4568\n this.socket.emit('change location', location);\n this.setState({currentLoc: location});\n }", "handleLocationChange(event) {\n this.setState({ location: event.target.value });\n }", "function blurInput(event) {\n //If field is empty, revert to previous city\n if (location === \"\") {\n setLocation(weather.name);\n } else {\n changeCity(location);\n }\n }", "function updateLocation() {\n var locIx = $(\"#locationSelect\").val() - 1;\n $(\"#latitude\").val(locations[locIx].latitude);\n $(\"#longitude\").val(locations[locIx].longitude);\n $(\"#zoom\").val(locations[locIx].zoom);\n selectedName = locations[locIx].name;\n}", "update() {\n\t this.value = this.originalInputValue;\n\t }", "handleLocationChange(event) {\n this.setState({location: event.target.value});\n }", "static get observers() {\n return [\n 'handle_input_data_changed(inputData)'\n ]\n }", "setLocation(location) {\n this.setAttribute(\"data-location\", this.encode(location));\n dispatchEvent(new Event(\"google-map-location-changed\"));\n }", "internalOnInput(event) {\n const me = this;\n\n // Keep the value synced with the inputValue at all times.\n me.inputting = true;\n me.value = me.input.value;\n me.inputting = false;\n\n me.trigger('input', { value: me.value, event });\n\n me.changeOnKeyStroke && me.changeOnKeyStroke(event);\n\n // since Widget has Events mixed in configured with 'callOnFunctions' this will also call onInput\n }", "onLocationChange(evt){\n this.setState({\n locations: [locationDict[evt.target.value] ]\n });\n }", "function handleConfirm(){\n const changes = {\n lat : latRef.current.value,\n long : longRef.current.value\n }\n updateLocation(location, changes)\n }", "function detectExistingInput() {\n var latitudeInput = $(formComponents.latitude.id),\n longitudeInput = $(formComponents.longitude.id);\n\n if (!latitudeInput.val().length && !longitudeInput.val().length) {\n return;\n }\n\n $.each(formComponents, function(index, formComponent) {\n $(formComponent.id).prop(\"disabled\", false);\n });\n\n googleMap.showLocation(new google.maps.LatLng(latitudeInput.val(), longitudeInput.val()));\n }", "static setCity(e) {\n e.preventDefault();\n city = locationInput.value;\n document.querySelector(\".location\").innerText = city;\n UI.updateUI();\n }", "function getLesionLocationCallback(measurementData, eventData, doneCallback) {\n //doneCallback(prompt('Enter your lesion location:'));\n }", "function updateInput() {\n\talert('Input registered')\n}", "function handleInput() {\n\t\t\tif (onInput) {\n\t\t\t\tonInput(value);\n\t\t\t}\n\t\t}", "function refresh(input) {\r\n\t\tupdateFromInput(input);\r\n\t}", "handleInputChange(e) {\n\n this.setState({search: e.target.value, venue_location: e.target.value})\n }", "setLocation(event) {\n this.setState({ location: event.target.value });\n }", "function handleFormFieldChange(event) {\n const value = event.target.value\n const fieldName = event.target.name\n\n const updatedLocation = { ...newLocation, [fieldName]: value }\n\n setNewLocation(updatedLocation)\n }", "searchLocation () {\n return this.inputLocation;\n }", "onPlaceChanged() {\n let place = this.autocomplete.getPlace();\n\n if (!place.geometry) {\n // User entered the name of a Place that was not suggested and\n // pressed the Enter key, or the Place Details request failed.\n this.$emit('no-results-found', place, this.id);\n return;\n }\n\n if (place.address_components !== undefined) {\n // return returnData object and PlaceResult object\n this.$emit('placechanged', this.formatResult(place), place, this.id);\n\n // update autocompleteText then emit change event\n this.autocompleteText = document.getElementById(this.id).value\n this.onChange()\n }\n }", "function onGetCurrentLocation () {\n geocodeByCurrentLocation();\n return false;\n}", "function MCH_InputChange(el_input) {\n console.log(\" ----- MCH_InputChange ----\")\n console.log(\" el_input\", el_input)\n mod_MCH_dict.has_changes = true;\n MCH_Hide_Inputboxes();\n }", "async function handleEditLocation() {\n const location = locationForm.values;\n await handleModalClose();\n await updateLocation(location);\n await newLocations();\n }", "function updateInput( e ) {\r\n this.set( \"value\", e.newVal );\r\n }", "locationSearch() {\n if (this.$locationInput.val()) {\n $('.spinner-zone').show();\n IndexSearchObj.searchYelp();\n this.focusBlur();\n }\n }", "function updatePosition() {\n\t\n\t//change time box to show updated message\n\t$('#time').val(\"Getting data...\");\n\t\n\t//instruct location service to get position with appropriate callbacks\n\twatchID = navigator.geolocation.watchPosition(successPosition, failPosition, locationOptions);\n}", "function handleInputChange(event) {\n console.count('input changed');\n }", "setRecentLocation(data) {\n data = JSON.parse(JSON.stringify(data));\n data.description = data.description ? data.description : data.formatted_address;\n data.active = false;\n this.selectedDataIndex = -1;\n this.locationInput = data.description;\n if (this.settings.showRecentSearch) {\n this._googlePlacesService.addRecentList(this.settings.recentStorageName, data, this.settings.noOfRecentSearchSave);\n this.getRecentLocations();\n }\n this.userSelectedOption = data;\n // below code will execute only when user press enter or select any option selection and it emit a callback to the parent component.\n if (!this.settings.resOnSearchButtonClickOnly) {\n this.select.emit(data);\n this.termChange.emit(data);\n }\n }", "function onDomainChanged() {\n var queryParamString = \"type=setUserLocation\";\n queryParamString += \"&username=\" + AccountServices.username;\n queryParamString += \"&location=unknown\";\n\n var uri = REQUEST_URL + \"?\" + queryParamString;\n\n if (DEBUG) {\n console.log(\"statusIndicator onDomainChanged: \" + uri);\n }\n\n request({\n uri: uri\n }, function (error, response) {\n if (error || !response || response.status !== \"success\") {\n console.error(\"Error with onDomainChanged: \" + JSON.stringify(response));\n } else {\n // successfully sent updateLocation\n if (DEBUG) {\n console.log(\"Entered onDomainChanged called: \" + zoneName);\n }\n }\n });\n }", "function handleChangeInput(e){\n setInputAddress(e.target.value)\n }", "function handleGeolocationRequest() {\n\t\t\tui.showGeolocationSearching(true);\n\t\t\tui.showGeolocationError(false);\n\t\t\tgeolocator.locate(handleGeolocateSuccess, handleGeolocateError, handleGeolocateNoSupport, preferences.language);\n\t\t}", "function userInputChanges(e) {\n setUserInput(e.target.value);\n }", "handleLocation(name) { // String\n\t\t// future active city, updated current activeCity\n\t\tif (name) {\n\t\t\tthis.props.changeActiveCity(\n\t\t\t\t_.merge(_.find(this.props.cities, name), name),\n\t\t\t\tthis.props.activeCity\n\t\t\t)\n\t\t}\n\t\tthis.setState({ dialogTravel: false })\n\t}", "function finishGeo(addr){\n\tsearchbarInput.value = addr;\n}", "function mapDataChanged(){\r\n //force an update\r\n onMapMoved();\r\n}", "SetLocation() {\n\n }", "function receiveMapZoomEvent() {\n updateLocationButton();\n // Redraw the user's location marker so it can be seen. */\n map.redrawLocationMarker();\n map.setCodeMarker(\n displayedCode.codeArea.latitudeLo,\n displayedCode.codeArea.longitudeLo,\n displayedCode.codeArea.latitudeHi,\n displayedCode.codeArea.longitudeHi);\n}", "function receiveMapZoomEvent() {\n updateLocationButton();\n // Redraw the user's location marker so it can be seen. */\n map.redrawLocationMarker();\n map.setCodeMarker(\n displayedCode.codeArea.latitudeLo,\n displayedCode.codeArea.longitudeLo,\n displayedCode.codeArea.latitudeHi,\n displayedCode.codeArea.longitudeHi);\n}", "onInput(event) {\n const input = event.target;\n // Let's wait for DOM to be updated\n nextTick().then(() => {\n this.$emit('update:modelValue', nullify(input.value));\n });\n }", "onLocationClicked(){}", "addLocationChangeHandler() {\n document.addEventListener('deviceready', () => {\n const location = new AWLocation(position => {\n this.location$.next(position);\n });\n location.getCurrentPosition({enableHighAccuracy: true, filter: 10});\n });\n }", "refreshFromLocation()\n {\n let args = helpers.args.location;\n this.inputElement.value = args.hash.get(\"search\") || \"\";\n this.refreshClearButtonVisibility();\n }", "_customLocation() {\n if (this.state.somewhereElse) {\n this.getCoordsByAddress();\n } else {\n this._onForward();\n }\n }", "function addInputListener() {\n const location = document.getElementById(\"location\");\n document.addEventListener(\"keypress\", (e) => {\n if (e.keyCode === 13 && location.value !== \"\") {\n elements.createWeatherPage();\n _searchWeather(location.value);\n }\n });\n }", "function locationSelectedInInput(div, val) {\n var intValue = parseInt(val);\n if (!isNaN(intValue)) {\n // Change the location control requests the location's geometry to place on the map.\n $.getJSON(indiciaData.read.url + 'index.php/services/data/location?parent_id=' + val + '&orderby=name' +\n '&mode=json&view=detail&auth_token=' + indiciaData.read.auth_token + '&nonce=' + indiciaData.read.nonce + \"&callback=?\", function(data) {\n // Sort into numeric section order.\n data.sort(function(a, b) {\n var aCode = a.code.replace(/^S/g, '');\n var bCode = b.code.replace(/^S/g, '');\n return parseInt(aCode, 10) - parseInt(bCode, 10);\n });\n indiciaData.subsites = data;\n $('#subsites').val(JSON.stringify(data));\n indiciaData.mapdiv.removeAllFeatures(indiciaData.mapdiv.map.editLayer, 'section');\n $.each(data, function(idx, subsite) {\n var geomwkt = subsite.boundary_geom || data[0].centroid_geom;\n var parser = new OpenLayers.Format.WKT();\n var feature = parser.read(geomwkt);\n indiciaData.siteChanged = true;\n feature.attributes.type = 'section';\n if (indiciaData.mapdiv.indiciaProjection.projCode!==indiciaData.mapdiv.map.projection.projCode){\n geomwkt = feature.geometry.transform(div.indiciaProjection, indiciaData.mapdiv.map.projection).toString();\n }\n indiciaData.mapdiv.map.editLayer.addFeatures([feature]);\n });\n indiciaData.mapdiv.map.zoomToExtent(indiciaData.mapdiv.map.editLayer.getDataExtent());\n });\n }\n }", "function updateMap() {\n get_geolocation();\n\n if (geolocation === null || geolocation === undefined) {\n return;\n }\n\n if (marker !== null) {\n marker.removeFrom(map);\n }\n marker = L.marker(geolocation, {\n draggable: true\n }).addTo(map);\n\n marker.on('dragend', function() {\n var coords = marker.getLatLng();\n $(\"#lat\")[0].value = coords['lat'];\n $(\"#lon\")[0].value = coords['lng'];\n updatePlot();\n setPage('plot');\n });\n}", "function onLocationFound(e) {\n\t\t\n\t\t//Coordinates of location for marker:\n\t\tvar latLon = e.latlng;\n\t\t\n\t\t//Creation of the marker:\n\t\tvar marker = $scope.createMarker(latLon.lat,latLon.lng,parseInt(0),\"default\",$rootScope.username);\n\t\t\t\n\t\t//If marker creation was successful show input dialog:\n\t\tif (marker) {\n\t\t\t\t\n\t\t\t//Add marker to editItems:\n\t\t\t$rootScope.editItems.addLayer(marker);\n\t\t\t\t\n\t\t\t// Show input dialog\n\t\t\t$rootScope.$broadcast(\"startedit\", {feature: marker});\n\t\t}\n\t\t\n\t\t//return button state to default state:\n\t\t$scope.locateButton.state('un_loaded');\n\t}", "handleInput(e) {\n if (this.props.onUpdate) { this.props.onUpdate(e.currentTarget.value) }\n }", "function onLeaveLoBoundLoc()\n{\n\tvar value = $(\"#loBoundLoc\").val();\n\t// Set variable for upBound completer\n\t$(\"#upBoundLoc\").data(\"ui-autocomplete\").options.params.loBound = value;\n}", "onchangeInput(e){\n\t\t//console.log('change')\n\t\t//console.log(e)\n\t\tdocument.getElementById('clearInputCountryButton').style.display='inline-block';//display the clear input button\n\n\n\t\tthis.autosearchCountry() //send to autosearch Country\n\n\t}", "function handleOnInputChange(event) {\n\n let newSource;\n\n switch (event.target.name) {\n case \"query\":\n setKeyWords(event.target.value);\n break;\n case \"scopus\":\n //switch between true and false\n queryData.scopus = true;\n queryData.googleScholar = false;\n queryData.arXiv = false;\n break;\n\n case \"googleScholar\":\n //switch between true and false\n queryData.scopus = false;\n queryData.googleScholar = true;\n queryData.arXiv = false;\n break;\n case \"arXiv\":\n //switch between true and false\n queryData.scopus = false;\n queryData.googleScholar = false;\n queryData.arXiv = true;\n break;\n case \"searchBy\":\n queryData.searchBy = event.target.value;\n break;\n case \"year\":\n queryData.year = event.target.value;\n break;\n default:\n break;\n }\n \n if(event.target.name !== \"query\" && queryData.query && keywords){\n queryData.query = keywords;\n history.push(createQueryStringFromObject(queryData));\n }else{\n setSource({\"scopus\": queryData.scopus, \"googleScholar\": queryData.googleScholar, \"arXiv\": queryData.arXiv});\n setSearchBy(queryData.searchBy);\n setYear(queryData.year);\n }\n\n }", "function onLocationChanged(lat, lon, alt, acc) {\n AppActions.execute('trackActivity', {\n eventObject: EventLogFactory.location('ar', Excursion.serverId, {\n latitude : lat,\n longitude: lon,\n altitude : alt,\n accuracy : acc\n })\n });\n $rootScope.$apply(function() {\n UserLocation.update(lon, lat, alt, acc);\n });\n }", "updateLocationDataIfMissing(locationData) {\r\n\t\t\t\t\tvar base, ref1;\r\n\t\t\t\t\tif (this.locationData && this.needsUpdatedStartLocation) {\r\n\t\t\t\t\t\tthis.locationData = Object.assign({}, this.locationData, {\r\n\t\t\t\t\t\t\tfirst_line: locationData.first_line,\r\n\t\t\t\t\t\t\tfirst_column: locationData.first_column,\r\n\t\t\t\t\t\t\trange: [locationData.range[0], this.locationData.range[1]]\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\tbase = ((ref1 = this.variable) != null ? ref1.base : void 0) || this.variable;\r\n\t\t\t\t\t\tif (base.needsUpdatedStartLocation) {\r\n\t\t\t\t\t\t\tthis.variable.locationData = Object.assign({}, this.variable.locationData, {\r\n\t\t\t\t\t\t\t\tfirst_line: locationData.first_line,\r\n\t\t\t\t\t\t\t\tfirst_column: locationData.first_column,\r\n\t\t\t\t\t\t\t\trange: [locationData.range[0], this.variable.locationData.range[1]]\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\tbase.updateLocationDataIfMissing(locationData);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tdelete this.needsUpdatedStartLocation;\r\n\t\t\t\t\t}\r\n\t\t\t\t\treturn super.updateLocationDataIfMissing(locationData);\r\n\t\t\t\t}", "onInputChange(term) {\n\t\tthis.setState({term});\n\t\tthis.props.onSearchTermChange(term);\n\t}", "chooseLocation() {\n \n }", "_onInput(event) {\n // Listening to the input event wouldn't be necessary when the input is using the\n // FormsModule or ReactiveFormsModule, because Angular forms also listens to input events.\n this.lastKeyValue = event.data;\n if (this._isTextarea) {\n this.lastCaretPosition = this._elementRef.nativeElement.selectionStart;\n }\n }", "function callbackGeolocate(location) {\n var locationString = \"\";\n var locations = state.locations = {};\n location.results[0].address_components.forEach(function(val) {\n if (val.types[0] == \"country\") locations[\"country\"] = val.long_name;\n if (val.types[0] == \"locality\") locations[\"city\"] = val.long_name;\n if (val.types[0] == \"administrative_area_level_1\") locations[\"state\"] = val.long_name;\n });\n if (state.locations.city) locationString += state.locations.city;\n if (state.locations.state) locationString += \", \" + state.locations.state;\n if (state.locations.country) locationString += \", \" + state.locations.country;\n if (locationString == \"\") alert(\"There was an error getting your location.\");\n $(\"#location\").val(locationString);\n state.getGeoLocation = true;\n}", "function mapForApproximateLocationCentreChanged()\n {\n determineLocationFromMap();\n }", "function inputComplete(){\n // stop listening for the input to lose focus\n $(\"body\").off(\"blur\", \"#area_scanner\", inputBlur);\n // report the results\n reportValues();\n }", "onInput(e) {\n this.updateFilledState();\n }", "function OnLongitude_Change( e , type )\r\n{\r\n Alloy.Globals.ShedModeShedPosition[\"LONGITUDE\"] = $.widgetAppTextFieldShedModeFormsShedPositionLongitude.get_text_value() ;\r\n}", "function onChangeHandler() {\n calculateAndDisplayRoute(directionsService, directionsDisplay);\n }", "handleLocationAutoCompleteSelect(chosenRequest) {\r\n this.setState({location: chosenRequest}, () => this.handleSubmit());\r\n }", "function inputComplete(){\n // stop listening for the input to lose focus\n $(\"body\").off(\"blur\", \"#area_scanner\", inputBlur);\n // report the results\n reportValues();\n }", "function inputComplete(){\n // stop listening for the input to lose focus\n $(\"body\").off(\"blur\", \"#area_scanner\", inputBlur);\n // report the results\n reportValues();\n }", "inputValueDidChange() {\n let value = parseInt(this.get('inputValue'), 10);\n this.set('value', isNaN(value) ? undefined : value);\n }", "function setLocationName(name) {\n locationDisplay.text(name);\n locationNameInput.val(name);\n }", "componentDidUpdate() {\n try {\n if (\n this.state.isFirstTime &&\n this.props.attributes &&\n !this.props.attributes[\"is_lookup_field\"]\n ) {\n /**\n * If form data does not exists, then fetch locaiton\n * else check the location data, if location exists render location\n * else fetch the location\n */\n if (!isEmpty(this.props.formData)) {\n const { value } = this.props.attributes;\n if (isEmpty(value)) {\n this.setState({\n isPickingLocation: true,\n isFirstTime: false,\n });\n this.promptForEnableLocationIfNeeded();\n } else {\n this.setState({\n isPickingLocation: false,\n isFirstTime: false,\n });\n }\n } else {\n this.setState({ isPickingLocation: true, isFirstTime: false });\n this.promptForEnableLocationIfNeeded();\n }\n }\n } catch (error) {\n console.warn(error);\n }\n }", "handleInputChange(event) {\n const { dispatch } = this.props;\n const { value } = event.target;\n dispatch(updateCity(value));\n }", "componentDidUpdate () {\n this.refs.locationInput.value = '';\n }", "function updateDraggedGeoCodes()\n{\n\tpoint = marker.getPosition()\n\tThisLat = point.lat();\n\tThisLong = point.lng();\n\tdocument.getElementById(\"latitude\").value = ThisLat;\n\tdocument.getElementById(\"longitude\").value = ThisLong;\t\n}", "_onInput() {\n // This is a noop function and is used to let Angular know whenever the value changes.\n // Angular will run a new change detection each time the `input` event has been dispatched.\n // It's necessary that Angular recognizes the value change, because when floatingLabel\n // is set to false and Angular forms aren't used, the placeholder won't recognize the\n // value changes and will not disappear.\n // Listening to the input event wouldn't be necessary when the input is using the\n // FormsModule or ReactiveFormsModule, because Angular forms also listens to input events.\n }", "function updateLocationData() {\n\n\tdocument.getElementById('riForm:hidlat').value = marker.getPosition().lat();\n\tdocument.getElementById('riForm:hidlng').value = marker.getPosition().lng();\n\tvar latlng = marker.getPosition();\n\tgeocoder.geocode({\n\t\t'latLng' : latlng\n\t}, function(results, status) {\n\t\tif (status == google.maps.GeocoderStatus.OK) {\n\t\t\tif (results[0]) {\n\n\t\t\t\t// map.setZoom(11);\n\t\t\t\t// marker = new google.maps.Marker({\n\t\t\t\t// position: latlng,\n\t\t\t\t// map: map\n\t\t\t\t// });\n\t\t\t\tupdateLocationDetails(results[0]);\n\t\t\t\t// infowindow.setContent(results[1].formatted_address);\n\t\t\t\t// infowindow.open(map, marker);\n\t\t\t} else {\n\t\t\t\talert('No results found');\n\t\t\t}\n\t\t} else {\n\t\t\talert('Geocoder failed due to: ' + status);\n\t\t}\n\t});\n\n}", "function onInput(e){\n console.log(e.detail);\n console.log(\"onInput: \", e.detail);\n }", "function onPlaceChanged(){\n\n\tvar place= autocomplete.getPlace();\n\n\t// var to get latitude and longitude of city to map using google maps API\n\tloc= new google.maps.LatLng(place.geometry.location.lat(), place.geometry.location.lng());\n\n\t// variable to store city,state and country for yelp matching\n\tcityName = place.formatted_address;\n\n\t//Empty previous list and markers\n\tplaceArray([]);\n\tmarker([]);\n\n\t// set heading based on place \n\t$('#heading').html(\"Restaurants around \" + place.name);\n\n\t// if place found zoom to place else ask user to enter a valid city\n\tif (place.geometry) {\n\t\tmap.panTo(place.geometry.location);\n\t\tif (screen.width < 600) {\n\t\t\tmap.setZoom(12);\n\t\t} else {\n \t\tmap.setZoom(15);\n \t}\n\n \t//hide citysearch input field\n\t\t$('.csearch').toggleClass(\"hidden\");\n\n\t\t//perform location search\n \tsearch();\n \t\n \tvar check = $('.menu').hasClass('closed');\n \tif (screen.width > 600 && check) {\n \t\ttoggleMenu();\n \t}\n\t} else {\n\t\talert(\"Enter a valid city\");\n\t\tgetCityInput();\n\t}\n}" ]
[ "0.6970966", "0.6907091", "0.676796", "0.6675062", "0.6498593", "0.6467904", "0.64392537", "0.6369615", "0.6338772", "0.62636656", "0.6185812", "0.618056", "0.6133366", "0.6103283", "0.61009306", "0.6074133", "0.60611576", "0.6058162", "0.6011542", "0.5968102", "0.59591824", "0.5948181", "0.59393704", "0.59258413", "0.59139675", "0.5909043", "0.59057474", "0.58992", "0.588781", "0.5885469", "0.58806705", "0.5879961", "0.58779246", "0.58737403", "0.5866284", "0.58376837", "0.58203673", "0.5818303", "0.5812888", "0.5812271", "0.58040774", "0.5800185", "0.57940805", "0.57869685", "0.57836825", "0.5756071", "0.57539546", "0.5745371", "0.57406306", "0.5740561", "0.5736637", "0.5730419", "0.5729908", "0.5722682", "0.57138616", "0.57054085", "0.5696584", "0.5694329", "0.5687704", "0.56809765", "0.5678477", "0.56669664", "0.56669664", "0.56656045", "0.56498027", "0.5642093", "0.564159", "0.5640203", "0.5636937", "0.5632806", "0.5629869", "0.5625978", "0.562338", "0.5621158", "0.5611534", "0.5604728", "0.5602095", "0.5600182", "0.559407", "0.5591633", "0.5589089", "0.55778545", "0.5563574", "0.5556988", "0.5555953", "0.5550475", "0.5548435", "0.5547275", "0.5534317", "0.5534317", "0.55316544", "0.5530906", "0.55266595", "0.5521104", "0.55069", "0.5506509", "0.55048853", "0.55032355", "0.54850477", "0.5480976" ]
0.58751625
33
Income and Household Size UI
get input_income(){ return this.userApiValue('input_income'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showIncome(n) {\n console.log(\"\\n\"+archive[n].name+\" has generated: \"+(archive[n].price*archive[n].Clients.length)+\" USD\"+\"\\n\");\n}", "function incomeVisibility() {\n 'use strict';\n\n // Earned Income\n FBRun.vis.applyRule($('#p3'), employedInHousehold());\n\n // Pensions Income:\n FBRun.vis.applyRule($('#p5'), pensionerInHousehold());\n\n // Non-dep Income:\n FBRun.vis.applyRule($('#p7'), nonDepInHousehold());\n return false;\n}", "static displayBudget() {\n const calced = Store.getBudget();\n document.getElementById(\"budgetDisplay\").innerHTML = \"$\" + calced;\n }", "function getBoxSize(length,breadth,cope_height,drag_height)\r\n{\r\n var div_box_dimension_start=\"<div class='disp_content' \";\r\n var div_box_dimension_end=\"</div>\";\r\n casting_length=$(\"#casting_length\").val();\r\n casting_breadth=$(\"#casting_breadth\").val();\r\n casting_height=$(\"#casting_height\").val();\r\n // box_dimension=$(\"#length_size\").val()+\"X\"+$(\"#breadth_size\").val()+\"X\"+$(\"#cope_height_size\").val()+\"X\"+$(\"#drag_height_size\").val();\r\n box_dimension = length+\"X\"+breadth+\"X\"+cope_height+\"X\"+drag_height;\r\n var dimension=box_dimension.split('X').map(Number);\r\n avl_length=$(\"#length_size\").find(':selected').attr(\"data-avl-length\");\r\n avl_breadth=$(\"#breadth_size\").find(':selected').attr(\"data-avl-breadth\");\r\n casting_length=parseInt(casting_length);\r\n casting_breadth=parseInt(casting_breadth);\r\n avl_length=parseInt(avl_length);\r\n avl_breadth=parseInt(avl_breadth);\r\n\r\n\r\n cavity = calcualteCavity(parseInt(casting_length),parseInt(casting_breadth),parseInt(avl_length),parseInt(avl_breadth));\r\n console.log(\"avl_length \"+avl_length);\r\n console.log(\"avl_breadth \"+avl_breadth);\r\n console.log(\"casting_length \"+casting_length);\r\n console.log(\"casting_breadth \"+casting_breadth);\r\n console.log(\"cavity \"+cavity);\r\n drawDiagram(casting_length,casting_breadth,avl_length,avl_breadth,dimension[0],dimension[1],row_count,column_count,cavity);\r\n sand_requirement=sandRequirement(casting_length,casting_breadth,casting_height,dimension);\r\n sand_requirement=parseInt(sand_requirement);\r\n new_sand = getPercentage(sand_requirement,2);\r\n bentonite = getPercentage(sand_requirement,0.8);\r\n lustron = getPercentage(sand_requirement,0.4);\r\n // console.log(sand_requirement);\r\n return_sand = (sand_requirement -(new_sand+bentonite+lustron));\r\n $(\"#display_jumbotron\").show();\r\n $(\"#preview_button\").show();\r\n /*var table_start=\"<table id='box_table' class='table table-bordered table-hover jumbotron shadow-z-2'>\";\r\n var table_heading=\"<tr><th>New Sand</th><th>Bentonite</th><th>Lustron</th><th>Return Sand</th><th>Preview</th></tr>\"\r\n var table_end=\"</table>\";\r\n var icon = \"<a style='text-decoration:none'><i id='preview'class='glyphicon glyphicon-picture' style='font-size:25px;' data-toggle='modal' data-target='.bs-example-modal-lg'></i></a>\"\r\n $(\"#display_content\").append(table_start+table_heading);\r\n printRequirementTable(\"#box_table\",new_sand,bentonite,lustron,return_sand,icon);\r\n $(\"#box_table\").append(table_end);*/\r\n $(\"#get_box_dimension\").append(div_box_dimension_start+\" data-casting-length='\"+casting_length+\"'\"+\"data-casting-breadth='\"+casting_breadth+\"'\"+\"data-casting-height='\"+casting_height+\"'\"+\"data-box-length='\"+dimension[0]+\"'\"+\"data-box-breadth='\"+dimension[1]+\"'\"+\"data-cope-height='\"+dimension[2]+\"'\"+\"data-drag-height='\"+dimension[3]+\"'\"+\"data-cavity='\"+cavity+\"'\"+\"data-sand-requirement='\"+sand_requirement+\"'\"+\"data-new-sand='\"+new_sand+\"'\"+\"data-bentonite='\"+bentonite+\"'\"+\"data-lustron='\"+lustron+\"'\"+\"data-return-sand='\"+return_sand+\"' data-box-size-requirement='\"+box_size_requirement+\"' >\"+div_box_dimension_end);\r\n}", "function showTotalIncident(transport) {\n let total = data.dataModified.get(\"1960\")[transport].length;\n let years = document.getElementById(\"selectYear\").value;\n\n document.getElementById(\"showTotalIncident\").innerHTML = total;\n document.getElementById(\"percent1\").innerHTML = \"Aire = \" + data.percent(years).percentair + \" %\";\n document.getElementById(\"percent2\").innerHTML = \"Tierra = \" + data.percent(years).percentland + \" %\";\n document.getElementById(\"percent3\").innerHTML = \"Agua = \" + data.percent(years).percentWater + \" %\";\n\n}", "function displayAccumulatedCountyData(total_male,total_female,total_population)\n{\n const total_male_area = document.querySelector(\"#total-male b\");\n const total_female_area = document.querySelector(\"#total-female b\");\n const total_population_per_county = document.querySelector(\"#total-population b\");\n total_male_area.innerHTML = total_male;\n total_female_area.innerHTML = total_female;\n total_population_per_county.innerHTML = total_population;\n}", "function calcBudget() {\n inputStatusCheck();\n const persons = Number(inputPerson.value);\n const budgetPerPerson = Number(inputBudget.value);\n budgetTotal.innerHTML = multiply(persons, budgetPerPerson);\n}", "function sizeCost(){\n if(this.size=s){\n return \"7.99\";\n }\n if(this.size=m){\n return \"9.99\"\n}\n if(this.size=l){\n return \"12.99\"\n}\n if(this.size=xl){\n return \"15.99\"\n}\n}", "function showHouse() {\n\thouseVariables.forEach(function (d) {\n\t\tvar extent = ranges[d];\n\n\t\tvar currentValue;\n\t\tif (d == \"sqft_lot15\") {\n\t\t\tcurrentValue = (Math.floor(d3.mean(extent)) / 43560).toFixed(2)\n\t\t} else if (d == \"view\") {\n\t\t\tcurrentValue = viewqualities[2];\n\t\t}else {\n\t\t\tcurrentValue = Math.floor(d3.mean(extent));\n\t\t}\n\n\t\tdocument.getElementById(d)\n\t\t.innerHTML = (\n\t\t\t\"<input type='range' min='\" + Math.floor(extent[0]) + \"' max='\" + Math.floor(extent[1]) + \"' value='\" + Math.floor(d3.mean(extent)) + \"'>\"\n\t\t\t+ \"<div class='currentValue'>\" + currentValue + \"</div>\");\n\t})\n\n\tsqft_living15 = d3.select(\"#sqft_living15 input\").attr(\"value\");\n\tsqft_lot15 = d3.select(\"#sqft_lot15 input\").attr(\"value\");\n\tsqft_basement = d3.select(\"#sqft_basement input\").attr(\"value\");\n\tfloors = d3.select(\"#floors input\").attr(\"value\");\n\tyr_built = d3.select(\"#yr_built input\").attr(\"value\");\n\tyr_renovated = d3.select(\"#yr_renovated input\").attr(\"value\");\n\tbathrooms = d3.select(\"#bathrooms input\").attr(\"value\");\n\tbedrooms = d3.select(\"#bedrooms input\").attr(\"value\");\n\tview = d3.select(\"#view input\").attr(\"value\");\n\n\t// Front view scales\n\tvar sqftScale = d3.scaleLinear().domain([0, ranges[\"sqft_living15\"][1]]).range([0, 600]);\n\tvar lotScale = d3.scaleLinear().domain([0, ranges[\"sqft_lot15\"][1]]).range([0, 200]);\n\tvar yearScale = d3.scaleLinear().domain(ranges[\"yr_built\"]).range([0, 100]);\n\tvar bsmtScale = d3.scaleLinear().domain([0, ranges[\"sqft_basement\"][1]]).range([0, 200]);\n\n\t// Top view scales\n\tvar sqftScaleTop = d3.scaleLinear().domain([0, Math.sqrt(ranges[\"sqft_lot15\"][1])]).range([0, 800]);\n\n\t// Top view positioning\n\tvar leftDist = (800-sqftScale(sqft_living15))/2;\n\n\t/* House */\n\tvar selectedView = \"front\"; // initially view house from front\n\n\tvar frontView = d3.select(\"#build #front\");\n\tvar sky = frontView.append(\"image\")\n\t\t\t\t\t.attr(\"xlink:href\", \"img/view-\" + viewqualities[view] + \".png\").attr(\"width\", 800);\n\tvar ground = frontView.append(\"rect\").attr(\"height\", 200).attr(\"width\", 800).attr(\"transform\", \"translate(0, 300)\").attr(\"fill\", \"green\");\n\t//var sky = frontView.append(\"rect\").attr(\"height\", 300).attr(\"width\", 800).attr(\"fill\", \"lightblue\");\n\n\tvar topView = d3.select(\"#build #top\");\n\tvar groundTop = topView.append(\"rect\").attr(\"height\", 500).attr(\"width\", 800).attr(\"fill\", \"green\");\n\n\t// Front view initial gfx\n\tvar lot = frontView.append(\"rect\").attr(\"class\", \"lot\")\n\t.attr(\"fill\", \"#51b51b\")\n\t.attr(\"height\", lotScale(sqft_lot15))\n\t.attr(\"width\", 800)\n\t.attr(\"transform\", \"translate(0, 300)\");\n\tvar house = frontView.append(\"g\").attr(\"transform\", \"translate(\" + leftDist + \")\");\n\tvar houseColor = d3.hsl(\"hsla(30, \" + yearScale(yr_built) + \"%, 30%, 1)\");\n\tvar bsmt = house.append(\"rect\").attr(\"class\", \"basement\")\n\t.attr(\"fill\", \"#000\")\n\t.attr(\"width\", sqftScale(sqft_living15))\n\t.attr(\"height\", bsmtScale(sqft_basement))\n\t.attr(\"transform\", \"translate(0, 300)\")\n\t.attr(\"stroke\", \"#fff\")\n\t.attr(\"stroke-dasharray\", \"5 5\")\n\t.attr(\"opacity\", 0.5);\n\n\t// Top view initial gfx\n\tvar lotTop = topView.append(\"rect\")\n\t.attr(\"fill\", \"#51b51b\")\n\t.attr(\"height\", sqftScaleTop(Math.sqrt(sqft_lot15)))\n\t.attr(\"width\", sqftScaleTop(Math.sqrt(sqft_lot15)))\n\t.attr(\"transform\", \"translate(\"\n\t\t+ ((800-sqftScaleTop(Math.sqrt(sqft_lot15))) / 2) + \",\"\n\t\t+ ((500-sqftScaleTop(Math.sqrt(sqft_lot15))) / 2) + \")\"\n\t);\n\tvar houseTop = topView.append(\"g\")\n\t.attr(\"transform\", \"translate(\"\n\t\t+ ((800-sqftScaleTop(Math.sqrt(sqft_living15))) / 2) + \",\"\n\t\t+ ((500-sqftScaleTop(Math.sqrt(sqft_living15))) / 2) + \")\"\n\t);\n\tvar sqftTop = houseTop.append(\"rect\")\n\t.attr(\"height\", sqftScaleTop(Math.sqrt(sqft_living15)))\n\t.attr(\"width\", sqftScaleTop(Math.sqrt(sqft_living15)))\n\t.attr(\"fill\", \"#fff\")\n\t.attr(\"stroke\", \"#000\")\n\t.attr(\"opacity\", 0.9);\n\n\t// Zoom in and out\n\tvar zoom = topView.append(\"g\").attr(\"id\", \"zoomButtons\");\n\tvar zoomIn = topView.append(\"g\").attr(\"transform\", \"translate(740, 10)\");\n\tzoomIn.append(\"rect\").attr(\"height\", 50).attr(\"width\", 50).attr(\"class\", \"zoom\").style(\"cursor\", \"pointer\");\n\tzoomIn.append(\"text\").text(\"+\").attr(\"fill\", \"#fff\").attr(\"transform\", \"translate(10,42)\").attr(\"font-size\", 50).style(\"cursor\", \"pointer\");\n\tvar zoomOut = topView.append(\"g\").attr(\"transform\", \"translate(740, 65)\");\n\tzoomOut.append(\"rect\").attr(\"height\", 50).attr(\"width\", 50).attr(\"class\", \"zoom\").style(\"cursor\", \"pointer\");\n\tzoomOut.append(\"text\").text(\"-\").attr(\"fill\", \"#fff\").attr(\"transform\", \"translate(16,40)\").attr(\"font-size\", 50).style(\"cursor\", \"pointer\");\n\n\tzoomIn.on(\"click\", function() {\n\t\tsqftScaleTop = d3.scaleLinear().domain([0, Math.sqrt(ranges[\"sqft_living15\"][1])]).range([0, 500]);\n\n\t\tlotTop.attr(\"height\", sqftScaleTop(Math.sqrt(sqft_lot15)))\n\t\t.attr(\"width\", sqftScaleTop(Math.sqrt(sqft_lot15)))\n\t\t.attr(\"transform\", \"translate(\"\n\t\t\t+ ((800-sqftScaleTop(Math.sqrt(sqft_lot15))) / 2) + \",\"\n\t\t\t+ ((500-sqftScaleTop(Math.sqrt(sqft_lot15))) / 2) + \")\");\n\n\t\thouseTop.attr(\"transform\", \"translate(\"\n\t\t+ ((800-sqftScaleTop(Math.sqrt(sqft_living15))) / 2) + \",\"\n\t\t+ ((500-sqftScaleTop(Math.sqrt(sqft_living15))) / 2) + \")\");\n\n\t\tsqftTop.attr(\"height\", sqftScaleTop(Math.sqrt(sqft_living15)))\n\t\t.attr(\"width\", sqftScaleTop(Math.sqrt(sqft_living15)));\n\n\t\tdrawRooms();\n\t});\n\n\tzoomOut.on(\"click\", function() {\n\t\tsqftScaleTop = d3.scaleLinear().domain([0, Math.sqrt(ranges[\"sqft_lot15\"][1])]).range([0, 800]);\n\n\t\tlotTop.attr(\"height\", sqftScaleTop(Math.sqrt(sqft_lot15)))\n\t\t.attr(\"width\", sqftScaleTop(Math.sqrt(sqft_lot15)))\n\t\t.attr(\"transform\", \"translate(\"\n\t\t\t+ ((800-sqftScaleTop(Math.sqrt(sqft_lot15))) / 2) + \",\"\n\t\t\t+ ((500-sqftScaleTop(Math.sqrt(sqft_lot15))) / 2) + \")\");\n\n\t\thouseTop.attr(\"transform\", \"translate(\"\n\t\t+ ((800-sqftScaleTop(Math.sqrt(sqft_living15))) / 2) + \",\"\n\t\t+ ((500-sqftScaleTop(Math.sqrt(sqft_living15))) / 2) + \")\");\n\n\t\tsqftTop.attr(\"height\", sqftScaleTop(Math.sqrt(sqft_living15)))\n\t\t.attr(\"width\", sqftScaleTop(Math.sqrt(sqft_living15)));\n\n\t\tdrawRooms();\n\t});\n\n\t// Draw the house with a given number of floors\n\tfunction drawHouse(numFloors) {\n\t\td3.selectAll(\".level\").remove();\n\t\td3.selectAll(\".roof\").remove();\n\t\tfor (var i = 0; i < numFloors; i++) {\n\t\t\thouse.append(\"rect\").attr(\"class\", \"level\")\n\t\t\t.attr(\"height\", 80)\n\t\t\t.attr(\"width\", sqftScale(sqft_living15))\n\t\t\t.attr(\"transform\", \"translate(0, \" + (220 - (80*i)) + \")\")\n\t\t\t.attr(\"fill\", houseColor)\n\t\t\t.attr(\"stroke\", \"#000\");\n\t\t}\n\t\thouse.append(\"path\").attr(\"class\", \"roof\")\n\t\t.attr(\"d\", \"M -50 \" + (220 - (80*(numFloors-1)))\n\t\t\t+ \" L \" + (sqftScale(sqft_living15) + 50) + \" \" + (220 - (80*(numFloors-1)))\n\t\t\t+ \" \" + sqftScale(sqft_living15)/2 + \" \" + (180 - (80*(numFloors-1))) + \" z\")\n\t\t.attr(\"fill\", \"#514420\");\n\t}\n\n\tfunction drawRooms() {\n\t\tvar br = Number(bedrooms);\n\t\tvar ba = Number(bathrooms);\n\t\td3.select(\"#rooms\").remove();\n\t\tvar g = houseTop.append(\"g\").attr(\"id\", \"rooms\");\n\n\t\tvar numRows = Math.ceil(Math.sqrt(br + ba));\n\n\t\tfor (var i = 0; i < numRows; i++) {\n\t\t\tfor (var j = 0; j < numRows; j++) {\n\t\t\t\tif (br > 0) {\n\t\t\t\t\tg.append(\"image\")\n\t\t\t\t\t.attr(\"xlink:href\", \"img/bed.png\")\n\t\t\t\t\t.attr(\"x\", (sqftTop.attr(\"width\") / numRows) * j)\n\t\t\t\t\t.attr(\"y\", (sqftTop.attr(\"width\") / numRows) * i)\n\t\t\t\t\t.attr(\"height\", (sqftTop.attr('width') / numRows) + \"px\")\n\t\t\t\t\t.attr(\"width\", (sqftTop.attr(\"width\") / numRows) + \"px\");\n\n\t\t\t\t\tbr--;\n\n\t\t\t\t} else if (ba > 0) {\n\t\t\t\t\tg.append(\"image\")\n\t\t\t\t\t.attr(\"xlink:href\", \"img/bath.png\")\n\t\t\t\t\t.attr(\"x\", (sqftTop.attr(\"width\") / numRows) * j)\n\t\t\t\t\t.attr(\"y\", (sqftTop.attr(\"width\") / numRows) * i)\n\t\t\t\t\t.attr(\"height\", (sqftTop.attr('width') / numRows) + \"px\")\n\t\t\t\t\t.attr(\"width\", (sqftTop.attr(\"width\") / numRows) + \"px\");\n\n\t\t\t\t\tba--;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t/* Sliders */\n\n\t// House size\n\td3.select(\"#sqft_living15 input\").on(\"input\", function() {\n\t\tsqft_living15 = this.value;\n\t\tleftDist = (800-sqftScale(sqft_living15))/2;\n\t\thouse.attr(\"transform\", \"translate(\" + leftDist + \")\");\n\t\tdrawHouse(floors);\n\t\tbsmt.attr(\"width\", sqftScale(sqft_living15));\n\n\t\thouseTop.attr(\"transform\", \"translate(\"\n\t\t\t+ ((800-sqftScaleTop(Math.sqrt(sqft_living15))) / 2) + \",\"\n\t\t\t+ ((500-sqftScaleTop(Math.sqrt(sqft_living15))) / 2) + \")\"\n\t\t);\n\t\tsqftTop.attr(\"height\", sqftScaleTop(Math.sqrt(sqft_living15)))\n\t\t.attr(\"width\", sqftScaleTop(Math.sqrt(sqft_living15)));\n\n\t\td3.select(\"#sqft_living15 .currentValue\").text(sqft_living15);\n\n\t\tdrawRooms();\n\t\tpricePrediction();\n\t});\n\n\t// Lot size\n\td3.select(\"#sqft_lot15 input\").on(\"input\", function() {\n\t\tsqft_lot15 = this.value;\n\t\tlotLeftDist = (800-lotScale(sqft_lot15))/2;\n\n\t\tlot.attr(\"height\", lotScale(sqft_lot15));\n\n\t\tlotTop.attr(\"height\", sqftScaleTop(Math.sqrt(sqft_lot15)))\n\t\t.attr(\"width\", sqftScaleTop(Math.sqrt(sqft_lot15)))\n\t\t.attr(\"transform\", \"translate(\"\n\t\t\t+ ((800-sqftScaleTop(Math.sqrt(sqft_lot15))) / 2) + \",\"\n\t\t\t+ ((500-sqftScaleTop(Math.sqrt(sqft_lot15))) / 2) + \")\"\n\t\t);\n\n\t\td3.select(\"#sqft_lot15 .currentValue\").text((sqft_lot15 / 43560).toFixed(2));\n\n\t\tpricePrediction();\n\t});\n\n\t// Basement size\n\td3.select(\"#sqft_basement input\").on(\"input\", function() {\n\t\tsqft_basement = this.value;\n\t\tbsmt.attr(\"height\", bsmtScale(sqft_basement));\n\t\td3.select(\"#sqft_basement .currentValue\").text(sqft_basement);\n\n\t\tpricePrediction();\n\t});\n\n\t// Number of floors\n\td3.select(\"#floors input\").on(\"input\", function () {\n\t\tfloors = this.value;\n\t\tdrawHouse(this.value);\n\t\td3.select(\"#floors .currentValue\").text(floors);\n\n\t\tpricePrediction();\n\t});\n\n\t// Year built\n\td3.select(\"#yr_built input\").on(\"input\", function() {\n\t\tyr_built = this.value;\n\t\thouseColor = d3.hsl(\"hsla(30, \" + yearScale(yr_built) + \"%, 30%, 1)\");\n\t\td3.selectAll(\".level\").attr(\"fill\", houseColor);\n\t\td3.select(\"#yr_built .currentValue\").text(yr_built);\n\n\t\tif (yr_built > yr_renovated) {\n\t\t\td3.select(\"#yr_built .currentValue\").style(\"background-color\", \"crimson\");\n\t\t\td3.select(\"#yr_renovated .currentValue\").style(\"background-color\", \"crimson\");\n\t\t} else {\n\t\t\td3.select(\"#yr_built .currentValue\").style(\"background-color\", \"#999\");\n\t\t\td3.select(\"#yr_renovated .currentValue\").style(\"background-color\", \"#999\");\n\t\t}\n\n\t\tpricePrediction();\n\t});\n\n\t// Year renovated\n\td3.select(\"#yr_renovated input\").on(\"input\", function() {\n\t\tyr_renovated = this.value;\n\t\td3.select(\"#yr_renovated .currentValue\").text(yr_renovated);\n\n\t\tif (yr_built > yr_renovated) {\n\t\t\td3.select(\"#yr_built .currentValue\").style(\"background-color\", \"crimson\");\n\t\t\td3.select(\"#yr_renovated .currentValue\").style(\"background-color\", \"crimson\");\n\t\t} else {\n\t\t\td3.select(\"#yr_built .currentValue\").style(\"background-color\", \"#999\");\n\t\t\td3.select(\"#yr_renovated .currentValue\").style(\"background-color\", \"#999\");\n\t\t}\n\n\t\tpricePrediction();\n\t});\n\n\t// Number of bathrooms\n\td3.select(\"#bathrooms input\").on(\"input\", function () {\n\t\tbathrooms = this.value;\n\t\td3.select(\"#bathrooms .currentValue\").text(bathrooms);\n\n\t\tdrawRooms();\n\t\tpricePrediction();\n\t});\n\n\t// Number of bedrooms\n\td3.select(\"#bedrooms input\").on(\"input\", function () {\n\t\tbedrooms = this.value;\n\t\td3.select(\"#bedrooms .currentValue\").text(bedrooms);\n\n\t\tdrawRooms();\n\t\tpricePrediction();\n\t});\n\n\t// View\n\td3.select(\"#view input\").on(\"input\", function () {\n\t\tview = this.value;\n\t\td3.select(\"#view .currentValue\").text(viewqualities[view]);\n\t\tsky.attr(\"xlink:href\", \"img/view-\" + viewqualities[view] + \".png\");\n\n\t\tpricePrediction();\n\t});\n\n\t// Toggle front and top view\n\td3.selectAll(\".buttons div\").on(\"click\", function() {\n\t\tselectedView = this.getAttribute(\"data-view\");\n\t\tif (selectedView == \"front\") {\n\t\t\td3.select(\"#front\").style(\"display\", \"inline-block\");\n\t\t\td3.select(\"#top\").style(\"display\", \"none\");\n\t\t} else {\n\t\t\td3.select(\"#front\").style(\"display\", \"none\");\n\t\t\td3.select(\"#top\").style(\"display\", \"inline-block\");\n\t\t}\n\t});\n\n\t// Draw the house in its initial position\n\tdrawHouse(floors);\n\tdrawRooms();\n\tpricePrediction();\n}", "function costBasedOnSelection() {\n let totalCost = 0;\n const size = document.getElementById(\"size\").value;\n const milk = document.getElementById(\"milk\").value\n\n const hasWhip = document.getElementById(\"whip\").checked;\n const hasWhole = milk === \"whole\";\n const hasTwoPercent = milk === \"two\";\n\n //Size\n if(size === \"small\") {\n totalCost += 5;\n }\n else if(size === \"medium\") {\n totalCost += 6;\n }\n else if(size === \"large\") {\n totalCost += 7;\n }\n else {\n totalCost += 0;\n }\n\n //Milk\n if(hasWhole || hasTwoPercent) {\n totalCost += 1;\n }\n\n //Whip\n if(hasWhip) {\n totalCost += .35;\n }\n else {\n totalCost += 0;\n }\n\n document.getElementById(\"total\").innerText = \"$\" + totalCost.toFixed(2);\n}", "function renderSize() {\n let sLinearScale = sizeScale();\n // Render transition between circle size change\n d3.selectAll(\".countryCircle\")\n .transition()\n .duration(1000)\n .attr(\"r\", d => sLinearScale(d[chosenSize]));\n // Refresh legend: size\n // d3.select(\"#sizeLegend\").html(\"\");\n createSizeLegend();\n}", "function getSizes()\n {\n sizes.field.rows = 3;\n sizes.field.cols = 6;\n\n sizes.desk.height = DOM.parent.offsetHeight / 3;\n sizes.desk.width = properties.coverSize.width * sizes.desk.height / properties.coverSize.height;\n sizes.deskContainer.marginBottom = sizes.desk.width / 2;\n\n sizes.card.height = DOM.parent.offsetHeight / 4.5;\n sizes.card.width = properties.coverSize.width * sizes.card.height / properties.coverSize.height;\n }", "getDrawSize () {\r\n return Math.ceil(this.calories / this.gestation * 10)\r\n }", "function renderPrice() {\n const submit = document.querySelector(\".Rectangle5\");\n var sum = 20;\n\n if (state.Patty)\n sum = sum + parseInt(ingredients.Patty);\n if (state.Cheese)\n sum = sum + parseInt(ingredients.Cheese);\n if (state.Tomatoes)\n sum = sum + parseInt(ingredients.Tomatoes);\n if (state.Onions)\n sum = sum + parseInt(ingredients.Onions);\n if (state.Lettuce)\n sum = sum + parseInt(ingredients.Lettuce);\n submit.onclick = (evt) => {\n document.querySelector(\".price-details\").innerHTML = \"INR \" + sum;\n }\n\n}", "function setBookshelfHeightUI(){\n\tvar hDiv = document.getElementById(\"heightOut\");\n\tvar inches = bookshelf.height/25.4;\n\thDiv.value = parseFloat(inches).toFixed(1);\n}", "function calculateTotalWorth() {\n if(totalWealthIsAlreadyDisplayed) {\n updateDOM();\n } else {\n displayTotalWorth();\n }\n}", "function display_ensemble_type_and_size() {\n // display_available_ensemble_type_and_size(search_ensemble_type_and_size(inputObject.network_archeticture, inputObject.dataset));\n search_ensemble_type_and_size(inputObject.network_archeticture, inputObject.dataset);\n}", "function getTotal() {\n const firstClassCount = getInputValue('firstClass');\n const economyCount = getInputValue('economy');\n const subTotal = firstClassCount * 150 + economyCount * 100;\n document.getElementById('subTotalAmount').innerText = subTotal;\n\n const vat = subTotal * 0.1;\n const total = subTotal + vat;\n document.getElementById('vatAmount').innerText = vat;\n document.getElementById('totalAmount').innerText = total;\n}", "function storagePayment(type)\n{\n if(type== 'usual')\n {\n document.getElementById('storage-cost').innerText= 0;\n \n }\n else if(type== 'medium')\n {\n document.getElementById('storage-cost').innerText= 100;\n }\n else if(type== 'large')\n {\n document.getElementById('storage-cost').innerText= 180;\n }\n finalTotal();\n\n}", "function calculateSize(shoeBrand, size) {\n var calculatedFit, conversion;\n var fit = desiredFit.options[desiredFit.selectedIndex].value;\n shoeBrands.forEach((brand) => {\n if (shoeBrand == brand.id) {\n shoeFits = Object.keys(brand);\n for (var key in brand) {\n if (fit == key) {\n conversion = brand[key];\n }\n }\n }\n });\n calculatedFit = size / conversion;\n calculatedFit = (Math.round(calculatedFit*2) / 2).toFixed(1);\n // console.log(calculatedFit);\n return calculatedFit;\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}", "function getGrowthOverview(results, data, growthType) {\n if (!results.netincome) return <div className=\"qload\">Hold tight while we load your data!</div>\n switch (growthType) {\n case 'netincome': {\n const dataarr = results.netincomedata ? results.netincomedata.v.slice(-5) : null\n const difference = dataarr ? formatNumber(getDifferenceBetween(dataarr)) : 0\n const change = dataarr ? getPercentDifference(...getFirstLastArr(dataarr)) : 0\n return (\n <div className=\"growthmetrics\">\n <div className=\"metric-spacer\"></div>\n <div className=\"metric\">\n {getMetricItem('5yr Net Income Growth', results.netincome)}\n <span className=\"result\">{`${results.symbol} has increased it’s net income by ${difference} over the last 5 years for a change of ${change}%!`}</span>\n <div className=\"desc\">\n <p>\n Net income is the profit that remains after all expenses and costs have been\n subtracted from revenue. Net income is an all-inclusive metric for profitability and\n provides insight into how well the management team runs all aspects of the business.\n Net income is often referred to as the \"bottom line\" due to its positioning at the\n bottom of the income statement.\n </p>\n </div>\n <div className=\"previewcontainer\">\n {getDataPreview(results ? results.netincomedata : null)}\n </div>\n </div>\n <div className=\"metric-spacer\"></div>\n </div>\n )\n }\n case 'cashflow': {\n const dataarr = results.cashgrowthdata ? results.cashgrowthdata.v.slice(-5) : null\n const difference = dataarr ? formatNumber(getDifferenceBetween(dataarr)) : 0\n const change = dataarr ? getPercentDifference(...getFirstLastArr(dataarr)) : 0\n return (\n <div className=\"growthmetrics\">\n <div className=\"metric-spacer\"></div>\n <div className=\"metric\">\n {getMetricItem('5yr Cash Flow Growth', results.cashgrowth)}\n <span className=\"result\">{`${results.symbol} has increased it’s FCF by ${difference} over the last 5 years for a change of ${change}%!`}</span>\n <div className=\"desc\">\n <p>\n Free cash flow (FCF) represents the cash a company generates after accounting for\n cash outflows to support operations and maintain its capital assets. Because FCF\n accounts for changes in working capital, it can provide important insights into the\n value of a company and the health of its fundamental trends.\n </p>\n </div>\n <div className=\"metric-spacer\"></div>\n <div className=\"previewcontainer\">\n {getDataPreview(results ? results.cashgrowthdata : null)}\n </div>\n </div>\n </div>\n )\n }\n case 'revenue': {\n const dataarr = results.revgrowthdata ? results.revgrowthdata.v.slice(-5) : null\n const difference = dataarr ? formatNumber(getDifferenceBetween(dataarr)) : 0\n const change = dataarr ? getPercentDifference(...getFirstLastArr(dataarr)) : 0\n return (\n <div className=\"growthmetrics\">\n <div className=\"metric-spacer\"></div>\n <div className=\"metric\">\n {getMetricItem('5yr Revenue Growth', results.revgrowth)}\n <span className=\"result\">{`${results.symbol} has increased it’s total revenue by ${difference} over the last 5 years for a change of ${change}%!`}</span>\n <div className=\"desc\">\n <p>\n Revenue is the money generated from normal business operations, calculated as the\n average sales price times the number of units sold. Revenue is known as the top line\n because it appears first on a company's income statement. There is a profit when\n revenues exceed expenses.\n </p>\n </div>\n <div className=\"previewcontainer\">\n {getDataPreview(results ? results.revgrowthdata : null)}\n </div>\n </div>\n <div className=\"metric-spacer\"></div>\n </div>\n )\n }\n }\n}", "function sizeUI(obj) {\n var uiZone = document.getElementsByClassName('asu-header-builder-ui')[0];\n var jsonArrLength = ASUHeaderMakerJSON.children.length;\n var addAmount = 0;\n if (!uiZone.style.width) {\n var width = 0;\n } else {\n var width = uiZone.style.width.replace('px', '');\n }\n if (!obj) {\n width = 0;\n for (var i = 0; i < jsonArrLength; i++) {\n addAmount += 280;\n }\n addAmount += (30*(ASUHeaderMakerJSON.count-i));\n } else if (obj && obj.parent) {\n addAmount = 30;\n } else if (obj) {\n addAmount = 280;\n }\n uiZone.style.width = (parseInt(width) + parseInt(addAmount)) + 'px';\n }", "function setSummaryFromStore() {\n document.getElementById(\"name_disp\").innerHTML =\n \"Name: \".bold() +\n store.get(\"first_name_text\") +\n \" \" +\n store.get(\"last_name_text\");\n document.getElementById(\"email_disp\").innerHTML =\n \"Email: \".bold() + store.get(\"email_text\");\n document.getElementById(\"phone_number_disp\").innerHTML =\n \"Phone Number: \".bold() + store.get(\"phone_number_text\");\n\n document.getElementById(\"hoodie_disp\").innerHTML =\n \"Type: \".bold() +\n setSummaryPriceText(\n store.get(\"settings\")[9][1],\n \"type\",\n store.get(\"settings\")[0][1]\n );\n document.getElementById(\"crewneck_disp\").innerHTML =\n \"Type: \".bold() +\n setSummaryPriceText(\n store.get(\"settings\")[10][1],\n \"type\",\n store.get(\"settings\")[1][1]\n );\n document.getElementById(\"green_disp\").innerHTML =\n \"Color: \".bold() +\n setSummaryPriceText(\n store.get(\"settings\")[11][1],\n \"color\",\n store.get(\"settings\")[2][1]\n );\n document.getElementById(\"gray_disp\").innerHTML =\n \"Color: \".bold() +\n setSummaryPriceText(\n store.get(\"settings\")[12][1],\n \"color\",\n store.get(\"settings\")[3][1]\n );\n\n document.getElementById(\"size_disp\").innerHTML =\n \"Size: \".bold() + store.get(\"size\");\n\n document.getElementById(\"front_disp\").innerHTML =\n \"Front: \".bold() +\n setSummaryPriceText(\n store.get(\"settings\")[13][1],\n \"front_text\",\n store.get(\"settings\")[4][1]\n );\n document.getElementById(\"left_arm_disp\").innerHTML =\n \"Left Arm: \".bold() +\n setSummaryPriceText(\n store.get(\"settings\")[14][1],\n \"left_arm_text\",\n store.get(\"settings\")[5][1]\n );\n document.getElementById(\"right_arm_disp\").innerHTML =\n \"Right Arm: \".bold() +\n setSummaryPriceText(\n store.get(\"settings\")[15][1],\n \"right_arm_text\",\n store.get(\"settings\")[6][1]\n );\n document.getElementById(\"back_disp\").innerHTML =\n \"Back: \".bold() +\n setSummaryPriceText(\n store.get(\"settings\")[16][1],\n \"back_text\",\n store.get(\"settings\")[7][1]\n );\n document.getElementById(\"comment_disp\").innerHTML =\n \"Additional Information: \".bold() + store.get(\"comment_text\");\n\n if (store.get(\"type\") === \"hoodie\") {\n document.getElementById(\"hood_disp\").innerHTML =\n \"Hood: \".bold() +\n setSummaryPriceText(\n store.get(\"settings\")[17][1],\n \"hood_text\",\n store.get(\"settings\")[8][1]\n );\n\n document.getElementById(\"hoodie_disp\").style.display = \"auto\";\n document.getElementById(\"hood_disp\").style.display = \"auto\";\n document.getElementById(\"crewneck_disp\").style.display = \"none\";\n } else {\n document.getElementById(\"crewneck_disp\").style.display = \"auto\";\n document.getElementById(\"hoodie_disp\").style.display = \"none\";\n document.getElementById(\"hood_disp\").style.display = \"none\";\n }\n\n if (store.get(\"color\") === \"green\") {\n document.getElementById(\"green_disp\").style.display = \"auto\";\n document.getElementById(\"gray_disp\").style.display = \"none\";\n } else {\n document.getElementById(\"gray_disp\").style.display = \"auto\";\n document.getElementById(\"green_disp\").style.display = \"none\";\n }\n}", "function calculateTotal() {\n const firstClassCount = getInputValue('first-class');\n const economyCount = getInputValue('economy');\n\n const subTotal = firstClassCount * 150 + economyCount * 100;\n document.getElementById('sub-total').innerText = '$' + subTotal;\n\n const vat = subTotal * 0.1;\n document.getElementById('vat').innerText = '$' + vat;\n\n const total = subTotal + vat;\n document.getElementById('total').innerText = '$' + total;\n}", "function formatSizeDisplay(x1, x2) {\n //x = units (metric 1 or not 0), x1 = higher group (m or feet), x2 = lower group (cm or in)\n  let x = Number(localStorage.aas_myGardenVs_units);\n let ind1 = \"\", ind2 = \"\", denom = 1;\n //if metric, \n // the incoming size that's in inches needs to be converted to cm\n // the denominator used for formatting is 100, otherwise 12\n // the displayed format will show m & cm, otherwise ' and \"\n if (x){\n x1 *= 2.54;\n denom = 100;\n ind1=\"m\";\n ind2 = \"cm\";\n } \n else {\n denom = 12;\n ind1=\"'\";\n ind2 = '\"';\n }\n \n //if a second argument is supplied, convert to small units and return one number\n if (x2){\n return parseInt(x1*denom+x2,10);\n }\n //if there are bigger units and a remainder, display bigger and smaller units\n else if ((parseInt(x1/denom,10)) && (parseInt(x1%denom,10))) {\n return parseInt(x1/denom,10)+ind1 + parseInt(x1%denom,10)+ind2;\n }\n //if a bigger unit is 0 and smaller is available (i.e. there is a remainder)\n else if (!(parseInt(x1/denom,10)) && (parseInt(x1%denom,10))) {\n return parseInt(x1%denom,10)+ind2;\n }\n //if there are bigger units and no smaller units\n else if ((parseInt(x1/denom,10)) && !(parseInt(x1%denom,10))) {\n return parseInt(x1/denom,10)+ind1;\n }\n //otherwise display 0 and smaller unit indicator\n else {\n return 0+ind2;\n }\n// let result = null;\n// x1%12?result=parseInt(x1/denom,10)+ind1+parseInt(x1%denom,10)+ind2:result=parseInt(x1/denom,10)+ind1;\n// return result;\n}", "function calculateTotal() {\n const firstCount = getInputValue('first');\n const economyCount = getInputValue('economy');\n\n const totalPrice = firstCount * 150 + economyCount * 100;\n document.getElementById('total-price').innerText = totalPrice;\n\n const tax = totalPrice * 0.1;\n document.getElementById('tax-amount').innerText = tax;\n\n const finalTotal = totalPrice + tax;\n document.getElementById('final-total').innerText = finalTotal\n}", "function addIncome(){\n \n var name = document.querySelector('.add-name');\n var value = document.querySelector('.add-value');\n // check validity\n if(name.checkValidity() && value.checkValidity()){\n // update ui\n var name = document.querySelector('.add-name').value;\n var value = document.querySelector('.add-value').value;\n id += 1;\n var addElement = document.createElement('p');\n addElement.setAttribute('id','income-'+id);\n addElement.innerHTML = name+ ' ' + value+'$' + '<svg class=\"bi bi-trash\" width=\"0.75em\" height=\"0.75em\" viewBox=\"0 0 16 16\" fill=\"currentColor\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M5.5 5.5A.5.5 0 016 6v6a.5.5 0 01-1 0V6a.5.5 0 01.5-.5zm2.5 0a.5.5 0 01.5.5v6a.5.5 0 01-1 0V6a.5.5 0 01.5-.5zm3 .5a.5.5 0 00-1 0v6a.5.5 0 001 0V6z\"/><path fill-rule=\"evenodd\" d=\"M14.5 3a1 1 0 01-1 1H13v9a2 2 0 01-2 2H5a2 2 0 01-2-2V4h-.5a1 1 0 01-1-1V2a1 1 0 011-1H6a1 1 0 011-1h2a1 1 0 011 1h3.5a1 1 0 011 1v1zM4.118 4L4 4.059V13a1 1 0 001 1h6a1 1 0 001-1V4.059L11.882 4H4.118zM2.5 3V2h11v1h-11z\" clip-rule=\"evenodd\"></svg>'\n document.querySelector('#income-list').appendChild(addElement);\n // add to array\n let newItem = {\n name:name,\n value:value,\n id:'income-'+id\n }\n incInput.push(newItem); \n incBudget();\n fullBudget() \n }\n\n else{\n alert('please enter valid form')\n }\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}", "function update_values(type, amount){\n\t\tconvert_to_number();\n\t\tif(type === 'income'){\n\t\t\tdisplayed_total += amount;\n\t\t\tdisplayed_income += amount;\n\t\t} else {\n\t\t\tdisplayed_total -= amount;\n\t\t\tdisplayed_expenses += amount;\t\t\t\n\t\t}\n\n\t\tconvert_to_number();\n\t\tdisplayed_total = displayed_total.toFixed(2);\n\t\tdisplayed_income = displayed_income.toFixed(2);\n\t\tdisplayed_expenses = displayed_expenses.toFixed(2);\n\t}", "function getCircleSize(earning) {\r\n // console.log(earning);\r\n var circleSize = earning.properties.year_2016_earnings * 80\r\n // console.log(circleSize)\r\n return circleSize;\r\n }", "function toggleCmIn(units) {\n let vals = ['grdns']; //, 'plnts'];todo: not done, see below\n for (let x = 0, l = vals.length; x < l; x++) {\n if (localStorage.getItem(\"aas_myGardenVs_\"+vals[x])) {\n let counter = localStorage.getItem(\"aas_myGardenVs_\"+vals[x]).split(\",\");\n for (let i = 0, l = counter.length; i < l; i++) {\n //for each garden, update the size indicators to display in units chosen\n //the units in local storage and settings menu are updated before this is called\n let grp = svgPlace.getElementById(vals[x][0]+\"_\"+counter[i]);\n if (vals[x] === \"grdns\") {\n grp.getElementsByClassName(\"sizeInd\")[0].textContent = \n formatSizeDisplay(Number(grp.children[0].getAttribute(\"height\"))/size);\n grp.getElementsByClassName(\"sizeInd\")[1].textContent = \n formatSizeDisplay(Number(grp.children[0].getAttribute(\"width\"))/size);\n }\n //todo: not done - need to convert displayed size to inches before supplying it to format...\n else if (grp.getElementsByClassName(\"plantSize\")) {\n const plantSize = grp.getElementsByClassName(\"plantSize\")[1];\n if (plantSize)\n plantSize.textContent = \n \"avg: \" + \n// formatSizeDisplay(Number(...)) + \n \" x \" //+ \n// formatSizeDisplay(Number(...));\n }\n }\n }\n }\n}", "function IncomePerMonth() {\r\n\r\n\r\n\r\n var Income_Value = document.getElementsByClassName(\"income-value\");\r\n var Sum = 0;\r\n\r\n\r\n for (let i = 0; i < Income_Value.length; i++) {\r\n\r\n Sum = Sum + parseInt(Income_Value[i].innerHTML);\r\n\r\n }\r\n var IncomeFinal = document.getElementById(\"income\");\r\n IncomeFinal.innerHTML = Sum.toFixed(2);\r\n\r\n var SumProcentege = document.getElementsByClassName(\"income-procentage\");\r\n for (let i = 0; i < SumProcentege.length; i++) {\r\n\r\n SumProcentege[i].innerHTML = (100 * parseInt(Income_Value[i].innerHTML) / Sum).toFixed(2) + \"%\";\r\n\r\n }\r\n\r\n Budget();\r\n}", "function displayTotals() {\r\n const totalPrice = SeatData.getTotalHeldPrice(seats);\r\n const heldSeatLabels = SeatData.getHeldSeats(seats).map(seat => seat.label);\r\n\r\n const priceSpan = document.querySelector(\"#selected-seat-price\");\r\n const labelSpan = document.querySelector(\"#selected-seat-labels\");\r\n\r\n priceSpan.innerText = totalPrice.toFixed(2);\r\n labelSpan.innerText = heldSeatLabels.length > 0 ? heldSeatLabels.join(\", \") : \"None\";\r\n }", "function _displayTotalRevenueOfOwner(list) {\n totalRevenue = list.reduce((prevVal, currVal) => {\n const val = currVal.cost;\n return {\n subTotal: prevVal.subTotal + val.subTotal,\n serviceTax: prevVal.serviceTax + val.serviceTax,\n swachhBharatCess: prevVal.swachhBharatCess + val.swachhBharatCess,\n krishiKalyanCess: prevVal.krishiKalyanCess + val.krishiKalyanCess,\n total: prevVal.total + val.total,\n tax: currVal.tax,\n }\n }, {\n subTotal: 0,\n serviceTax: 0,\n swachhBharatCess: 0,\n krishiKalyanCess: 0,\n total: 0,\n });\n console.log('Total Revenue');\n _displayLog(totalRevenue);\n }", "function displayTotalWorth() {\n totalWorthHasBeenRequested = true;\n let totalWorth = userDataArray.reduce( (acc,element) => acc += element.worth ,0 );\n const totalWorthDOM = document.createElement('h2');\n totalWorthDOM.classList.add('total');\n totalWorthDOM.innerHTML = `Total<strong>$${setFormat(totalWorth)}</strong>`;\n mainContainer.appendChild(totalWorthDOM);\n totalWealthIsAlreadyDisplayed = true;\n}", "function calcTotals() {\n var incomes = 0;\n var expenses = 0;\n var budget;\n // calculate total income\n data.allItems.inc.forEach(function(item) {\n incomes+= item.value;\n })\n //calculate total expenses\n data.allItems.exp.forEach(function(item) {\n expenses+= item.value;\n })\n //calculate total budget\n budget = incomes - expenses;\n // Put them in our data structure\n data.total.exp = expenses;\n data.total.inc = incomes;\n //Set Budget\n data.budget = budget;\n }", "function updatePaxDisplay() {\n\n var paxDetail = {\n roomQuantity: 0,\n adultQuantity: 0,\n childQuantity: 0\n };\n\n var searchOptions = getSearchOptions();\n\n paxDetail.roomQuantity = searchOptions.hotelSearchBody.length;\n searchOptions.hotelSearchBody.forEach(function name(pax) {\n paxDetail.adultQuantity += +pax.adultQuantity;\n paxDetail.childQuantity += +pax.childQuantity;\n });\n\n return paxDetail;\n\n }", "shelfSize()\n {\n return this.values.size * this.values.quantity;\n }", "function updateExpPercentage(){\n let percentages = budget.getPercentages();\n ui.displayPercentage(percentages);\n }", "function updateIncome(amount) {\n currentIncome = currentIncome + amount;\n income.innerHTML = `+$ ${currentIncome}`;\n}", "function summary(){\n const phonePrice = parseFloat(document.getElementById('phn-price').innerText);\n const casePrice = parseFloat(document.getElementById('case-price').innerText);\n\n const tax = parseFloat(document.getElementById('tax-price').innerText);\n document.getElementById('sub-total').innerText = phonePrice + casePrice;\n document.getElementById('total').innerText = phonePrice + casePrice + tax;\n\n \n}", "function totalCalculate(){\n const firstClassQuantityNumber = getQuantityValue('firstClass');\n const economyQuantityNumber = getQuantityValue('economy');\n\n //Sub-total Price\n const subTotalPrice = firstClassQuantityNumber * 150 + economyQuantityNumber * 100;\n document.getElementById('sub-total').innerText = subTotalPrice;\n\n //Total Tax\n const totalTax = Math.round(subTotalPrice * 0.1);\n document.getElementById('tax-amount').innerText = totalTax;\n \n //Total Amount\n const totalAmount = subTotalPrice + totalTax;\n document.getElementById('total-amount').innerText = totalAmount;\n \n //Total Fare\n const ticketFare = totalAmount;\n document.getElementById('total-fare').innerText = ticketFare;\n \n //Total Ticket\n const totalTicket = firstClassQuantityNumber + economyQuantityNumber;\n document.getElementById('total-ticket').innerText = totalTicket;\n}", "function projectpage(data) {\n var fundpercc = 0;\n if(!isNaN(100*(data.project.Budget/data.project.targetMoney))){\n fundpercc = parseInt(100*(data.project.Budget/data.project.targetMoney));\n }\n\n var fundrate = 0;\n if(fundpercc > 100){\n fundrate = 100;\n } else {\n fundrate = fundpercc;\n }\n\n\n document.getElementById(\"fundedInfo\").innerText = fundpercc + \"% out of 100% is invested\";\n document.getElementById(\"fundedMoney\").innerText = \"Current investments: \" + data.project.Budget + \"$\";\n document.getElementById(\"projjjName\").innerText = \"Project name: \" + data.project.name;\n document.getElementById(\"projjjDesc\").innerText = \"Project description: \" + data.project.description;\n document.getElementById(\"shareInfo\").innerText = \"Shares amount: \" + data.project.sharesPercenage;\n document.getElementById(\"targetMoney\").innerText = \"Target money: \" + data.project.targetMoney + \"$\";\n document.getElementById(\"fundrate\").style.width = fundrate +\"%\";\n document.getElementById(\"projjjCreator\").innerText = \"Project Creator: \" + data.author;\n document.getElementById(\"projjjImg\").src = data.project.photo;\n document.getElementById(\"invpp\").href = \"#/investproj/\" + data.project._id;\n\n // var cont = \"\";\n // for(var i = 0; i < data.cofounders.length; i++){\n // cont = cont + \"<li><a href='#/profile/\" + data.cofounders[i].cofounderId + \"'>\" + data.cofounders[i].cofounderName + \"</a></li>\";\n // }\n // document.getElementById(\"ulinvestors\").innerHTML = cont;\n\n}", "function calculateOverview(value, overviewer, summatoryName) {\r\n if (value < overviewer.min)\r\n overviewer.min = value;\r\n if (value > overviewer.max)\r\n overviewer.max = value;\r\n summatory[`${summatoryName}`] += value;\r\n }", "function budgetCalculator(watch,phone,laptop){\n var watchPrize=watch*50;\n var phonePrize=phone*100;\n var laptopPrize=laptop*500;\n var total= watchPrize+phonePrize+laptopPrize;\n return total;\n }", "calculateAdvancedCost() {\n var scale = this.isMonthly ? 1 : 1 / 12; // divide by 12 if the user input yearly numbers \n this.cost = parseInt( ( parseInt(this.monthlyRentCost) + parseInt(this.homeInsuranceCost) + parseInt(this.utilitiesCost)) * scale);\n // this.cost = this.cost.toFixed(2);\n\n this.eventAggregator.publish('update', {name: 'Housing', value: this.cost});\n }", "function captureSize() {\n\tchoice = sizeSelector.value;\n\tproduct.label = product.name + choice;\n\tproduct.size = choice;\n}", "function update_views(type, description, amount, addition_or_removal){\n\t\tamount = amount.toFixed(2);\n\n\t\tif(displayed_total < 0){\n\t\t\tvar displayed_total_to_string = displayed_total.toString();\n\t\t\tdisplayed_total_to_string = displayed_total_to_string.slice(1, displayed_total_to_string.length);\n\n\t\t\t$('#sub_mid_final').text(`Budget -$${displayed_total_to_string}`);\n\t\t} else {\n\t\t\t$('#sub_mid_final').text(`Budget +$${displayed_total}`);\n\t\t}\n\n\t\tif(type === 'income'){\n\t\t\tif(addition_or_removal === 'addition'){\n\t\t\t\t$('#sub_entries_income').append(`<h4 class=\"income entry\">${description} $${amount} <i class=\"remove fa fa-times-circle\"></i> </h4>`);\t\t\t\n\t\t\t}\n\n\t\t\t$('#sub_mid_income').text(`Income +$${displayed_income}`);\n\n\t\t} else {\n\t\t\tif(addition_or_removal === 'addition'){\n\t\t\t\t$('#sub_entries_expenses').append(`<h4 class=\"expense entry\">${description} $${amount} <i class=\"remove fa fa-times-circle\"></i> </h4>`);\n\t\t\t}\t\n\n\t\t\t$('#sub_mid_expenses').text(`Expenses -$${displayed_expenses}`);\n\t\t}\n\t}", "#updatePercentage() {\n //1. calculate the percentage\n model.calculatePercentages();\n //2. Read the percentage from th budget controller\n var percentage = model.getPercentages();\n //3. display the percentage to the UI\n addItemsView.displayPercentage(percentage);\n }", "function calculatePerHead(bill,noOfPersons){\n\n var price= Math.floor(bill/noOfPersons);\n alert(\"Each person have to give a \" + price + \" $ of his share in the bill\");\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 classHandler(classType, isIncrease){ \n const classCount = getInputValue(classType); \n let totalClassCount = classCount;\n\n if (isIncrease == true && classCount >= 0 ){\n totalClassCount = totalClassCount + 1;\n }\n\n if (isIncrease == false && classCount >= 1 ){\n totalClassCount = totalClassCount - 1;\n }\n\n document.getElementById(classType + '-Class-Count').value = totalClassCount;\n \n if (classType == \"first\"){\n\n document.getElementById('sub-Total1').innerText ='$' + totalClassCount * 150;\n \n }\n\n if (classType == \"economy\"){\n document.getElementById('sub-Total2').innerText ='$' + totalClassCount * 100;\n }\n calculateSubTotal(); \n}", "function formatAdjustments() {\n const { deductions, credits } = $scope.data;\n\n deductions.state.income = deductions.federal.ordinaryIncome;\n credits.state.income = credits.federal.ordinaryIncome;\n }", "function calculate() {\n\tincomeList = [];\n\tspentList = [];\n\tcountIncomePeriod();\n\tcountSpentPeriod();\n\tremainingDays();\n\t\n\tvar currentDate = new Date();\n\tvar currentDay = currentDate.getDate();\n\tvar currentMonth = currentDate.getMonth();\n\tvar currentYear = currentDate.getFullYear();\n\tvar yesterdayDate = new Date(currentYear, currentMonth, currentDay - 1);\n\tvar todayDate = new Date(currentYear, currentMonth, currentDay);\n\tlocalStorage.spentYesterday = countSpentDay(yesterdayDate);\n\tlocalStorage.spentToday = countSpentDay(todayDate);\n\tlocalStorage.incomeToday = countIncomeDay(todayDate);\n\tvar budget = localStorage.fixIncome - localStorage.fixCost - localStorage.fixSaving;\n\tdocument.getElementById(\"budget\").innerHTML = parseInt(budget - +localStorage.spentPeriod + +localStorage.incomePeriod + +localStorage.incomeToday - +localStorage.spentToday);\n\tdocument.getElementById(\"todayBudget\").innerHTML = parseInt(((budget - +localStorage.spentPeriod + +localStorage.incomePeriod) / +localStorage.remainingDays) + +localStorage.incomeToday - localStorage.spentToday);\n\tdocument.getElementById(\"spentYesterday\").innerHTML = parseInt(+localStorage.spentYesterday);\n\tdocument.getElementById(\"tomorowBudget\").innerHTML = parseInt((budget - +localStorage.spentPeriod + +localStorage.incomePeriod + +localStorage.incomeToday - +localStorage.spentToday) / (+localStorage.remainingDays - 1));\n}", "function calculate() {\n\tconst principal = parseFloat(billInput.value);\n\tconst percent = selectedTip / 100;\n\tconst people = parseFloat(peopleInput.value);\n\tconst amount = (principal * percent) / people;\n\tconst total = principal / people + amount;\n\t\n\ttipPerson.textContent = '$' + amount.toFixed(2);\n\ttotalPerson.textContent = '$' + total.toFixed(2);\n\treturn;\n}", "function calculateTotal() {\n const firstClassCount = getInputValue(\"first-class\");\n const economyCount = getInputValue(\"economy\");\n\n // Calculating subtotal\n const subTotal = firstClassCount * 150 + economyCount * 100;\n document.getElementById(\"subtotal-amount\").innerText = '$' + subTotal;\n\n // Calculating VAT\n const vat = Math.round(subTotal * 0.1);\n document.getElementById(\"vat-amount\").innerText = '$' + vat;\n\n // Calculating Total\n const Total = subTotal + vat;\n document.getElementById(\"total-amount\").innerText = '$' + Total;\n}", "function display() {\r\n \r\n var monthlyIncome = document.getElementById(\"incomePerMonth\").value;\r\n var insurance = insuranceDeduc(monthlyIncome);\r\n var dependents = dependentsDeduc();\r\n var deductions = totalDeduc(monthlyIncome, insurance, dependents);\r\n var payables = totalTax(monthlyIncome, deductions);\r\n var finaltotal = thousands_separators(payables);\r\n \r\n document.getElementById(\"demo\").innerHTML = \"₱ \" + finaltotal; // displays the final output to the site\r\n }", "displayCalculator(name, sprinklers, rad, subTotal) {\n \n // show default message if no sprinklers available\n if (sprinklers.length === 0) {\n const p = this.createElement('p')\n p.textContent = 'Set your sprinkler type, pressure and flow rate'\n this.sprinklers.append(p);\n } else {\n // display chosen sprinklers\n const title = U.createElement('h3')\n title.textContent = name\n const list = sprinklers.map((sprinkler, i) => {\n \n // amount adjuster\n const arcAdjust = U.createInput('number', `${name}-${sprinkler.arc}`, sprinkler.arc, `amount`)\n arcAdjust.input.value = sprinkler.amount\n arcAdjust.input.dataset.index = i\n\n // throw indicator\n const radius = U.createElement('p', 'radius')\n radius.textContent = sprinkler['radius'] ? sprinkler['radius'] : rad\n\n // flow counter\n const flow = U.createElement('p', 'flow')\n flow.dataset.flowRate = sprinkler['flow-rate']\n flow.textContent = sprinkler.totalFlow ? sprinkler.totalFlow.toFixed(2) : 0\n\n /*\n TODO: add precipiptation rates\n */\n\n // row to contain elements\n const li = U.wrapElements([arcAdjust.label, arcAdjust.input, radius, flow], 'li', 'table-row')\n li.dataset.name = name\n li.classList.add(`nozzle`)\n li.id = `row-${sprinkler.arc}`\n \n return li\n })\n \n const ul = U.createElement('ul')\n list.forEach(el => ul.append(el))\n \n // total flow\n const total = U.createElement('span', 'cell-4')\n total.textContent = subTotal\n total.id = 'total-flow'\n const totalLabel = U.createElement('span', 'cell-1-3')\n totalLabel.textContent = 'Total Flow'\n const totalRow = U.wrapElements([totalLabel, total], 'li', 'table-row')\n totalRow.classList.add('total')\n \n ul.append(totalRow)\n return U.wrapElements([title, ul], 'section', 'table')\n }\n }", "function showGameData() {\n $(\".beerBrewed\").html(gameData.beer + \" beer in stock\");\n $(\".grainStock\").html((Math.round(gameData.grain * 10) / 10) + \" kg grain in stock\");\n $(\".money\").html(\"$\" + gameData.money);\n $(\".perClickUpgrade\").html(\"Current upgrade level: \" + gameData.beerPerClick + \" -- Cost: $\" + gameData.beerPerClickCost);\n $(\".grainPrice\").html(\"Price per kg grain: $\" + gameData.grainCost);\n $('#grainCapacity').css('width', (Math.round(((gameData.grain / gameData.grainCapacity)*100) * 10) / 10) +'%').attr('aria-valuenow', gameData.grainCapacity).html((Math.round(((gameData.grain / gameData.grainCapacity)*100) * 10) / 10) + \"% full\");\n}", "function showDalcAndWalc() {\n\n\t// calculate the average workday and weekend alcohol \n\t// consumption arrays for each age\n\tvar avgDalcConsumption = calculateAvgOf(\"Dalc\"),\n\t\tavgWalcConsumption = calculateAvgOf(\"Walc\");\n\n\t// we give \"dalcWalcLabel\" to both lines so that we can remove them together\n\tshowLine(avgDalcConsumption, \"avgDalcLine\");\n \taddPointsToLine(avgDalcConsumption, \"dalcWalc\");\t\t\t\n \taddLabelToLine(avgDalcConsumption, \"Workday Average\", \"dalcWalcLabel\");\n\n \tshowLine(avgWalcConsumption, \"avgWalcLine\");\n \taddPointsToLine(avgWalcConsumption, \"dalcWalc\");\t\t\t\n \taddLabelToLine(avgWalcConsumption, \"Weekend Average\", \"dalcWalcLabel\");\n}", "function calculatePrice() {\n const firstClassCount = getBooking(\"firstClass\");\n const economyCount = getBooking(\"economy\");\n const subTotalPricing = firstClassCount * 150 + economyCount * 100;\n document.getElementById(\"subtotal\").innerText = \"$\" + subTotalPricing;\n\n const tax = Math.round(subTotalPricing * 0.1);\n document.getElementById(\"tax\").innerText = \"$\" + tax;\n\n const total = subTotalPricing + tax;\n document.getElementById(\"total\").innerText = \"$\" + total;\n}", "function totalnoinhousehold () {\n var totalno =\n parseInt($(editemployer + '#adult').val(), 10) +\n parseInt($(editemployer + '#teenager').val(), 10) +\n parseInt($(editemployer + '#children').val(), 10) +\n parseInt($(editemployer + '#infant').val(), 10) +\n parseInt($(editemployer + '#elderly').val(), 10) +\n parseInt($(editemployer + '#disabled').val(), 10)\n $('.totalnoinhousehold').text(totalno)\n }", "function calcElementsSize(){\r\n\t\r\n\tvar bodyHeight = window.innerHeight;\r\n\t// partimos del ancho como referencia para obtener cosas \"cuadradas\"\r\n\tvar boardWidth = $('.detail-panel').width();\r\n\t// Asignamos el height deseado a las fuentes\r\n\t$('.detail-panel').css({'font-size':((boardWidth*1/4)/4)+'px'});\r\n\t$('.detail-panel').css({'line-height':(((boardWidth*1/4)/4)+2)+'px'});\r\n\t$('.money-gold, .money-silver, .money-copper').css({'background-size':((boardWidth*1/5)/3)+'px '+((boardWidth*1/5)/3)+'px'});\r\n\t$('.money-gold, .money-silver, .money-copper').css({'padding-right':((boardWidth*1/5)/3)+'px'});\r\n}", "function totalCalculate(){\n const firstClassCount = getInput('firstClassTicket');\n const economyClassCount = getInput('economyClassTicket');\n var totalTicket = firstClassCount + economyClassCount;\n const totalPrice = firstClassCount * 150 + economyClassCount * 100;\n document.getElementById('subTotal').innerText = '$' + totalPrice;\n const tax = Math.round(totalPrice * 0.1);\n document.getElementById('tax-amount').innerText = '$' + tax;\n const grandTotal = totalPrice + tax;\n document.getElementById('grand-total').innerText = '$' + grandTotal;\n document.getElementById('firstClassQuantity').innerText = firstClassCount;\n document.getElementById('firstClassPrice').innerText ='$' + firstClassCount * 150;\n document.getElementById('economyClassQuantity').innerText = economyClassCount;\n document.getElementById('economyClassPrice').innerText ='$' + economyClassCount * 100;\n document.getElementById('totalTicket').innerText = totalTicket;\n document.getElementById('totalTicketPrice').innerText ='$' + totalPrice;\n}", "function setBookshelfDepthUI(){\n\tvar hDiv = document.getElementById(\"depthOut\");\n\tvar inches = bookshelf.depth/25.4;\n\thDiv.value = parseFloat(inches).toFixed(1);\n}", "function findAgeLevel() {\n let weight = document.getElementById(\"weight\").value;\n weightInt = parseFloat(weight);\n let heightFeet = document.getElementById(\"heightFeet\").value;\n let heightInches = document.getElementById(\"heightInches\").value;\n\n var heightFeetInt = parseInt(heightFeet);\n var heightInchesInt = parseInt(heightInches);\n\n var TotalHeight = heightFeetInt * 12 + heightInchesInt;\n var ageLevel;\n\n if (weightInt < 120 && TotalHeight < 45) {\n ageLevel = \"Youth\";\n } else if (weightInt < 120 && TotalHeight >= 45 && TotalHeight < 54) {\n ageLevel = \"Junior\";\n } else if (weightInt < 120 && TotalHeight >= 54 && TotalHeight < 57) {\n ageLevel = \"Junior\";\n } else if (weightInt < 120 && TotalHeight >= 57 && TotalHeight < 63) {\n ageLevel = \"Intermediate\";\n } else if (weightInt >= 120 && weightInt < 160 && TotalHeight < 45) {\n ageLevel = \"Youth\";\n } else if (weightInt >= 120 && weightInt < 160 && TotalHeight >= 45 && TotalHeight < 54) {\n ageLevel = \"Junior\";\n } else if (weightInt >= 120 && weightInt < 160 && TotalHeight >= 54 && TotalHeight < 57) {\n ageLevel = \"Intermediate\";\n } else if (weightInt >= 120 && weightInt < 160 && TotalHeight >= 57 && TotalHeight < 63) {\n ageLevel = \"Intermediate\";\n } else if (weightInt >= 120 && weightInt < 160 && TotalHeight >= 63) {\n ageLevel = \"Senior\";\n } else if (weightInt < 120 && TotalHeight >= 63) {\n ageLevel = \"Senior\";\n } else if (weightInt >= 160 && TotalHeight < 45) {\n ageLevel = \"Youth\";\n } else if (weightInt >= 160 && TotalHeight >= 45 && TotalHeight < 54) {\n ageLevel = \"Junior\";\n } else if (weightInt >= 160 && TotalHeight >= 54 && TotalHeight < 57) {\n ageLevel = \"Intermediate\";\n } else if (weightInt >= 160 && TotalHeight >= 57 && TotalHeight < 63) {\n ageLevel = \"Senior\";\n } else {\n ageLevel = \"Senior\";\n }\n\n return ageLevel;\n}", "function calcBill() {\n // get the bill\n let totalBill = bill.value;\n\n // number of people\n let totalPeople = people.value;\n let total = totalBill / totalPeople;\n\n // tip per person\n document.querySelector('#amount').value = (total * (tipAmount / 100)).toFixed(2);\n\n // show total per person\n document.querySelector('#total').value = total.toFixed(2);\n}", "function calcResults() {\n\t\trbAge.innerText = parseInt(currentAge)+parseInt(yearsToRetirement);\n\t\trbIncome.innerText = rawNestAmount*targetRetirementIncomePercentage;\n\t\trbInterest.innerText = (rawNestAmount-(rawNestAmount*targetRetirementIncomePercentage))*targetInterestRateToNest;\n\t\trbBalance.innerText = (rawNestAmount-(rawNestAmount*targetRetirementIncomePercentage))+(rawNestAmount-(rawNestAmount*targetRetirementIncomePercentage))*targetInterestRateToNest;\n\t}", "function calcDayBudget() {\n dayBudget = montlyBudget / 31;\n dayBudgetSelector.innerHTML = (Math.round(dayBudget * 100) / 100).toFixed(2);\n}", "function budgetInfo([description, value, type]) {\n this.type = type;\n this.description = description;\n this.value = value;\n this.htmlBuilder = function(description, value, type) {\n\n\n //Creating the HTML tags\n \tconst div1 = document.createElement('div');\n\tdiv1.classList.add(\"item\");\n\tdiv1.classList.add(\"clearfix\");\n\tdiv1.id = 'expense-0';\n\t\n\tif (this.type == 'inc'){\n\t\tdiv1.classList.add(\"incItem-\" + (incList.length - 1));\n\t}\n\n\telse {\n\t\tdiv1.classList.add(\"expItem-\" + (expList.length - 1));\n\t}\n\n\tconst div2 = document.createElement('div');\n\tdiv2.classList.add(\"item__description\");\n\tlet procDesc = document.createTextNode(this.description);\n\tdiv2.appendChild(procDesc);\n\n\tconst div3 = document.createElement('div');\n\tdiv3.classList.add(\"right\");\n\tdiv3.classList.add(\"clearfix\");\n\n\n\tconst div4 = document.createElement('div');\n\tdiv4.classList.add(\"item__value\");\n\n\tif (this.type == 'inc'){\n\n\t\tlet procVal = document.createTextNode(\"+\" + this.value);\n\t\tdiv4.appendChild(procVal);\n\t}\n\telse {\n\t\tlet procVal = document.createTextNode(\"-\" + this.value);\n\t\tdiv4.appendChild(procVal);\n\t}\n\t\n\n\tconst div5 = document.createElement('div');\n\tdiv5.classList.add(\"item__percentage\");\n\tvar procT = document.createTextNode(this.type);\n\tdiv5.appendChild(procT);\n\n\n\tconst div6 = document.createElement('div');\n\tdiv6.classList.add(\"item__delete\");\n\n\n\t//Creating button tag and button function\n\n\tconst button = document.createElement('button');\n\tbutton.classList.add(\"item__delete--btn\");\n\tvar incomeNumber = incList.length;\n\tvar expenseNumber = expList.length;\n\n\tif (this.type == 'inc'){\n\t\tbutton.addEventListener('click', function(){\n\t\t\tif (incList.length >= 1){\n\t\t\t\tvar income = $(\".incItem-\" + (incomeNumber -1));\n\t\t\t\tincome.remove(\"div\");\n\t\t\t\tincList.splice(incList[incList.length -1], 1 );\n\t\t\t\tincListValue.splice(incList[incList.length -1], 1);\n\t\t\t\tconst incomeAdder = (accumulator, currentValue) => (accumulator + currentValue);\n\t\t\t\tincListTotalVal = incListValue.reduce(incomeAdder,0);\n\t\t\t\tdocument.querySelector(\".budget__income--value\").textContent = incListTotalVal;\n\t\t\t\ttotalBudgetCalculator(incListTotalVal, expListTotalVal);\n\n\t\t\t}\n\t\t\t\n\t\t})\n\t}\n\telse {\n\t\tbutton.addEventListener('click', function(){\n\t\t\tif (expList.length >= 1){\n\t\t\t\tvar expenses = $(\".expItem-\" + (expenseNumber -1));\n\t\t\t\texpenses.remove(\"div\");\n\t\t\t\texpList.splice(expList[expList.length - 1], 1);\n\t\t\t\texpListValue.splice(expList[expList.length -1], 1);\n\t\t\t\tconst expensesAdder = (accumulator, currentValue) => (accumulator + currentValue);\n\t\t\t\texpListTotalVal = ~expListValue.reduce(expensesAdder,0) + 1;\t\n\t\t\t\tdocument.querySelector(\".budget__expenses--value\").textContent = expListTotalVal;\n\t\t\t\ttotalBudgetCalculator(incListTotalVal, expListTotalVal);\n\t\t\t\t\n\t\t\t\t\n\n\n\t\t\t}\n\n\t\t}) \n\t}\n\n\n\n\t//Creating i tag inside button tag\n\tconst i = document.createElement('i');\n\ti.classList.add(\"ion-ios-close-outline\");\n\n\n\t//Output the created HTML tags from the variables\n\tbutton.appendChild(i);\n\tdiv6.appendChild(button);\n\tdiv3.appendChild(div4);\n\tdiv3.appendChild(div5);\n\tdiv3.appendChild(div6);\n\tdiv1.appendChild(div3);\n\tdiv1.appendChild(div2);\n\n\n\tif (this.type == 'inc'){\n\t\tconst income__list = document.querySelector(\".income__list\");\n\t\treturn income__list.appendChild(div1);\t\n\t}\n\n\telse {\n\n\t\tconst expenses__list = document.querySelector(\".expenses__list\");\n\t\treturn expenses__list.appendChild(div1);\n\t\t}\n\t} \n}", "function price_display() {\r\n document.getElementById(\"adultTicket\").innerHTML = ticket_price[\"adult\"];\r\n document.getElementById(\"seniorTicket\").innerHTML= ticket_price[\"senior\"];\r\n document.getElementById(\"childTicket\").innerHTML = ticket_price[\"child\"];\r\n }", "function ContainerWeight(container)\n{\n if (disable_autocalc())\n return;\n\n var total = 0.0;\n var slots = document.getElementById(container).rows.length - 3;\n for (var i = 1; i <= slots; i++)\n {\n var num = parseFloat(sheet()[container + \"Gear\" + FormatNumber(i) + \"W\"].value);\n if (!isNaN(num))\n total += num;\n }\n\n document.getElementById(container + \"Weight\").innerHTML = total.toFixed(1);\n}", "function newHouse(input = []) {\n let [type, count, budget] = [...input].map(x => isNaN(x) ? x : Number(x));\n let flowerPrices = {\n Roses: 5,\n Dahlias: 3.8,\n Tulips: 2.8,\n Narcissus: 3,\n Gladiolus: 2.5\n };\n let discount = {\n Roses: 0.1,\n Dahlias: 0.15,\n Tulips: 0.15,\n };\n\n let increase = {\n Narcissus: 0.15,\n Gladiolus: 0.2\n };\n\n let totalPrice = count * flowerPrices[type];\n let disc = 1;\n if (count > 80 && type === 'Roses') {\n disc = 1 - discount[type];\n } else if (count > 90 && type === 'Dahlias') {\n disc = 1 - discount[type];\n } else if (count > 80 && type === 'Tulips') {\n disc = 1 - discount[type];\n } else if (count < 120 && type === \"Narcissus\") {\n disc = 1 + increase[type];\n } else if (count < 80 && type === 'Gladiolus') {\n disc = 1 + increase[type];\n }\n\n let finalPrice = totalPrice * disc;\n let moneyDiff = Math.abs(finalPrice - budget);\n if (budget >= finalPrice) {\n return `Hey, you have a great garden with ${count} ${type} and ${moneyDiff.toFixed(2)} leva left.`;\n }\n return `Not enough money, you need ${moneyDiff.toFixed(2)} leva more.`;\n}", "function calculateTotal () {\n const fistClassQuantity = getQuantityNumber('first-class');\n\n const economyQuantity = getQuantityNumber('economy');\n\n const subtotal = fistClassQuantity * 150 + economyQuantity * 100;\n document.getElementById('subtotal').innerText = subtotal;\n document.getElementById('show-subtotal').innerText = subtotal;\n\n const vat = Math.floor(subtotal * 0.1);\n document.getElementById('vat').innerText = vat;\n document.getElementById('show-vat').innerText = vat;\n\n const total = subtotal + vat;\n document.getElementById('total').innerText = total;\n document.getElementById('show-total').innerText = total;\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 tinhTien() {\n let size = document.getElementById('sizePizza').value;\n let price = document.getElementById('price-total');\n if (size == 'L') {\n price.innerHTML = (1000 * quantityInput.value * Gia + 10000).toLocaleString() + 'đ';\n }\n else if (size == 'XL') {\n price.innerHTML = (1000 * quantityInput.value * Gia + 20000).toLocaleString() + 'đ';\n }\n else {\n price.innerHTML = (1000 * quantityInput.value * Gia).toLocaleString() + 'đ';\n }\n}", "function calculateSubTotal(){\n const firstCount = getInputValue('first')\n const economyCount = getInputValue('economy')\n const subTotalPrice = firstCount*150 + economyCount*100; //sub total Calculation\n document.getElementById('sub-Total').innerText = '$' + subTotalPrice;\n\n const tax = subTotalPrice * .1 //tax Calculation\n document.getElementById('tax-Amount').innerText = '$' + tax;\n const grandTotal = tax + subTotalPrice;\n document.getElementById('grand-Total').innerText = '$' + grandTotal; //grand total Calculation\n}", "incomeOverTime() {\n return `Your weekly income will be Ksh ${this.totalProduction() * 7}\nYour yearly income will be Ksh ${this.totalProduction() * 366}`;\n }", "calculateSpace()\n {\n\n return (this.getMaxBudget() - this.sumOfExpenses());\n }", "function brandSizeDef(brandVal, sizeVal){\r\n\tlet brand1 = \"\";\r\n\tlet brand2 = \"\";\r\n\tlet size1 = 0;\r\n\tlet size2 = 0;\r\nif (brandVal === 2){ //if brand selected is H&M\r\n\tbrand1 = \"Levis\";\r\n\tbrand2 = \"Forever21\";\r\n\tsize1 = sizeVal+1;\r\n\tsize2 = sizeVal-1;}\r\nelse if (brandVal === 1){ //if brand selected is Levis\r\n\tbrand1 = \"H&M\";\r\n\tbrand2 = \"Forever21\";\r\n\tsize1 = sizeVal-1;\r\n\tsize2 = sizeVal-2;}\r\nelse { //if brand selected is Forever21\r\n\tbrand1 = \"H&M\";\r\n\tbrand2 = \"Levis\";\r\n\tsize1 = sizeVal+1;\r\n\tsize2 = sizeVal+2;}\r\n\t\r\nlet value = iterationMsgs.msg6[0] + brand1 + iterationMsgs.msg6[1] + size1 + iterationMsgs.msg6[2] + brand2 + iterationMsgs.msg6[3] + size2 + iterationMsgs.msg6[4];\r\n\r\nreturn value;\r\n}", "function mercantileType() {\n var calcOcc = function () {\n // Taking input\n var a = document.getElementById('carpetAreaGround-mercantile').valueAsNumber;\n var b = document.getElementById('carpetAreaUpper-mercantile').valueAsNumber;\n // Calculating Number of People\n var resultA = Math.abs(Math.round(a / 3));\n var resultB = Math.abs(Math.round(b / 6));\n var resultFixedOccupancy = Math.abs(Math.round((resultA + resultB) * 0.10));\n var resultFloatingOccupancy = Math.abs(Math.round((resultA + resultB) * 0.90));\n var resultTotalOccupancy = Math.abs(Math.round(resultA + resultB));\n\n return [resultA, resultB, resultFixedOccupancy, resultFloatingOccupancy, resultTotalOccupancy];\n };\n var occupancyResult = function () {\n // Declaring Result\n var values = calcOcc();\n document.getElementById('resultOccupancy').innerHTML = \"Total Occupancy: \" + values[4] + \"<br />\" + \"Fixed Occupancy ~ \" + values[2] + \"<br />\" + \"Floating Occupancy ~ \" + values[3] ;\n };\n \n return occupancyResult();\n}", "function calculate() {\r\n let totalBill = document.getElementById(\"total-bill\").value;\r\n if (isNaN(totalBill) || (totalBill <= 0)) {\r\n alert(`Plase enter a valid amount!`);\r\n return;\r\n }\r\n let tipPercentage = 0;\r\n let tipSelection = document.getElementsByClassName('service')[0].value;\r\n if (tipSelection === 'excellent') {\r\n tipPercentage = 20;\r\n } else if (tipSelection === 'good') {\r\n tipPercentage = 15;\r\n } else if (tipSelection === 'poor') {\r\n tipPercentage = 10;\r\n } else {\r\n alert(`Please select an option!`);\r\n }\r\n\r\n let totalTip = totalBill * tipPercentage / 100;\r\n\r\n let totalPersons = Number(document.getElementById('people-form').value);\r\n if (isNaN(totalPersons) || (totalPersons <= 0)) {\r\n alert(`Plase enter a valid number of persons!`);\r\n return;\r\n }\r\n\r\n if (Number.isInteger(totalPersons)) {\r\n let tipPerPerson = totalTip / totalPersons;\r\n let tipPerPersoninDollar = tipPerPerson.toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 });\r\n document.getElementById('tips').innerHTML = tipPerPersoninDollar;\r\n document.getElementById('total').style = 'display: inline';\r\n } else { alert('Plase enter an interger number') }\r\n }", "function GHOB_calculate_total(bedtype){\n\tvar present_val = document.getElementById(bedtype+\"_roomcount\").value;\n\tvar label_id = document.getElementById(bedtype+\"_total\");\n\tif((present_val!='')&&(GHOB_inst.isNumeric(present_val))){\n\t\tswitch(bedtype){\n\t\t\tcase 'singlebed':{ label_id.innerHTML = 'Total Beds:'+parseInt(present_val)*1; break; }\n\t\t\tcase 'doublebed':{ label_id.innerHTML = 'Total Beds:'+parseInt(present_val)*2; break; }\n\t\t\tcase 'triplebed':{ label_id.innerHTML = 'Total Beds:'+parseInt(present_val)*3; break; }\n\t\t}\n\t}else{\n\t\tif(present_val!=''){\n\t\t\talert('Please enter a numeric value in Number of room field');\n\t\t\tlabel_id.innerHTML = '';\n\t\t}\n\t}\n}", "function AccountingStatistics() {\r\n let AccountingNumbers = {\r\n MarketCapitalizationRate = 0,\r\n CashOnCashReturn = 0,\r\n MonthlyROI = 0\r\n }\r\n let incomeCalc = IncomeCalculations()\r\n let userInputs = UserDefinedInputs()\r\n let initialInvestment = FirstYearOutOfPocket()\r\n\r\n //MarketCapitalizationRate -> YearlyNetOperatingIncome / subtotal\r\n AccountingNumbers.MarketCapitalizationRate = incomeCalc.NetYearlyIncome / userInputs.SubTotal\r\n //CashOnCashReturn -> initialInvestment / YearlyNetOperatingIncome\r\n AccountingNumbers.CashOnCashReturn = initialInvestment / incomeCalc.NetYearlyIncome\r\n //Monthly ROI -> Net Monthly Income/first year out of pocket\r\n AccountingNumbers.MonthlyROI = incomeCalc.NetMonthlyIncome / initialInvestment\r\n \r\n return AccountingNumbers\r\n}", "updateInfo() {\n d3.select('#company-name').text(this.company.company);\n d3.select('#market-cap').text('Market Cap (millions): ' + (this.company.market_cap ? this.company.market_cap : \"N.A.\"));\n d3.select('#employees').text('Number of Employees: ' + (this.company.n_employee ? this.company.n_employee : \"N.A.\"));\n d3.select('#revenue').text('Revenue (millions): ' + (this.company.revenue ? this.company.revenue : \"N.A.\"));\n d3.select('#male').text('Male vs Female (of the board): ' + (this.company.male_pct ?\n (this.company.male_pct * 100).toFixed(2) + \"% vs \" + ((1 - this.company.male_pct) * 100).toFixed(2) + \"%\" : \"N.A.\"));\n d3.select('#industry-sector').text(\"Industry Sector: \" + this.company.sector);\n\n d3.select('#mba-pct').text(\n (this.company.mba_pct * 100).toFixed(2) + \"% of the board members hold MBA degrees\");\n\n // Draw the pie charts for education/age/nationality\n let width = d3.select(\"#svg-elements\").node().getBoundingClientRect().width;\n let height = d3.select(\"svg#age\").node().getBoundingClientRect().height;\n\n d3.select(\"svg#age\").attr(\"width\", width).selectAll(\"*\").remove();\n d3.select(\"svg#degree\").attr(\"width\", width).selectAll(\"*\").remove();\n d3.select(\"svg#nationality\").attr(\"width\", width).selectAll(\"*\").remove();\n\n let radius = Math.min(width, height) * 0.9 / 2;\n let ageSVG = d3.select(\"svg#age\")\n .append('g')\n .attr(\"transform\", \"translate(\" + 0.4 * width + \",\" + height / 2 + \")\");\n let degreeSVG = d3.select(\"svg#degree\")\n .append('g')\n .attr(\"transform\", \"translate(\" + 0.4 * width + \",\" + height / 2 + \")\");\n let nationalitySVG = d3.select(\"svg#nationality\")\n .append('g')\n .attr(\"transform\", \"translate(\" + 0.4 * width + \",\" + height / 2 + \")\");\n\n let arcGenerator = d3.arc()\n .innerRadius(0)\n .outerRadius(radius);\n\n let ageData = {\n \"<40\": this.company.age_below_40,\n \"40-49\": this.company.age_40_to_50,\n \"50-59\": this.company.age_50_to_60,\n \"60-69\": this.company.age_60_to_70,\n \">=70\": this.company.age_above_70,\n \"N.A.\": this.company.age_unknown\n };\n\n let degreeData = {\n \"Bachelor\": this.company.degree_bachelor_pct,\n \"Master\": this.company.degree_master_pct,\n \"Ph.D.\": this.company.degree_phd_pct,\n \"Others\": this.company.degree_others_pct\n }\n\n let nationalityData = {\n \"U.S.\": this.company.us_pct,\n \"Foreign\": this.company.non_us_pct,\n \"N.A.\": this.company.na_nationality_pct\n }\n\n let ageColorScale = d3.scaleOrdinal().domain(ageData).range(d3.schemeSet2);\n let degreeColorScale = d3.scaleOrdinal().domain(degreeData).range([\"#b35806\", \"#f1a340\", \"#fee0b6\", \"#d8daeb\"]);\n let nationalityColorScale = d3.scaleOrdinal().domain(nationalityData).range([\"#22b376\", \"#53e1c1\", \"#a3c9b2\"]);\n\n let pie = d3.pie()\n .value(d => d.value)(d3.entries(ageData));\n let degreePie = d3.pie()\n .value(d => d.value)(d3.entries(degreeData));\n let nationalityPie = d3.pie()\n .value(d => d.value)(d3.entries(nationalityData));\n\n // education\n degreeSVG.selectAll('path')\n .data(degreePie)\n .join('path')\n .attr('d', arcGenerator)\n .attr('fill', function (d) {\n return (degreeColorScale(d.data.key));\n })\n .attr(\"stroke\", \"white\");\n // age\n ageSVG.selectAll('path')\n .data(pie)\n .join('path')\n .attr('d', arcGenerator)\n .attr('fill', function (d) {\n return (ageColorScale(d.data.key));\n })\n .attr(\"stroke\", \"white\");\n // nationality\n nationalitySVG.selectAll('path')\n .data(nationalityPie)\n .join('path')\n .attr('d', arcGenerator)\n .attr('fill', function (d) {\n return (nationalityColorScale(d.data.key));\n })\n .attr(\"stroke\", \"white\");\n\n\n // Add the legend for the pie charts\n\n // education\n d3.select(\"svg#degree\")\n .selectAll(\"circle\")\n .data(degreePie)\n .join(\"circle\")\n .attr(\"cx\", 0.45 * width + radius)\n .attr(\"cy\", function (d, i) {\n return 0.3 * height + i * 0.1 * height;\n })\n .attr(\"r\", 0.02 * height)\n .style(\"fill\", d => degreeColorScale(d.data.key));\n\n d3.select(\"svg#degree\").selectAll(\"text\")\n .data(degreePie)\n .join(\"text\")\n .attr(\"x\", 0.47 * width + radius)\n .attr(\"y\", function (d, i) {\n return 0.3 * height + i * 0.1 * height;\n })\n .text(d => d.data.key)\n .attr(\"text-anchor\", \"left\")\n .style(\"alignment-baseline\", \"middle\");\n\n // age\n d3.select(\"svg#age\")\n .selectAll(\"circle\")\n .data(pie)\n .join(\"circle\")\n .attr(\"cx\", 0.45 * width + radius)\n .attr(\"cy\", function (d, i) {\n return 0.3 * height + i * 0.1 * height;\n })\n .attr(\"r\", 0.02 * height)\n .style(\"fill\", d => ageColorScale(d.data.key));\n\n d3.select(\"svg#age\").selectAll(\"text\")\n .data(pie)\n .join(\"text\")\n .attr(\"x\", 0.47 * width + radius)\n .attr(\"y\", function (d, i) {\n return 0.3 * height + i * 0.1 * height;\n })\n .text(d => d.data.key)\n .attr(\"text-anchor\", \"left\")\n .style(\"alignment-baseline\", \"middle\");\n\n // nationality\n d3.select(\"svg#nationality\")\n .selectAll(\"circle\")\n .data(nationalityPie)\n .join(\"circle\")\n .attr(\"cx\", 0.45 * width + radius)\n .attr(\"cy\", function (d, i) {\n return 0.3 * height + i * 0.1 * height;\n })\n .attr(\"r\", 0.02 * height)\n .style(\"fill\", d => nationalityColorScale(d.data.key));\n\n // nationality\n d3.select(\"svg#nationality\").selectAll(\"text\")\n .data(nationalityPie)\n .join(\"text\")\n .attr(\"x\", 0.47 * width + radius)\n .attr(\"y\", function (d, i) {\n return 0.3 * height + i * 0.1 * height;\n })\n .text(d => d.data.key)\n .attr(\"text-anchor\", \"left\")\n .style(\"alignment-baseline\", \"middle\");\n }", "function updateBodyCostDisplay() {\n document.getElementById(\"bodyCostDiv\").innerText = String(calculateBodyCost());\n }", "function calculatTotal(){\n const ticketCount = getInputValue(\"first-class-count\");\n const economyCount = getInputValue(\"economy-count\");\n const totalPrice = ticketCount * 150 + economyCount * 100;\n elementId(\"total-price\").innerText = '$' + totalPrice;\n const vat = totalPrice * .1;\n elementId(\"vat\").innerText = \"$\" + vat;\n const grandTotal = totalPrice + vat;\n elementId(\"grandTotal\").innerText = \"$\" + grandTotal;\n}", "function monthlyCost() {\n let budget = 0;\n for (let i = 0; i < employeeList.length; i++) {\n budget += Number(employeeList[i].annualSalary / 12);\n }\n if (budget > 20000) {\n $('#budgetAmount').css(\"background-color\", \"red\");\n }else if (budget < 20000){\n $('#budgetAmount').css(\"background-color\", \"transparent\");\n }\n let el = $('#budgetAmount');\n el.empty();\n el.append(Number(budget).toFixed(2));\n}", "function scaling(n, choice) {\n let size = 0;\n if (choice === 'Confirmed') {\n if (n === 0) {\n size = 0;\n } else if (n < 5000) {\n size = 1;\n } else if (n < 10000) {\n size = 3;\n } else if (n < 50000) {\n size = 5;\n } else if (n < 100000) {\n size = 8;\n } else if (n < 500000) {\n size = 10;\n } else if (n < 1000000) {\n size = 20;\n } else if (n < 2000000) {\n size = 30;\n } else {\n size = 50;\n }\n } else if (choice === 'Deaths') {\n if (n === 0) {\n size = 0;\n } else if (n < 100) {\n size = 1;\n } else if (n < 500) {\n size = 3;\n } else if (n < 1000) {\n size = 5;\n } else if (n < 5000) {\n size = 10;\n } else if (n < 10000) {\n size = 15;\n } else if (n < 50000) {\n size = 20;\n } else if (n < 100000) {\n size = 25;\n } else {\n size = 35;\n }\n } else if (choice === 'Daily_Confirmed') {\n if (n === 0) {\n size = 0;\n } else if (n < 100) {\n size = 1;\n } else if (n < 500) {\n size = 3;\n } else if (n < 1000) {\n size = 5;\n } else if (n < 2000) {\n size = 10;\n } else if (n < 5000) {\n size = 15;\n } else if (n < 10000) {\n size = 20;\n } else if (n < 20000) {\n size = 25;\n } else if (n < 50000) {\n size = 30;\n } else {\n size = 50;\n }\n } else {\n if (n === 0) {\n size = 0;\n } else if (n < 10) {\n size = 1;\n } else if (n < 30) {\n size = 5;\n } else if (n < 50) {\n size = 7;\n } else if (n < 100) {\n size = 10;\n } else if (n < 200) {\n size = 15;\n } else if (n < 500) {\n size = 20;\n } else if (n < 1000) {\n size = 25;\n } else {\n size = 30;\n }\n }\n return size;\n}", "function getArea() {\n if (interest.Perceeloppervlakte) {\n return interest.Woonoppervlakte + 'm² / ' + interest.Perceeloppervlakte + 'm² • ' + interest.AantalKamers + ' kamers';\n } else {\n return interest.Woonoppervlakte + 'm² • ' + interest.AantalKamers + ' kamers';\n }\n }", "function calculateNetWorth() {\n \n let finalAssets = calculateAsset();\n let finalLiabilities = calculateLiabilities();\n\n let netWorth = finalAssets - finalLiabilities;\n netWorth = netWorth.toFixed(2);\n if (!isNaN(netWorth)) {\n document.getElementById('showNetWorth').innerHTML = \"N\"+ netWorth;\n \n }\n return calculateNetWorth;\n \n }", "function updateValues(){\n\t$(\"#values\").html('available capacity: '+(sackLimit-weight)+'kg <br>total weight: '+weight+'kg, value: $'+value);\n}", "GridProportion(ev, data) {\n let parentName = ev.target.offsetParent.className,\n containerName = 'container_' + parentName.split('_')[1],\n configName = parentName.split(' ')[1],\n gridTotally = 0,\n nodes = $('.' + configName + ' .column input[type=\"text\"]');\n\n for (let j = 0; j < nodes.length; j++) {\n let num = parseInt(nodes[j].value, 10);\n let name = $('.' + containerName)[0].childNodes[j].className;\n\n gridTotally += num;\n data.map(d=>{\n d.id === name ? d.properties.map(p=>{\n p.name === 'bootstrapSmall' ? p.value = num : null;\n }) : null;\n });\n }\n if (gridTotally === 12) {\n for (let i = 0; i < nodes.length; i++) {\n let value = nodes[i].value,\n chartProperty = {},\n node = $('.' + containerName)[0].childNodes[i],\n canvas = node.childNodes[0] ?\n node.childNodes[0].childNodes[0].className : null;\n\n node.style.width = (value / 12 * 100) + '%';\n let cntWidth = $('.' + containerName)[0].clientWidth;\n\n data.map((d, i)=>{\n if (d.canvas && d.canvas.className === canvas) {\n d.components.properties.map(t=>{\n t.name === 'width' ? t.value = value / 12 * cntWidth - 10 : null;\n chartProperty[t.name] = (t.value === 'false' || t.value === 'true') ?\n JSON.parse(t.value) : t.value;\n });\n let obj = {\n option: d.type,\n node: [d.canvas],\n chartData: chartProperty\n };\n\n ChartComponent(obj);\n }\n });\n this.props.saveData(data);\n }\n }\n }", "function resultWindowPrice(height, width, price) {\r\n\r\n var full = parseInt(height) * parseInt(width) * price / 10;\r\n\r\n full = format1(full);\r\n\r\n document.getElementById(\"onlyWindowPrice\").innerHTML = full + \" $\";\r\n totalResult(full);\r\n}", "function calculate (){\n let salary = getSalary();\n if (salary > 0) {\n // return calculateTax(salary);\n let deductions = calculateTax(salary);\n document.getElementById(\"deductions\").innerHTML = deductions.toFixed(2);\n document.getElementById(\"net\").innerHTML = netIncome(salary, deductions).toFixed(2);\n }else {\n document.getElementById(\"deductions\").innerHTML = 0;\n }\n}", "total(){\n return operations.incomes() + operations.expenses()\n }", "function displayTotalcalories() {\n //Get total calories\n const totalCalories = ItemCtr.getTotalCalories();\n //add total calories to UI\n UICtrl.showTotalCalories(totalCalories);\n }", "getTotalMenuPrice() {\n return this.menu.reduce((a,b) => a+b.pricePerServing, \" \") * this.getNumberOfGuests();\n }", "renderAssetAllocation() {\n const assetAllocation = Object.keys(\n this.props.selectedPortfolio.assetAllocation\n ).map(assetClass => {\n return {\n name: assetClass,\n percentage: Math.round(\n this.props.selectedPortfolio.assetAllocation[assetClass]\n )\n };\n });\n\n return assetAllocation.map(assetClass => (\n <Text key={assetClass.name} style={this.styles.assetAllocation}>\n {assetClass.name}: {assetClass.percentage} %\n </Text>\n ));\n }", "function setInfobox(props){\r\n \r\n var infoValue, i = infoValue = 0;\r\n do {\r\n var infoValue = parseFloat(props[expressed]).toFixed(i);\r\n i++;\r\n }\r\n while (infoValue <= 0);\r\n \r\n if (isNaN(infoValue)) {\r\n var infoValue, infoAcres = infoValue = 0;\r\n } else {\r\n var infoValue = comma(parseFloat(props[expressed]).toFixed(i));\r\n var infoAcres = comma(props[displayed]);\r\n }\r\n\r\n var infoDesc2 = \"Acreage \" + drop2Choice;\r\n var infoDesc1 = \"Total Acreage of \" + drop1Choice;\r\n \r\n //label content\r\n var infoAttribute1 = '<h2><span id=\"inf\">' + infoDesc1 + ': </span> ' + infoAcres + '</h2>';\r\n var infoAttribute2 = '<h2><span id=\"inf\">' + infoDesc2 + ': </span> ' + infoValue + '</h2>';\r\n var stateName = '<h2>' + props.geo_name + '</h2>';\r\n \r\n //create info label div\r\n var infolabel = d3.select(\"body\")\r\n .append(\"div\")\r\n .attr(\"class\", \"infolabel\")\r\n .attr(\"id\", props.geo_id + \"_label\")\r\n .html(stateName);\r\n\r\n var stateName = infolabel.append(\"div\")\r\n .attr(\"class\", \"infogoo\")\r\n .html(infoAttribute1);\r\n var stateName = infolabel.append(\"div\")\r\n .attr(\"class\", \"infogoo\")\r\n .html(infoAttribute2);\r\n }" ]
[ "0.6062576", "0.5844187", "0.5822073", "0.57405657", "0.57292813", "0.57210386", "0.5707514", "0.56934345", "0.56642264", "0.5656131", "0.56139547", "0.56002456", "0.55953586", "0.5580501", "0.5535244", "0.552781", "0.55094194", "0.55021346", "0.55019397", "0.5500624", "0.54987407", "0.54987186", "0.5491002", "0.54890156", "0.5480314", "0.5480002", "0.5477164", "0.54618835", "0.54417884", "0.54411423", "0.54403055", "0.5435884", "0.54277426", "0.54265165", "0.5424609", "0.5423456", "0.5419597", "0.5411328", "0.5409103", "0.5396057", "0.5394771", "0.5389938", "0.5368858", "0.53673375", "0.53548414", "0.53525037", "0.5336365", "0.53321385", "0.53307873", "0.53303736", "0.53288543", "0.5324761", "0.53174937", "0.5314313", "0.53069055", "0.5301261", "0.5300385", "0.52982575", "0.52976114", "0.5293339", "0.529318", "0.5292809", "0.52917415", "0.5285773", "0.5284674", "0.52835006", "0.52830833", "0.5276624", "0.52762216", "0.52713996", "0.5270597", "0.52603686", "0.5258114", "0.52567726", "0.5252326", "0.52488995", "0.52484494", "0.5245249", "0.52414507", "0.52372473", "0.5236187", "0.52349967", "0.52226955", "0.52065665", "0.5201842", "0.51964337", "0.51953226", "0.51935387", "0.5191665", "0.5188222", "0.51878047", "0.51820064", "0.518153", "0.5181468", "0.51809794", "0.51773906", "0.51773393", "0.51760274", "0.51731193", "0.5171989", "0.51714486" ]
0.0
-1
Sets the origin so that floorplan is centered
resetOrigin() { var centerX = this.canvasElement.innerWidth() / 2.0; var centerY = this.canvasElement.innerHeight() / 2.0; var centerFloorplan = this.floorplan.getCenter(); this.originX = Dimensioning.cmToPixel(centerFloorplan.x) - centerX; this.originY = Dimensioning.cmToPixel(centerFloorplan.z) - centerY; this.unScaledOriginX = Dimensioning.cmToPixel(centerFloorplan.x, false) - centerX; this.unScaledOriginY = Dimensioning.cmToPixel(centerFloorplan.z, false) - centerY; // this.originX = centerFloorplan.x * this.pixelsPerCm - centerX; // this.originY = centerFloorplan.z * this.pixelsPerCm - centerY; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "recenter(origin = Vector.zero) {\n this.originX = origin.x;\n this.originY = origin.y;\n }", "function moveToOrigin() {\n if (visible) {\n ctx.translate(-((width / 2) - x(viewCenter.x)), -(-y(viewCenter.y) + (height / 2)));\n }\n }", "function setOrigin(ctx, axis) {\n\tctx.translate(-1 * axis.xLeftRange + axis.blank,\n\t\t-1 * axis.yRightRange + axis.blank);\n}", "setCenter() {\n this.cx = this.x + this.width / 2;\n this.cy = this.y + this.height / 2;\n }", "setCenter() {\n this.center = createVector(this.x, this.y);\n }", "centerCam()\n {\n this.camPos.x = -this.camOffset.x;\n this.camPos.y = -this.camOffset.y;\n this.zoom = 1.5;\n }", "setStartPosition() {\n this.x = DrunkenSailor.canvas.width - 20;\n this.y = 560;\n }", "_setWorldTransformOrigin() {\n // set transformation origin relative to world space as well\n this._boundingRect.world.transformOrigin = new Vec3(\n (this.transformOrigin.x * 2 - 1) // between -1 and 1\n * this._boundingRect.world.width,\n -(this.transformOrigin.y * 2 - 1) // between -1 and 1\n * this._boundingRect.world.height,\n this.transformOrigin.z\n );\n }", "function Origin(){\n this.x = midWidth;\n this.y = midHeight;\n}", "resetCenter() {\n this.center = createVector(this.x + this.w / 2, this.y + this.h / 2);\n }", "function handleOrigin(){\n\tvar newZoom = DEFAULT_SIZE / blob.r*5; //Precalculate the new zoom.\n\tzoom = lerp(zoom, newZoom, ZOOM_ACC); //Slowly 'lerp' to the new zoom from the old zoom.\n\t\n\ttranslate(width/2, height/2); //Center the view.\n\tscale(zoom); //Scale the view.\n\ttranslate(-blob.pos.x, -blob.pos.y); //Translate view with respect to player movement.\n}", "center() {\n this.panTo(this.graphDims.width / 2, this.graphDims.height / 2);\n }", "setOrigin( origin ) {\n this.transformOrigin = this.translation( origin.x, origin.y, origin.z );\n return this;\n }", "center() {\n this.move(this.getWorkspaceCenter().neg());\n }", "function set_mapview_origin(gui_x0, gui_y0)\n{\n var xmin, xmax, ymin, ymax, xsize, ysize;\n \n /* Normalize (wrap) the mapview origin. */\n var r = normalize_gui_pos(gui_x0, gui_y0);\n gui_x0 = r['gui_x'];\n gui_y0 = r['gui_y'];\n \n /* TODO: add support for mapview scrolling here. */\n \n base_set_mapview_origin(gui_x0, gui_y0);\n \n}", "set tileOrigin(coord) {\n this.x = coord.x * 8;\n this.y = coord.y * 8;\n }", "capLatitudeInPlace() {\n const limit = 0.5 * Math.PI;\n this._radians0 = Geometry_1.Geometry.clampToStartEnd(this._radians0, -limit, limit);\n this._radians1 = Geometry_1.Geometry.clampToStartEnd(this._radians1, -limit, limit);\n }", "function base_set_mapview_origin(gui_x0, gui_y0)\n{\n /* We need to calculate the vector of movement of the mapview. So\n * we find the GUI distance vector and then use this to calculate\n * the original mapview origin relative to the current position. Thus\n * if we move one tile to the left, even if this causes GUI positions\n * to wrap the distance vector is only one tile. */\n var g = normalize_gui_pos(gui_x0, gui_y0);\n gui_x0 = g['gui_x'];\n gui_y0 = g['gui_y'];\n \n mapview['gui_x0'] = gui_x0;\n mapview['gui_y0'] = gui_y0;\n \n}", "setOrigin(origin) {\n this._positionStrategy.setOrigin(origin);\n return this;\n }", "setOrigin (event) {\n const { left, top, width, height } = options.getBoundingClientRect(event)\n const origin = {\n x: left + Math.floor(width / 2),\n y: top + Math.floor(height / 2)\n }\n this.setState({ origin })\n }", "recenter() {\n this.pan = {\n x: 0,\n y: 0\n };\n this.zoom = 1;\n }", "adjustPosition() {\n //this.geometry.applyMatrix( new THREE.Matrix4().makeTranslation( -(this.width / 2), 0, -(this.height / 2)) );\n this.geometry.translate(-(this.width / 2), 0, -(this.height / 2));\n }", "function moveToViewCenter() {\n if (visible) {\n ctx.translate((width / 2) - x(viewCenter.x), -y(viewCenter.y) + (height / 2));\n }\n }", "_updatePosFromCenter() {\n let half = this._size.$multiply(0.5);\n this._topLeft = this._center.$subtract(half);\n this._bottomRight = this._center.$add(half);\n }", "function ReSet(){\n\ttransform.position.x = ((tempLon * 20037508.34 / 180)/100)-iniRef.x;\n\ttransform.position.z = System.Math.Log(System.Math.Tan((90 + tempLat) * System.Math.PI / 360)) / (System.Math.PI / 180);\n\ttransform.position.z = ((transform.position.z * 20037508.34 / 180)/100)-iniRef.z; \n\tcam.position.x = ((tempLon * 20037508.34 / 180)/100)-iniRef.x;\n\tcam.position.z = System.Math.Log(System.Math.Tan((90 + tempLat) * System.Math.PI / 360)) / (System.Math.PI / 180);\n\tcam.position.z = ((cam.position.z * 20037508.34 / 180)/100)-iniRef.z; \n}", "function setCenter() {\r\n that.center = new Array();\r\n that.center.x = board.fromPiecePos(that.xP) + \r\n board.fromPieceDist(that.widthP) / 2;\r\n that.center.y = board.fromPiecePos(that.yP) + \r\n board.fromPieceDist(that.heightP) / 2;\r\n }", "resetPosition() {\n // 505 is width, 101 is one block, so 202 will be center\n this.x = 202;\n // 606 is height, 171 is one block, so 435 will be center, but we need to be be off a bit,\n // so it will be 435 - 45px\n this.y = 390;\n }", "setCenter() {\n let x = 0;\n let y = 0;\n for (var v of this.pixelVectorPositions) {\n x += v.x;\n y += v.y;\n }\n\n x /= this.pixelVectorPositions.length;\n y /= this.pixelVectorPositions.length;\n this.center = createVector(x, y);\n\n }", "setCenter() {\n let x = 0;\n let y = 0;\n for (let v of this.pixelVectorPositions) {\n x += v.x;\n y += v.y;\n }\n\n x /= this.pixelVectorPositions.length;\n y /= this.pixelVectorPositions.length;\n this.center = createVector(x, y);\n }", "setMiddleCanva(){\n this.setX(this.canvas.width/2);\n this.setY(this.canvas.height/2);\n this.setDx(0);\n this.setDy(0);\n }", "function panAquSpCen(){\n map.setView(new ol.View({\n center: aquSpMercator,\n zoom: 19\n }));\n}", "reset() {\n this.x = this.originX;\n this.y = this.originY;\n }", "set center(value) {}", "function moveToCenter() {\n var coords;\n if (_.isEmpty(transitionCoordinates)) {\n /*\n * Checking to make sure we actually made it. This is a noop if\n * we are actually there.\n */\n selectRegion(currentRegion, true);\n return;\n }\n if (!feature) {\n // No data yet.\n return;\n }\n coords = transitionCoordinates.shift();\n projection.origin(coords);\n circle.origin(coords);\n currentOrigin = coords;\n feature.attr('d', clip);\n _.delay(_.bind(moveToCenter, this), TRANSITION_DELAY);\n }", "set Center(value) {}", "initTopLeft(){\n this._config = {\n left: 0.0,\n bottom: 0.5,\n width: 0.5,\n height: 0.5,\n position: [ -this._objectSize, 0, 0 ],\n up: [ -1, 0, 0 ],\n // init with a given angle to correct issues\n initAngle: {\n axis: new THREE.Vector3( 1, 0, 0 ),\n angle: -0.0001\n }\n }\n this._viewName = \"top_left\";\n this._backgroundColor = new THREE.Color().setRGB( 1, 1, 1 );\n }", "startMiddle() {\n this._x = Scene_Width / 2;\n this._y = Scene_Height / 2;\n this._dx = 1;\n this._dy = 1.5;\n }", "function centerUs() {\n\t\t\t var sizeAll = that.loaded.getBBox();\n\t\t\t\tobj.set.undrag();\n\t\t\t\tthat.loaded.animate({\n\t\t\t\t\ttransform: 'T'+(that.cx-sizeAll.x-sizeAll.width/2)+','+(that.cy-sizeAll.y-sizeAll.height/2)+'...'\n\t\t\t\t}, 1000, 'ease-in-out', function() {\n\t\t\t obj.set.drag(move, start, end);\n\t\t\t });\n\t\t\t}", "function centerMap() {\r\n\t\tvar sets = $['mapsettings'];\r\n\t\tvar $this = sets.element;\r\n\t\tvar location = new Point(($this.innerWidth()/2)-(sets.resolutions[sets.zoom-1].width/2),($this.innerHeight()/2)-(sets.resolutions[sets.zoom-1].height/2));\r\n\t\tsetInnerDimentions(location);\r\n\t}", "setWCCenter(xPos, yPos) {\r\n let p = vec2.fromValues(xPos, yPos);\r\n this.mCameraState.setCenter(p);\r\n }", "setCenter(object) {\n\t\tthis.center = object;\n\t\t\n\t\tthis.m = this.center.m;\n\t\tthis.center.parent = this;\n\t\tthis.r = this.center.r;\n\t\tthis.color = this.center.color;\n\t}", "computeCenter() {\n self.centerX = self.screenX + self.screenDisplacementX;\n self.centerY = self.screenY + self.screenDisplacementY;\n }", "function setScreenPerpCenter(point, camera) {\n // If it does not exist, create a new one\n if (!gplane) {\n var planeGeo = new THREE.PlaneGeometry(100, 100);\n var material = new THREE.MeshBasicMaterial({ visible: false });\n var plane = gplane = new THREE.Mesh(planeGeo, material);\n plane.visible = true; // Hide it..\n scene.add(gplane);\n }\n\n // Center at mouse position\n gplane.position.copy(point);\n\n // Make it face toward the camera\n gplane.quaternion.copy(camera.quaternion);\n}", "function setPosition() {\n\n var bottom = window.innerHeight-startBottom-y;\n bottom = (bottom>0)? bottom : 0;\n bottom = ((bottom+elem[0].getBoundingClientRect().height)<window.innerHeight)?bottom:(window.innerHeight-elem[0].getBoundingClientRect().height-40);\n\n var right = window.innerWidth-startRight-x;\n right = (right>0)? right : 0;\n right = ((right+elem[0].getBoundingClientRect().width)<window.innerWidth)?right:(window.innerWidth-elem[0].getBoundingClientRect().width);\n\n elem.css({\n bottom: bottom + 'px',\n right: right + 'px'\n });\n }", "function onFrame() {\n var vector = destination - view.center;\n setViewCenter(view.center + (vector / 15));\n}", "putCenter(b, xOffset = 0, yOffset = 0) { \n let a = this\n b.x = (a.x + a.halfWidth - b.halfWidth) + xOffset \n b.y = (a.y + a.halfHeight - b.halfHeight) + yOffset \n }", "function resetCubePosition() {\n let camera = tomni.threeD.getCamera();\n camera.fov = 40;\n let center = tomni.getCurrentCell().getCenter();\n let shift = tomni.getCurrentCell().info.dataset_id === 1 ? 256 : 2014;\n switch (tomni.twoD.axis) {\n case 'x':\n camera.position.set(-500, 0, 0);\n camera.up.set(0, 0, -1);\n // tomni.center.rotation.set(center.x + shift, center.y, center.z);\n break;\n case 'y':\n camera.position.set(0, 500, 0);\n camera.up.set(0, 0, -1);\n // tomni.center.rotation.set(center.x, center.y + shift, center.z);\n break;\n case 'z':\n camera.position.set(0, 0, -500);\n camera.up.set(0, -1, 0);\n // tomni.center.rotation.set(center.x, center.y, center.z + shift);\n break;\n }\n\n camera.rotation.set(0, 1, 1);\n tomni.center.rotation = tomni.getCurrentCell().getCenter();//.set(1, 1, 1);\n tomni.threeD.zoom = 750;\n camera.updateProjectionMatrix();\n tomni.forceRedraw();\n }", "setCenter(x, y) {\n this._center.cx = x;\n this._center.cy = y;\n this._position.x = this._center.cx - this._dimView.width / 2;\n this._position.y = this._center.cy - this._dimView.height / 2;\n }", "centerObj (gObj, offset = 0) {\n\t\t// Detect Main camera and grabs width and heigh of screen\n\t\tlet screenWidth = this.cameras.main.width;\n\t\tlet screenHeight = this.cameras.main.width;\n\n\t\t// Move the object\n\t\tgObj.x = screenWidth / 2;\n\t\tgObj.y = screenHeight / 2 - offset * 100;\n\t}", "function recenterMap(target) {\n console.log(target)\n map.setView(target,8);\n}", "function centerBoard() {\r\n\tpaper.project.activeLayer.position = paper.view.center;\r\n}", "function setLandingPosition(){\n landingPosition.x = Math.floor(Math.random() * (landingLimitCoordinates.right - landingLimitCoordinates.left + 1) + landingLimitCoordinates.left);\n landingPosition.y = Math.floor(Math.random() * (landingLimitCoordinates.down - landingLimitCoordinates.up + 1) + landingLimitCoordinates.up);\n}", "function setCamera()\n{\n var v = 0.0025; // camera tool speed\n var r = 950.0; // camera to origin distance\n \n var alphaX = v * camRotationX * Math.PI;\n var alphaY = v * camRotationY * Math.PI;\n \n alphaX = Math.max(alphaX, -0.5 * Math.PI)\n alphaX = Math.min(alphaX, 0.0)\n \n var sX = Math.sin(alphaX);\n var cX = Math.cos(alphaX);\n \n var sY = Math.sin(alphaY);\n var cY = Math.cos(alphaY);\n \n camera.position.x = r * cX * sY;\n camera.position.y = r * (-sX);\n camera.position.z = r * cX * cY;\n \n // aim the camera at the origin\n camera.lookAt(new THREE.Vector3(0,0,0));\n}", "function setOriginLocator (locator) {\n var currentX = getX(), currentY = getY();\n\n originLocator = locator;\n\n setX(currentX);\n setY(currentY);\n }", "lookAtCenter() {\n if (this.viewport) {\n this.viewport.update();\n }\n if (this.controls) {\n this.controls.reset();\n }\n this.updateScene();\n }", "set_sprite_offset_center() {\r\n this.sprite.x_offset = -(Math.round(this.sprite.width / 2));\r\n this.sprite.y_offset = -(Math.round(this.sprite.height / 2));\r\n }", "_setStartCameraPosition() {\n this._startCameraPosition = new Vector2(this._camera.x, this._camera.y);\n }", "setOrigin(origin) {\n this.origin = origin;\n }", "setTransformOrigin(origin) {\n if(!origin.type || origin.type !== \"Vec3\") {\n if(!this.renderer.production) {\n throwWarning(this.type + \": Cannot set transform origin because the parameter passed is not of Vec3 type:\", origin);\n }\n\n return;\n }\n\n origin.sanitizeNaNValuesWith(this.transformOrigin);\n\n if(!origin.equals(this.transformOrigin)) {\n this.transformOrigin.copy(origin);\n\n // set transformation origin relative to world space as well\n this._setWorldTransformOrigin();\n\n this._updateMVMatrix = true;\n }\n }", "setOrigin(x:number, y:number) {\n\t\tif(this.isValidNumber(x) && this.isValidNumber(y)) {\n\t\t\tthis.origin = {x: x, y: y};\n\t\t}\n\t}", "function btnRecenter() {\n olData.getMap().then(function(map){\n //this coordinate is coordinate of Mesjid Raya Baiturrahman\n var latLon = [10610664.603506522,619192.4795668736];\n map.getView().setCenter(latLon);\n map.getView().setZoom(15);\n });\n }", "function panBare(){\n map.setView(new ol.View({\n center: bareHallMercator,\n zoom: 19\n }));\n}", "centre(){\n this.map.fitBounds(this.bounds)\n }", "function moveToCenter() {\n $._resetToCenter();\n}", "function setCameraCoordinatesBasis(camera)\n{\n var w = normalize(sub(camera.position, camera.target));\n var u = normalize(cross(camera.up, w));\n var v = normalize(cross(w, u));\n camera.coordinateBasis = [u,v,w]\n}", "function setOriginCoords(x, y) {\n\t\tthis.originX = eval(x);\n\t\tthis.originY = eval(y);\n\t}", "_setWorldPosition() {\n // dimensions and positions of our plane in the document and clip spaces\n // don't forget translations in webgl space are referring to the center of our plane and canvas\n const planeCenter = {\n x: (this._boundingRect.document.width / 2) + this._boundingRect.document.left,\n y: (this._boundingRect.document.height / 2) + this._boundingRect.document.top,\n };\n\n const containerCenter = {\n x: (this.renderer._boundingRect.width / 2) + this.renderer._boundingRect.left,\n y: (this.renderer._boundingRect.height / 2) + this.renderer._boundingRect.top,\n };\n\n this._boundingRect.world.top = ((containerCenter.y - planeCenter.y) / this.renderer._boundingRect.height) * this._boundingRect.world.ratios.height;\n this._boundingRect.world.left = ((planeCenter.x - containerCenter.x) / this.renderer._boundingRect.width) * this._boundingRect.world.ratios.width;\n }", "function setViewCenter(newCenter) {\n view.center = newCenter\n if (player != undefined ) {\n player.position = newCenter \n }\n}", "function drawOrigin() {\n context.beginPath()\n context.strokeStyle = '#9E9E9E'\n context.moveTo(origin.x, 0)\n context.lineTo(origin.x, canvas.height)\n context.moveTo(0, origin.y)\n context.lineTo(canvas.width, origin.y)\n context.closePath()\n context.stroke()\n context.strokeStyle = '#000000'\n }", "function panArnHall(){\n map.setView(new ol.View({\n center: arnHallMercator,\n zoom: 19\n }));\n}", "constructor() {\n this.matrix = Matrix.identity(3);\n this._centerPoint = new Point(0, 0);\n }", "function centercube(loc, size, material){\n\n\tvar f = new Drone( loc );\n\t//Escribe en una linea los movimientos para dejar una calabaza en el centro del cubo\n\t//...//\n\n}", "function recenterCamera() {\n\tvar old_up = [\n\t\tviewerParams.camera.up.x,\n\t\tviewerParams.camera.up.y,\n\t\tviewerParams.camera.up.z,\n\t];\n\tif (viewerParams.useTrackball) initControls();\n\t// handle fly controls-- just want to look at the center\n\telse viewerParams.camera.lookAt(viewerParams.center);\n\t// maintain orientation as best we can\n\tviewerParams.camera.up.set(old_up[0],old_up[1],old_up[2]);\n\tsendCameraInfoToGUI(null, true);\n}", "function reCenterMap() {\n // map.setCenter({ lat: yourLat, lng: yourLng })\n map.setCenter( origMapCenter );\n } // reCenterMap()", "_setCoordinates() {\n this._bounds = [];\n this._coordinates = this._convertCoordinates(this._coordinates);\n\n this._projectedBounds = [];\n this._projectedCoordinates = this._projectCoordinates();\n\n this._center = this._coordinates;\n }", "_setTransformOrigin(position) {\n if (!this._transformOriginSelector) {\n return;\n }\n const elements = this._boundingBox.querySelectorAll(this._transformOriginSelector);\n let xOrigin;\n let yOrigin = position.overlayY;\n if (position.overlayX === 'center') {\n xOrigin = 'center';\n }\n else if (this._isRtl()) {\n xOrigin = position.overlayX === 'start' ? 'right' : 'left';\n }\n else {\n xOrigin = position.overlayX === 'start' ? 'left' : 'right';\n }\n for (let i = 0; i < elements.length; i++) {\n elements[i].style.transformOrigin = `${xOrigin} ${yOrigin}`;\n }\n }", "function resetOriginLocator () {\n var currentX = getX(), currentY = getY();\n\n originLocator = null;\n\n setX(currentX);\n setY(currentY);\n }", "function panbobStand(){\n map.setView(new ol.View({\n center: bobStadMercator,\n zoom: 19\n }));\n}", "function positionCameraToBuilding(object, controls, camera) {\n camera.position.copy(getCameraPositionBasedOnObject(object));\n controls.target.copy(getObjectCenter(object));\n // controls.update() must be called after any manual changes to the camera's transform\n controls.update();\n}", "function centerMap(){\n map.fitBounds(b);\n map.setZoom(z);\n }", "function setProjection() {\n\n // Set bounds for projection.\n viewerDist = length(subtract(e, a));\n pn = viewerDist - 6;\n pf = viewerDist + 64;\n\n // Perspecive projection bounds.\n pt = pn * Math.tan(Math.PI / 4);\n pb = -pt;\n pr = pt;\n pl = -pr;\n\n getPerspective();\n}", "function setDirection() {\n cameraVectorObj.rotation.x = params.upAndDown * Math.PI/180;\n widgetObj.rotation.y = Math.PI + (params.around * Math.PI/180);\n}", "function centerMap() {\n getLocation()\n }", "setupCoordinates(){\n // Start the circle off screen to the bottom left.\n // We divide the size by two because we're drawing from the center.\n this.xPos = -circleSize / 2;\n this.yPos = height + circleSize / 2;\n }", "centerFocus(zoomIn = true) {\n if (layoutModeGet()) return;\n findDimensions(this);\n const minX = simulationArea.minWidth || 0;\n const minY = simulationArea.minHeight || 0;\n const maxX = simulationArea.maxWidth || 0;\n const maxY = simulationArea.maxHeight || 0;\n\n const reqWidth = maxX - minX + 150;\n const reqHeight = maxY - minY + 150;\n\n this.scale = Math.min(width / reqWidth, height / reqHeight);\n\n if (!zoomIn) { this.scale = Math.min(this.scale, DPR); }\n this.scale = Math.max(this.scale, DPR / 10);\n\n this.ox = (-minX) * this.scale + (width - (maxX - minX) * this.scale) / 2;\n this.oy = (-minY) * this.scale + (height - (maxY - minY) * this.scale) / 2;\n }", "centerScreen() {\n self.moveCenter(0,0);\n }", "setPixelCenter() {\n let bodyPos = this.body.getPixelCoordinates();\n let angle = this.body.angle;\n let rotatedCenter = createVector(this.center.x, this.center.y);\n rotatedCenter.rotate(angle);\n let trueCenterPos = p5.Vector.add(bodyPos, rotatedCenter);\n this.pixelCenter = trueCenterPos;\n }", "function panAqua(){\n map.setView(new ol.View({\n center: aquSpMercator,\n zoom: 19\n }));\n}", "function _center() {\n\t\tif (data.isMobile) {\n\t\t\tvar newLeft = 0,\n\t\t\t\tnewTop = 0;\n\t\t} else {\n\t\t\tvar newLeft = ($(window).width() - data.$boxer.width() - data.padding) / 2,\n\t\t\t\tnewTop = (data.options.top <= 0) ? (($(window).height() - data.$boxer.height() - data.padding) / 2) : data.options.top;\n\t\t\t\n\t\t\tif (data.options.fixed !== true) {\n\t\t\t\tnewTop += $(window).scrollTop();\n\t\t\t}\n\t\t}\n\t\t\n\t\tdata.$boxer.css({ \n\t\t\tleft: newLeft, \n\t\t\ttop: newTop \n\t\t});\n\t}", "setCenter(x:number, y:number) {\n\t\tthis._center = null;\n\t\tthis._rect = null;\n\t\tthis.setOrigin(x - Math.round(this._width / 2), y - Math.round(this._height / 2));\n\t}", "function _setXYZ(shape) {\n _scale = (_zoomed ? (_worldBounds.width - _mapRegion.find('.details').width()) : _worldBounds.width) / shape.size.width;\n var offsetX = 50; // Check the reason of this offset\n var offsetXRight = 39; // Check the reason of this offset\n var offsetY = 140; // Check the reason of this offset\n _x = shape.center.x + (shape.center.x + shape.size.width + offsetX > _worldBounds.width ? offsetXRight : offsetX);\n _y = shape.center.y + offsetY;\n }", "setFloor(floor) {\n\t\tthis.floor = floor;\n\t}", "SetRelativeLocation(z, y, x) {\n this.CurrentLocation.Z += z;\n this.CurrentLocation.Y += y;\n this.CurrentLocation.X += x;\n }", "function allocateOrigin() {\n\t\tthis.originX = this.originPort.x + 3 + this.originPort.ne.x;\n\t\tthis.originY = this.originPort.y + 3 + this.originPort.ne.y;\n\t\tif (this.destinationX != null && this.destinationY != null) {\n\t\t\tthis.allocate();\n\t\t}\n\t}", "reset() {\n\t\tthis._orbitCenter = this._resetOrbitCenter;\n\t}", "function panBlan(){\n map.setView(new ol.View({\n center: blanHallMercator,\n zoom: 19\n }));\n}", "function ensureCentre(o, target) {\n o.cx = o.cx == null ? target.bbox().cx : o.cx\n o.cy = o.cy == null ? target.bbox().cy : o.cy\n}", "function ensureCentre(o, target) {\n o.cx = o.cx == null ? target.bbox().cx : o.cx\n o.cy = o.cy == null ? target.bbox().cy : o.cy\n}", "function ensureCentre(o, target) {\r\n o.cx = o.cx == null ? target.bbox().cx : o.cx\r\n o.cy = o.cy == null ? target.bbox().cy : o.cy\r\n}", "setInitialBowlerPosition() {\n\t\tthis.startBowlPosX = config.width * 0.55;\n\t\tthis.startBowlPosY = config.height * 0.35;\n\t}" ]
[ "0.6963244", "0.68701035", "0.67081255", "0.65162814", "0.6457855", "0.6382377", "0.6355766", "0.6334865", "0.6326623", "0.624805", "0.6244178", "0.622014", "0.6214292", "0.6188106", "0.61551195", "0.6151244", "0.6120659", "0.61107975", "0.6072131", "0.6060452", "0.6059877", "0.60446167", "0.60296094", "0.5972478", "0.59585476", "0.59454286", "0.5941359", "0.5927878", "0.5922704", "0.5906183", "0.587595", "0.58709943", "0.58674973", "0.5851167", "0.5843896", "0.5834848", "0.5820436", "0.58089405", "0.5806323", "0.57966554", "0.57942206", "0.5793797", "0.5774536", "0.5771619", "0.575875", "0.5758282", "0.5755815", "0.5755625", "0.5719101", "0.57086605", "0.57078683", "0.5700367", "0.56804144", "0.5680051", "0.5669336", "0.5660243", "0.56601286", "0.56548005", "0.5645417", "0.5638018", "0.5628697", "0.5628505", "0.5609945", "0.5603211", "0.5602249", "0.5582032", "0.5572809", "0.5566605", "0.5562899", "0.55537826", "0.55474246", "0.55398893", "0.55355465", "0.553408", "0.55322224", "0.55224633", "0.5517838", "0.55112314", "0.550651", "0.5500648", "0.5498769", "0.5497224", "0.54788536", "0.54707426", "0.5468641", "0.54666305", "0.54658026", "0.5464375", "0.54620653", "0.54595584", "0.54584295", "0.54579264", "0.5457442", "0.5454517", "0.5451262", "0.54439443", "0.54413366", "0.54413366", "0.54331523", "0.54275334" ]
0.81728476
0
Convert from THREEjs coords to canvas coords.
convertX(x) { return Dimensioning.cmToPixel(x - Dimensioning.pixelToCm(this.originX)); // return (x - (this.originX * this.cmPerPixel)) * this.pixelsPerCm; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "canvasToWorldCoordinates(p) {\r\n\t\tlet m = MathTools.inverseMatMul(this.camera.t, [\r\n\t\t\t[p.x-window.innerWidth/2+this.camera.x],\r\n\t\t\t[window.innerHeight-(p.y+window.innerHeight/2)+this.camera.y]\r\n\t\t])\r\n\t\treturn {\r\n\t\t\tx: m[0][0],\r\n\t\t\ty: m[1][0]\r\n\t\t}\r\n\t}", "function geoCoordsToCanvasCoords(coords) {\n\t\tvar result = [coords[0], coords[1]];\n\t\tresult[0] += 180.0;\n\t\tresult[0] /= 360.0;\n\t\tresult[1] -= 90.0;\n\t\tresult[1] /= -180.0;\n\t\treturn result;\n\t}", "function convertCoordinates(canvas, x, y){\n var container = canvas.getBoundingClientRect();\n return {x: x - container.left * (canvas.width / container.width),\n y: y - container.top * (canvas.height / container.height)};\n }", "world2canvas(modelMatrix, viewMatrix, projectionMatrix) {\n // https://webglfundamentals.org/webgl/lessons/webgl-text-html.html\n // We just got through computing a matrix to draw our\n // F in 3D.\n\n // compute a clip space position\n // using the matrix we computed for the F\n const clipspace = vec4.create()\n\n // duplicate in programHelper\n const modelViewMatrix = mat4.create();\n mat4.multiply(modelViewMatrix, viewMatrix, modelMatrix);\n const mvpMatrix = mat4.create();\n mat4.multiply(mvpMatrix, projectionMatrix, modelViewMatrix);\n\n vec4.transformMat4(clipspace, [0.5, 0.5, 0.5, 1], mvpMatrix);\n\n if (clipspace[3] < 0)\n return null\n // divide X and Y by W just like the GPU does.\n clipspace[0] /= clipspace[3];\n clipspace[1] /= clipspace[3];\n\n // convert from clipspace to pixels\n var pixelX = (clipspace[0] * 0.5 + 0.5) * gl.canvas.width;\n var pixelY = (clipspace[1] * -0.5 + 0.5) * gl.canvas.height;\n\n if (pixelX < 0 || pixelX > gl.canvas.width)\n return null\n if (pixelY < 0 || pixelY > gl.canvas.height)\n return null\n\n // position the div\n // div.style.left = Math.floor(pixelX) + \"px\";\n //div.style.top = Math.floor(pixelY) + \"px\";\n //textNode.nodeValue = clock.toFixed(2);\n return { x: Math.floor(pixelX), y: Math.floor(pixelY), z: clipspace[3] }\n }", "projectWorldToCanvas(canvas, vWorld) {\n\t // Calculate the ModelViewProjection Matrix.\n\t var mvp = (canvas.uMVMatrix.copy()).mult(canvas.uPMatrix);\n\n\t // Transform the vector to Normalized Device Coordinate.\n\t var vNDC = this.multMatrixVector(mvp, vWorld);\n\n\t // Transform vector from NDC to Canvas coordinates.\n\t var vCanvas = createVector();\n\t vCanvas.x = 0.5 * (vNDC.x + 1.0) * canvas.GL.drawingBufferWidth;\n\t vCanvas.y = 0.5 * (vNDC.y + 1.0) * canvas.GL.drawingBufferHeight;\n\t vCanvas.z = 0.5 * (vNDC.z + 1.0);\n\n\t return vCanvas;\n\t}", "function fieldCoordsToCanvasCoords(x, y, fieldIndex) {\n let gridCellSize = getGridCellSize();\n let offset = getOffset(fieldIndex);\n\n return {\n x: x * gridCellSize + offset.x,\n y: y * gridCellSize + offset.y,\n };\n}", "screenToWorld(x, y) {\r\n\t\tconst dpr = window.devicePixelRatio || 1;\r\n\t \treturn {\r\n\t\t\tx:(x - this._canvas.width / dpr / 2) / this.zoom + this.posX,\r\n\t\t\tz:(y - this._canvas.height / dpr / 2) / this.zoom + this.posZ\r\n\t\t};\r\n\t}", "function setTexcoords( gl ) {\n const W = 853;\n const H = 606;\n\n gl.bufferData(\n gl.ARRAY_BUFFER,\n new Float32Array( [\n\n\n // FRONT X/W Y/H\n\n\n\n 0 / W, 395 / H,\n 408 / W, 600 / H,\n 408 / W, 395 / H,\n\n\n\n 0 / W, 600 / H,\n 408 / W, 600 / H,\n 0 / W, 395 / H,\n\n\n\n\n\n\n // TOP FACE\n 0 / W, 0 / H,\n\n 408 / W, 395 / H,\n 408 / W, 0 / H,\n\n 0 / W, 395 / H,\n\n 408 / W, 395 / H,\n 0 / W, 0 / H,\n\n\n // LEFT\n 408 / W, 395 / H,\n 834 / W, 600 / H,\n 834 / W, 395 / H,\n\n 408 / W, 600 / H,\n 834 / W, 600 / H,\n 408 / W, 395 / H,\n\n // right\n 408 / W, 395 / H,\n 834 / W, 600 / H,\n 834 / W, 395 / H,\n\n 408 / W, 600 / H,\n 834 / W, 600 / H,\n 408 / W, 395 / H,\n\n // back\n 408 / W, 395 / H,\n 834 / W, 600 / H,\n 834 / W, 395 / H,\n\n 408 / W, 600 / H,\n 834 / W, 600 / H,\n 408 / W, 395 / H,\n\n // bottom\n 408 / W, 0 / H,\n 834 / W, 395 / H,\n 834 / W, 0 / H,\n\n 408 / W, 395 / H,\n 834 / W, 395 / H,\n 408 / W, 0 / H,\n\n\n ] ),\n gl.STATIC_DRAW );\n}", "function toScreen( position, camera, jqdiv ) {\n\n var pos = position.clone(); \n projScreenMat = new THREE.Matrix4();\n projScreenMat.multiplyMatrices( camera.projectionMatrix, camera.matrixWorldInverse );\n pos.applyProjection(projScreenMat);\n\n return { x: ( pos.x + 1 ) * jqdiv.width() / 2 ,\n y: ( pos.y + 1 ) * jqdiv.height()/ 2 };\n\n // return pos;\n }", "screenToWorld(x, y) {\n if (y === undefined) {\n y = x.y;\n x = x.x;\n }\n\n let M = this.ctx.getTransform().invertSelf();\n\n let ret = {\n x: x * M.a + y * M.c + M.e,\n y: x * M.b + y * M.d + M.f,\n };\n\n return ret;\n }", "function localToCanvas(e)\n {\n var canvas = element[0].getBoundingClientRect();\n\n return {\n x : e.clientX - canvas.left,\n y : e.clientY - canvas.top\n };\n }", "worldToScreen(x, y) {\n if (y === undefined) {\n y = x.y;\n x = x.x;\n }\n\n let M = this.ctx.getTransform();\n\n let ret = {\n x: x * M.a + y * M.c + M.e,\n y: x * M.b + y * M.d + M.f,\n };\n\n return ret;\n }", "trackToCoords(_c) {\r\n\t\t\t\tthis.x = _c.x - (SCREEN_WIDTH*0.5)|0;\r\n\t\t\t\tthis.y = _c.y - (SCREEN_HEIGHT*0.5)|0;\r\n\t\t\t}", "function toCanvasSpace(location, centerLoc) {\n\tvar relativeLoc = new Location(location.x + -centerLoc.x, location.y + -centerLoc.y); \n\treturn new Location(relativeLoc.x * Renderer.GAME_TO_CANVAS,\n\t\trelativeLoc.y * Renderer.GAME_TO_CANVAS);\n}", "function from_coords(x,y) {\n return x + y*16;\n }", "transformCoords(x: number, y: number) {\n return {\n x: (x * this.im.scale) + this.im.position.x,\n y: (y * this.im.scale) + this.im.position.y,\n };\n }", "calculateVertices() {\n var geometry = this.geometry;\n var vertices = geometry.buffers[0].data;\n if (geometry.vertexDirtyId === this.vertexDirty && this._transformID === this.transform._worldID) {\n return;\n }\n this._transformID = this.transform._worldID;\n if (this.vertexData.length !== vertices.length) {\n this.vertexData = new Float32Array(vertices.length);\n }\n var wt = this.transform.worldTransform;\n var a = wt.a;\n var b = wt.b;\n var c = wt.c;\n var d = wt.d;\n var tx = wt.tx;\n var ty = wt.ty;\n var vertexData = this.vertexData;\n for (var i = 0; i < vertexData.length / 2; i++) {\n var x = vertices[(i * 2)];\n var y = vertices[(i * 2) + 1];\n vertexData[(i * 2)] = (a * x) + (c * y) + tx;\n vertexData[(i * 2) + 1] = (b * x) + (d * y) + ty;\n }\n if (this._roundPixels) {\n for (var i$1 = 0; i$1 < vertexData.length; i$1++) {\n vertexData[i$1] = Math.round(vertexData[i$1]);\n }\n }\n this.vertexDirty = geometry.vertexDirtyId;\n }", "project(coord, transMat) {\n var point = BABYLON.Vector3.TransformCoordinates(coord, transMat);\n // The transformed coordinates will be based on coordinate system\n // starting on the center of the screen. But drawing on screen normally starts\n // from top left. We then need to transform them again to have x:0, y:0 on top left.\n var x = point.x * this.workingWidth + this.workingWidth / 2.0 >> 0; // >>0 二进制右移 相当于取整\n var y = -point.y * this.workingHeight + this.workingHeight / 2.0 >> 0;\n return (new BABYLON.Vector2(x, y));\n }", "coordCanvasToImage(x, y, doLog = false) {\n if (doLog) {\n console.log(\"-----coordCanvasToImage() Start-----\");\n }\n var canvas = this.getCanvas();\n var rect = canvas.getBoundingClientRect();\n\n var img = this.getImage();\n var deltaXCanvas = x - 0.5;\n var deltaYCanvas = y - 0.5;\n\n var deltaXImg = this.scaleCanvasToImageX(deltaXCanvas);\n var deltaYImg = this.scaleCanvasToImageY(deltaYCanvas);\n\n if (doLog) {\n console.log(\"x, y: \" + x + \", \" + y);\n console.log(\n \"deltaXCanvas, deltaYCanvas: \" +\n deltaXCanvas +\n \", \" +\n deltaYCanvas\n );\n console.log(\n \"deltaXImg, deltaYImg: \" + deltaXImg + \", \" + deltaYImg\n );\n console.log(\"-----coordCanvasToImage() End-----\");\n }\n return {\n x: this.state.x_center + deltaXImg,\n y: this.state.y_center + deltaYImg\n };\n }", "convertCoordinates( x, y ) {\r\n let loc_x = x * this._NUM_PIXELS / this._GRID_SIZE;;\r\n let loc_y = y * this._NUM_PIXELS / this._GRID_SIZE;;\r\n return { x: loc_x, y: loc_y };\r\n }", "function toScreenPosition(obj, camera, renderer){\n var vector = new THREE.Vector3();\n\n var widthHalf = 0.5*renderer.context.canvas.width;\n var heightHalf = 0.5*renderer.context.canvas.height;\n\n obj.updateMatrixWorld();\n vector.setFromMatrixPosition(obj.matrixWorld);\n vector.project(camera);\n\n vector.x = ( vector.x * widthHalf ) + widthHalf;\n vector.y = - ( vector.y * heightHalf ) + heightHalf;\n\n return {\n x: vector.x,\n y: vector.y\n };\n}", "function toXYCoords(pos) {\n console.log(camera)\n let vector = raycaster.setFromCamera((pos.clone, camera))\n vector.x = (vector.x + 1) / 2 * window.innerWidth;\n vector.y = -(vector.y - 1) / 2 * window.innerHeight;\n return vector;\n}", "cameraCoords() {\n let coords0 = vec3.fromValues(5, 2, 0);\n let coords1 = vec3.fromValues(3, 3, 1);\n let coords2 = vec3.fromValues(-3,3,1);\n return new Array(coords0, coords1, coords2);\n }", "function mouseBrowserToCanvas(canvas, x, y) {\t\t\t\t//x,y sono le coordinate browser del puntatore del mouse\n var bbox = canvas.getBoundingClientRect();\n return { x: Math.round(x - bbox.left * (canvas.width / bbox.width)),\n y: Math.round(y - bbox.top * (canvas.height / bbox.height))\n\t\t\t}; \t \n}", "function getCursorPosition2(canvas, event) {\nvec.set(\n ( event.clientX / window.innerWidth ) * 2 - 1,\n - ( event.clientY / window.innerHeight ) * 2 + 1,\n 0.5 );\n\nvec.unproject( camera );\n\nvec.sub( camera.position ).normalize();\n\nvar distance = - camera.position.z / vec.z;\n\npos.copy( camera.position ).add( vec.multiplyScalar( distance ) );\nconsole.log(pos);\n\n\t\t// var geometry = new THREE.BoxGeometry( 1, 1, 1 ); << to create a cube\n\t\tvar geometry = new THREE.DodecahedronGeometry(1, 0); \n\t\t// .DodecahedronGeometry(Radius, detail); play with second number\n\n\n\t\tvar material = new THREE.MeshBasicMaterial( { color: colorRGB,\n\t\t\twireframe: true } );\n\t\t// yellow: 0xffff00\n\t\t// green: 0x00ff00\n\t\t// pink: 0xFFC0CB\n\t\t// white: 0xFFFFFF\n\t\tvar cube = new THREE.Mesh( geometry, material );\n\n\t\tcube.position.set( pos.x, pos.y, 0);\n\n\t\tscene.add( cube );\n\n\t\t// camera.position.z = 5;\n\n\n\t\t// begin: render scene and animate\n\t\tvar animate = function () {\n\t\t\trequestAnimationFrame( animate );\n\n\t\t\tcube.rotation.x += 0.01;\n\t\t\tcube.rotation.y += 0.01;\n\n\t\t\trenderer.render( scene, camera );\n\t\t};\n\n\t\tanimate();\n\t\t// end: render scene and animate\n}", "function base_canvas_to_map_pos(canvas_x, canvas_y)\n{\n return gui_to_map_pos(canvas_x + mapview.gui_x0,\n canvas_y + mapview.gui_y0);\t\t \n}", "projectCanvasToWorld(canvas, vCanvas) {\n\t // Retrieve the ModelView and Projection matrices.\n\t var mv = canvas.uMVMatrix.copy();\n\t var p = canvas.uPMatrix.copy();\n\n\t // Compute the ModelViewProjection matrix.\n\t var mvp = mv.mult(p);\n\n\t // Inverts the MVP.\n\t var invMVP = mvp.invert(mvp);\n\t \n\t // Transform the canvas vector to Normalized Device Coordinates (in [-1, 1]³),\n\t // Here viewport is (0, 0, drawingBufferWidth, drawingBufferHeight).\n\t var vNDC = createVector();\n\t vNDC.x = (-1.0 + 2.0 * (vCanvas.x / canvas.GL.drawingBufferWidth));\n\t vNDC.y = (-1.0 + 2.0 * (vCanvas.y / canvas.GL.drawingBufferHeight));\n\t vNDC.z = (-1.0 + 2.0 * (vCanvas.z));\n\n\t // Transform vector from NDC to world coordinates.\n\t var vWorld = this.multMatrixVector(invMVP, vNDC);\n\n\t return vWorld;\n\t}", "coordImageToCanvas(x, y, doLog = false) {\n if (doLog) {\n console.log(\"-----coordImageToCanvas() Start-----\");\n }\n var canvas = this.getCanvas();\n var rect = canvas.getBoundingClientRect();\n var img = this.getImage();\n\n var deltaXImage = x - this.state.x_center;\n var deltaYImage = y - this.state.y_center;\n\n var deltaXCanvas = this.scaleImageToCanvasX(deltaXImage);\n var deltaYCanvas = this.scaleImageToCanvasY(deltaYImage);\n\n if (doLog) {\n console.log(\"x, y: \" + x + \", \" + y);\n console.log(\n \"deltaXImage, deltaYImage: \" + deltaXImage + \", \" + deltaYImage\n );\n console.log(\n \"deltaXCanvas, deltaYCanvas: \" +\n deltaXCanvas +\n \", \" +\n deltaYCanvas\n );\n console.log(\"-----coordImageToCanvas() End-----\");\n }\n\n return { x: 0.5 + deltaXCanvas, y: 0.5 + deltaYCanvas };\n }", "function cameraToWorldCoords(camera, cameraCoords)\n{\n\tvar basis = camera.coordinateBasis;\n\tvar worldCoords = camera.position;\n\tfor(var i=0; i<3; i++)\n\t\tworldCoords = add(worldCoords, mult_scalar(cameraCoords[i], basis[i]));\n\treturn worldCoords;\n}", "function canvasCoordsToFieldCoords(x, y, floorResult, fieldIndex) {\n let gridCellSize = getGridCellSize();\n let offset = getOffset(fieldIndex);\n\n return {\n x: floorResult ?\n floor((x - offset.x) / gridCellSize) : round((x - offset.x) / gridCellSize),\n y: floorResult ?\n floor((y - offset.y) / gridCellSize) : round((y - offset.y) / gridCellSize),\n };\n}", "setFloat32Buffers() {\n let tempArr = []\n for(let i = 0; i < this.vertices.length; i++) {\n let vertex = this.vertices[i];\n tempArr[3*i] = vertex.points[0];\n tempArr[3*i + 1] = vertex.points[1];\n tempArr[3*i + 2] = vertex.points[2];\n }\n this.vertexPosArray = new Float32Array(tempArr);\n this.colorArray = new Float32Array(this.colors);\n this.normalArray = new Float32Array(this.normals);\n }", "function to_coords(val) {\n return {'x': val % 16,\n 'y': Math.floor(val/16) };\n }", "function canvasToWorldPt(pt)\n{\n\tvar min = engine.render.bounds.min;\n\tvar max = engine.render.bounds.max;\t\n\tvar xworld = min.x + (max.x - min.x) * pt.x / canvas.width;\n\tvar yworld = min.y + (max.y - min.y) * pt.y / canvas.height;\n\treturn {x:xworld, y:yworld};\n}", "function doMatrixConversions(shaderProgram, position) \n{\n\t/**\n\t * We need to create a transformation that takes world coordinate\n\t * points in the pointArrayBuffer to the coordinates WebGL expects.\n\t * (a) Start with second half in pixelsToWebGLMatrix, which takes pixel\n\t * coordinates to WebGL coordinates.\n\t * (b) Scale and translate to take world coordinates to pixel coords\n\t */\n var mapMatrix = new Float32Array(16);\n\t// copy pixel->webgl matrix\n\tmapMatrix.set(pixelsToWebGLMatrix);\n\t// Scale to current zoom (worldCoords * 2^zoom)\n\tvar scale = Math.pow(2, OsmMaps.zoom);\n _scaleMatrix(mapMatrix, scale, scale);\n var boundingBox = OsmMaps.points.getBoundingBox(position);\n var offset = OsmMaps.points.latLongToPixelXY(boundingBox.latMax, boundingBox.lonMin);\n _translateMatrix(mapMatrix, -offset.x, -offset.y);\n \n\t// attach matrix value to 'mapMatrix' uniform in shader\n var matrixLoc = gl.getUniformLocation(shaderProgram, 'mapMatrix');\n\tgl.uniformMatrix4fv(matrixLoc, false, mapMatrix);\n}", "getCoords() {\n return [this.x, this.y, this.z];\n }", "setImageCoords(shaderProg) {\n let attributeCoords = this.gl.getAttribLocation(shaderProg, \"a_coords\");\n this.gl.enableVertexAttribArray(attributeCoords);\n\n // Set Up Draw buffer draw coords\n let bufferCoords = this.gl.createBuffer();\n this.gl.bindBuffer(this.gl.ARRAY_BUFFER, bufferCoords);\n this.gl.bufferData(this.gl.ARRAY_BUFFER,\n new Float32Array([\n -1.0, -1.0,\n 1.0, -1.0,\n -1.0, 1.0,\n -1.0, 1.0,\n 1.0, -1.0,\n 1.0, 1.0]),\n this.gl.STATIC_DRAW);\n this.gl.vertexAttribPointer(attributeCoords, 2, this.gl.FLOAT, false, 0, 0);\n }", "function getCoords(e, canvas) {\n if (e.offsetX) {\n return { x: e.offsetX, y: e.offsetY };\n }\n else if (e.layerX) {\n return { x: e.layerX, y: e.layerY };\n }\n else {\n return { x: e.pageX, y: e.pageY };\n }\n }", "function TranslateHelperGeometry() {\n\n const geometry = new THREE.BufferGeometry();\n\n geometry.setAttribute('position', new THREE.Float32BufferAttribute([0, 0, 0, 1, 1, 1], 3));\n\n return geometry;\n\n}", "screenToWorldCoordinates(point) {\n var _a, _b, _c, _d;\n let newX = point.x;\n let newY = point.y;\n // transform back to world space\n newX = (newX / this.viewport.width) * this.drawWidth;\n newY = (newY / this.viewport.height) * this.drawHeight;\n // transform based on zoom\n newX = newX - this.halfDrawWidth;\n newY = newY - this.halfDrawHeight;\n // shift by focus\n newX += (_b = (_a = this._camera) === null || _a === void 0 ? void 0 : _a.x) !== null && _b !== void 0 ? _b : 0;\n newY += (_d = (_c = this._camera) === null || _c === void 0 ? void 0 : _c.y) !== null && _d !== void 0 ? _d : 0;\n return new Vector(Math.floor(newX), Math.floor(newY));\n }", "project(ax, ay, az, angles){\r\n var x = ax - this.camera_p.x;\r\n var y = ay - this.camera_p.y;\r\n var z = az - this.camera_p.z;\r\n \r\n var dx = angles.cy*(angles.sz*y + angles.cz*x) - angles.sy*z;\r\n var dy = angles.sx*(angles.cy*z + angles.sy*(angles.sz*y + angles.cz*x)) + angles.cx*(angles.cz*y - angles.sz*x);\r\n var dz = angles.cx*(angles.cy*z + angles.sy*(angles.sz*y + angles.cz*x)) - angles.sx*(angles.cz*y - angles.sz*x);\r\n return {x: (this.view_p.z*dx)/dz - this.view_p.x, y: (this.view_p.z*dy)/dz - this.view_p.y, dx:dx, dy:dy, dz:dz};\r\n }", "function getPointOnCanvasInCanvasUnits( ptInGlobalUnits, geometry, canvas ){\n\t\n\tvar sizeInGlobalUnits = {\n\t\tx: geometry.parameters.width,\n\t\ty: geometry.parameters.height\n\t}\n\t\n\tvar sizeInLocalUnits = {\n\t\tx: canvas.width,\n\t\ty: canvas.height\n\t}\n\n\tvar convertFactor = { \n\t\tx: ( sizeInLocalUnits.x / sizeInGlobalUnits.x ),\n\t\ty: ( sizeInLocalUnits.y / sizeInGlobalUnits.y )\n\t};\n\t\n\tvar pointInLocalUnits = new THREE.Vector2( \n\t\t/* x */ _Math.convertValue( convertFactor.x, \"global\", \"px\", ptInGlobalUnits.x ),\n\t\t/* y */\t_Math.convertValue( convertFactor.y, \"global\", \"px\", ptInGlobalUnits.y )\n\t\t\t);\t\n\n\tdebug.master & debug.intersectionHandling && console.log( \"getPointOnCanvasInLocalUnits() :\" , pointInLocalUnits );\n\t\n\treturn pointInLocalUnits;\n}", "function convertCoords(x,y) {\n var sidelen = 400 / board.size();\n\n x = x - 154 - sidelen / 2;\n y = y - 10 - sidelen / 2;\n return [x,y];\n}", "calculateVertices() {\n if (this._transformID === this.transform._worldID) {\n return;\n }\n this._transformID = this.transform._worldID;\n var wt = this.transform.worldTransform;\n // reveal(wt)\n var a = wt.a;\n var b = wt.b;\n var c = wt.c;\n var d = wt.d;\n var tx = wt.tx;\n var ty = wt.ty;\n var data = this.geometry.points; // batch.vertexDataOriginal;\n var vertexData = this.vertexData;\n var count = 0;\n for (var i = 0; i < data.length; i += 2) {\n var x = data[i];\n var y = data[i + 1];\n vertexData[count++] = (a * x) + (c * y) + tx;\n vertexData[count++] = (d * y) + (b * x) + ty;\n }\n }", "function windowToCanvas(x, y) {\n var bbox = canvas.getBoundingClientRect();\n return {\n x: x - bbox.left * w / bbox.width,\n y: y - bbox.top * h / bbox.height\n };\n }", "pointToNormalizedCanvas(p) {\n return p.matrixTransform(this.transformationMatrix);\n }", "function pixelToCameraCoords(camera, i, j, width, height)\n{\n\tvar bounds = camera.cameraBounds;\n\tvar u = bounds.l + (bounds.r - bounds.l) * (i + 0.5) / width;\n\tvar v = bounds.b + (bounds.t - bounds.b) * (j + 0.5) / height;\n\tvar w = -camera.near;\n\treturn [u,v,w];\n}", "canvasToPointForNormalizedCanvas(p) {\n return p.matrixTransform(this.transformationMatrix.inverse());\n }", "function windowToCanvas(x, y) {\n var bbox = canvas.getBoundingClientRect();\n return {\n x: x - bbox.left * (w / bbox.width),\n y: y - bbox.top * (h / bbox.height)\n };\n }", "function convertXYtoCanvas(x, y){\n var xLeft = X_MIN + x * (X_MAX - X_MIN) * 0.1;\n var xRight = xLeft + (X_MAX - X_MIN) * 0.1;\n var yLow = Y_MIN + y * (Y_MAX-Y_MIN) * 0.05;\n var yHigh = yLow + (Y_MAX-Y_MIN) * 0.05;\n\n var squareVerticies = [xLeft, yLow, xRight, yLow, xLeft, yHigh, xRight, yHigh];\n\n return squareVerticies;\n}", "function getCoords(e) {\n\t\tif (e.offsetX) {\n\t\t\t// Works in Chrome / Safari (except on iPad/iPhone)\n\t\t\treturn { x: e.offsetX, y: e.offsetY };\n\t\t}\n\t\telse if (e.layerX) {\n\t\t\t// Works in Firefox\n\t\t\treturn { x: e.layerX, y: e.layerY };\n\t\t}\n\t\telse {\n\t\t\t// Works in Safari on iPad/iPhone\n\t\t\treturn { x: e.pageX - canvas.offsetLeft, y: e.pageY - canvas.offsetTop };\n\t\t}\n\t}", "function webcam2space(x, y, z) {\r\n return new THREE.Vector3(\r\n x - capture.videoWidth / 2,\r\n -(y - capture.videoHeight / 2),\r\n -z\r\n );\r\n}", "function worldToScreen(pos, camera) {\n\t var v = pos.clone();\n\t v.project(camera);\n\t v.x = window.innerWidth / 2 + v.x * (window.innerWidth / 2);\n\t v.y = window.innerHeight / 2 - v.y * (window.innerHeight / 2);\n\t return v;\n\t }", "function windowToCanvas(canvas, x, y){\n\t\tvar bbox = canvas.getBoundingClientRect();\n\t\treturn { x: parseInt(x - bbox.left * (canvas.width / bbox.width), 10),\n\t\t\t\ty: parseInt(y - bbox.top * (canvas.height / bbox.height), 10)\n\t\t};\n\t}", "function getElementPosition() {\r\n obj = document.getElementById(\"threecanvas\");\r\n var curleft = 0, curtop = 0;\r\n if (obj.offsetParent) {\r\n do {\r\n curleft += obj.offsetLeft;\r\n curtop += obj.offsetTop;\r\n } while (obj = obj.offsetParent);\r\n return { x: curleft, y: curtop };\r\n }\r\n return undefined;\r\n}", "function mouseXY(e){\r\n var rect = canvas.getBoundingClientRect();\r\n mouseX = e.x - rect.left;\r\n mouseY = e.y - rect.top;\r\n\r\n}", "function world2Screen(wrapper, aX = 0, aY = 0, aZ = 0) {\n if (window.camera != null) {\n // Get the 3d position\n var vec = wrapper.getWorldPosition();\n // Add the delta\n vec.y += aY;\n vec.x += aX;\n vec.z += aZ\n // Project it on the camera\n var newVector = vec.project(window.camera);\n // Calculate the 2d contex\n newVector.x = (vec.x + 1) / 2 * window.ctx.canvas.width;\n newVector.y = - (vec.y - 1) / 2 * window.ctx.canvas.height;\n /// Now, lets check if it's in the screen\n // Get camera pos and target\n var cameraPos = window.camera.getWorldPosition()\n var targetPos = wrapper.getWorldPosition();\n // Add delta\n targetPos.x += aX;\n targetPos.y += aY;\n targetPos.z += aZ;\n // Get where we are looking\n var lookat = window.camera.getWorldDirection();\n var pos = targetPos.sub(cameraPos)\n // Check if it is not in the camera's view\n if (pos.angleTo(lookat) > (Math.PI / 2)) {\n // If not, invert X (yes, if it's on in the camera's view, x and y get inverted)\n newVector.x *= -1;\n // Put the y on the bottom\n newVector.y = 1000;\n }\n // Return this shit\n return newVector;\n } return null;\n}", "function windowToCanvas(canvas, x, y) {\r\n var bbox = canvas.getBoundingClientRect();\r\n\r\n return {\r\n x: x - bbox.left * (canvas.width / bbox.width),\r\n y: y - bbox.top * (canvas.height / bbox.height),\r\n };\r\n}", "function canvasToCartesianAxisCoords(pos) {\n // return an object with x/y corresponding to all used axes\n var res = {},\n i, axis;\n for (i = 0; i < xaxes.length; ++i) {\n axis = xaxes[i];\n if (axis && axis.used) {\n res[\"x\" + axis.n] = axis.c2p(pos.left);\n }\n }\n\n for (i = 0; i < yaxes.length; ++i) {\n axis = yaxes[i];\n if (axis && axis.used) {\n res[\"y\" + axis.n] = axis.c2p(pos.top);\n }\n }\n\n if (res.x1 !== undefined) {\n res.x = res.x1;\n }\n\n if (res.y1 !== undefined) {\n res.y = res.y1;\n }\n\n return res;\n }", "function updateCanvasPosition(zspace) {\r\n var canvasRect = zspace.canvas.getBoundingClientRect();\r\n\r\n zspace.canvasPosition[0] = window.screenX + canvasRect.left - screen.availLeft + zspace.browserViewportOffset[0];\r\n zspace.canvasPosition[1] = window.screenY + canvasRect.top + zspace.browserViewportOffset[1];\r\n }", "function cubeCoords(q, r) {\r\n\tthis.x = q;\r\n\tthis.z = r;\r\n\tthis.y = -q-r;\r\n}", "function CanvasThreeD(points, center_point, connection) {\n this.points = points;\n this.center_point = center_point;\n this.connection = connection;\n this.box = [\n [1, 0, 0, 0],\n [0, 1, 0, 0],\n [0, 0, 1, 0],\n [0, 0, 0, 1]\n ];\n}", "updateTexCoords() \n {\n this.quad.updateTexCoords(this.texCoords);\n }", "function mousePos(canvas, e) {\n let rect = canvas.getBoundingClientRect();\n let scaleX = canvas.width / rect.width;\n let scaleY = canvas.height / rect.height;\n return {\n x: (e.clientX - rect.left) * scaleX,\n y: (e.clientY - rect.top) * scaleY\n }\n}", "function mouseCoordToHex(x, y) {\n var ratio_x, ratio_y;\n x = x - allCanvas.pointer.offset().left;\n y = y - allCanvas.pointer.offset().top;\n\n if (framesize.decoded.height === 0) {\n ratio_x = x / getWidth();\n ratio_y = y / getHeight();\n } else {\n var calculated_height = framesize.decoded.height * framesize.displayed.width * framesize.displayed.scale / framesize.decoded.width;\n var calculated_width = framesize.displayed.width * framesize.displayed.scale; //framesize.decoded.width * framesize.displayed.height / framesize.decoded.height ;\n var offsetHeight = (calculated_height - framesize.displayed.height) / 2;\n var offsetWidth = (calculated_width - (framesize.displayed.width * framesize.displayed.scale)) / 2;\n ratio_x = ((x + offsetWidth)) / calculated_width;\n ratio_y = ((y + offsetHeight)) / calculated_height;\n }\n\n\n\n\n var hexX = that._percentToHex(ratio_x * 100);\n var hexY = that._percentToHex(ratio_y * 100);\n return hexX === 'FFFF' || hexY === 'FFFF' ? 'FFFFFFFF' : hexX + hexY;\n }", "normalizeCoords(x: number, y: number) {\n return {\n x: (x - this.im.position.x) / this.im.scale,\n y: (y - this.im.position.y) / this.im.scale,\n };\n }", "setPoints (pointCoords) {\n let gl = this.renderer.gl;\n // Step1 - render points to texture\n // Bind the shaders\n this.scatterPlotShader = new glCore.GLShader(gl, this.vertexKdeSrc, this.fragmentKdeSrc);\n this.scatterPlotShader.bind();\n // set any uniforms in the shader(s) here\n //this.scatterPlotShader.uniforms.positions = 0;\n this.scatterPlotShader.uniforms.uSampler = 0;\n\n // Create a buffer for the drawing the point coordinates\n this.pointCoords = pointCoords;\n this.numPoints = pointCoords.length/2;\n let pointBuffer = new glCore.GLBuffer.createVertexBuffer(gl, pointCoords);\n // And index these (simply 0->n-1)\n let indices = new Uint16Array(pointCoords.length/2);\n for (let i = 0; i < indices.length; i++) {\n indices[i] = i;\n }\n let indexBuffer = new glCore.GLBuffer.createIndexBuffer(gl, indices);\n //Control everything via a Vertex Array Object\n this.vao = new glCore.VertexArrayObject(gl);\n // set the attributes\n this.vao.addAttribute(pointBuffer, this.scatterPlotShader.attributes.aVertexPosition);\n this.vao.addIndex(indexBuffer);\n\n // Step 1.5 - extract a single color from the float\n this.floatPackShader = new glCore.GLShader(gl, this.vertexFloatPackSrc, this.fragmentFloatPackSrc);\n this.floatPackShader.bind();\n\n\n let verts = new glCore.GLBuffer.createVertexBuffer(gl, this.vertCoords);\n let tex = new glCore.GLBuffer.createVertexBuffer(gl, this.texCoords);\n let inds = new glCore.GLBuffer.createVertexBuffer(gl, this.quadIndices);\n\n // Buffer for drawing the Quad to render th texture created in Step1\n this.vaoPackQuad = new glCore.VertexArrayObject(gl);\n this.vaoPackQuad.addAttribute(verts, this.floatPackShader.attributes.aVertexPosition);\n this.vaoPackQuad.addAttribute(tex, this.floatPackShader.attributes.aTextureCoord);\n this.vaoPackQuad.addIndex(inds);\n\n // Step2 - render texture to Quad\n this.declippingShader = new glCore.GLShader(gl, this.vertexDeclipSrc, this.fragmentDeclipSrc);\n this.declippingShader.bind();\n this.declippingShader.uniforms.uSampler = 0; // the texture number to sample\n\n let qverts = new glCore.GLBuffer.createVertexBuffer(gl, this.vertCoords);\n let qtex = new glCore.GLBuffer.createVertexBuffer(gl, this.texCoords);\n let qinds = new glCore.GLBuffer.createVertexBuffer(gl, this.quadIndices);\n\n // Buffer for drawing the Quad to render th texture created in Step1\n this.vaoQuad = new glCore.VertexArrayObject(gl);\n this.vaoQuad.addAttribute(qverts, this.declippingShader.attributes.aVertexPosition);\n this.vaoQuad.addAttribute(qtex, this.declippingShader.attributes.aTextureCoord);\n this.vaoQuad.addIndex(qinds);\n }", "toScreen(camera)\n\t{\n\t\tlet pos = new NodeGraph.Position(this.x, this.y);\n\n\t\tif (this.worldSpace)\n\t\t{\n\t\t\tpos.x = pos.x * camera.zoomSmooth - camera.xSmooth;\n\t\t\tpos.y = pos.y * camera.zoomSmooth - camera.ySmooth;\n\t\t}\n\n\t\treturn pos;\n\t}", "function getPosition( evt, canvas ) {\n\n\t\tvar rect = canvas.getBoundingClientRect();\n\n\t\tvar scaleX = canvas.width / rect.width;\n\t\tvar scaleY = canvas.height / rect.height;\n\n\t\treturn {\n\t\t\tx: ( evt.clientX - rect.left ) * scaleX,\n\t\t\ty: ( evt.clientY - rect.top ) * scaleY\n\t\t};\n\t}", "function generateTextureCoord(vertices) {\n texCoordsArray = [];\n var i;\n for(i = 0; i < vertices.length; i+=4) \n {\n texCoordsArray[i] = texCoord[0];\n texCoordsArray[i+1] = texCoord[1];\n texCoordsArray[i+2] = texCoord[2];\n texCoordsArray[i+3] = texCoord[3];\n }\n}", "function webcam2space(x,y,z){\n return new THREE.Vector3(\n (x-capture.videoWidth /2),\n -(y-capture.videoHeight/2), // in threejs, +y is up\n - z\n )\n}", "function mouseToThree(mousePos) {\n var projector = new THREE.Projector();\n var vector = new THREE.Vector3(\n (mousePos.x / window.innerWidth) * 2 - 1,\n - (mousePos.y / window.innerHeight) * 2 + 1,\n 0.5);\n\n projector.unprojectVector(vector, camera);\n\n var dir = vector.sub(camera.position).normalize();\n\n var distance = -camera.position.z / dir.z;\n\n var pos = camera.position.clone().add(dir.multiplyScalar(distance));\n return pos;\n}", "calculateVertices() {\n var texture = this._texture;\n if (this._transformID === this.transform._worldID && this._textureID === texture._updateID) {\n return;\n }\n this._transformID = this.transform._worldID;\n this._textureID = texture._updateID;\n // set the vertex data\n var wt = this.transform.worldTransform;\n var a = wt.a;\n var b = wt.b;\n var c = wt.c;\n var d = wt.d;\n var tx = wt.tx;\n var ty = wt.ty;\n var vertexData = this.vertexData;\n var trim = texture.trim;\n var orig = texture.orig;\n var anchor = this._anchor;\n var w0 = 0;\n var w1 = 0;\n var h0 = 0;\n var h1 = 0;\n if (trim) {\n // if the sprite is trimmed and is not a tilingsprite then we need to add the extra\n // space before transforming the sprite coords.\n w1 = trim.x - (anchor._x * orig.width);\n w0 = w1 + trim.width;\n h1 = trim.y - (anchor._y * orig.height);\n h0 = h1 + trim.height;\n }\n else {\n w1 = -anchor._x * orig.width;\n w0 = w1 + orig.width;\n h1 = -anchor._y * orig.height;\n h0 = h1 + orig.height;\n }\n // xy\n vertexData[0] = (a * w1) + (c * h1) + tx;\n vertexData[1] = (d * h1) + (b * w1) + ty;\n // xy\n vertexData[2] = (a * w0) + (c * h1) + tx;\n vertexData[3] = (d * h1) + (b * w0) + ty;\n // xy\n vertexData[4] = (a * w0) + (c * h0) + tx;\n vertexData[5] = (d * h0) + (b * w0) + ty;\n // xy\n vertexData[6] = (a * w1) + (c * h0) + tx;\n vertexData[7] = (d * h0) + (b * w1) + ty;\n if (this._roundPixels) {\n for (var i = 0; i < 8; i++) {\n vertexData[i] = Math.round(vertexData[i]);\n }\n }\n }", "function toRadians (obj) {\n obj.x = THREE.MathUtils.degToRad(obj.x);\n obj.y = THREE.MathUtils.degToRad(obj.y);\n obj.z = THREE.MathUtils.degToRad(obj.z);\n}", "function getXY(evt) {\n let canvas = getCanvas();\n let rect = canvas.getBoundingClientRect();\n let x = evt.clientX - rect.left;\n let y = evt.clientY - rect.top;\n let s2w = _model.viewport.getXform(_rhino3dm.CoordinateSystem.Screen, _rhino3dm.CoordinateSystem.World)\n let world_point = _rhino3dm.Point3d.transform([x, y, 0], s2w);\n s2w.delete();\n return [world_point[0], world_point[1]];\n}", "getPoints(){\n let v = this.vertices.slice();\n glmatrix.mat4.identity(this.m);\n\n glmatrix.mat4.multiply(this.m, this.m, this.mT);\n glmatrix.mat4.multiply(this.m, this.m, this.mRY);\n glmatrix.mat4.multiply(this.m, this.m, this.mTAnchor);\n\n\n let verts = [];\n for (var i = 0; i < v.length; i++) {\n glmatrix.vec3.transformMat4(v[i], v[i], this.m);\n }\n\n return v;\n }", "function correctCoordinates(x, y) {\n /* Correction for scrolling */\n x += document.body.scrollLeft + document.documentElement.scrollLeft;\n y += document.body.scrollTop + document.documentElement.scrollTop;\n\n /* Correction for canvas position */\n x -= canvas.offsetLeft + 1; /* <-- Weird! */\n y -= canvas.offsetTop;\n\n /* Correction for world's coordinate system */\n x -= camera.x;\n y -= camera.y;\n return new Vec2(x, y);\n }", "build() {\n var points = this.points;\n if (!points) {\n return;\n }\n var vertexBuffer = this.getAttribute('aVertexPosition');\n var uvBuffer = this.getAttribute('aTextureCoord');\n var indexBuffer = this.getIndex();\n // if too little points, or texture hasn't got UVs set yet just move on.\n if (points.length < 1) {\n return;\n }\n // if the number of points has changed we will need to recreate the arraybuffers\n if (vertexBuffer.data.length / 4 !== points.length) {\n vertexBuffer.data = new Float32Array(points.length * 4);\n uvBuffer.data = new Float32Array(points.length * 4);\n indexBuffer.data = new Uint16Array((points.length - 1) * 6);\n }\n var uvs = uvBuffer.data;\n var indices = indexBuffer.data;\n uvs[0] = 0;\n uvs[1] = 0;\n uvs[2] = 0;\n uvs[3] = 1;\n // indices[0] = 0;\n // indices[1] = 1;\n var total = points.length; // - 1;\n for (var i = 0; i < total; i++) {\n // time to do some smart drawing!\n var index = i * 4;\n var amount = i / (total - 1);\n uvs[index] = amount;\n uvs[index + 1] = 0;\n uvs[index + 2] = amount;\n uvs[index + 3] = 1;\n }\n var indexCount = 0;\n for (var i$1 = 0; i$1 < total - 1; i$1++) {\n var index$1 = i$1 * 2;\n indices[indexCount++] = index$1;\n indices[indexCount++] = index$1 + 1;\n indices[indexCount++] = index$1 + 2;\n indices[indexCount++] = index$1 + 2;\n indices[indexCount++] = index$1 + 1;\n indices[indexCount++] = index$1 + 3;\n }\n // ensure that the changes are uploaded\n uvBuffer.update();\n indexBuffer.update();\n this.updateVertices();\n }", "function getCoords(e) {\n if (e.offsetX) {\n // Works in Chrome / Safari (except on iPad/iPhone)\n return { x: e.offsetX, y: e.offsetY };\n }\n else if (e.layerX) {\n // Works in Firefox\n return { x: e.layerX, y: e.layerY };\n }\n else {\n // Works in Safari on iPad/iPhone\n return { x: e.pageX - findPos(_c.canvasElement).left, y: e.pageY - findPos(_c.canvasElement).top };\n }\n }", "worldToScreenXY(x, y) {\n return new Vector2D(Math.round(x), Math.round(-y + this.canvas.height));\n }", "documentToWorld(x, y) {\n // We create a 2D vector\n var vector = new THREE.Vector2();\n // We set its position where the user clicked and we convert it to a number between -1 & 1\n vector.set(\n 2 * ((x - this._offset.left) / this._w) - 1,\n 1 - 2 * ((y - this._offset.top) / this._h)\n );\n\n return vector;\n }", "static getCoords(t, c, p) {\r\n\t\tlet m = MathTools.matMul(t.t, [\r\n\t\t\t[p.x],\r\n\t\t\t[p.y],\r\n\t\t\t[1]\r\n\t\t])\r\n\t\tm[0][0] += (t.x - c.x)\r\n\t\tm[1][0] += (t.y - c.y)\r\n\t\tm = MathTools.matMul(c.t, m)\r\n\t\treturn {\r\n\t\t\tx: m[0][0]+window.innerWidth/2,\r\n\t\t\ty: window.innerHeight - (m[1][0]+window.innerHeight/2)\r\n\t\t}\r\n\t}", "function fixCoordinates(x, y) {\n let newX = (x / outputCanvas.width) * 2 - 1;\n let newY = (y / outputCanvas.height) * 2 - 1;\n return [newX, newY];\n}", "function cartesianAxisToCanvasCoords(pos) {\n // get canvas coords from the first pair of x/y found in pos\n var res = {},\n i, axis, key;\n\n for (i = 0; i < xaxes.length; ++i) {\n axis = xaxes[i];\n if (axis && axis.used) {\n key = \"x\" + axis.n;\n if (pos[key] == null && axis.n === 1) {\n key = \"x\";\n }\n\n if (pos[key] != null) {\n res.left = axis.p2c(pos[key]);\n break;\n }\n }\n }\n\n for (i = 0; i < yaxes.length; ++i) {\n axis = yaxes[i];\n if (axis && axis.used) {\n key = \"y\" + axis.n;\n if (pos[key] == null && axis.n === 1) {\n key = \"y\";\n }\n\n if (pos[key] != null) {\n res.top = axis.p2c(pos[key]);\n break;\n }\n }\n }\n\n return res;\n }", "function getCoords(e) {\t\t\n\t\treturn { x: e.pageX - theCanvas.offsetLeft, y: e.pageY - theCanvas.offsetTop };\n\t }", "loadTextureCoords(jsntcpairs) {\nvar i, tca;\n//----------------\n// Flatten the JSON TC pairs on insertion into the texCoords array.\ntca = new Float32Array(2 * jsntcpairs.length);\ni = 0;\njsntcpairs.forEach((function(cc) {\nthis[i] = cc[0];\nthis[i + 1] = cc[1];\nreturn i += 2;\n}), tca);\nreturn this.texCoords = tca;\n}", "function screenToCanvas(arr)\n {\n var screenW = screen.width,\n screenH = screen.height,\n canvasW = canvas.clientWidth,\n canvasH = canvas.clientHeight;\n\n arr[0] = arr[0] * canvasW / screenW;\n arr[1] = arr[1] * canvasH / screenH;\n\n // don't do out of the screen\n if (arr[0] > canvasW)\n {\n arr[0] = canvasW;\n }\n if (arr[1] > canvasH)\n {\n arr[1] = canvasH;\n }\n\n return arr;\n }", "getPosition(pos) {\n //getBoundingClientRect() renvoie la taille du canvas et sa position par rapport au viewport.\n const canvas = this.canvas.getBoundingClientRect();\n const x = (pos.x - canvas.left) / (canvas.right - canvas.left) * this.canvas.width; //récupère la position exacte de la souris (position X)\n const y = (pos.y - canvas.top) / (canvas.bottom - canvas.top) * this.canvas.height;\n return {\n x,\n y\n };\n }", "function toLocalPoint(globalPosition) {\n var viewbox = canvas.viewbox();\n\n var clientRect = canvas._container.getBoundingClientRect();\n\n return {\n x: viewbox.x + (globalPosition.x - clientRect.left) / viewbox.scale,\n y: viewbox.y + (globalPosition.y - clientRect.top) / viewbox.scale\n };\n } // helpers", "function getMouseCoords(event)\n{\n var pointer = canvas.getPointer(event.e);\n var posX = pointer.x;\n var posY = pointer.y;\n \n return [posX,posY];\n}", "function getCoords () {\n return {\n x: 10,\n y: 22\n }\n }", "worldToScreenCoordinates(point) {\n var _a, _b, _c, _d;\n let screenX = point.x;\n let screenY = point.y;\n // shift by focus\n screenX -= (_b = (_a = this._camera) === null || _a === void 0 ? void 0 : _a.x) !== null && _b !== void 0 ? _b : 0;\n screenY -= (_d = (_c = this._camera) === null || _c === void 0 ? void 0 : _c.y) !== null && _d !== void 0 ? _d : 0;\n // transform back on zoom\n screenX = screenX + this.halfDrawWidth;\n screenY = screenY + this.halfDrawHeight;\n // transform back to screen space\n screenX = (screenX * this.viewport.width) / this.drawWidth;\n screenY = (screenY * this.viewport.height) / this.drawHeight;\n return new Vector(Math.floor(screenX), Math.floor(screenY));\n }", "to3D() {\r\n if (this.dimension === 3) {\r\n return;\r\n }\r\n console.assert(this.dimension === 2);\r\n let cpoints = this.cpoints.toArray();\r\n for (let i = 0; i < cpoints.length; i++) {\r\n cpoints[i].push(0);\r\n }\r\n this.cpoints = common_1.arr(cpoints);\r\n }", "to3D() {\r\n if (this.dimension === 3) {\r\n return;\r\n }\r\n console.assert(this.dimension === 2);\r\n let cpoints = this.cpoints.toArray();\r\n for (let i = 0; i < cpoints.length; i++) {\r\n cpoints[i].push(0);\r\n }\r\n this.cpoints = common_1.arr(cpoints);\r\n }", "function toCanvasPt(event) {\n return {\n x: event.pageX - appCanvas.offsetTop - appCanvas.width / 2,\n y: event.pageY - appCanvas.offsetLeft - appCanvas.height / 2\n };\n}", "calculateVertices()\n {\n if (this._transformID === this.transform._worldID && this._textureID === this._texture._updateID)\n {\n return;\n }\n\n this._transformID = this.transform._worldID;\n this._textureID = this._texture._updateID;\n\n // set the vertex data\n\n const texture = this._texture;\n const wt = this.transform.worldTransform;\n const a = wt.a;\n const b = wt.b;\n const c = wt.c;\n const d = wt.d;\n const tx = wt.tx;\n const ty = wt.ty;\n const vertexData = this.vertexData;\n const trim = texture.trim;\n const orig = texture.orig;\n let w0 = 0;\n let w1 = 0;\n let h0 = 0;\n let h1 = 0;\n\n if (trim)\n {\n // if the sprite is trimmed and is not a tilingsprite then we need to add the extra\n // space before transforming the sprite coords.\n w1 = trim.x - (this.anchor._x * orig.width);\n w0 = w1 + trim.width;\n\n h1 = trim.y - (this.anchor._y * orig.height);\n h0 = h1 + trim.height;\n }\n else\n {\n w0 = orig.width * (1 - this.anchor._x);\n w1 = orig.width * -this.anchor._x;\n\n h0 = orig.height * (1 - this.anchor._y);\n h1 = orig.height * -this.anchor._y;\n }\n\n // xy\n vertexData[0] = (a * w1) + (c * h1) + tx;\n vertexData[1] = (d * h1) + (b * w1) + ty;\n\n // xy\n vertexData[2] = (a * w0) + (c * h1) + tx;\n vertexData[3] = (d * h1) + (b * w0) + ty;\n\n // xy\n vertexData[4] = (a * w0) + (c * h0) + tx;\n vertexData[5] = (d * h0) + (b * w0) + ty;\n\n // xy\n vertexData[6] = (a * w1) + (c * h0) + tx;\n vertexData[7] = (d * h0) + (b * w1) + ty;\n }", "function windowToCavasCoordinates(canvas, x, y) {\n var boundingBox = canvas.getBoundingClientRect();\n\n return {x: x - boundingBox.left * (canvas.width / boundingBox.width),\n y: y - boundingBox.top * (canvas.height / boundingBox.height)};\n}", "project(xyz) {\n const {viewport} = this.context;\n const worldPosition = getWorldPosition(xyz, {\n viewport,\n modelMatrix: this.props.modelMatrix,\n coordinateOrigin: this.props.coordinateOrigin,\n coordinateSystem: this.props.coordinateSystem\n });\n const [x, y, z] = worldToPixels(worldPosition, viewport.pixelProjectionMatrix);\n return xyz.length === 2 ? [x, y] : [x, y, z];\n }", "function worldToScreen ( worldPos ) {\n\n var windowHalfX = window.innerWidth / 2;\n var windowHalfY = window.innerHeight / 2;\n\n var screenPos = worldPos.clone();\n projector.projectVector( screenPos, camera );\n screenPos.x = ( screenPos.x + 1 ) * windowHalfX;\n screenPos.y = ( - screenPos.y + 1) * windowHalfY;\n return screenPos;\n}", "setPosition(gl, x, y, z) {\n this.x = x;\n this.y = y;\n this.z = z;\n\n let translatedPositions = [];\n gl.bindBuffer(gl.ARRAY_BUFFER, this.buffers.position);\n translatedPositions = this.sourcePositions.slice();\n let i = 0;\n for (i = 0; i < 12 * this.treeLOD; i++) {\n translatedPositions[i * 3] += this.x;\n translatedPositions[i * 3 + 1] += this.y;\n translatedPositions[i * 3 + 2] += this.z;\n }\n\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(translatedPositions), gl.STATIC_DRAW);\n \n }", "function toCanvas (x, canvas, physical) {\n return (canvas.min + Math.round( (canvas.max - canvas.min) * (x - physical.min) / (physical.max - physical.min)));\n}", "function setTexCoords() {\n texCoord = [\n vec2(minT, minT),\n vec2(minT, maxT),\n vec2(maxT, maxT),\n vec2(maxT, minT)\n ];\n\n texCoordsArray = [];\n texCoordsArray.push(texCoord[0]);\n texCoordsArray.push(texCoord[1]);\n texCoordsArray.push(texCoord[2]);\n texCoordsArray.push(texCoord[0]);\n texCoordsArray.push(texCoord[2]);\n texCoordsArray.push(texCoord[3]);\n document.getElementById(\"tilingFreq\").innerText = \"The tiling frequency is currently set to: \" + maxT\n}" ]
[ "0.6321145", "0.63092566", "0.62364954", "0.6133929", "0.6068068", "0.59580237", "0.5851667", "0.579865", "0.57922256", "0.5734497", "0.56963795", "0.5682346", "0.5590426", "0.55618817", "0.5530158", "0.55102015", "0.5456116", "0.54541487", "0.5451091", "0.5438286", "0.5436045", "0.5426471", "0.5425957", "0.54093707", "0.5408385", "0.5403559", "0.54012984", "0.53636205", "0.53608966", "0.532568", "0.53093964", "0.53080595", "0.52815384", "0.5279889", "0.5268579", "0.5230159", "0.5217924", "0.52125543", "0.52023435", "0.5194023", "0.51937884", "0.51897347", "0.5186105", "0.5186011", "0.5184157", "0.51808393", "0.5175158", "0.51733685", "0.51733124", "0.5171273", "0.51667607", "0.5156305", "0.51547104", "0.51528525", "0.5135718", "0.5133528", "0.512845", "0.5123787", "0.5119547", "0.5118526", "0.5115082", "0.5112868", "0.5109729", "0.5106318", "0.510207", "0.50995815", "0.50992095", "0.50902516", "0.50898093", "0.5078095", "0.50767064", "0.5074349", "0.50715375", "0.505801", "0.5058006", "0.5051416", "0.50482416", "0.504797", "0.50414896", "0.5039772", "0.5036861", "0.50343883", "0.50303197", "0.5029519", "0.5016792", "0.50162417", "0.5011518", "0.5005584", "0.5003959", "0.49994135", "0.49984607", "0.49938223", "0.49938223", "0.49884865", "0.49866024", "0.49830678", "0.4981452", "0.49578166", "0.4956489", "0.49563745", "0.4956363" ]
0.0
-1
Convert from THREEjs coords to canvas coords.
convertY(y) { return Dimensioning.cmToPixel(y - Dimensioning.pixelToCm(this.originY)); // return (y - (this.originY * this.cmPerPixel)) * this.pixelsPerCm; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "canvasToWorldCoordinates(p) {\r\n\t\tlet m = MathTools.inverseMatMul(this.camera.t, [\r\n\t\t\t[p.x-window.innerWidth/2+this.camera.x],\r\n\t\t\t[window.innerHeight-(p.y+window.innerHeight/2)+this.camera.y]\r\n\t\t])\r\n\t\treturn {\r\n\t\t\tx: m[0][0],\r\n\t\t\ty: m[1][0]\r\n\t\t}\r\n\t}", "function geoCoordsToCanvasCoords(coords) {\n\t\tvar result = [coords[0], coords[1]];\n\t\tresult[0] += 180.0;\n\t\tresult[0] /= 360.0;\n\t\tresult[1] -= 90.0;\n\t\tresult[1] /= -180.0;\n\t\treturn result;\n\t}", "function convertCoordinates(canvas, x, y){\n var container = canvas.getBoundingClientRect();\n return {x: x - container.left * (canvas.width / container.width),\n y: y - container.top * (canvas.height / container.height)};\n }", "world2canvas(modelMatrix, viewMatrix, projectionMatrix) {\n // https://webglfundamentals.org/webgl/lessons/webgl-text-html.html\n // We just got through computing a matrix to draw our\n // F in 3D.\n\n // compute a clip space position\n // using the matrix we computed for the F\n const clipspace = vec4.create()\n\n // duplicate in programHelper\n const modelViewMatrix = mat4.create();\n mat4.multiply(modelViewMatrix, viewMatrix, modelMatrix);\n const mvpMatrix = mat4.create();\n mat4.multiply(mvpMatrix, projectionMatrix, modelViewMatrix);\n\n vec4.transformMat4(clipspace, [0.5, 0.5, 0.5, 1], mvpMatrix);\n\n if (clipspace[3] < 0)\n return null\n // divide X and Y by W just like the GPU does.\n clipspace[0] /= clipspace[3];\n clipspace[1] /= clipspace[3];\n\n // convert from clipspace to pixels\n var pixelX = (clipspace[0] * 0.5 + 0.5) * gl.canvas.width;\n var pixelY = (clipspace[1] * -0.5 + 0.5) * gl.canvas.height;\n\n if (pixelX < 0 || pixelX > gl.canvas.width)\n return null\n if (pixelY < 0 || pixelY > gl.canvas.height)\n return null\n\n // position the div\n // div.style.left = Math.floor(pixelX) + \"px\";\n //div.style.top = Math.floor(pixelY) + \"px\";\n //textNode.nodeValue = clock.toFixed(2);\n return { x: Math.floor(pixelX), y: Math.floor(pixelY), z: clipspace[3] }\n }", "projectWorldToCanvas(canvas, vWorld) {\n\t // Calculate the ModelViewProjection Matrix.\n\t var mvp = (canvas.uMVMatrix.copy()).mult(canvas.uPMatrix);\n\n\t // Transform the vector to Normalized Device Coordinate.\n\t var vNDC = this.multMatrixVector(mvp, vWorld);\n\n\t // Transform vector from NDC to Canvas coordinates.\n\t var vCanvas = createVector();\n\t vCanvas.x = 0.5 * (vNDC.x + 1.0) * canvas.GL.drawingBufferWidth;\n\t vCanvas.y = 0.5 * (vNDC.y + 1.0) * canvas.GL.drawingBufferHeight;\n\t vCanvas.z = 0.5 * (vNDC.z + 1.0);\n\n\t return vCanvas;\n\t}", "function fieldCoordsToCanvasCoords(x, y, fieldIndex) {\n let gridCellSize = getGridCellSize();\n let offset = getOffset(fieldIndex);\n\n return {\n x: x * gridCellSize + offset.x,\n y: y * gridCellSize + offset.y,\n };\n}", "screenToWorld(x, y) {\r\n\t\tconst dpr = window.devicePixelRatio || 1;\r\n\t \treturn {\r\n\t\t\tx:(x - this._canvas.width / dpr / 2) / this.zoom + this.posX,\r\n\t\t\tz:(y - this._canvas.height / dpr / 2) / this.zoom + this.posZ\r\n\t\t};\r\n\t}", "function setTexcoords( gl ) {\n const W = 853;\n const H = 606;\n\n gl.bufferData(\n gl.ARRAY_BUFFER,\n new Float32Array( [\n\n\n // FRONT X/W Y/H\n\n\n\n 0 / W, 395 / H,\n 408 / W, 600 / H,\n 408 / W, 395 / H,\n\n\n\n 0 / W, 600 / H,\n 408 / W, 600 / H,\n 0 / W, 395 / H,\n\n\n\n\n\n\n // TOP FACE\n 0 / W, 0 / H,\n\n 408 / W, 395 / H,\n 408 / W, 0 / H,\n\n 0 / W, 395 / H,\n\n 408 / W, 395 / H,\n 0 / W, 0 / H,\n\n\n // LEFT\n 408 / W, 395 / H,\n 834 / W, 600 / H,\n 834 / W, 395 / H,\n\n 408 / W, 600 / H,\n 834 / W, 600 / H,\n 408 / W, 395 / H,\n\n // right\n 408 / W, 395 / H,\n 834 / W, 600 / H,\n 834 / W, 395 / H,\n\n 408 / W, 600 / H,\n 834 / W, 600 / H,\n 408 / W, 395 / H,\n\n // back\n 408 / W, 395 / H,\n 834 / W, 600 / H,\n 834 / W, 395 / H,\n\n 408 / W, 600 / H,\n 834 / W, 600 / H,\n 408 / W, 395 / H,\n\n // bottom\n 408 / W, 0 / H,\n 834 / W, 395 / H,\n 834 / W, 0 / H,\n\n 408 / W, 395 / H,\n 834 / W, 395 / H,\n 408 / W, 0 / H,\n\n\n ] ),\n gl.STATIC_DRAW );\n}", "function toScreen( position, camera, jqdiv ) {\n\n var pos = position.clone(); \n projScreenMat = new THREE.Matrix4();\n projScreenMat.multiplyMatrices( camera.projectionMatrix, camera.matrixWorldInverse );\n pos.applyProjection(projScreenMat);\n\n return { x: ( pos.x + 1 ) * jqdiv.width() / 2 ,\n y: ( pos.y + 1 ) * jqdiv.height()/ 2 };\n\n // return pos;\n }", "screenToWorld(x, y) {\n if (y === undefined) {\n y = x.y;\n x = x.x;\n }\n\n let M = this.ctx.getTransform().invertSelf();\n\n let ret = {\n x: x * M.a + y * M.c + M.e,\n y: x * M.b + y * M.d + M.f,\n };\n\n return ret;\n }", "function localToCanvas(e)\n {\n var canvas = element[0].getBoundingClientRect();\n\n return {\n x : e.clientX - canvas.left,\n y : e.clientY - canvas.top\n };\n }", "worldToScreen(x, y) {\n if (y === undefined) {\n y = x.y;\n x = x.x;\n }\n\n let M = this.ctx.getTransform();\n\n let ret = {\n x: x * M.a + y * M.c + M.e,\n y: x * M.b + y * M.d + M.f,\n };\n\n return ret;\n }", "trackToCoords(_c) {\r\n\t\t\t\tthis.x = _c.x - (SCREEN_WIDTH*0.5)|0;\r\n\t\t\t\tthis.y = _c.y - (SCREEN_HEIGHT*0.5)|0;\r\n\t\t\t}", "function toCanvasSpace(location, centerLoc) {\n\tvar relativeLoc = new Location(location.x + -centerLoc.x, location.y + -centerLoc.y); \n\treturn new Location(relativeLoc.x * Renderer.GAME_TO_CANVAS,\n\t\trelativeLoc.y * Renderer.GAME_TO_CANVAS);\n}", "function from_coords(x,y) {\n return x + y*16;\n }", "transformCoords(x: number, y: number) {\n return {\n x: (x * this.im.scale) + this.im.position.x,\n y: (y * this.im.scale) + this.im.position.y,\n };\n }", "calculateVertices() {\n var geometry = this.geometry;\n var vertices = geometry.buffers[0].data;\n if (geometry.vertexDirtyId === this.vertexDirty && this._transformID === this.transform._worldID) {\n return;\n }\n this._transformID = this.transform._worldID;\n if (this.vertexData.length !== vertices.length) {\n this.vertexData = new Float32Array(vertices.length);\n }\n var wt = this.transform.worldTransform;\n var a = wt.a;\n var b = wt.b;\n var c = wt.c;\n var d = wt.d;\n var tx = wt.tx;\n var ty = wt.ty;\n var vertexData = this.vertexData;\n for (var i = 0; i < vertexData.length / 2; i++) {\n var x = vertices[(i * 2)];\n var y = vertices[(i * 2) + 1];\n vertexData[(i * 2)] = (a * x) + (c * y) + tx;\n vertexData[(i * 2) + 1] = (b * x) + (d * y) + ty;\n }\n if (this._roundPixels) {\n for (var i$1 = 0; i$1 < vertexData.length; i$1++) {\n vertexData[i$1] = Math.round(vertexData[i$1]);\n }\n }\n this.vertexDirty = geometry.vertexDirtyId;\n }", "project(coord, transMat) {\n var point = BABYLON.Vector3.TransformCoordinates(coord, transMat);\n // The transformed coordinates will be based on coordinate system\n // starting on the center of the screen. But drawing on screen normally starts\n // from top left. We then need to transform them again to have x:0, y:0 on top left.\n var x = point.x * this.workingWidth + this.workingWidth / 2.0 >> 0; // >>0 二进制右移 相当于取整\n var y = -point.y * this.workingHeight + this.workingHeight / 2.0 >> 0;\n return (new BABYLON.Vector2(x, y));\n }", "coordCanvasToImage(x, y, doLog = false) {\n if (doLog) {\n console.log(\"-----coordCanvasToImage() Start-----\");\n }\n var canvas = this.getCanvas();\n var rect = canvas.getBoundingClientRect();\n\n var img = this.getImage();\n var deltaXCanvas = x - 0.5;\n var deltaYCanvas = y - 0.5;\n\n var deltaXImg = this.scaleCanvasToImageX(deltaXCanvas);\n var deltaYImg = this.scaleCanvasToImageY(deltaYCanvas);\n\n if (doLog) {\n console.log(\"x, y: \" + x + \", \" + y);\n console.log(\n \"deltaXCanvas, deltaYCanvas: \" +\n deltaXCanvas +\n \", \" +\n deltaYCanvas\n );\n console.log(\n \"deltaXImg, deltaYImg: \" + deltaXImg + \", \" + deltaYImg\n );\n console.log(\"-----coordCanvasToImage() End-----\");\n }\n return {\n x: this.state.x_center + deltaXImg,\n y: this.state.y_center + deltaYImg\n };\n }", "convertCoordinates( x, y ) {\r\n let loc_x = x * this._NUM_PIXELS / this._GRID_SIZE;;\r\n let loc_y = y * this._NUM_PIXELS / this._GRID_SIZE;;\r\n return { x: loc_x, y: loc_y };\r\n }", "function toScreenPosition(obj, camera, renderer){\n var vector = new THREE.Vector3();\n\n var widthHalf = 0.5*renderer.context.canvas.width;\n var heightHalf = 0.5*renderer.context.canvas.height;\n\n obj.updateMatrixWorld();\n vector.setFromMatrixPosition(obj.matrixWorld);\n vector.project(camera);\n\n vector.x = ( vector.x * widthHalf ) + widthHalf;\n vector.y = - ( vector.y * heightHalf ) + heightHalf;\n\n return {\n x: vector.x,\n y: vector.y\n };\n}", "function toXYCoords(pos) {\n console.log(camera)\n let vector = raycaster.setFromCamera((pos.clone, camera))\n vector.x = (vector.x + 1) / 2 * window.innerWidth;\n vector.y = -(vector.y - 1) / 2 * window.innerHeight;\n return vector;\n}", "cameraCoords() {\n let coords0 = vec3.fromValues(5, 2, 0);\n let coords1 = vec3.fromValues(3, 3, 1);\n let coords2 = vec3.fromValues(-3,3,1);\n return new Array(coords0, coords1, coords2);\n }", "function mouseBrowserToCanvas(canvas, x, y) {\t\t\t\t//x,y sono le coordinate browser del puntatore del mouse\n var bbox = canvas.getBoundingClientRect();\n return { x: Math.round(x - bbox.left * (canvas.width / bbox.width)),\n y: Math.round(y - bbox.top * (canvas.height / bbox.height))\n\t\t\t}; \t \n}", "function getCursorPosition2(canvas, event) {\nvec.set(\n ( event.clientX / window.innerWidth ) * 2 - 1,\n - ( event.clientY / window.innerHeight ) * 2 + 1,\n 0.5 );\n\nvec.unproject( camera );\n\nvec.sub( camera.position ).normalize();\n\nvar distance = - camera.position.z / vec.z;\n\npos.copy( camera.position ).add( vec.multiplyScalar( distance ) );\nconsole.log(pos);\n\n\t\t// var geometry = new THREE.BoxGeometry( 1, 1, 1 ); << to create a cube\n\t\tvar geometry = new THREE.DodecahedronGeometry(1, 0); \n\t\t// .DodecahedronGeometry(Radius, detail); play with second number\n\n\n\t\tvar material = new THREE.MeshBasicMaterial( { color: colorRGB,\n\t\t\twireframe: true } );\n\t\t// yellow: 0xffff00\n\t\t// green: 0x00ff00\n\t\t// pink: 0xFFC0CB\n\t\t// white: 0xFFFFFF\n\t\tvar cube = new THREE.Mesh( geometry, material );\n\n\t\tcube.position.set( pos.x, pos.y, 0);\n\n\t\tscene.add( cube );\n\n\t\t// camera.position.z = 5;\n\n\n\t\t// begin: render scene and animate\n\t\tvar animate = function () {\n\t\t\trequestAnimationFrame( animate );\n\n\t\t\tcube.rotation.x += 0.01;\n\t\t\tcube.rotation.y += 0.01;\n\n\t\t\trenderer.render( scene, camera );\n\t\t};\n\n\t\tanimate();\n\t\t// end: render scene and animate\n}", "function base_canvas_to_map_pos(canvas_x, canvas_y)\n{\n return gui_to_map_pos(canvas_x + mapview.gui_x0,\n canvas_y + mapview.gui_y0);\t\t \n}", "projectCanvasToWorld(canvas, vCanvas) {\n\t // Retrieve the ModelView and Projection matrices.\n\t var mv = canvas.uMVMatrix.copy();\n\t var p = canvas.uPMatrix.copy();\n\n\t // Compute the ModelViewProjection matrix.\n\t var mvp = mv.mult(p);\n\n\t // Inverts the MVP.\n\t var invMVP = mvp.invert(mvp);\n\t \n\t // Transform the canvas vector to Normalized Device Coordinates (in [-1, 1]³),\n\t // Here viewport is (0, 0, drawingBufferWidth, drawingBufferHeight).\n\t var vNDC = createVector();\n\t vNDC.x = (-1.0 + 2.0 * (vCanvas.x / canvas.GL.drawingBufferWidth));\n\t vNDC.y = (-1.0 + 2.0 * (vCanvas.y / canvas.GL.drawingBufferHeight));\n\t vNDC.z = (-1.0 + 2.0 * (vCanvas.z));\n\n\t // Transform vector from NDC to world coordinates.\n\t var vWorld = this.multMatrixVector(invMVP, vNDC);\n\n\t return vWorld;\n\t}", "coordImageToCanvas(x, y, doLog = false) {\n if (doLog) {\n console.log(\"-----coordImageToCanvas() Start-----\");\n }\n var canvas = this.getCanvas();\n var rect = canvas.getBoundingClientRect();\n var img = this.getImage();\n\n var deltaXImage = x - this.state.x_center;\n var deltaYImage = y - this.state.y_center;\n\n var deltaXCanvas = this.scaleImageToCanvasX(deltaXImage);\n var deltaYCanvas = this.scaleImageToCanvasY(deltaYImage);\n\n if (doLog) {\n console.log(\"x, y: \" + x + \", \" + y);\n console.log(\n \"deltaXImage, deltaYImage: \" + deltaXImage + \", \" + deltaYImage\n );\n console.log(\n \"deltaXCanvas, deltaYCanvas: \" +\n deltaXCanvas +\n \", \" +\n deltaYCanvas\n );\n console.log(\"-----coordImageToCanvas() End-----\");\n }\n\n return { x: 0.5 + deltaXCanvas, y: 0.5 + deltaYCanvas };\n }", "function cameraToWorldCoords(camera, cameraCoords)\n{\n\tvar basis = camera.coordinateBasis;\n\tvar worldCoords = camera.position;\n\tfor(var i=0; i<3; i++)\n\t\tworldCoords = add(worldCoords, mult_scalar(cameraCoords[i], basis[i]));\n\treturn worldCoords;\n}", "function canvasCoordsToFieldCoords(x, y, floorResult, fieldIndex) {\n let gridCellSize = getGridCellSize();\n let offset = getOffset(fieldIndex);\n\n return {\n x: floorResult ?\n floor((x - offset.x) / gridCellSize) : round((x - offset.x) / gridCellSize),\n y: floorResult ?\n floor((y - offset.y) / gridCellSize) : round((y - offset.y) / gridCellSize),\n };\n}", "setFloat32Buffers() {\n let tempArr = []\n for(let i = 0; i < this.vertices.length; i++) {\n let vertex = this.vertices[i];\n tempArr[3*i] = vertex.points[0];\n tempArr[3*i + 1] = vertex.points[1];\n tempArr[3*i + 2] = vertex.points[2];\n }\n this.vertexPosArray = new Float32Array(tempArr);\n this.colorArray = new Float32Array(this.colors);\n this.normalArray = new Float32Array(this.normals);\n }", "function to_coords(val) {\n return {'x': val % 16,\n 'y': Math.floor(val/16) };\n }", "function canvasToWorldPt(pt)\n{\n\tvar min = engine.render.bounds.min;\n\tvar max = engine.render.bounds.max;\t\n\tvar xworld = min.x + (max.x - min.x) * pt.x / canvas.width;\n\tvar yworld = min.y + (max.y - min.y) * pt.y / canvas.height;\n\treturn {x:xworld, y:yworld};\n}", "function doMatrixConversions(shaderProgram, position) \n{\n\t/**\n\t * We need to create a transformation that takes world coordinate\n\t * points in the pointArrayBuffer to the coordinates WebGL expects.\n\t * (a) Start with second half in pixelsToWebGLMatrix, which takes pixel\n\t * coordinates to WebGL coordinates.\n\t * (b) Scale and translate to take world coordinates to pixel coords\n\t */\n var mapMatrix = new Float32Array(16);\n\t// copy pixel->webgl matrix\n\tmapMatrix.set(pixelsToWebGLMatrix);\n\t// Scale to current zoom (worldCoords * 2^zoom)\n\tvar scale = Math.pow(2, OsmMaps.zoom);\n _scaleMatrix(mapMatrix, scale, scale);\n var boundingBox = OsmMaps.points.getBoundingBox(position);\n var offset = OsmMaps.points.latLongToPixelXY(boundingBox.latMax, boundingBox.lonMin);\n _translateMatrix(mapMatrix, -offset.x, -offset.y);\n \n\t// attach matrix value to 'mapMatrix' uniform in shader\n var matrixLoc = gl.getUniformLocation(shaderProgram, 'mapMatrix');\n\tgl.uniformMatrix4fv(matrixLoc, false, mapMatrix);\n}", "getCoords() {\n return [this.x, this.y, this.z];\n }", "setImageCoords(shaderProg) {\n let attributeCoords = this.gl.getAttribLocation(shaderProg, \"a_coords\");\n this.gl.enableVertexAttribArray(attributeCoords);\n\n // Set Up Draw buffer draw coords\n let bufferCoords = this.gl.createBuffer();\n this.gl.bindBuffer(this.gl.ARRAY_BUFFER, bufferCoords);\n this.gl.bufferData(this.gl.ARRAY_BUFFER,\n new Float32Array([\n -1.0, -1.0,\n 1.0, -1.0,\n -1.0, 1.0,\n -1.0, 1.0,\n 1.0, -1.0,\n 1.0, 1.0]),\n this.gl.STATIC_DRAW);\n this.gl.vertexAttribPointer(attributeCoords, 2, this.gl.FLOAT, false, 0, 0);\n }", "function getCoords(e, canvas) {\n if (e.offsetX) {\n return { x: e.offsetX, y: e.offsetY };\n }\n else if (e.layerX) {\n return { x: e.layerX, y: e.layerY };\n }\n else {\n return { x: e.pageX, y: e.pageY };\n }\n }", "function TranslateHelperGeometry() {\n\n const geometry = new THREE.BufferGeometry();\n\n geometry.setAttribute('position', new THREE.Float32BufferAttribute([0, 0, 0, 1, 1, 1], 3));\n\n return geometry;\n\n}", "screenToWorldCoordinates(point) {\n var _a, _b, _c, _d;\n let newX = point.x;\n let newY = point.y;\n // transform back to world space\n newX = (newX / this.viewport.width) * this.drawWidth;\n newY = (newY / this.viewport.height) * this.drawHeight;\n // transform based on zoom\n newX = newX - this.halfDrawWidth;\n newY = newY - this.halfDrawHeight;\n // shift by focus\n newX += (_b = (_a = this._camera) === null || _a === void 0 ? void 0 : _a.x) !== null && _b !== void 0 ? _b : 0;\n newY += (_d = (_c = this._camera) === null || _c === void 0 ? void 0 : _c.y) !== null && _d !== void 0 ? _d : 0;\n return new Vector(Math.floor(newX), Math.floor(newY));\n }", "project(ax, ay, az, angles){\r\n var x = ax - this.camera_p.x;\r\n var y = ay - this.camera_p.y;\r\n var z = az - this.camera_p.z;\r\n \r\n var dx = angles.cy*(angles.sz*y + angles.cz*x) - angles.sy*z;\r\n var dy = angles.sx*(angles.cy*z + angles.sy*(angles.sz*y + angles.cz*x)) + angles.cx*(angles.cz*y - angles.sz*x);\r\n var dz = angles.cx*(angles.cy*z + angles.sy*(angles.sz*y + angles.cz*x)) - angles.sx*(angles.cz*y - angles.sz*x);\r\n return {x: (this.view_p.z*dx)/dz - this.view_p.x, y: (this.view_p.z*dy)/dz - this.view_p.y, dx:dx, dy:dy, dz:dz};\r\n }", "function getPointOnCanvasInCanvasUnits( ptInGlobalUnits, geometry, canvas ){\n\t\n\tvar sizeInGlobalUnits = {\n\t\tx: geometry.parameters.width,\n\t\ty: geometry.parameters.height\n\t}\n\t\n\tvar sizeInLocalUnits = {\n\t\tx: canvas.width,\n\t\ty: canvas.height\n\t}\n\n\tvar convertFactor = { \n\t\tx: ( sizeInLocalUnits.x / sizeInGlobalUnits.x ),\n\t\ty: ( sizeInLocalUnits.y / sizeInGlobalUnits.y )\n\t};\n\t\n\tvar pointInLocalUnits = new THREE.Vector2( \n\t\t/* x */ _Math.convertValue( convertFactor.x, \"global\", \"px\", ptInGlobalUnits.x ),\n\t\t/* y */\t_Math.convertValue( convertFactor.y, \"global\", \"px\", ptInGlobalUnits.y )\n\t\t\t);\t\n\n\tdebug.master & debug.intersectionHandling && console.log( \"getPointOnCanvasInLocalUnits() :\" , pointInLocalUnits );\n\t\n\treturn pointInLocalUnits;\n}", "function convertCoords(x,y) {\n var sidelen = 400 / board.size();\n\n x = x - 154 - sidelen / 2;\n y = y - 10 - sidelen / 2;\n return [x,y];\n}", "calculateVertices() {\n if (this._transformID === this.transform._worldID) {\n return;\n }\n this._transformID = this.transform._worldID;\n var wt = this.transform.worldTransform;\n // reveal(wt)\n var a = wt.a;\n var b = wt.b;\n var c = wt.c;\n var d = wt.d;\n var tx = wt.tx;\n var ty = wt.ty;\n var data = this.geometry.points; // batch.vertexDataOriginal;\n var vertexData = this.vertexData;\n var count = 0;\n for (var i = 0; i < data.length; i += 2) {\n var x = data[i];\n var y = data[i + 1];\n vertexData[count++] = (a * x) + (c * y) + tx;\n vertexData[count++] = (d * y) + (b * x) + ty;\n }\n }", "function windowToCanvas(x, y) {\n var bbox = canvas.getBoundingClientRect();\n return {\n x: x - bbox.left * w / bbox.width,\n y: y - bbox.top * h / bbox.height\n };\n }", "pointToNormalizedCanvas(p) {\n return p.matrixTransform(this.transformationMatrix);\n }", "function pixelToCameraCoords(camera, i, j, width, height)\n{\n\tvar bounds = camera.cameraBounds;\n\tvar u = bounds.l + (bounds.r - bounds.l) * (i + 0.5) / width;\n\tvar v = bounds.b + (bounds.t - bounds.b) * (j + 0.5) / height;\n\tvar w = -camera.near;\n\treturn [u,v,w];\n}", "canvasToPointForNormalizedCanvas(p) {\n return p.matrixTransform(this.transformationMatrix.inverse());\n }", "function windowToCanvas(x, y) {\n var bbox = canvas.getBoundingClientRect();\n return {\n x: x - bbox.left * (w / bbox.width),\n y: y - bbox.top * (h / bbox.height)\n };\n }", "function convertXYtoCanvas(x, y){\n var xLeft = X_MIN + x * (X_MAX - X_MIN) * 0.1;\n var xRight = xLeft + (X_MAX - X_MIN) * 0.1;\n var yLow = Y_MIN + y * (Y_MAX-Y_MIN) * 0.05;\n var yHigh = yLow + (Y_MAX-Y_MIN) * 0.05;\n\n var squareVerticies = [xLeft, yLow, xRight, yLow, xLeft, yHigh, xRight, yHigh];\n\n return squareVerticies;\n}", "function getCoords(e) {\n\t\tif (e.offsetX) {\n\t\t\t// Works in Chrome / Safari (except on iPad/iPhone)\n\t\t\treturn { x: e.offsetX, y: e.offsetY };\n\t\t}\n\t\telse if (e.layerX) {\n\t\t\t// Works in Firefox\n\t\t\treturn { x: e.layerX, y: e.layerY };\n\t\t}\n\t\telse {\n\t\t\t// Works in Safari on iPad/iPhone\n\t\t\treturn { x: e.pageX - canvas.offsetLeft, y: e.pageY - canvas.offsetTop };\n\t\t}\n\t}", "function webcam2space(x, y, z) {\r\n return new THREE.Vector3(\r\n x - capture.videoWidth / 2,\r\n -(y - capture.videoHeight / 2),\r\n -z\r\n );\r\n}", "function worldToScreen(pos, camera) {\n\t var v = pos.clone();\n\t v.project(camera);\n\t v.x = window.innerWidth / 2 + v.x * (window.innerWidth / 2);\n\t v.y = window.innerHeight / 2 - v.y * (window.innerHeight / 2);\n\t return v;\n\t }", "function windowToCanvas(canvas, x, y){\n\t\tvar bbox = canvas.getBoundingClientRect();\n\t\treturn { x: parseInt(x - bbox.left * (canvas.width / bbox.width), 10),\n\t\t\t\ty: parseInt(y - bbox.top * (canvas.height / bbox.height), 10)\n\t\t};\n\t}", "function getElementPosition() {\r\n obj = document.getElementById(\"threecanvas\");\r\n var curleft = 0, curtop = 0;\r\n if (obj.offsetParent) {\r\n do {\r\n curleft += obj.offsetLeft;\r\n curtop += obj.offsetTop;\r\n } while (obj = obj.offsetParent);\r\n return { x: curleft, y: curtop };\r\n }\r\n return undefined;\r\n}", "function mouseXY(e){\r\n var rect = canvas.getBoundingClientRect();\r\n mouseX = e.x - rect.left;\r\n mouseY = e.y - rect.top;\r\n\r\n}", "function world2Screen(wrapper, aX = 0, aY = 0, aZ = 0) {\n if (window.camera != null) {\n // Get the 3d position\n var vec = wrapper.getWorldPosition();\n // Add the delta\n vec.y += aY;\n vec.x += aX;\n vec.z += aZ\n // Project it on the camera\n var newVector = vec.project(window.camera);\n // Calculate the 2d contex\n newVector.x = (vec.x + 1) / 2 * window.ctx.canvas.width;\n newVector.y = - (vec.y - 1) / 2 * window.ctx.canvas.height;\n /// Now, lets check if it's in the screen\n // Get camera pos and target\n var cameraPos = window.camera.getWorldPosition()\n var targetPos = wrapper.getWorldPosition();\n // Add delta\n targetPos.x += aX;\n targetPos.y += aY;\n targetPos.z += aZ;\n // Get where we are looking\n var lookat = window.camera.getWorldDirection();\n var pos = targetPos.sub(cameraPos)\n // Check if it is not in the camera's view\n if (pos.angleTo(lookat) > (Math.PI / 2)) {\n // If not, invert X (yes, if it's on in the camera's view, x and y get inverted)\n newVector.x *= -1;\n // Put the y on the bottom\n newVector.y = 1000;\n }\n // Return this shit\n return newVector;\n } return null;\n}", "function windowToCanvas(canvas, x, y) {\r\n var bbox = canvas.getBoundingClientRect();\r\n\r\n return {\r\n x: x - bbox.left * (canvas.width / bbox.width),\r\n y: y - bbox.top * (canvas.height / bbox.height),\r\n };\r\n}", "function canvasToCartesianAxisCoords(pos) {\n // return an object with x/y corresponding to all used axes\n var res = {},\n i, axis;\n for (i = 0; i < xaxes.length; ++i) {\n axis = xaxes[i];\n if (axis && axis.used) {\n res[\"x\" + axis.n] = axis.c2p(pos.left);\n }\n }\n\n for (i = 0; i < yaxes.length; ++i) {\n axis = yaxes[i];\n if (axis && axis.used) {\n res[\"y\" + axis.n] = axis.c2p(pos.top);\n }\n }\n\n if (res.x1 !== undefined) {\n res.x = res.x1;\n }\n\n if (res.y1 !== undefined) {\n res.y = res.y1;\n }\n\n return res;\n }", "function updateCanvasPosition(zspace) {\r\n var canvasRect = zspace.canvas.getBoundingClientRect();\r\n\r\n zspace.canvasPosition[0] = window.screenX + canvasRect.left - screen.availLeft + zspace.browserViewportOffset[0];\r\n zspace.canvasPosition[1] = window.screenY + canvasRect.top + zspace.browserViewportOffset[1];\r\n }", "function cubeCoords(q, r) {\r\n\tthis.x = q;\r\n\tthis.z = r;\r\n\tthis.y = -q-r;\r\n}", "function CanvasThreeD(points, center_point, connection) {\n this.points = points;\n this.center_point = center_point;\n this.connection = connection;\n this.box = [\n [1, 0, 0, 0],\n [0, 1, 0, 0],\n [0, 0, 1, 0],\n [0, 0, 0, 1]\n ];\n}", "updateTexCoords() \n {\n this.quad.updateTexCoords(this.texCoords);\n }", "function mousePos(canvas, e) {\n let rect = canvas.getBoundingClientRect();\n let scaleX = canvas.width / rect.width;\n let scaleY = canvas.height / rect.height;\n return {\n x: (e.clientX - rect.left) * scaleX,\n y: (e.clientY - rect.top) * scaleY\n }\n}", "function mouseCoordToHex(x, y) {\n var ratio_x, ratio_y;\n x = x - allCanvas.pointer.offset().left;\n y = y - allCanvas.pointer.offset().top;\n\n if (framesize.decoded.height === 0) {\n ratio_x = x / getWidth();\n ratio_y = y / getHeight();\n } else {\n var calculated_height = framesize.decoded.height * framesize.displayed.width * framesize.displayed.scale / framesize.decoded.width;\n var calculated_width = framesize.displayed.width * framesize.displayed.scale; //framesize.decoded.width * framesize.displayed.height / framesize.decoded.height ;\n var offsetHeight = (calculated_height - framesize.displayed.height) / 2;\n var offsetWidth = (calculated_width - (framesize.displayed.width * framesize.displayed.scale)) / 2;\n ratio_x = ((x + offsetWidth)) / calculated_width;\n ratio_y = ((y + offsetHeight)) / calculated_height;\n }\n\n\n\n\n var hexX = that._percentToHex(ratio_x * 100);\n var hexY = that._percentToHex(ratio_y * 100);\n return hexX === 'FFFF' || hexY === 'FFFF' ? 'FFFFFFFF' : hexX + hexY;\n }", "normalizeCoords(x: number, y: number) {\n return {\n x: (x - this.im.position.x) / this.im.scale,\n y: (y - this.im.position.y) / this.im.scale,\n };\n }", "setPoints (pointCoords) {\n let gl = this.renderer.gl;\n // Step1 - render points to texture\n // Bind the shaders\n this.scatterPlotShader = new glCore.GLShader(gl, this.vertexKdeSrc, this.fragmentKdeSrc);\n this.scatterPlotShader.bind();\n // set any uniforms in the shader(s) here\n //this.scatterPlotShader.uniforms.positions = 0;\n this.scatterPlotShader.uniforms.uSampler = 0;\n\n // Create a buffer for the drawing the point coordinates\n this.pointCoords = pointCoords;\n this.numPoints = pointCoords.length/2;\n let pointBuffer = new glCore.GLBuffer.createVertexBuffer(gl, pointCoords);\n // And index these (simply 0->n-1)\n let indices = new Uint16Array(pointCoords.length/2);\n for (let i = 0; i < indices.length; i++) {\n indices[i] = i;\n }\n let indexBuffer = new glCore.GLBuffer.createIndexBuffer(gl, indices);\n //Control everything via a Vertex Array Object\n this.vao = new glCore.VertexArrayObject(gl);\n // set the attributes\n this.vao.addAttribute(pointBuffer, this.scatterPlotShader.attributes.aVertexPosition);\n this.vao.addIndex(indexBuffer);\n\n // Step 1.5 - extract a single color from the float\n this.floatPackShader = new glCore.GLShader(gl, this.vertexFloatPackSrc, this.fragmentFloatPackSrc);\n this.floatPackShader.bind();\n\n\n let verts = new glCore.GLBuffer.createVertexBuffer(gl, this.vertCoords);\n let tex = new glCore.GLBuffer.createVertexBuffer(gl, this.texCoords);\n let inds = new glCore.GLBuffer.createVertexBuffer(gl, this.quadIndices);\n\n // Buffer for drawing the Quad to render th texture created in Step1\n this.vaoPackQuad = new glCore.VertexArrayObject(gl);\n this.vaoPackQuad.addAttribute(verts, this.floatPackShader.attributes.aVertexPosition);\n this.vaoPackQuad.addAttribute(tex, this.floatPackShader.attributes.aTextureCoord);\n this.vaoPackQuad.addIndex(inds);\n\n // Step2 - render texture to Quad\n this.declippingShader = new glCore.GLShader(gl, this.vertexDeclipSrc, this.fragmentDeclipSrc);\n this.declippingShader.bind();\n this.declippingShader.uniforms.uSampler = 0; // the texture number to sample\n\n let qverts = new glCore.GLBuffer.createVertexBuffer(gl, this.vertCoords);\n let qtex = new glCore.GLBuffer.createVertexBuffer(gl, this.texCoords);\n let qinds = new glCore.GLBuffer.createVertexBuffer(gl, this.quadIndices);\n\n // Buffer for drawing the Quad to render th texture created in Step1\n this.vaoQuad = new glCore.VertexArrayObject(gl);\n this.vaoQuad.addAttribute(qverts, this.declippingShader.attributes.aVertexPosition);\n this.vaoQuad.addAttribute(qtex, this.declippingShader.attributes.aTextureCoord);\n this.vaoQuad.addIndex(qinds);\n }", "toScreen(camera)\n\t{\n\t\tlet pos = new NodeGraph.Position(this.x, this.y);\n\n\t\tif (this.worldSpace)\n\t\t{\n\t\t\tpos.x = pos.x * camera.zoomSmooth - camera.xSmooth;\n\t\t\tpos.y = pos.y * camera.zoomSmooth - camera.ySmooth;\n\t\t}\n\n\t\treturn pos;\n\t}", "function getPosition( evt, canvas ) {\n\n\t\tvar rect = canvas.getBoundingClientRect();\n\n\t\tvar scaleX = canvas.width / rect.width;\n\t\tvar scaleY = canvas.height / rect.height;\n\n\t\treturn {\n\t\t\tx: ( evt.clientX - rect.left ) * scaleX,\n\t\t\ty: ( evt.clientY - rect.top ) * scaleY\n\t\t};\n\t}", "function generateTextureCoord(vertices) {\n texCoordsArray = [];\n var i;\n for(i = 0; i < vertices.length; i+=4) \n {\n texCoordsArray[i] = texCoord[0];\n texCoordsArray[i+1] = texCoord[1];\n texCoordsArray[i+2] = texCoord[2];\n texCoordsArray[i+3] = texCoord[3];\n }\n}", "function webcam2space(x,y,z){\n return new THREE.Vector3(\n (x-capture.videoWidth /2),\n -(y-capture.videoHeight/2), // in threejs, +y is up\n - z\n )\n}", "function mouseToThree(mousePos) {\n var projector = new THREE.Projector();\n var vector = new THREE.Vector3(\n (mousePos.x / window.innerWidth) * 2 - 1,\n - (mousePos.y / window.innerHeight) * 2 + 1,\n 0.5);\n\n projector.unprojectVector(vector, camera);\n\n var dir = vector.sub(camera.position).normalize();\n\n var distance = -camera.position.z / dir.z;\n\n var pos = camera.position.clone().add(dir.multiplyScalar(distance));\n return pos;\n}", "calculateVertices() {\n var texture = this._texture;\n if (this._transformID === this.transform._worldID && this._textureID === texture._updateID) {\n return;\n }\n this._transformID = this.transform._worldID;\n this._textureID = texture._updateID;\n // set the vertex data\n var wt = this.transform.worldTransform;\n var a = wt.a;\n var b = wt.b;\n var c = wt.c;\n var d = wt.d;\n var tx = wt.tx;\n var ty = wt.ty;\n var vertexData = this.vertexData;\n var trim = texture.trim;\n var orig = texture.orig;\n var anchor = this._anchor;\n var w0 = 0;\n var w1 = 0;\n var h0 = 0;\n var h1 = 0;\n if (trim) {\n // if the sprite is trimmed and is not a tilingsprite then we need to add the extra\n // space before transforming the sprite coords.\n w1 = trim.x - (anchor._x * orig.width);\n w0 = w1 + trim.width;\n h1 = trim.y - (anchor._y * orig.height);\n h0 = h1 + trim.height;\n }\n else {\n w1 = -anchor._x * orig.width;\n w0 = w1 + orig.width;\n h1 = -anchor._y * orig.height;\n h0 = h1 + orig.height;\n }\n // xy\n vertexData[0] = (a * w1) + (c * h1) + tx;\n vertexData[1] = (d * h1) + (b * w1) + ty;\n // xy\n vertexData[2] = (a * w0) + (c * h1) + tx;\n vertexData[3] = (d * h1) + (b * w0) + ty;\n // xy\n vertexData[4] = (a * w0) + (c * h0) + tx;\n vertexData[5] = (d * h0) + (b * w0) + ty;\n // xy\n vertexData[6] = (a * w1) + (c * h0) + tx;\n vertexData[7] = (d * h0) + (b * w1) + ty;\n if (this._roundPixels) {\n for (var i = 0; i < 8; i++) {\n vertexData[i] = Math.round(vertexData[i]);\n }\n }\n }", "function toRadians (obj) {\n obj.x = THREE.MathUtils.degToRad(obj.x);\n obj.y = THREE.MathUtils.degToRad(obj.y);\n obj.z = THREE.MathUtils.degToRad(obj.z);\n}", "function getXY(evt) {\n let canvas = getCanvas();\n let rect = canvas.getBoundingClientRect();\n let x = evt.clientX - rect.left;\n let y = evt.clientY - rect.top;\n let s2w = _model.viewport.getXform(_rhino3dm.CoordinateSystem.Screen, _rhino3dm.CoordinateSystem.World)\n let world_point = _rhino3dm.Point3d.transform([x, y, 0], s2w);\n s2w.delete();\n return [world_point[0], world_point[1]];\n}", "getPoints(){\n let v = this.vertices.slice();\n glmatrix.mat4.identity(this.m);\n\n glmatrix.mat4.multiply(this.m, this.m, this.mT);\n glmatrix.mat4.multiply(this.m, this.m, this.mRY);\n glmatrix.mat4.multiply(this.m, this.m, this.mTAnchor);\n\n\n let verts = [];\n for (var i = 0; i < v.length; i++) {\n glmatrix.vec3.transformMat4(v[i], v[i], this.m);\n }\n\n return v;\n }", "function correctCoordinates(x, y) {\n /* Correction for scrolling */\n x += document.body.scrollLeft + document.documentElement.scrollLeft;\n y += document.body.scrollTop + document.documentElement.scrollTop;\n\n /* Correction for canvas position */\n x -= canvas.offsetLeft + 1; /* <-- Weird! */\n y -= canvas.offsetTop;\n\n /* Correction for world's coordinate system */\n x -= camera.x;\n y -= camera.y;\n return new Vec2(x, y);\n }", "build() {\n var points = this.points;\n if (!points) {\n return;\n }\n var vertexBuffer = this.getAttribute('aVertexPosition');\n var uvBuffer = this.getAttribute('aTextureCoord');\n var indexBuffer = this.getIndex();\n // if too little points, or texture hasn't got UVs set yet just move on.\n if (points.length < 1) {\n return;\n }\n // if the number of points has changed we will need to recreate the arraybuffers\n if (vertexBuffer.data.length / 4 !== points.length) {\n vertexBuffer.data = new Float32Array(points.length * 4);\n uvBuffer.data = new Float32Array(points.length * 4);\n indexBuffer.data = new Uint16Array((points.length - 1) * 6);\n }\n var uvs = uvBuffer.data;\n var indices = indexBuffer.data;\n uvs[0] = 0;\n uvs[1] = 0;\n uvs[2] = 0;\n uvs[3] = 1;\n // indices[0] = 0;\n // indices[1] = 1;\n var total = points.length; // - 1;\n for (var i = 0; i < total; i++) {\n // time to do some smart drawing!\n var index = i * 4;\n var amount = i / (total - 1);\n uvs[index] = amount;\n uvs[index + 1] = 0;\n uvs[index + 2] = amount;\n uvs[index + 3] = 1;\n }\n var indexCount = 0;\n for (var i$1 = 0; i$1 < total - 1; i$1++) {\n var index$1 = i$1 * 2;\n indices[indexCount++] = index$1;\n indices[indexCount++] = index$1 + 1;\n indices[indexCount++] = index$1 + 2;\n indices[indexCount++] = index$1 + 2;\n indices[indexCount++] = index$1 + 1;\n indices[indexCount++] = index$1 + 3;\n }\n // ensure that the changes are uploaded\n uvBuffer.update();\n indexBuffer.update();\n this.updateVertices();\n }", "function getCoords(e) {\n if (e.offsetX) {\n // Works in Chrome / Safari (except on iPad/iPhone)\n return { x: e.offsetX, y: e.offsetY };\n }\n else if (e.layerX) {\n // Works in Firefox\n return { x: e.layerX, y: e.layerY };\n }\n else {\n // Works in Safari on iPad/iPhone\n return { x: e.pageX - findPos(_c.canvasElement).left, y: e.pageY - findPos(_c.canvasElement).top };\n }\n }", "worldToScreenXY(x, y) {\n return new Vector2D(Math.round(x), Math.round(-y + this.canvas.height));\n }", "documentToWorld(x, y) {\n // We create a 2D vector\n var vector = new THREE.Vector2();\n // We set its position where the user clicked and we convert it to a number between -1 & 1\n vector.set(\n 2 * ((x - this._offset.left) / this._w) - 1,\n 1 - 2 * ((y - this._offset.top) / this._h)\n );\n\n return vector;\n }", "static getCoords(t, c, p) {\r\n\t\tlet m = MathTools.matMul(t.t, [\r\n\t\t\t[p.x],\r\n\t\t\t[p.y],\r\n\t\t\t[1]\r\n\t\t])\r\n\t\tm[0][0] += (t.x - c.x)\r\n\t\tm[1][0] += (t.y - c.y)\r\n\t\tm = MathTools.matMul(c.t, m)\r\n\t\treturn {\r\n\t\t\tx: m[0][0]+window.innerWidth/2,\r\n\t\t\ty: window.innerHeight - (m[1][0]+window.innerHeight/2)\r\n\t\t}\r\n\t}", "function fixCoordinates(x, y) {\n let newX = (x / outputCanvas.width) * 2 - 1;\n let newY = (y / outputCanvas.height) * 2 - 1;\n return [newX, newY];\n}", "function cartesianAxisToCanvasCoords(pos) {\n // get canvas coords from the first pair of x/y found in pos\n var res = {},\n i, axis, key;\n\n for (i = 0; i < xaxes.length; ++i) {\n axis = xaxes[i];\n if (axis && axis.used) {\n key = \"x\" + axis.n;\n if (pos[key] == null && axis.n === 1) {\n key = \"x\";\n }\n\n if (pos[key] != null) {\n res.left = axis.p2c(pos[key]);\n break;\n }\n }\n }\n\n for (i = 0; i < yaxes.length; ++i) {\n axis = yaxes[i];\n if (axis && axis.used) {\n key = \"y\" + axis.n;\n if (pos[key] == null && axis.n === 1) {\n key = \"y\";\n }\n\n if (pos[key] != null) {\n res.top = axis.p2c(pos[key]);\n break;\n }\n }\n }\n\n return res;\n }", "function getCoords(e) {\t\t\n\t\treturn { x: e.pageX - theCanvas.offsetLeft, y: e.pageY - theCanvas.offsetTop };\n\t }", "loadTextureCoords(jsntcpairs) {\nvar i, tca;\n//----------------\n// Flatten the JSON TC pairs on insertion into the texCoords array.\ntca = new Float32Array(2 * jsntcpairs.length);\ni = 0;\njsntcpairs.forEach((function(cc) {\nthis[i] = cc[0];\nthis[i + 1] = cc[1];\nreturn i += 2;\n}), tca);\nreturn this.texCoords = tca;\n}", "function screenToCanvas(arr)\n {\n var screenW = screen.width,\n screenH = screen.height,\n canvasW = canvas.clientWidth,\n canvasH = canvas.clientHeight;\n\n arr[0] = arr[0] * canvasW / screenW;\n arr[1] = arr[1] * canvasH / screenH;\n\n // don't do out of the screen\n if (arr[0] > canvasW)\n {\n arr[0] = canvasW;\n }\n if (arr[1] > canvasH)\n {\n arr[1] = canvasH;\n }\n\n return arr;\n }", "getPosition(pos) {\n //getBoundingClientRect() renvoie la taille du canvas et sa position par rapport au viewport.\n const canvas = this.canvas.getBoundingClientRect();\n const x = (pos.x - canvas.left) / (canvas.right - canvas.left) * this.canvas.width; //récupère la position exacte de la souris (position X)\n const y = (pos.y - canvas.top) / (canvas.bottom - canvas.top) * this.canvas.height;\n return {\n x,\n y\n };\n }", "function toLocalPoint(globalPosition) {\n var viewbox = canvas.viewbox();\n\n var clientRect = canvas._container.getBoundingClientRect();\n\n return {\n x: viewbox.x + (globalPosition.x - clientRect.left) / viewbox.scale,\n y: viewbox.y + (globalPosition.y - clientRect.top) / viewbox.scale\n };\n } // helpers", "function getMouseCoords(event)\n{\n var pointer = canvas.getPointer(event.e);\n var posX = pointer.x;\n var posY = pointer.y;\n \n return [posX,posY];\n}", "function getCoords () {\n return {\n x: 10,\n y: 22\n }\n }", "worldToScreenCoordinates(point) {\n var _a, _b, _c, _d;\n let screenX = point.x;\n let screenY = point.y;\n // shift by focus\n screenX -= (_b = (_a = this._camera) === null || _a === void 0 ? void 0 : _a.x) !== null && _b !== void 0 ? _b : 0;\n screenY -= (_d = (_c = this._camera) === null || _c === void 0 ? void 0 : _c.y) !== null && _d !== void 0 ? _d : 0;\n // transform back on zoom\n screenX = screenX + this.halfDrawWidth;\n screenY = screenY + this.halfDrawHeight;\n // transform back to screen space\n screenX = (screenX * this.viewport.width) / this.drawWidth;\n screenY = (screenY * this.viewport.height) / this.drawHeight;\n return new Vector(Math.floor(screenX), Math.floor(screenY));\n }", "to3D() {\r\n if (this.dimension === 3) {\r\n return;\r\n }\r\n console.assert(this.dimension === 2);\r\n let cpoints = this.cpoints.toArray();\r\n for (let i = 0; i < cpoints.length; i++) {\r\n cpoints[i].push(0);\r\n }\r\n this.cpoints = common_1.arr(cpoints);\r\n }", "to3D() {\r\n if (this.dimension === 3) {\r\n return;\r\n }\r\n console.assert(this.dimension === 2);\r\n let cpoints = this.cpoints.toArray();\r\n for (let i = 0; i < cpoints.length; i++) {\r\n cpoints[i].push(0);\r\n }\r\n this.cpoints = common_1.arr(cpoints);\r\n }", "function toCanvasPt(event) {\n return {\n x: event.pageX - appCanvas.offsetTop - appCanvas.width / 2,\n y: event.pageY - appCanvas.offsetLeft - appCanvas.height / 2\n };\n}", "calculateVertices()\n {\n if (this._transformID === this.transform._worldID && this._textureID === this._texture._updateID)\n {\n return;\n }\n\n this._transformID = this.transform._worldID;\n this._textureID = this._texture._updateID;\n\n // set the vertex data\n\n const texture = this._texture;\n const wt = this.transform.worldTransform;\n const a = wt.a;\n const b = wt.b;\n const c = wt.c;\n const d = wt.d;\n const tx = wt.tx;\n const ty = wt.ty;\n const vertexData = this.vertexData;\n const trim = texture.trim;\n const orig = texture.orig;\n let w0 = 0;\n let w1 = 0;\n let h0 = 0;\n let h1 = 0;\n\n if (trim)\n {\n // if the sprite is trimmed and is not a tilingsprite then we need to add the extra\n // space before transforming the sprite coords.\n w1 = trim.x - (this.anchor._x * orig.width);\n w0 = w1 + trim.width;\n\n h1 = trim.y - (this.anchor._y * orig.height);\n h0 = h1 + trim.height;\n }\n else\n {\n w0 = orig.width * (1 - this.anchor._x);\n w1 = orig.width * -this.anchor._x;\n\n h0 = orig.height * (1 - this.anchor._y);\n h1 = orig.height * -this.anchor._y;\n }\n\n // xy\n vertexData[0] = (a * w1) + (c * h1) + tx;\n vertexData[1] = (d * h1) + (b * w1) + ty;\n\n // xy\n vertexData[2] = (a * w0) + (c * h1) + tx;\n vertexData[3] = (d * h1) + (b * w0) + ty;\n\n // xy\n vertexData[4] = (a * w0) + (c * h0) + tx;\n vertexData[5] = (d * h0) + (b * w0) + ty;\n\n // xy\n vertexData[6] = (a * w1) + (c * h0) + tx;\n vertexData[7] = (d * h0) + (b * w1) + ty;\n }", "function windowToCavasCoordinates(canvas, x, y) {\n var boundingBox = canvas.getBoundingClientRect();\n\n return {x: x - boundingBox.left * (canvas.width / boundingBox.width),\n y: y - boundingBox.top * (canvas.height / boundingBox.height)};\n}", "project(xyz) {\n const {viewport} = this.context;\n const worldPosition = getWorldPosition(xyz, {\n viewport,\n modelMatrix: this.props.modelMatrix,\n coordinateOrigin: this.props.coordinateOrigin,\n coordinateSystem: this.props.coordinateSystem\n });\n const [x, y, z] = worldToPixels(worldPosition, viewport.pixelProjectionMatrix);\n return xyz.length === 2 ? [x, y] : [x, y, z];\n }", "function worldToScreen ( worldPos ) {\n\n var windowHalfX = window.innerWidth / 2;\n var windowHalfY = window.innerHeight / 2;\n\n var screenPos = worldPos.clone();\n projector.projectVector( screenPos, camera );\n screenPos.x = ( screenPos.x + 1 ) * windowHalfX;\n screenPos.y = ( - screenPos.y + 1) * windowHalfY;\n return screenPos;\n}", "setPosition(gl, x, y, z) {\n this.x = x;\n this.y = y;\n this.z = z;\n\n let translatedPositions = [];\n gl.bindBuffer(gl.ARRAY_BUFFER, this.buffers.position);\n translatedPositions = this.sourcePositions.slice();\n let i = 0;\n for (i = 0; i < 12 * this.treeLOD; i++) {\n translatedPositions[i * 3] += this.x;\n translatedPositions[i * 3 + 1] += this.y;\n translatedPositions[i * 3 + 2] += this.z;\n }\n\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(translatedPositions), gl.STATIC_DRAW);\n \n }", "function toCanvas (x, canvas, physical) {\n return (canvas.min + Math.round( (canvas.max - canvas.min) * (x - physical.min) / (physical.max - physical.min)));\n}", "function setTexCoords() {\n texCoord = [\n vec2(minT, minT),\n vec2(minT, maxT),\n vec2(maxT, maxT),\n vec2(maxT, minT)\n ];\n\n texCoordsArray = [];\n texCoordsArray.push(texCoord[0]);\n texCoordsArray.push(texCoord[1]);\n texCoordsArray.push(texCoord[2]);\n texCoordsArray.push(texCoord[0]);\n texCoordsArray.push(texCoord[2]);\n texCoordsArray.push(texCoord[3]);\n document.getElementById(\"tilingFreq\").innerText = \"The tiling frequency is currently set to: \" + maxT\n}" ]
[ "0.6321145", "0.63092566", "0.62364954", "0.6133929", "0.6068068", "0.59580237", "0.5851667", "0.579865", "0.57922256", "0.5734497", "0.56963795", "0.5682346", "0.5590426", "0.55618817", "0.5530158", "0.55102015", "0.5456116", "0.54541487", "0.5451091", "0.5438286", "0.5436045", "0.5426471", "0.5425957", "0.54093707", "0.5408385", "0.5403559", "0.54012984", "0.53636205", "0.53608966", "0.532568", "0.53093964", "0.53080595", "0.52815384", "0.5279889", "0.5268579", "0.5230159", "0.5217924", "0.52125543", "0.52023435", "0.5194023", "0.51937884", "0.51897347", "0.5186105", "0.5186011", "0.5184157", "0.51808393", "0.5175158", "0.51733685", "0.51733124", "0.5171273", "0.51667607", "0.5156305", "0.51547104", "0.51528525", "0.5135718", "0.5133528", "0.512845", "0.5123787", "0.5119547", "0.5118526", "0.5115082", "0.5112868", "0.5109729", "0.5106318", "0.510207", "0.50995815", "0.50992095", "0.50902516", "0.50898093", "0.5078095", "0.50767064", "0.5074349", "0.50715375", "0.505801", "0.5058006", "0.5051416", "0.50482416", "0.504797", "0.50414896", "0.5039772", "0.5036861", "0.50343883", "0.50303197", "0.5029519", "0.5016792", "0.50162417", "0.5011518", "0.5005584", "0.5003959", "0.49994135", "0.49984607", "0.49938223", "0.49938223", "0.49884865", "0.49866024", "0.49830678", "0.4981452", "0.49578166", "0.4956489", "0.49563745", "0.4956363" ]
0.0
-1
Iterates the current array value and yields a binder node for every item.
*[Symbol.iterator]() { const array = this.valueOf(); const ItemModel = this[_ItemModel]; if (array.length !== this.itemModels.length) { this.itemModels.length = array.length; } for (const i of array.keys()) { let itemModel = this.itemModels[i]; if (!itemModel) { const [optional, ...rest] = this.itemModelArgs; itemModel = new ItemModel(this, i, optional, ...rest); this.itemModels[i] = itemModel; } yield getBinderNode(itemModel); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "*[Symbol.iterator]() {\n for (let node = this.first, position = 0; node; position++, node = node.next) {\n yield node.value;\n }\n }", "* values() {\n\t\tfor (const [, value] of this) {\n\t\t\tyield value;\n\t\t}\n\t}", "*[Symbol.iterator]() {\n let values = this.values;\n for (let i = 0; i < values.length; i++)\n yield values[i];\n }", "function evaluateObjectBindingPattern({ node, environment, evaluate, statementTraversalStack }, rightHandValue) {\n for (const element of node.elements) {\n evaluate.nodeWithArgument(element, environment, rightHandValue, statementTraversalStack);\n }\n}", "function evaluateArrayBindingPattern({ node, evaluate, environment, statementTraversalStack }, rightHandValue) {\n const iterator = rightHandValue[Symbol.iterator]();\n let elementsCursor = 0;\n while (elementsCursor < node.elements.length) {\n const { done, value } = iterator.next();\n if (done === true)\n break;\n evaluate.nodeWithArgument(node.elements[elementsCursor++], environment, value, statementTraversalStack);\n }\n}", "* processBinding (key, value) {\n // Get the \"on\" binding from \"on.click\"\n const [handlerName, property] = key.split('.');\n const handler = this.bindingHandlers.get(handlerName);\n\n if (handler && handler.preprocess) {\n const bindingsAddedByHandler = [];\n const chainFn = (...args) => bindingsAddedByHandler.push(args);\n value = handler.preprocess(value, key, chainFn);\n for (const [key, value] of bindingsAddedByHandler) {\n yield * this.processBinding(key, value);\n }\n } else if (property) {\n value = `{${property}:${value}}`;\n }\n\n yield `'${handlerName}':${value}`;\n }", "* processBinding (key, value) {\n // Get the \"on\" binding from \"on.click\"\n const [handlerName, property] = key.split('.')\n const handler = this.bindingHandlers.get(handlerName)\n\n if (handler && handler.preprocess) {\n const bindingsAddedByHandler = []\n const chainFn = (...args) => bindingsAddedByHandler.push(args)\n value = handler.preprocess(value, key, chainFn)\n for (const [key, value] of bindingsAddedByHandler) {\n yield * this.processBinding(key, value)\n }\n } else if (property) {\n value = `{${property}:${value}}`\n }\n\n yield `${handlerName}:${value}`\n }", "*[Symbol.iterator]() {\n let i = 0\n while (i < this.size()) {\n yield this.get(i)\n i++\n }\n }", "traverse(){\r\n this.Array.forEach(function (sa) {\r\n \r\n console.log(sa);\r\n\r\n })\r\n}", "[Symbol.iterator]() {\n return this.items.values();\n }", "each(cb) {\n let node = this.head;\n while (node !== null) {\n cb(node.value);\n node = node.next;\n }\n }", "*[Symbol.iterator]() {\n for (let current = this.#head.next;\n current != this.#tail;\n current = current.next) {\n yield current.value;\n }\n }", "traverse(){\r\n for (let i = 0; i < this.Array.length; i++) {\r\n console.log(this.Array[i])\r\n }}", "traverse() {\n \n\n for(var i = 0; i < this.arr.length; i++) {\n console.log(this.items[i])\n }\n}", "* [Symbol.iterator] () {\n yield* this.items;\n }", "bind() {\n const parent = DesignTokenNode.findParent(this);\n\n if (parent) {\n parent.appendChild(this);\n }\n\n for (const key of this.assignedValues.keys()) {\n key.notify(this.target);\n }\n }", "[Symbol.iterator]() {\n return this.data.values();\n }", "[Symbol.iterator]() {\n return this.data.values();\n }", "each(callback, ...names) {\n const {\n stack\n } = this;\n const {\n length\n } = stack;\n let value = getLast(stack);\n\n for (const name of names) {\n value = value[name];\n stack.push(name, value);\n }\n\n for (let i = 0; i < value.length; ++i) {\n stack.push(i, value[i]);\n callback(this, i);\n stack.length -= 2;\n }\n\n stack.length = length;\n }", "*[Symbol.iterator]() {\n const length = this.length;\n for (let i = 0 ; i < length ; i++) {\n yield this.get(i);\n }\n }", "traverseBF(fn) {\n //will give us some element within our root node, inside an array\n const arr = [this.root]\n\n //while-loop, works as long as array has something in it, is TRUTHY\n while (arr.length) {\n //remove first element out of array, with shift() method\n const node = arr.shift()\n //then take all node's children and push them into our array\n // CAN'T do node.children, would create a nested array\n // use spread operator to take all elements out, and push them into the array\n arr.push(...node.children) //TODO:For-loop, would have been more code!!!\n\n //take node AND pass in to our iterator func\n fn(node)\n }\n }", "*values() {\n\n let current = this[head];\n\n while (current !== null) {\n yield current.data;\n current = current.next;\n }\n }", "function gatherBindings(node) {\n const bindings =[];\n return Array.from(node.attributes).map(attr => {\n const match = /[(\\[](\\w+)[\\])]/.exec(attr.name);\n if(match) {\n return {\n type: match[0][0] === \"[\" ? 'input' : 'output',\n name: match[1],\n value: attr.value,\n attachTo: node \n };\n }\n }).filter(n => n)\n}", "[Symbol.iterator]() {\n return this.values[Symbol.iterator]();\n }", "[Symbol.iterator]() {\n return this.values[Symbol.iterator]();\n }", "iter() {\n return iter(this.root);\n }", "*[Symbol.iterator]() {\n let node = this.head;\n while (node) {\n yield node;\n node = node.next;\n }\n }", "[Symbol.iterator]() {\n return this.#array[Symbol.iterator]();\n }", "traverse() {\n this.#array.forEach((element, i) => console.log(`Indice ${i}: ${element}`));\n }", "iterateOverList(handler, newData) {\n /** @type NodeHandlerState */\n const state = PRIVATE.get(handler);\n let isDataArray = isArray(newData);\n let iterationDataList;\n\n\n if (isDataArray) {\n isDataArray = true;\n iterationDataList = newData;\n }\n else if (isPureObject(newData)) {\n iterationDataList = objectKeys(newData);\n } else {\n return;\n }\n\n const currentBinders = handler.binders;\n const binderToBeDestroyed = new Map(); // Will be recycled\n const totalItems = iterationDataList.length;\n const { usesKey, getKey } = handler._viewTemplate[EACH];\n\n // Loop through each piece of data and build a DOM binder for it.\n // The data should be in sync with `currentBinders`\n for (let i = 0; i < totalItems; i++) {\n let rowData = { // FIXME: can this object creation be avoided? For Arrays - it should be possible. Objects - not sure.\n $root: state.data.$root || state.data,\n $parent: state.data,\n $data: state.data.$data || state.data\n };\n\n // Adjust the rowData to have the `key` and/or `value` and `index` as top level items\n // These are added to the rowData object just created above.\n if (isDataArray) {\n this.getDataForIteration([ iterationDataList[i], i ], rowData);\n }\n else {\n this.getDataForIteration([ newData[ iterationDataList[i] ], iterationDataList[i], i ], rowData);\n }\n\n const rowKey = getKey(\n usesKey\n ? rowData // => Use rowData created above - getKey() will run a value getter on it.\n : isDataArray\n ? iterationDataList[i] // => Use the object from the newData\n : newData[ iterationDataList[i] ] // => Use the Object key\n );\n\n // If a binder currently exists, then see if it is the one previously\n // created for this row's data\n if (currentBinders[i] && currentBinders[i]._loop.rowKey === rowKey) {\n currentBinders[i][DOM_DATA_BIND_PROP].setData(rowData);\n continue;\n }\n\n // If there is a binder at the current position, then its not the one need.\n // move it to the `to be destroyed` list.\n if (currentBinders[i]) {\n currentBinders[i][DOM_DATA_BIND_PROP].recover();\n binderToBeDestroyed.set(\n currentBinders[i]._loop.rowKey,\n currentBinders[i]\n );\n currentBinders[i] = null;\n }\n\n // Do we have a rowBinder for this data item in the existing list,\n // but perhaps at a different location? Get it and move it to the new position.\n // Old position in the existing array is set to null (avoids mutating array)\n let binder = handler.bindersByKey.get(rowKey);\n\n if (binder) {\n if (binder._loop.pos !== null && currentBinders[binder._loop.pos] === binder) {\n currentBinders[binder._loop.pos] = null;\n }\n } else {\n binder = binderToBeDestroyed.get(rowKey);\n\n if (binder) {\n binderToBeDestroyed.delete(rowKey);\n }\n }\n\n if (binder) {\n currentBinders[i] = binder;\n binder._loop.pos = i;\n currentBinders[i][DOM_DATA_BIND_PROP].recover();\n positionRowInDom(currentBinders, i, handler._placeholderEle);\n currentBinders[i][DOM_DATA_BIND_PROP].setData(rowData);\n continue;\n }\n\n // Create new binder\n // First check if we can recycle one that is tagged to be destroyed.\n // if not, then create a new one.\n if (binderToBeDestroyed.size) {\n const [recycleBinderKey, recycleBinder] = binderToBeDestroyed.entries().next().value;\n binder = recycleBinder;\n binder[DOM_DATA_BIND_PROP].setData(rowData);\n binderToBeDestroyed.delete(recycleBinderKey);\n binder._loop.rowKey = rowKey;\n binder._loop.pos = i;\n } else {\n binder = render(handler._viewTemplate, rowData, handler._directives);\n binder._destroy = destroyRowElement;\n binder._handler = handler; // needed by destroyRowElement()\n binder._loop = { rowKey, pos: i };\n }\n\n currentBinders[i] = binder;\n handler.bindersByKey.set(rowKey, binder);\n positionRowInDom(currentBinders, i, handler._placeholderEle);\n }\n\n // Destroy binders that were not used\n if (binderToBeDestroyed.size) {\n arrayForEach(binderToBeDestroyed.values(), destroyBinder);\n binderToBeDestroyed.clear();\n }\n\n // remove any left over items in currentBinders where is no longer part of newData\n if (totalItems < currentBinders.length) {\n arrayForEach(arraySplice(currentBinders, totalItems), destroyBinder);\n }\n }", "traverse() {\n let result = [];\n let curr = this.first;\n while (curr) {\n result.push(curr.val);\n curr = curr.next;\n }\n return result;\n }", "process() {\n const val = this.value;\n\n // For arrays, for directives in each member\n if (_.isArray(val)) {\n return bluebird.map(val, (member, i) => {\n return this.child(i).process();\n });\n }\n\n // For objects, recurse through each key\n if (_.isObject(val)) {\n const directives = {};\n\n return bluebird\n // Iterate through members\n .props(_.mapValues(val, (v, k) => {\n // Process directives\n if (k.charAt(0) === '$' && typeof this[k] === 'function') {\n directives[k] = this[k].bind(this, v);\n return v;\n }\n\n // Otherwise, recurse into members\n return this.child(k).process();\n }))\n\n // Apply directives\n .then(mapped => {\n return bluebird.reduce(_.values(directives), (result, directive) => {\n return directive(result);\n }, mapped);\n })\n\n // Strip directives out of result\n .then(filtered => {\n if (_.isArray(filtered)) {\n return filtered;\n }\n\n if (_.isObject(filtered)) {\n return _.omit(filtered, _.keys(directives));\n }\n\n return filtered;\n });\n }\n\n // Otherwise, just return as a constant\n return bluebird.resolve(this.value);\n }", "forEach(visitor) {\n this.tree_walk(this.root, (node) => visitor(node.item.key, node.item.value));\n }", "*[Symbol.iterator]() {\n let node = this.head;\n\n while(node) {\n yield node;\n node = node.next;\n }\n }", "* [Symbol.iterator]() {\n for (let node = this.first, position = 0;\n node;\n position += 1, node = node.next) {\n yield { node, position };\n }\n }", "*buffers() {\n for (let network of this.values()) {\n for (let buffer of network.buffers.values()) {\n yield buffer;\n }\n }\n }", "get values() {\n return this.items.map(e => e._value);\n }", "*[Symbol.iterator]() {\n let pointer = this.head\n while (pointer) {\n yield pointer\n pointer = pointer.next\n }\n }", "[Symbol.iterator]() {\n return this._items[Symbol.iterator]();\n }", "each( callback, ...names ) {\n\t\tconst { stack } = this;\n\t\tconst { length } = stack;\n\t\tlet value = getLast( stack );\n\n\t\tfor ( const name of names ) {\n\t\t\tvalue = value[ name ];\n\t\t\tstack.push( name, value );\n\t\t}\n\n\t\tfor ( let i = 0; i < value.length; ++i ) {\n\t\t\tif ( i in value ) {\n\t\t\t\tstack.push( i, value[ i ] ); // If the callback needs to know the value of i, call\n\t\t\t\t// path.getName(), assuming path is the parameter name.\n\n\t\t\t\tcallback( this );\n\t\t\t\tstack.length -= 2;\n\t\t\t}\n\t\t}\n\n\t\tstack.length = length;\n\t}", "define_array(array){\n return new binder(array,this.settings);\n }", "*[Symbol.iterator]() {\n\t\tlet node = this.head;\n\t\twhile(node.next !== null){\n\t\t\tyield node;\n\t\t\tnode = node.next;\n\t\t}\n\t}", "function ForEach(nodeList, callback, scope) {\r\n for (var i = 0; i < nodeList.length; i++) {\r\n\t callback(nodeList[i]); // passes back stuff we need\r\n }\r\n}", "function each(objOrArr, callBack) {\n\n\n}", "[Symbol.iterator]() {\n return this.items[Symbol.iterator]();\n }", "[Symbol.iterator]() {\n return this.items[Symbol.iterator]();\n }", "forEach(fn) {\n let node = this.head;\n while (node) {\n fn(node.value);\n node = node.next;\n }\n }", "forEach(callback) {\n for (const ele of this.arr) {\n callback(ele);\n }\n }", "*entries() {\n for (const item of this) {\n yield [item, item];\n }\n }", "breadthFirstForEach(cb) {\n console.log(this);\n const queue = [];\n queue.push(this);\n for (let i = 0; i < queue.length; i++) {\n cb(queue[i].value);\n if (queue[i].left) queue.push(queue[i].left);\n if (queue[i].right) queue.push(queue[i].right);\n }\n }", "[Symbol.iterator]()\n {\n return this._iterate({ wrapPoint:false, includeEmpty:false });\n }", "forEach(callback) {\n let i = this._cursor;\n let node = this._front;\n let elements = node._elements;\n while (i !== elements.length || node._next !== undefined) {\n if (i === elements.length) {\n node = node._next;\n elements = node._elements;\n i = 0;\n if (elements.length === 0) {\n break;\n }\n }\n callback(elements[i]);\n ++i;\n }\n }", "forEach(callback) {\n let i = this._cursor;\n let node = this._front;\n let elements = node._elements;\n while (i !== elements.length || node._next !== undefined) {\n if (i === elements.length) {\n node = node._next;\n elements = node._elements;\n i = 0;\n if (elements.length === 0) {\n break;\n }\n }\n callback(elements[i]);\n ++i;\n }\n }", "bindFromArray(values) {\n for (let num = 0; num < values.length; num++) { const value = values[num]; this.bindValue(value, num+1); }\n return true;\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 }", "_forEach(array, callback, scope) {\n\t \tfor (var i = 0; i < array.length; i++) {\n\t \tcallback.call(scope, i, array[i]); // passes back stuff we need\n\t \t}\n\t}", "breadthFirstForEach(cb) {\n const q = new Queue();\n q.enqueue(this);\n \n while (!q.isEmpty()) {\n const node = q.dequeue();\n cb(node.value);\n if (node.left) {\n q.enqueue(node.left);\n }\n if (node.right) {\n q.enqueue(node.right);\n }\n }\n }", "_loop(index0, callback) {\n for (const key0 in index0) callback(key0);\n }", "forEach(callback) {\n let index = 0;\n for (let current = this.#head.next;\n current != this.#tail;\n current = current.next) {\n callback(current.value, index++);\n }\n }", "function forEach(array, cb){\n\tfor (let item of arrayGenerator(array)){\n\t\tcb(item)\n\t}\n}", "_loop(index0, callback) {\n for (var key0 in index0) callback(key0);\n }", "forEach(array, callback, scope) {\n for (let i = 0; i < array.length; i++) {\n callback.call(scope, i, array[i])\n }\n }", "function each(obj, iterator, context) {\n if (!obj) return;\n try {\n if (obj.forEach) return obj.forEach(iterator, context);\n if (obj.childNodes) obj = toArray(obj.childNodes);\n if (obj.length) {\n // Iterate through array-like objects (works for Strings on *some* browsers)\n for (var l = obj.length, i = 0; i < l; i++) iterator.call(context, obj[i], i);\n return;\n }\n // Iterate through object properties\n for (var k in obj) iterator.call(context, obj[k], k);\n } catch (e) {\n if (e != STOP) throw e;\n }\n return obj;\n }", "values() {\n return this[Symbol.iterator]();\n }", "function Generator(arr) {\n this._value = arr;\n this._indice = 0;\n}", "each(cb) {\n let curr = this.first(true);\n \n while (curr !== this[this._end]) {\n if (false === cb.call(this, curr.data, curr)) {\n break;\n }\n \n curr = curr[this._next];\n }\n \n return this;\n }", "applyBindingSet() {\n // set the attribute mappings\n this.binder.attributeMappings = {\n placeholder: 'placeholder', // map placeholder to placeholder\n 'value-state': '_valueState',\n name: 'name',\n maxlength: 'maxlength', // for the input element itself\n };\n\n // set the label mappings\n this.binder.labelMappings = {\n 'show-value-help-icon': 'showValueHelpIcon',\n 'show-suggestions': 'showSuggestions',\n readonly: '__readonly',\n required: 'required',\n disabled: 'disabled',\n modified: 'modified',\n highlight: 'highlight',\n };\n\n // set attributes to constrains mapping for furo.fat types\n this.binder.fatAttributesToConstraintsMappings = {\n maxlength: 'value._constraints.max.is', // for the fieldnode constraint\n required: 'value._constraints.required.is', // for the fieldnode constraint\n };\n\n // set constrains to attributes mapping for furo.fat types\n this.binder.constraintsTofatAttributesMappings = {\n max: 'maxlength',\n required: 'required',\n };\n\n /**\n * check overrides from the used component, attributes set on the component itself overrides all\n */\n this.binder.checkLabelandAttributeOverrrides();\n\n // update the value on input changes\n this.addEventListener('input', val => {\n // update the value\n this.binder.fieldValue = val.target.value;\n\n /**\n * Fired when value changed\n * @type {Event}\n */\n const customEvent = new Event('value-changed', { composed: true, bubbles: true });\n customEvent.detail = val.target.value;\n this.dispatchEvent(customEvent);\n\n // set flag empty on empty strings (for fat types)\n if (val.target.value) {\n this.binder.deleteLabel('empty');\n } else {\n this.binder.addLabel('empty');\n }\n // if something was entered the field is not empty\n this.binder.addLabel('modified');\n });\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 }", "visitBoundAttribute(attribute) { attribute.value.visit(this); }", "visitBoundAttribute(attribute) { attribute.value.visit(this); }", "function _varBindingElement(element, vars, handlerSets, rootInstance) {\n\n\t\tif (element.nodeName.toLowerCase() === \"template\" && element.getAttribute('anvedi-foreach')) {\n\t\t\tlet varName = element.getAttribute('anvedi-foreach');\n\t\t\tvarName = varName.substring(2, varName.length - 2);\n\t\t\thandlerSets[varName] = handlerSets[varName] || [];\n\t\t\tengineLists(element, extractValueFromObject(vars, varName), handlerSets[varName], rootInstance);\n\t\t\treturn;\n\t\t}\n\n\t\tif (element.nodeType !== Node.TEXT_NODE) {\n\t\t\tif (element.attributes) {\n\t\t\t\tfor (let i = 0; i < element.attributes.length; i++) {\n\t\t\t\t\tlet attr = element.attributes.item(i);\n\t\t\t\t\tif (attributeEngineIfAny(element, attr, rootInstance)) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tif (attr.name.match(/^{{.*?}}$/)) {\n\t\t\t\t\t\tvarBindingAttributeName(element, attr.name.substr(2, attr.name.length - 4), vars, handlerSets);\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\t// check if there is at least one var, avoiding to do an useless less efficient regexp\n\t\t\t\t\tif (attr.value.split(\"{{\").length > 1) {\n\t\t\t\t\t\tvarBindingAttribute(attr, vars, handlerSets);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tlet childNodes = [...element.childNodes].slice(0);\n\t\t\tchildNodes.forEach(node => {\n\t\t\t\t// console.log({node,l:childNodes.length});\n\t\t\t\t_varBindingElement(node, vars, handlerSets, rootInstance);\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\t\tvarBindingTextNode(element, vars, handlerSets, rootInstance);\n\t}", "function get_each_context$1(ctx, list, i) {\n var child_ctx = ctx.slice();\n child_ctx[7] = list[i];\n child_ctx[9] = i;\n return child_ctx;\n } // (66:8) {#each tags as tag,i}", "function search_form_index_svelte_get_each_context(ctx, list, i) {\n var child_ctx = ctx.slice();\n child_ctx[14] = list[i];\n child_ctx[15] = list;\n child_ctx[16] = i;\n return child_ctx;\n} // (208:16) {#each data as datum, i}", "get values() {\n return this._array;\n }", "* iterNodeIds() {\n yield* this.nodes.keys();\n }", "function getLoopValueFromAttribute(node, obj, itemName, attributeName, cb) {\n var tmp = node.getAttribute(attributeName).split('.'), tokenObjectProperty;\n if (tmp.length > 0 && tmp[0] === itemName) {\n tokenObjectProperty = tmp.slice(1).join('.');\n cb(getGlobalCall(tokenObjectProperty, obj));\n } else {\n // TODO handle this correctly\n console.error('repeat:getLoopValueFromAttribute has problems');\n }\n }", "function $each(iterable, fn, bind){\n\treturn Array.prototype.forEach.call(iterable, fn, bind);\n}", "function myForEach(arr, cb){\n for (var i = 0; i < arr.length; i++) {\n var el = arr[i];\n cb(el, i, arr);\n }\n}", "forEach(f) {\n for (var i=0,l=this.count; i<l; i++) {\n f(this.get(i));\n }\n }", "forEach(callback) {\n callback(this);\n for (const child of this.children) {\n child.forEach(callback);\n }\n }", "function __get_binding_from_attributes(elem,root, process_event){\n var bindings = []; \n var attrs = elem.attributes;\n var ij = attrs.length;\n \n while(ij--){\n \n attr = elem.attributes[ij];\n var bind = __parse_attribute (elem, root, attr.nodeName,attr.value, process_event );\n\n if(bind != null )bindings.push(bind);\n\n }\n\n \n var nodes = elem.childNodes;\n var result = \"\";\n for(var i = 0; i < nodes.length; i++) {\n if(nodes[i].nodeType == 3) { // If it is a text node,\n // MIEUX VAUT MINIFIER LE HTML AUSSI!\n result += nodes[i].textContent;\n }\n }\n result.trim();\n if(result != \"\"){ \n var bind = __parse_attribute (elem, root, 'innerHTML', result, process_event );\n if(bind != null )bindings.push(bind);\n }\n\n\n\n return bindings;\n}", "*[Symbol.iterator]() {\n yield* this.readQuads();\n }", "walkBody() {\r\n\t\t\t\t\tvar directives, expr, index;\r\n\t\t\t\t\tdirectives = [];\r\n\t\t\t\t\tindex = 0;\r\n\t\t\t\t\twhile (expr = this.body.expressions[index]) {\r\n\t\t\t\t\t\tif (!(expr instanceof Value && expr.isString())) {\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (expr.hoisted) {\r\n\t\t\t\t\t\t\tindex++;\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tdirectives.push(...this.body.expressions.splice(index, 1));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tthis.traverseChildren(false, (child) => {\r\n\t\t\t\t\t\tvar cont, i, j, len1, node, ref1;\r\n\t\t\t\t\t\tif (child instanceof Class || child instanceof HoistTarget) {\r\n\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tcont = true;\r\n\t\t\t\t\t\tif (child instanceof Block) {\r\n\t\t\t\t\t\t\tref1 = child.expressions;\r\n\t\t\t\t\t\t\tfor (i = j = 0, len1 = ref1.length; j < len1; i = ++j) {\r\n\t\t\t\t\t\t\t\tnode = ref1[i];\r\n\t\t\t\t\t\t\t\tif (node instanceof Value && node.isObject(true)) {\r\n\t\t\t\t\t\t\t\t\tcont = false;\r\n\t\t\t\t\t\t\t\t\tchild.expressions[i] = this.addProperties(node.base.properties);\r\n\t\t\t\t\t\t\t\t} else if (node instanceof Assign && node.variable.looksStatic(this.name)) {\r\n\t\t\t\t\t\t\t\t\tnode.value.isStatic = true;\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\tchild.expressions = flatten(child.expressions);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\treturn cont;\r\n\t\t\t\t\t});\r\n\t\t\t\t\treturn directives;\r\n\t\t\t\t}", "each(callback) {\n this.el.forEach(el => callback(el));\n }", "function Iteration(value, index) {\n this.value = value;\n this.index = index;\n}", "function writeIterable({ type, buffer, value, length }) {\n buffer.addAll(flexInt.makeValueBuffer(length));\n for (const instance of value)\n type.writeValue(buffer, instance);\n}", "function each(iterator) {\n for (var i = 0, length = this.length; i < length; i++)\n iterator(this[i]);\n }", "function each(iterator) {\n for (var i = 0, length = this.length; i < length; i++)\n iterator(this[i]);\n }", "function values(){\n var args = arguments;\n //need to bind since arguments within next refers to arguments passed in to next\n //not the origin values arguments\n var n = args.length;\n var i = 0;\n return {\n next: function(){\n if (i >= n ){\n throw new Error(\"end of iteration\");\n } else {\n return args[i++];\n //store args[i] to return, increments i then return args[i]\n }\n }\n }\n}", "function getBindingAttributesArray(node){\n\n var result = [];\n \n for (var i = 0; i < node.attributes.length; i++) {\n var attribute = node.attributes[i];\n \n if (attribute.name.substring(0, bindingPrefix.length) !== bindingPrefix) {\n continue;\n }\n \n result.push(attribute);\n }\n \n return result; \n }", "inner_apply(obj){\n switch( obj.type ) {\n case JXONObj.TAG:\n var json = {}\n for(var i=0; i<obj.value.length; i++) {\n var p = this.inner_apply(obj.value[i])\n json[p[0]] = p[1]\n }\n return json\n case JXONAttribute.TAG:\n var pair = obj.value\n var value = this.inner_apply(pair[1])\n return [pair[0].value, value]\n case JXONList.TAG:\n var a = []\n for(var i=0; i<obj.value.length; i++)\n a.push(this.inner_apply(obj.value[i])) \n return a\n default:\n return obj.value\n }\n }", "function _gobbleArray(context) {\n context.index++;\n return {\n type: 9, // 'ArrayExpression'\n elements: _gobbleArguments(context, CBRACK_CODE)\n };\n }", "function bindChildren() {\n for (var idx = 0; idx < childContainerPropNames.length; idx++) {\n var childContainerPropName = childContainerPropNames[idx];\n var childContainer = config[childContainerPropName];\n if (Ext.isArray(childContainer)) {\n var newItems = [];\n for (var i = 0; i < childContainer.length; i++) {\n var childItem = childContainer[i];\n var result = this.collectBindings(childItem, viewmodel, config, childContainerPropName, xtypeAdapter, bindingsList, indents + 1);\n newItems.push(result.config);\n }\n config[childContainerPropName] = newItems;\n } else {\n //otherwise do a simple recursion\n config[childContainerPropName] = this.collectBindings(childContainer, viewmodel, config, childContainerPropName, xtypeAdapter, bindingsList, indents + 1).config;\n }\n }\n }", "observeArray(items: Array < any > ) {\n for (let i = 0, l = items.length; i < l; i++) {\n // 使数组中的每一个值变成响应式的\n observe(items[i])\n }\n }", "[Symbol.iterator]() {\n return this.storage.values[Symbol.iterator]();\n }", "[Symbol.iterator]() {\n return this.storage.values[Symbol.iterator]();\n }", "getChildNodeIterator() {}", "function preprocessNode(node){\n \n if (!validateBindingNode(node)){\n return;\n }\n \n var bindingAttributes = getBindingAttributesArray(node);\n \n if (bindingAttributes.length === 0) {\n return;\n }\n \n var dataBindAttribute = node.getAttribute(regularBindingAttributeName);\n var existingBindings = convertBindingsStringToObject(dataBindAttribute);\n\n for (var i = 0; i < bindingAttributes.length; i++) {\n appendBindingsFromAttribute(existingBindings, bindingAttributes[i]); \n } \n \n node.setAttribute(regularBindingAttributeName, objectLiteralToString(existingBindings)); \n }", "function each(arr, inputFunction){\n arr.forEach(function(item){\n inputFunction(item);\n });\n}", "[Symbol.iterator]() { return this._notes.values() }" ]
[ "0.59960055", "0.59519696", "0.5868421", "0.5701254", "0.5693932", "0.5630378", "0.5591889", "0.557498", "0.5558848", "0.55200684", "0.550839", "0.5439565", "0.5429936", "0.53422356", "0.5290209", "0.52881205", "0.52828795", "0.52828795", "0.5261787", "0.52565503", "0.5194202", "0.51831704", "0.51682174", "0.51626706", "0.51626706", "0.5157099", "0.51460826", "0.5141461", "0.5129767", "0.51204026", "0.5114571", "0.5096616", "0.5090224", "0.5083227", "0.50605804", "0.50588137", "0.5039423", "0.50264555", "0.49861446", "0.49779966", "0.49766406", "0.49630395", "0.495817", "0.49220127", "0.49016574", "0.49016574", "0.4898752", "0.48943922", "0.48942563", "0.48893782", "0.4880716", "0.48572865", "0.48572865", "0.48569903", "0.48292357", "0.48255983", "0.4817588", "0.48175454", "0.4816583", "0.4805199", "0.4798676", "0.47918308", "0.47892118", "0.47837472", "0.4779442", "0.47751206", "0.4768158", "0.47671738", "0.47648606", "0.47648606", "0.4755719", "0.47547084", "0.47414175", "0.47215807", "0.47204682", "0.47194597", "0.47101516", "0.47080487", "0.47062674", "0.46978253", "0.46846133", "0.46829057", "0.46747133", "0.46727267", "0.46579835", "0.46559158", "0.46438143", "0.4637784", "0.46285295", "0.46249363", "0.46208522", "0.461166", "0.46024153", "0.45938352", "0.4590599", "0.4590599", "0.45894736", "0.45852128", "0.45806792", "0.4579237" ]
0.7023833
0
create a function/fuctions that collects the form values appends the values to the list of Adjectives make sure that the adjective is clickable make sure the list of adjectives is updated when a word is clicked on/ removed
function myFunc(event) { event.preventDefault() let word = document.createElement("li") word.textContent = form.field1.value; words.appendChild(word) //dynamic.textContent = form.field1.value; let dynamicWords = document.querySelectorAll("li") dynamicWords.forEach( word => { word.addEventListener("click", () => { dynamic.textContent = word.textContent; words.removeChild(word); }); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function buttonListener()\n{\n event.preventDefault(); //do not reload\n\n //get all fields\n const myAdLib = document.getElementById( \"title_input\" ).value;\n const noun = document.getElementById( \"noun\" ).value;\n const verb = document.getElementById( \"verb\" ).value;\n const adjective = document.getElementById( \"adjective\" ).value;\n\n //if the user has any field left blank\n if ( !myAdLib || !noun || !verb || !adjective )\n {\n alert( \"Please fill in all fields\" );\n return;\n }\n\n //otherwise parse fields\n const story = `Last night I ate a ${noun}, and today I just had to ${verb}. What a ${adjective} day!`;\n form.style.display = \"none\"; //hide form container\n storyP.innerText = story;\n}", "function addGoal()\n{\n const enteredGoal = inputGoalEl.value ;\n const enteredGoalDesc = inputDescEl.value ;\n\n if( enteredGoal.length > 0 )\n {\n const enteredGoalStrong = document.createElement('strong')\n enteredGoalStrong.textContent = enteredGoal\n\n var attribId = \"goalItem\"\n attribId = attribId.concat( listEl.childElementCount+1 ) \n\n const buttonDeleteItem = document.createElement('input')\n buttonDeleteItem.setAttribute('onclick', 'removeItem(\"' + attribId + '\")')\n buttonDeleteItem.setAttribute('type', 'button')\n buttonDeleteItem.setAttribute('style', 'margin-top: 8px')\n \n buttonDeleteItem.value = \"Delete\"\n\n const lineBreak = document.createElement('br')\n const listItem = document.createElement('li');\n listItem.setAttribute('id', attribId)\n\n listItem.appendChild(enteredGoalStrong)\n listItem.append(lineBreak)\n listItem.append(enteredGoalDesc)\n listItem.append(buttonDeleteItem)\n \n listEl.appendChild(listItem)\n }\n else\n {\n alert(\"Title cannot be empty\")\n }\n\n // Reset values in form\n inputGoalEl.value = ''\n inputDescEl.value = ''\n}", "function addListItemFromForm() {\n addListItem( getFormValues());\n}", "function madLibs() {\n\n var storyDiv = document.getElementById(\"story\");\n\n var name = document.getElementById(\"name\").value;\n\n var adjective = document.getElementById(\"adjective\").value;\n\n var noun = document.getElementById(\"noun\").value;\n\n storyDiv.innerHTML = name + \" has a \" + adjective + \" \" + noun + \" and can't make it to the party!\";\n\n }", "function seachVerb(e) {\n e.preventDefault()\n let result2 = datass.filter(element => element.conjugated_forms[0][1].split(\" \")[1] === inputValue || element.conjugated_forms[1][1] === inputValue || element.conjugated_forms[1][1] === inputValue || element.conjugated_forms[2][1] === inputValue)\n\n\n\n\n try {\n settitre(result2[0].conjugated_forms[0][0] + \" : \")\n setvaleurTitre(result2[0].conjugated_forms[0][1])\n setSimplePast1(result2[0].conjugated_forms[1][0] + \" : \")\n setSimplePastValue(result2[0].conjugated_forms[1][1])\n setPastParticipe(result2[0].conjugated_forms[2][0] + \" : \")\n setPastParticipeValue(result2[0].conjugated_forms[2][1])\n setSimplePresent(result2[0].conjugation_tables.indicative[0].heading.toUpperCase())\n setPresentI(result2[0].conjugation_tables.indicative[0].forms[0][0])\n setPresentIRresult(result2[0].conjugation_tables.indicative[0].forms[0][1])\n setPresentYou(result2[0].conjugation_tables.indicative[0].forms[1][0])\n setPresentYouResult(result2[0].conjugation_tables.indicative[0].forms[1][1])\n setPresentHe(result2[0].conjugation_tables.indicative[0].forms[2][0])\n setPresentHeResult(result2[0].conjugation_tables.indicative[0].forms[2][1])\n setPresentWe(result2[0].conjugation_tables.indicative[0].forms[3][0])\n setPresentWeResult(result2[0].conjugation_tables.indicative[0].forms[3][1])\n setPresentYou1(result2[0].conjugation_tables.indicative[0].forms[4][0])\n setPresentYou1Result(result2[0].conjugation_tables.indicative[0].forms[4][1])\n setPresentThey(result2[0].conjugation_tables.indicative[0].forms[5][0])\n setPresentTheyResult(result2[0].conjugation_tables.indicative[0].forms[5][1])\n\n /* present progressive */\n setPresentProgressive(result2[0].conjugation_tables.indicative[1].heading.toUpperCase())\n setPresentProgressiveI(result2[0].conjugation_tables.indicative[1].forms[0][0])\n setPresentProgressiveIRresult(result2[0].conjugation_tables.indicative[1].forms[0][1])\n setPresentProgressiveYou(result2[0].conjugation_tables.indicative[1].forms[1][0])\n setPresentProgressiveYouResult(result2[0].conjugation_tables.indicative[1].forms[1][1])\n setPresentProgressiveHe(result2[0].conjugation_tables.indicative[1].forms[2][0])\n setPresentProgressiveHeResult(result2[0].conjugation_tables.indicative[1].forms[2][1])\n setPresentProgressiveWe(result2[0].conjugation_tables.indicative[1].forms[3][0])\n setPresentProgressiveWeResult(result2[0].conjugation_tables.indicative[1].forms[3][1])\n setPresentProgressiveYou1(result2[0].conjugation_tables.indicative[1].forms[4][0])\n setPresentProgressiveYou1Result(result2[0].conjugation_tables.indicative[1].forms[4][1])\n setPresentProgressiveThey(result2[0].conjugation_tables.indicative[1].forms[5][0])\n setPresentProgressiveTheyResult(result2[0].conjugation_tables.indicative[1].forms[5][1])\n\n /* present perfect */\n setPresentPerfect(result2[0].conjugation_tables.indicative[2].heading.toUpperCase())\n setPresentPerfectI(result2[0].conjugation_tables.indicative[2].forms[0][0])\n setPresentPerfectIRresult(result2[0].conjugation_tables.indicative[2].forms[0][1])\n setPresentPerfectYou(result2[0].conjugation_tables.indicative[2].forms[1][0])\n setPresentPerfectYouResult(result2[0].conjugation_tables.indicative[2].forms[1][1])\n setPresentPerfectHe(result2[0].conjugation_tables.indicative[2].forms[2][0])\n setPresentPerfectHeResult(result2[0].conjugation_tables.indicative[2].forms[2][1])\n setPresentPerfectWe(result2[0].conjugation_tables.indicative[2].forms[3][0])\n setPresentPerfectWeResult(result2[0].conjugation_tables.indicative[2].forms[3][1])\n setPresentPerfectYou1(result2[0].conjugation_tables.indicative[2].forms[4][0])\n setPresentPerfectYou1Result(result2[0].conjugation_tables.indicative[2].forms[4][1])\n setPresentPerfectThey(result2[0].conjugation_tables.indicative[2].forms[5][0])\n setPresentPerfectTheyResult(result2[0].conjugation_tables.indicative[2].forms[5][1])\n\n\n /* present perfect progressive */\n setPresentPerfectProgressive(result2[0].conjugation_tables.indicative[3].heading.toUpperCase())\n setPresentPerfectProgressiveI(result2[0].conjugation_tables.indicative[3].forms[0][0])\n setPresentPerfectProgressiveIRresult(result2[0].conjugation_tables.indicative[3].forms[0][1])\n setPresentPerfectProgressiveYou(result2[0].conjugation_tables.indicative[3].forms[1][0])\n setPresentPerfectProgressiveYouResult(result2[0].conjugation_tables.indicative[3].forms[1][1])\n setPresentPerfectProgressiveHe(result2[0].conjugation_tables.indicative[3].forms[2][0])\n setPresentPerfectProgressiveHeResult(result2[0].conjugation_tables.indicative[3].forms[2][1])\n setPresentPerfectProgressiveWe(result2[0].conjugation_tables.indicative[3].forms[3][0])\n setPresentPerfectProgressiveWeResult(result2[0].conjugation_tables.indicative[3].forms[3][1])\n setPresentPerfectProgressiveYou1(result2[0].conjugation_tables.indicative[3].forms[4][0])\n setPresentPerfectProgressiveYou1Result(result2[0].conjugation_tables.indicative[3].forms[4][1])\n setPresentPerfectProgressiveThey(result2[0].conjugation_tables.indicative[3].forms[5][0])\n setPresentPerfectProgressiveTheyResult(result2[0].conjugation_tables.indicative[3].forms[5][1])\n\n /* Simple past */\n setSimplePast(result2[0].conjugation_tables.indicative[4].heading.toUpperCase())\n setSimplePastI(result2[0].conjugation_tables.indicative[4].forms[0][0])\n setSimplePastIRresult(result2[0].conjugation_tables.indicative[4].forms[0][1])\n setSimplePastYou(result2[0].conjugation_tables.indicative[4].forms[1][0])\n setSimplePastYouResult(result2[0].conjugation_tables.indicative[4].forms[1][1])\n setSimplePastHe(result2[0].conjugation_tables.indicative[4].forms[2][0])\n setSimplePastHeResult(result2[0].conjugation_tables.indicative[4].forms[2][1])\n setSimplePastWe(result2[0].conjugation_tables.indicative[4].forms[3][0])\n setSimplePastWeResult(result2[0].conjugation_tables.indicative[4].forms[3][1])\n setSimplePastYou1(result2[0].conjugation_tables.indicative[4].forms[4][0])\n setSimplePastYou1Result(result2[0].conjugation_tables.indicative[4].forms[4][1])\n setSimplePastThey(result2[0].conjugation_tables.indicative[4].forms[5][0])\n setSimplePastTheyResult(result2[0].conjugation_tables.indicative[4].forms[5][1])\n\n\n /* past progressive */\n setPastProgressive(result2[0].conjugation_tables.indicative[5].heading.toUpperCase())\n setPastProgressiveI(result2[0].conjugation_tables.indicative[5].forms[0][0])\n setPastProgressiveIRresult(result2[0].conjugation_tables.indicative[5].forms[0][1])\n setPastProgressiveYou(result2[0].conjugation_tables.indicative[5].forms[1][0])\n setPastProgressiveYouResult(result2[0].conjugation_tables.indicative[5].forms[1][1])\n setPastProgressiveHe(result2[0].conjugation_tables.indicative[5].forms[2][0])\n setPastProgressiveHeResult(result2[0].conjugation_tables.indicative[5].forms[2][1])\n setPastProgressiveWe(result2[0].conjugation_tables.indicative[5].forms[3][0])\n setPastProgressiveWeResult(result2[0].conjugation_tables.indicative[5].forms[3][1])\n setPastProgressiveYou1(result2[0].conjugation_tables.indicative[5].forms[4][0])\n setPastProgressiveYou1Result(result2[0].conjugation_tables.indicative[5].forms[4][1])\n setPastProgressiveThey(result2[0].conjugation_tables.indicative[5].forms[5][0])\n setPastProgressiveTheyResult(result2[0].conjugation_tables.indicative[5].forms[5][1])\n\n /* past perfect */\n setPastPerfect(result2[0].conjugation_tables.indicative[6].heading.toUpperCase())\n setPastPerfectI(result2[0].conjugation_tables.indicative[6].forms[0][0])\n setPastPerfectIRresult(result2[0].conjugation_tables.indicative[6].forms[0][1])\n setPastPerfectYou(result2[0].conjugation_tables.indicative[6].forms[1][0])\n setPastPerfectYouResult(result2[0].conjugation_tables.indicative[6].forms[1][1])\n setPastPerfectHe(result2[0].conjugation_tables.indicative[6].forms[2][0])\n setPastPerfectHeResult(result2[0].conjugation_tables.indicative[6].forms[2][1])\n setPastPerfectWe(result2[0].conjugation_tables.indicative[6].forms[3][0])\n setPastPerfectWeResult(result2[0].conjugation_tables.indicative[6].forms[3][1])\n setPastPerfectYou1(result2[0].conjugation_tables.indicative[6].forms[4][0])\n setPastPerfectYou1Result(result2[0].conjugation_tables.indicative[6].forms[4][1])\n setPastPerfectThey(result2[0].conjugation_tables.indicative[6].forms[5][0])\n setPastPerfectTheyResult(result2[0].conjugation_tables.indicative[6].forms[5][1])\n\n\n /* past perfect progressive*/\n setPastPerfectProgressive(result2[0].conjugation_tables.indicative[7].heading.toUpperCase())\n setPastPerfectProgressiveI(result2[0].conjugation_tables.indicative[7].forms[0][0])\n setPastPerfectProgressiveIRresult(result2[0].conjugation_tables.indicative[7].forms[0][1])\n setPastPerfectProgressiveYou(result2[0].conjugation_tables.indicative[7].forms[1][0])\n setPastPerfectProgressiveYouResult(result2[0].conjugation_tables.indicative[7].forms[1][1])\n setPastPerfectProgressiveHe(result2[0].conjugation_tables.indicative[7].forms[2][0])\n setPastPerfectProgressiveHeResult(result2[0].conjugation_tables.indicative[7].forms[2][1])\n setPastPerfectProgressiveWe(result2[0].conjugation_tables.indicative[7].forms[3][0])\n setPastPerfectProgressiveWeResult(result2[0].conjugation_tables.indicative[7].forms[3][1])\n setPastPerfectProgressiveYou1(result2[0].conjugation_tables.indicative[7].forms[4][0])\n setPastPerfectProgressiveYou1Result(result2[0].conjugation_tables.indicative[7].forms[4][1])\n setPastPerfectProgressiveThey(result2[0].conjugation_tables.indicative[7].forms[5][0])\n setPastPerfectProgressiveTheyResult(result2[0].conjugation_tables.indicative[7].forms[5][1])\n\n /* simple future*/\n setSimpleFuture(result2[0].conjugation_tables.indicative[8].heading.toUpperCase())\n setSimpleFutureI(result2[0].conjugation_tables.indicative[8].forms[0][0])\n setSimpleFutureIRresult(result2[0].conjugation_tables.indicative[8].forms[0][1])\n setSimpleFutureYou(result2[0].conjugation_tables.indicative[8].forms[1][0])\n setSimpleFutureYouResult(result2[0].conjugation_tables.indicative[8].forms[1][1])\n setSimpleFutureHe(result2[0].conjugation_tables.indicative[8].forms[2][0])\n setSimpleFutureHeResult(result2[0].conjugation_tables.indicative[8].forms[2][1])\n setSimpleFutureWe(result2[0].conjugation_tables.indicative[8].forms[3][0])\n setSimpleFutureWeResult(result2[0].conjugation_tables.indicative[8].forms[3][1])\n setSimpleFutureYou1(result2[0].conjugation_tables.indicative[8].forms[4][0])\n setSimpleFutureYou1Result(result2[0].conjugation_tables.indicative[8].forms[4][1])\n setSimpleFutureThey(result2[0].conjugation_tables.indicative[8].forms[5][0])\n setSimpleFutureTheyResult(result2[0].conjugation_tables.indicative[8].forms[5][1])\n\n /* future progressive*/\n setFuturProgressive(result2[0].conjugation_tables.indicative[9].heading.toUpperCase())\n setFuturProgressiveI(result2[0].conjugation_tables.indicative[9].forms[0][0])\n setFuturProgressiveIRresult(result2[0].conjugation_tables.indicative[9].forms[0][1])\n setFuturProgressiveYou(result2[0].conjugation_tables.indicative[9].forms[1][0])\n setFuturProgressiveYouResult(result2[0].conjugation_tables.indicative[9].forms[1][1])\n setFuturProgressiveHe(result2[0].conjugation_tables.indicative[9].forms[2][0])\n setFuturProgressiveHeResult(result2[0].conjugation_tables.indicative[9].forms[2][1])\n setFuturProgressiveWe(result2[0].conjugation_tables.indicative[9].forms[3][0])\n setFuturProgressiveWeResult(result2[0].conjugation_tables.indicative[9].forms[3][1])\n setFuturProgressiveYou1(result2[0].conjugation_tables.indicative[9].forms[4][0])\n setFuturProgressiveYou1Result(result2[0].conjugation_tables.indicative[9].forms[4][1])\n setFuturProgressiveThey(result2[0].conjugation_tables.indicative[9].forms[5][0])\n setFuturProgressiveTheyResult(result2[0].conjugation_tables.indicative[9].forms[5][1])\n\n /* future perfect*/\n setFuturePerfect(result2[0].conjugation_tables.indicative[10].heading.toUpperCase())\n setFuturePerfectI(result2[0].conjugation_tables.indicative[10].forms[0][0])\n setFuturePerfectIRresult(result2[0].conjugation_tables.indicative[10].forms[0][1])\n setFuturePerfectYou(result2[0].conjugation_tables.indicative[10].forms[1][0])\n setFuturePerfectYouResult(result2[0].conjugation_tables.indicative[10].forms[1][1])\n setFuturePerfectHe(result2[0].conjugation_tables.indicative[10].forms[2][0])\n setFuturePerfectHeResult(result2[0].conjugation_tables.indicative[10].forms[2][1])\n setFuturePerfectWe(result2[0].conjugation_tables.indicative[10].forms[3][0])\n setFuturePerfectWeResult(result2[0].conjugation_tables.indicative[10].forms[3][1])\n setFuturePerfectYou1(result2[0].conjugation_tables.indicative[10].forms[4][0])\n setFuturePerfectYou1Result(result2[0].conjugation_tables.indicative[10].forms[4][1])\n setFuturePerfectThey(result2[0].conjugation_tables.indicative[10].forms[5][0])\n setFuturePerfectTheyResult(result2[0].conjugation_tables.indicative[10].forms[5][1])\n\n\n /* future perfect progressive*/\n setFuturePerfectProgressive(result2[0].conjugation_tables.indicative[11].heading.toUpperCase())\n setFuturePerfectProgressiveI(result2[0].conjugation_tables.indicative[11].forms[0][0])\n setFuturePerfectProgressiveIRresult(result2[0].conjugation_tables.indicative[11].forms[0][1])\n setFuturePerfectProgressiveYou(result2[0].conjugation_tables.indicative[11].forms[1][0])\n setFuturePerfectProgressiveYouResult(result2[0].conjugation_tables.indicative[11].forms[1][1])\n setFuturePerfectProgressiveHe(result2[0].conjugation_tables.indicative[11].forms[2][0])\n setFuturePerfectProgressiveHeResult(result2[0].conjugation_tables.indicative[11].forms[2][1])\n setFuturePerfectProgressiveWe(result2[0].conjugation_tables.indicative[11].forms[3][0])\n setFuturePerfectProgressiveWeResult(result2[0].conjugation_tables.indicative[11].forms[3][1])\n setFuturePerfectProgressiveYou1(result2[0].conjugation_tables.indicative[11].forms[4][0])\n setFuturePerfectProgressiveYou1Result(result2[0].conjugation_tables.indicative[11].forms[4][1])\n setFuturePerfectProgressiveThey(result2[0].conjugation_tables.indicative[11].forms[5][0])\n setFuturePerfectProgressiveTheyResult(result2[0].conjugation_tables.indicative[11].forms[5][1])\n\n /* passive form ------------------------------------------- */\n\n setSimplePassivePresent(result2[0].conjugation_tables.passive[0].heading.toUpperCase())\n setPassivePresentI(result2[0].conjugation_tables.passive[0].forms[0][0])\n setPassivePresentIRresult(result2[0].conjugation_tables.passive[0].forms[0][1])\n setPassivePresentYou(result2[0].conjugation_tables.passive[0].forms[1][0])\n setPassivePresentYouResult(result2[0].conjugation_tables.passive[0].forms[1][1])\n setPassivePresentHe(result2[0].conjugation_tables.passive[0].forms[2][0])\n setPassivePresentHeResult(result2[0].conjugation_tables.passive[0].forms[2][1])\n setPassivePresentWe(result2[0].conjugation_tables.passive[0].forms[3][0])\n setPassivePresentWeResult(result2[0].conjugation_tables.passive[0].forms[3][1])\n setPassivePresentYou1(result2[0].conjugation_tables.passive[0].forms[4][0])\n setPassivePresentYou1Result(result2[0].conjugation_tables.passive[0].forms[4][1])\n setPassivePresentThey(result2[0].conjugation_tables.passive[0].forms[5][0])\n setPassivePresentTheyResult(result2[0].conjugation_tables.passive[0].forms[5][1])\n\n /* present passive progressive */\n setPassivePresentProgressive(result2[0].conjugation_tables.passive[1].heading.toUpperCase())\n setPassivePresentProgressiveI(result2[0].conjugation_tables.passive[1].forms[0][0])\n setPassivePresentProgressiveIRresult(result2[0].conjugation_tables.passive[1].forms[0][1])\n setPassivePresentProgressiveYou(result2[0].conjugation_tables.passive[1].forms[1][0])\n setPassivePresentProgressiveYouResult(result2[0].conjugation_tables.passive[1].forms[1][1])\n setPassivePresentProgressiveHe(result2[0].conjugation_tables.passive[1].forms[2][0])\n setPassivePresentProgressiveHeResult(result2[0].conjugation_tables.passive[1].forms[2][1])\n setPassivePresentProgressiveWe(result2[0].conjugation_tables.passive[1].forms[3][0])\n setPassivePresentProgressiveWeResult(result2[0].conjugation_tables.passive[1].forms[3][1])\n setPassivePresentProgressiveYou1(result2[0].conjugation_tables.passive[1].forms[4][0])\n setPassivePresentProgressiveYou1Result(result2[0].conjugation_tables.passive[1].forms[4][1])\n setPassivePresentProgressiveThey(result2[0].conjugation_tables.passive[1].forms[5][0])\n setPassivePresentProgressiveTheyResult(result2[0].conjugation_tables.passive[1].forms[5][1])\n\n /* present passive perfect */\n setPassivePresentPerfect(result2[0].conjugation_tables.passive[2].heading.toUpperCase())\n setPassivePresentPerfectI(result2[0].conjugation_tables.passive[2].forms[0][0])\n setPassivePresentPerfectIRresult(result2[0].conjugation_tables.passive[2].forms[0][1])\n setPassivePresentPerfectYou(result2[0].conjugation_tables.passive[2].forms[1][0])\n setPassivePresentPerfectYouResult(result2[0].conjugation_tables.passive[2].forms[1][1])\n setPassivePresentPerfectHe(result2[0].conjugation_tables.passive[2].forms[2][0])\n setPassivePresentPerfectHeResult(result2[0].conjugation_tables.passive[2].forms[2][1])\n setPassivePresentPerfectWe(result2[0].conjugation_tables.passive[2].forms[3][0])\n setPassivePresentPerfectWeResult(result2[0].conjugation_tables.passive[2].forms[3][1])\n setPassivePresentPerfectYou1(result2[0].conjugation_tables.passive[2].forms[4][0])\n setPassivePresentPerfectYou1Result(result2[0].conjugation_tables.passive[2].forms[4][1])\n setPassivePresentPerfectThey(result2[0].conjugation_tables.passive[2].forms[5][0])\n setPassivePresentPerfectTheyResult(result2[0].conjugation_tables.passive[2].forms[5][1])\n\n\n /* present passive perfect progressive */\n setPassivePresentPerfectProgressive(result2[0].conjugation_tables.passive[3].heading.toUpperCase())\n setPassivePresentPerfectProgressiveI(result2[0].conjugation_tables.passive[3].forms[0][0])\n setPassivePresentPerfectProgressiveIRresult(result2[0].conjugation_tables.passive[3].forms[0][1])\n setPassivePresentPerfectProgressiveYou(result2[0].conjugation_tables.passive[3].forms[1][0])\n setPassivePresentPerfectProgressiveYouResult(result2[0].conjugation_tables.passive[3].forms[1][1])\n setPassivePresentPerfectProgressiveHe(result2[0].conjugation_tables.passive[3].forms[2][0])\n setPassivePresentPerfectProgressiveHeResult(result2[0].conjugation_tables.passive[3].forms[2][1])\n setPassivePresentPerfectProgressiveWe(result2[0].conjugation_tables.passive[3].forms[3][0])\n setPassivePresentPerfectProgressiveWeResult(result2[0].conjugation_tables.passive[3].forms[3][1])\n setPassivePresentPerfectProgressiveYou1(result2[0].conjugation_tables.passive[3].forms[4][0])\n setPassivePresentPerfectProgressiveYou1Result(result2[0].conjugation_tables.passive[3].forms[4][1])\n setPassivePresentPerfectProgressiveThey(result2[0].conjugation_tables.passive[3].forms[5][0])\n setPassivePresentPerfectProgressiveTheyResult(result2[0].conjugation_tables.passive[3].forms[5][1])\n\n /* Simple passivepast */\n setSimplePassivePast(result2[0].conjugation_tables.passive[4].heading.toUpperCase())\n setSimplePassivePastI(result2[0].conjugation_tables.passive[4].forms[0][0])\n setSimplePassivePastIRresult(result2[0].conjugation_tables.passive[4].forms[0][1])\n setSimplePassivePastYou(result2[0].conjugation_tables.passive[4].forms[1][0])\n setSimplePassivePastYouResult(result2[0].conjugation_tables.passive[4].forms[1][1])\n setSimplePassivePastHe(result2[0].conjugation_tables.passive[4].forms[2][0])\n setSimplePassivePastHeResult(result2[0].conjugation_tables.passive[4].forms[2][1])\n setSimplePassivePastWe(result2[0].conjugation_tables.passive[4].forms[3][0])\n setSimplePassivePastWeResult(result2[0].conjugation_tables.passive[4].forms[3][1])\n setSimplePassivePastYou1(result2[0].conjugation_tables.passive[4].forms[4][0])\n setSimplePassivePastYou1Result(result2[0].conjugation_tables.passive[4].forms[4][1])\n setSimplePassivePastThey(result2[0].conjugation_tables.passive[4].forms[5][0])\n setSimplePassivePastTheyResult(result2[0].conjugation_tables.passive[4].forms[5][1])\n\n\n /* past passive progressive */\n setPassivePastProgressive(result2[0].conjugation_tables.passive[5].heading.toUpperCase())\n setPassivePastProgressiveI(result2[0].conjugation_tables.passive[5].forms[0][0])\n setPassivePastProgressiveIRresult(result2[0].conjugation_tables.passive[5].forms[0][1])\n setPassivePastProgressiveYou(result2[0].conjugation_tables.passive[5].forms[1][0])\n setPassivePastProgressiveYouResult(result2[0].conjugation_tables.passive[5].forms[1][1])\n setPassivePastProgressiveHe(result2[0].conjugation_tables.passive[5].forms[2][0])\n setPassivePastProgressiveHeResult(result2[0].conjugation_tables.passive[5].forms[2][1])\n setPassivePastProgressiveWe(result2[0].conjugation_tables.passive[5].forms[3][0])\n setPassivePastProgressiveWeResult(result2[0].conjugation_tables.passive[5].forms[3][1])\n setPassivePastProgressiveYou1(result2[0].conjugation_tables.passive[5].forms[4][0])\n setPassivePastProgressiveYou1Result(result2[0].conjugation_tables.passive[5].forms[4][1])\n setPassivePastProgressiveThey(result2[0].conjugation_tables.passive[5].forms[5][0])\n setPassivePastProgressiveTheyResult(result2[0].conjugation_tables.passive[5].forms[5][1])\n\n /* past passive perfect */\n setPassivePastPerfect(result2[0].conjugation_tables.passive[6].heading.toUpperCase())\n setPassivePastPerfectI(result2[0].conjugation_tables.passive[6].forms[0][0])\n setPassivePastPerfectIRresult(result2[0].conjugation_tables.passive[6].forms[0][1])\n setPassivePastPerfectYou(result2[0].conjugation_tables.passive[6].forms[1][0])\n setPassivePastPerfectYouResult(result2[0].conjugation_tables.passive[6].forms[1][1])\n setPassivePastPerfectHe(result2[0].conjugation_tables.passive[6].forms[2][0])\n setPassivePastPerfectHeResult(result2[0].conjugation_tables.passive[6].forms[2][1])\n setPassivePastPerfectWe(result2[0].conjugation_tables.passive[6].forms[3][0])\n setPassivePastPerfectWeResult(result2[0].conjugation_tables.passive[6].forms[3][1])\n setPassivePastPerfectYou1(result2[0].conjugation_tables.passive[6].forms[4][0])\n setPassivePastPerfectYou1Result(result2[0].conjugation_tables.passive[6].forms[4][1])\n setPassivePastPerfectThey(result2[0].conjugation_tables.passive[6].forms[5][0])\n setPassivePastPerfectTheyResult(result2[0].conjugation_tables.passive[6].forms[5][1])\n\n\n /* past passiveperfect progressive*/\n setPassivePastPerfectProgressive(result2[0].conjugation_tables.passive[7].heading.toUpperCase())\n setPassivePastPerfectProgressiveI(result2[0].conjugation_tables.passive[7].forms[0][0])\n setPassivePastPerfectProgressiveIRresult(result2[0].conjugation_tables.passive[7].forms[0][1])\n setPassivePastPerfectProgressiveYou(result2[0].conjugation_tables.passive[7].forms[1][0])\n setPassivePastPerfectProgressiveYouResult(result2[0].conjugation_tables.passive[7].forms[1][1])\n setPassivePastPerfectProgressiveHe(result2[0].conjugation_tables.passive[7].forms[2][0])\n setPassivePastPerfectProgressiveHeResult(result2[0].conjugation_tables.passive[7].forms[2][1])\n setPassivePastPerfectProgressiveWe(result2[0].conjugation_tables.passive[7].forms[3][0])\n setPassivePastPerfectProgressiveWeResult(result2[0].conjugation_tables.passive[7].forms[3][1])\n setPassivePastPerfectProgressiveYou1(result2[0].conjugation_tables.passive[7].forms[4][0])\n setPassivePastPerfectProgressiveYou1Result(result2[0].conjugation_tables.passive[7].forms[4][1])\n setPassivePastPerfectProgressiveThey(result2[0].conjugation_tables.passive[7].forms[5][0])\n setPassivePastPerfectProgressiveTheyResult(result2[0].conjugation_tables.passive[7].forms[5][1])\n\n /* simple passive future*/\n setPassiveSimpleFuture(result2[0].conjugation_tables.passive[8].heading.toUpperCase())\n setPassiveSimpleFutureI(result2[0].conjugation_tables.passive[8].forms[0][0])\n setPassiveSimpleFutureIRresult(result2[0].conjugation_tables.passive[8].forms[0][1])\n setPassiveSimpleFutureYou(result2[0].conjugation_tables.passive[8].forms[1][0])\n setPassiveSimpleFutureYouResult(result2[0].conjugation_tables.passive[8].forms[1][1])\n setPassiveSimpleFutureHe(result2[0].conjugation_tables.passive[8].forms[2][0])\n setPassiveSimpleFutureHeResult(result2[0].conjugation_tables.passive[8].forms[2][1])\n setPassiveSimpleFutureWe(result2[0].conjugation_tables.passive[8].forms[3][0])\n setPassiveSimpleFutureWeResult(result2[0].conjugation_tables.passive[8].forms[3][1])\n setPassiveSimpleFutureYou1(result2[0].conjugation_tables.passive[8].forms[4][0])\n setPassiveSimpleFutureYou1Result(result2[0].conjugation_tables.passive[8].forms[4][1])\n setPassiveSimpleFutureThey(result2[0].conjugation_tables.passive[8].forms[5][0])\n setPassiveSimpleFutureTheyResult(result2[0].conjugation_tables.passive[8].forms[5][1])\n\n /* future passive progressive*/\n setPassiveFuturProgressive(result2[0].conjugation_tables.passive[9].heading.toUpperCase())\n setPassiveFuturProgressiveI(result2[0].conjugation_tables.passive[9].forms[0][0])\n setPassiveFuturProgressiveIRresult(result2[0].conjugation_tables.passive[9].forms[0][1])\n setPassiveFuturProgressiveYou(result2[0].conjugation_tables.passive[9].forms[1][0])\n setPassiveFuturProgressiveYouResult(result2[0].conjugation_tables.passive[9].forms[1][1])\n setPassiveFuturProgressiveHe(result2[0].conjugation_tables.passive[9].forms[2][0])\n setPassiveFuturProgressiveHeResult(result2[0].conjugation_tables.passive[9].forms[2][1])\n setPassiveFuturProgressiveWe(result2[0].conjugation_tables.passive[9].forms[3][0])\n setPassiveFuturProgressiveWeResult(result2[0].conjugation_tables.passive[9].forms[3][1])\n setPassiveFuturProgressiveYou1(result2[0].conjugation_tables.passive[9].forms[4][0])\n setPassiveFuturProgressiveYou1Result(result2[0].conjugation_tables.passive[9].forms[4][1])\n setPassiveFuturProgressiveThey(result2[0].conjugation_tables.passive[9].forms[5][0])\n setPassiveFuturProgressiveTheyResult(result2[0].conjugation_tables.passive[9].forms[5][1])\n\n /* future passive perfect*/\n setPassiveFuturePerfect(result2[0].conjugation_tables.passive[10].heading.toUpperCase())\n setPassiveFuturePerfectI(result2[0].conjugation_tables.passive[10].forms[0][0])\n setPassiveFuturePerfectIRresult(result2[0].conjugation_tables.passive[10].forms[0][1])\n setPassiveFuturePerfectYou(result2[0].conjugation_tables.passive[10].forms[1][0])\n setPassiveFuturePerfectYouResult(result2[0].conjugation_tables.passive[10].forms[1][1])\n setPassiveFuturePerfectHe(result2[0].conjugation_tables.passive[10].forms[2][0])\n setPassiveFuturePerfectHeResult(result2[0].conjugation_tables.passive[10].forms[2][1])\n setPassiveFuturePerfectWe(result2[0].conjugation_tables.passive[10].forms[3][0])\n setPassiveFuturePerfectWeResult(result2[0].conjugation_tables.passive[10].forms[3][1])\n setPassiveFuturePerfectYou1(result2[0].conjugation_tables.passive[10].forms[4][0])\n setPassiveFuturePerfectYou1Result(result2[0].conjugation_tables.passive[10].forms[4][1])\n setPassiveFuturePerfectThey(result2[0].conjugation_tables.passive[10].forms[5][0])\n setPassiveFuturePerfectTheyResult(result2[0].conjugation_tables.passive[10].forms[5][1])\n\n\n /* future passive perfect progressive*/\n setPassiveFuturePerfectProgressive(result2[0].conjugation_tables.passive[11].heading.toUpperCase())\n setPassiveFuturePerfectProgressiveI(result2[0].conjugation_tables.passive[11].forms[0][0])\n setPassiveFuturePerfectProgressiveIRresult(result2[0].conjugation_tables.passive[11].forms[0][1])\n setPassiveFuturePerfectProgressiveYou(result2[0].conjugation_tables.passive[11].forms[1][0])\n setPassiveFuturePerfectProgressiveYouResult(result2[0].conjugation_tables.passive[11].forms[1][1])\n setPassiveFuturePerfectProgressiveHe(result2[0].conjugation_tables.passive[11].forms[2][0])\n setPassiveFuturePerfectProgressiveHeResult(result2[0].conjugation_tables.passive[11].forms[2][1])\n setPassiveFuturePerfectProgressiveWe(result2[0].conjugation_tables.passive[11].forms[3][0])\n setPassiveFuturePerfectProgressiveWeResult(result2[0].conjugation_tables.passive[11].forms[3][1])\n setPassiveFuturePerfectProgressiveYou1(result2[0].conjugation_tables.passive[11].forms[4][0])\n setPassiveFuturePerfectProgressiveYou1Result(result2[0].conjugation_tables.passive[11].forms[4][1])\n setPassiveFuturePerfectProgressiveThey(result2[0].conjugation_tables.passive[11].forms[5][0])\n setPassiveFuturePerfectProgressiveTheyResult(result2[0].conjugation_tables.passive[11].forms[5][1])\n\n\n\n\n /* condition form ------------------------------------------- */\n\n setSimpleConditionalPresent(result2[0].conjugation_tables.conditional[0].heading.toUpperCase())\n setConditionalPresentI(result2[0].conjugation_tables.conditional[0].forms[0][0])\n setConditionalPresentIRresult(result2[0].conjugation_tables.conditional[0].forms[0][1])\n setConditionalPresentYou(result2[0].conjugation_tables.conditional[0].forms[1][0])\n setConditionalPresentYouResult(result2[0].conjugation_tables.conditional[0].forms[1][1])\n setConditionalPresentHe(result2[0].conjugation_tables.conditional[0].forms[2][0])\n setConditionalPresentHeResult(result2[0].conjugation_tables.conditional[0].forms[2][1])\n setConditionalPresentWe(result2[0].conjugation_tables.conditional[0].forms[3][0])\n setConditionalPresentWeResult(result2[0].conjugation_tables.conditional[0].forms[3][1])\n setConditionalPresentYou1(result2[0].conjugation_tables.conditional[0].forms[4][0])\n setConditionalPresentYou1Result(result2[0].conjugation_tables.conditional[0].forms[4][1])\n setConditionalPresentThey(result2[0].conjugation_tables.conditional[0].forms[5][0])\n setConditionalPresentTheyResult(result2[0].conjugation_tables.conditional[0].forms[5][1])\n\n /* present Conditional progressive */\n setConditionalPresentProgressive(result2[0].conjugation_tables.conditional[1].heading.toUpperCase())\n setConditionalPresentProgressiveI(result2[0].conjugation_tables.conditional[1].forms[0][0])\n setConditionalPresentProgressiveIRresult(result2[0].conjugation_tables.conditional[1].forms[0][1])\n setConditionalPresentProgressiveYou(result2[0].conjugation_tables.conditional[1].forms[1][0])\n setConditionalPresentProgressiveYouResult(result2[0].conjugation_tables.conditional[1].forms[1][1])\n setConditionalPresentProgressiveHe(result2[0].conjugation_tables.conditional[1].forms[2][0])\n setConditionalPresentProgressiveHeResult(result2[0].conjugation_tables.conditional[1].forms[2][1])\n setConditionalPresentProgressiveWe(result2[0].conjugation_tables.conditional[1].forms[3][0])\n setConditionalPresentProgressiveWeResult(result2[0].conjugation_tables.conditional[1].forms[3][1])\n setConditionalPresentProgressiveYou1(result2[0].conjugation_tables.conditional[1].forms[4][0])\n setConditionalPresentProgressiveYou1Result(result2[0].conjugation_tables.conditional[1].forms[4][1])\n setConditionalPresentProgressiveThey(result2[0].conjugation_tables.conditional[1].forms[5][0])\n setConditionalPresentProgressiveTheyResult(result2[0].conjugation_tables.conditional[1].forms[5][1])\n\n /* present Conditional perfect */\n setConditionalPresentPerfect(result2[0].conjugation_tables.conditional[2].heading.toUpperCase())\n setConditionalPresentPerfectI(result2[0].conjugation_tables.conditional[2].forms[0][0])\n setConditionalPresentPerfectIRresult(result2[0].conjugation_tables.conditional[2].forms[0][1])\n setConditionalPresentPerfectYou(result2[0].conjugation_tables.conditional[2].forms[1][0])\n setConditionalPresentPerfectYouResult(result2[0].conjugation_tables.conditional[2].forms[1][1])\n setConditionalPresentPerfectHe(result2[0].conjugation_tables.conditional[2].forms[2][0])\n setConditionalPresentPerfectHeResult(result2[0].conjugation_tables.conditional[2].forms[2][1])\n setConditionalPresentPerfectWe(result2[0].conjugation_tables.conditional[2].forms[3][0])\n setConditionalPresentPerfectWeResult(result2[0].conjugation_tables.conditional[2].forms[3][1])\n setConditionalPresentPerfectYou1(result2[0].conjugation_tables.conditional[2].forms[4][0])\n setConditionalPresentPerfectYou1Result(result2[0].conjugation_tables.conditional[2].forms[4][1])\n setConditionalPresentPerfectThey(result2[0].conjugation_tables.conditional[2].forms[5][0])\n setConditionalPresentPerfectTheyResult(result2[0].conjugation_tables.conditional[2].forms[5][1])\n\n\n /* present Conditional perfect progressive */\n setConditionalPresentPerfectProgressive(result2[0].conjugation_tables.conditional[3].heading.toUpperCase())\n setConditionalPresentPerfectProgressiveI(result2[0].conjugation_tables.conditional[3].forms[0][0])\n setConditionalPresentPerfectProgressiveIRresult(result2[0].conjugation_tables.conditional[3].forms[0][1])\n setConditionalPresentPerfectProgressiveYou(result2[0].conjugation_tables.conditional[3].forms[1][0])\n setConditionalPresentPerfectProgressiveYouResult(result2[0].conjugation_tables.conditional[3].forms[1][1])\n setConditionalPresentPerfectProgressiveHe(result2[0].conjugation_tables.conditional[3].forms[2][0])\n setConditionalPresentPerfectProgressiveHeResult(result2[0].conjugation_tables.conditional[3].forms[2][1])\n setConditionalPresentPerfectProgressiveWe(result2[0].conjugation_tables.conditional[3].forms[3][0])\n setConditionalPresentPerfectProgressiveWeResult(result2[0].conjugation_tables.conditional[3].forms[3][1])\n setConditionalPresentPerfectProgressiveYou1(result2[0].conjugation_tables.conditional[3].forms[4][0])\n setConditionalPresentPerfectProgressiveYou1Result(result2[0].conjugation_tables.conditional[3].forms[4][1])\n setConditionalPresentPerfectProgressiveThey(result2[0].conjugation_tables.conditional[3].forms[5][0])\n setConditionalPresentPerfectProgressiveTheyResult(result2[0].conjugation_tables.conditional[3].forms[5][1])\n\n\n\n\n } catch (e) {\n console.log(e.message)\n }\n\n history.push(`/conjugation/conjugation-verb-${inputValue}.html`)\n\n }", "function addAnnouncements() {\r\n anmtTitle = document.getElementById(\"titleAnmt\").value;\r\n anmtDescr = document.getElementById(\"descrAnmt\").value;\r\n var ul = document.getElementById(\"fullAnnouncements\");\r\n var li = document.createElement(\"li\");\r\n li.appendChild(document.createTextNode(anmtTitle + \" : \" + anmtDescr))\r\n ul.appendChild(li);\r\n}", "function addListItem() {\n let item = document.querySelector(\".item\").value; \n let info = document.querySelector(\".textarea\").value;\n fullList.push({\n \"item\" : item,\n \"info\" : info\n });\n modal.classList.remove(\"open\");\n adauga.classList.remove(\"open\");\n adauga.reset();\n build();\n}", "function keywordForm() {\n document.querySelector('#keyword-button').addEventListener('click', (e) => {\n e.preventDefault();\n var keyword = document.querySelector('#keyword').value\n\n // If no title or description, return early from this function\n if (!keyword) {\n return;\n }\n\n // Add values to firebase database\n firebase.database().ref('takeover/').push({\n keyword: keyword\n });\n\n // Remove value from input after adding it\n document.querySelector('#keyword').value = '';\n\n });\n\n\n // Show the full database value\n\n let listContainer = document.querySelector('.keywords-container');\n let state = {};\n\n firebase.database().ref('takeover/').on('value', function(snapshot) {\n // Pull the list value from firebase\n state.list = snapshot.val();\n renderList(listContainer, state)\n keywordList(state)\n chipperView()\n });\n\n\n}", "function addSuggestionToArray(ev) {\n\n var newSuggestion = inputElement.value;\n\n if(newSuggestion !== '' || newSuggestion !== undefined) {\n\n var isExisting = suggestionIsExisting(newSuggestion);\n\n var isUndefinedText = false;\n if(newSuggestion === 'undefined' || newSuggestion === ''){\n isUndefinedText = true;\n }\n\n\n if(!isExisting && !isUndefinedText){\n initialSuggestions.push(newSuggestion);\n\n traverseSuggestionsArray();\n\n inputElement.value = '';\n }\n\n } else{\n //do nothing\n }\n\n hideAllLiElements();\n inputElement.value = '';\n //console.toLocaleString(newSuggestion);\n }", "function searchDrug(){\n var search_term = \"\";\n __$(\"ulDrugs\").innerHTML = \"\";\n \n if(__$(\"inputTxt\").value.trim().length > 0){\n search_term = __$(\"inputTxt\").value.trim()\n }\n \n // Create Generic Drugs list\n for(var d = 0; d < generics.length; d++){\n if(search_term != \"\"){\n if(!generics[d][0].toLowerCase().match(search_term.toLowerCase())){\n continue;\n }\n }\n \n var li = document.createElement(\"li\");\n li.id = \"option\" + generics[d][0];\n li.innerHTML = generics[d][0];\n li.style.padding = \"15px\";\n\n if(d%2>0){\n li.style.backgroundColor = \"#eee\";\n li.setAttribute(\"tag\", \"#eee\");\n } else { \n li.setAttribute(\"tag\", \"#fff\");\n }\n\n li.setAttribute(\"concept_id\", generics[d][1])\n\n li.onclick = function(){ \n highlightSelected(__$(\"ulDrugs\"), this);\n \n current_concept_id = __$(this.id).getAttribute(\"concept_id\");\n \n __$(\"inputTxt\").value = this.innerHTML;\n askFormulation();\n }\n\n __$(\"ulDrugs\").appendChild(li);\n }\n}", "function addToList(cakeId, cakeName, quantity, selectedText , price, description, productImage) {\n const item = {\n cakeId: cakeId, \n cakeName: cakeName,\n quantity: quantity, \n weight: selectedText, \n price: price, \n description: description,\n productImage: productImage\n }\n formList.push(item);\n console.log(formList);\n// clear the form for the next input \n clearForm();\n console.log(`Total Submission: ${formList.length}`.formList);\n}", "function getInputs(e) {\n\te.preventDefault();\n\tvar subjectSelect = document.getElementById('subject').value;\n\tvar numPara = document.getElementById('paragraphs').value;\n\tvar numSent = document.getElementById('sentences').value;\n\tbuildPara(subjectSelect, numPara, numSent); \n}", "function addAnotherGenre(){\r\n // console.log('adding another genre')\r\n let hiddenVal = '';\r\n let val = document.getElementsByName(\"genreINPUT\");\r\n // console.log(val)\r\n let curVal = val[0].value;\r\n if (curVal === ''){\r\n console.log(\"EMPTY Value\");\r\n return\r\n }\r\n if(!checkgenreVal(val)){\r\n console.log(\"invalid text from genre\")\r\n \r\n val[0].value='';\r\n alert(\"Please enter a valid genre :)\")\r\n \r\n return;\r\n }\r\n\r\n let aDiv = document.getElementById(\"GenreAdd\");\r\n\r\n\r\n for(x in genreList){\r\n if(curVal.toLowerCase() === genreList[x].toLowerCase()){\r\n console.log(\"match\")\r\n curVal = genreList[x];\r\n \r\n }\r\n }\r\n \r\n\r\n\r\n let List = document.getElementById(\"genreList\") \r\n let hiddenElm = document.createElement(\"input\");\r\n hiddenElm.name = \"genreINPUT\";\r\n hiddenElm.type = \"text\";\r\n hiddenElm.value = curVal;\r\n hiddenElm.id = curVal;\r\n // hiddenElm.disabled = true;\r\n hiddenElm.style.display = \"none\";\r\n\r\n\r\n //maybe append the hiddenElm to the li so when it gets deleted \r\n // aDiv.appendChild(hiddenElm); \r\n \r\n let newElm = document.createElement(\"li\");\r\n let ex = document.createElement(\"p\");\r\n \r\n newElm.innerText = curVal;\r\n \r\n newElm.name = \"genre\";\r\n newElm.id = curVal\r\n \r\n ex.className = \"close\";\r\n // ex.innerHTML = \"&times;\";\r\n ex.appendChild(newElm)\r\n // newElm.appendChild(ex);\r\n newElm.appendChild(hiddenElm)\r\n\r\n // List.appendChild(newElm)\r\n List.appendChild(ex);\r\n val[0].value = '';\r\n events();\r\n}", "function adopt(){\n mainSection.innerHTML += adoptForm\n const adoptButton = document.getElementById('adopt-submit')\n adoptButton.addEventListener('click', adoptA)\n hideNameDiv()\n}", "function submitCourse(form) {\n /* create hidden field of selected courses */\n var acForm = document.getElementById(\"acForm\");\n var wantTake = document.getElementById(\"wantTake\").getElementsByTagName(\"li\");\n var alreadyTaken = document.getElementById(\"alreadyTaken\").getElementsByTagName(\"li\");\n /***************************************************/\n var dataArray = new Array;\n for ( i = 0; i < wantTake.length; i++) {\n var id = wantTake[i].id;\n var sid = wantTake[i].getElementsByTagName(\"input\")[0].value;\n var cid = wantTake[i].getElementsByTagName(\"input\")[1].value;\n dataArray.push(new wantTakeCourse(id, sid, cid));\n }\n var json = JSON.stringify(dataArray);\n\n var inp = document.createElement(\"input\");\n inp.setAttribute(\"type\", \"hidden\");\n inp.setAttribute(\"name\", \"wantTakeCourses\");\n inp.setAttribute(\"value\", json);\n acForm.appendChild(inp);\n /***************************************************/\n var dataArray = new Array;\n for ( i = 0; i < alreadyTaken.length; i++) {\n var id = alreadyTaken[i].id;\n var sid = alreadyTaken[i].getElementsByTagName(\"input\")[0].value;\n var cid = alreadyTaken[i].getElementsByTagName(\"input\")[1].value;\n dataArray.push(new wantTakeCourse(id, sid, cid));\n }\n var json = JSON.stringify(dataArray);\n\n var inp = document.createElement(\"input\");\n inp.setAttribute(\"type\", \"hidden\");\n inp.setAttribute(\"name\", \"alreadyTakenCourses\");\n inp.setAttribute(\"value\", json);\n acForm.appendChild(inp);\n /***************************************************/\n\n var dataArray = new Array;\n for ( i = 0; i < wantTake.length; i++) {\n var id = wantTake[i].id;\n // var maxDepth = 1;\n // if (wantTake[i].getElementsByTagName(\"input\")[2])\n \tmaxDepth = wantTake[i].getElementsByTagName(\"input\")[2].value;\n dataArray.push(new ASO(id, maxDepth));\n }\n\n var inpASO = document.createElement(\"input\");\n inpASO.setAttribute(\"type\", \"hidden\");\n inpASO.setAttribute(\"name\", \"aso\");\n inpASO.setAttribute(\"value\", JSON.stringify(dataArray));\n acForm.appendChild(inpASO);\n /***************************************************/\n form.submit();\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 addto() {\n\tCW.add($(\".word input[name='trial']\").val(), $(\".word input[name='definition']\").val(), $(\".word select\").find(\":selected\").attr(\"value\"), ($(\".word input[name='horizontal']\").val() - 1), ($(\".word input[name='vertical']\").val() - 1), $(\".word input[name='symbol']\").val().toUpperCase);\t\n\t// convert value to integer\n\t$(\".alert-success span\").html(+($(\".alert-success span\").text()) + 1);\n\t$('.word')[0].reset();\n\t$(\".alert-warning\").hide()\n\t$(\".alert-success\").hide()\n\t$(\".alert-success\").toggle(\"fast\");\n\tevent.preventDefault();\n}", "updateForm() {\n this.$step.innerText = this.currentStep;\n\n\n this.slides.forEach(slide => {\n slide.classList.remove(\"active\");\n\n if (slide.dataset.step == this.currentStep) {\n slide.classList.add(\"active\");\n }\n });\n\n this.$stepInstructions[0].parentElement.parentElement.hidden = this.currentStep >= 5;\n this.$step.parentElement.hidden = this.currentStep >= 5;\n let categories = form.querySelectorAll(\"input[type='checkbox']:checked\");\n\n let categoriesText = [];\n for (let checkbox of categories) {\n categoriesText.push(checkbox.parentNode.lastElementChild.textContent);\n }\n\n console.log(categoriesText);\n\n let bagQuantityElement = form.querySelector(\"input[type='number']\").value;\n\n let donationDetails = document.querySelectorAll(\"div[data-step='5'] .summary div[class='form-section'] .summary--text\");\n console.log(donationDetails);\n let numberOfBags = donationDetails[0];\n console.log(bagQuantityElement);\n if (bagQuantityElement < 2) {\n numberOfBags.innerText = bagQuantityElement + \" worek zawierający \" + categoriesText.join(\" oraz \");\n } else if (bagQuantityElement < 5) {\n numberOfBags.innerText = bagQuantityElement + \" worki zawierające \" + categoriesText.join(\" oraz \");\n } else {\n numberOfBags.innerText = bagQuantityElement + \" worków zawierających \" + categoriesText.join(\" oraz \");\n }\n\n let address = form.querySelectorAll(\"div[data-step='4'] div[class='form-section form-section--columns'] input[type='text']\");\n let street = address[0].value;\n let city = address[1].value;\n let zipcode = address[2].value;\n let phone = document.querySelector(\"input[type='phone']\").value;\n let pickUpDate = document.querySelector(\"input[type='date']\").value;\n let pickUpTime = document.querySelector(\"input[type='time']\").value;\n let pickUpComments = document.querySelector(\"textarea\").value;\n\n const contactDetails = form.querySelectorAll(\"div[data-step='5'] .summary div[class='form-section form-section--columns'] ul li\");\n contactDetails[0].innerText = street;\n contactDetails[1].innerText = city;\n contactDetails[2].innerText = zipcode;\n contactDetails[3].innerText = phone;\n contactDetails[4].innerText = pickUpDate;\n contactDetails[5].innerText = pickUpTime;\n contactDetails[6].innerText = pickUpComments;\n\n let institutions = form.querySelector(\"input[type='radio']:checked\").parentNode.lastElementChild.firstElementChild.textContent;\n let institutionText = donationDetails[1];\n institutionText.innerText = \"Dla fundacji \" + institutions;\n }", "function addToListMouse() {\n let text1 = document.getElementById(\"text1\").value;\n if (text1.length > 0) {\n appendToList(text1);\n\n }\n}", "function submit() {\n words.innerHTML = emotionsArray.join(\" - \");\n}", "function addNewValues(){\n event.preventDefault();\n var textValue=$(\"#textBox\").val();\n console.log(textValue);\n topics.push(textValue);\n $(\"#textBox\").val(\"\");\n renderButton();\n\n}", "function getElements() { \n ignoreHyphenatedWordsText = document.getElementById('ignoreHyphenatedWordsText');\n replacementClickableText = document.getElementById('replacementClickableText');\n excludeConjuctionsText = document.getElementById('excludeConjuctionsText');\n excludePronounsText = document.getElementById('excludePronounsText');\n oneWordSynonymsText = document.getElementById('oneWordSynonymsText');\n resetOptionsBtn = document.getElementById('resetOptionsBtn');\n chkConjunctions = document.getElementById('chkConjunctions');\n redoPedantify = document.getElementById('forwardTextBtn');\n percentReplVal = document.getElementById('percReplValue');\n noSynRepText = document.getElementById('noSynRepText');\n percentReplSlider = document.getElementById('slider1');\n undoPedantify = document.getElementById('backTextBtn');\n chkMultiWord = document.getElementById('chkMultiWord');\n chkPronouns = document.getElementById('chkPronouns');\n chkNoRepeat = document.getElementById('chkNoRepeat');\n percRepText = document.getElementById('percRepText');\n excludeWord = document.getElementById('textArea2');\n chkHyphens = document.getElementById('chkHyphens');\n chooseFile = document.getElementById('chooseFile');\n saveBtn = document.getElementById('saveFileLink');\n submitBtn = document.getElementById('submitBtn');\n text_area = document.getElementById('textArea1');\n resetBtn = document.getElementById(\"resetBtn\");\n randBtn = document.getElementById('randBtn');\n minBtn = document.getElementById('minBtn');\n maxBtn = document.getElementById('maxBtn');\n}", "run(){\n \n const form = document.querySelector('#character-creation');\n const btn = document.querySelector('#display-info');\n //save a new character to the list\n form.addEventListener('click', event => {\n \n let target = event.target;\n if(target.type == 'submit') {\n event.preventDefault();\n event.preventDefault();\n console.log('click working');\n \n const form = document.querySelector('#character-creation');\n let character = CharacterFactory.characters(form['character'].value);\n character.name = form['name'].value;\n character.birthPlace = form['birth-place'].value;\n console.log(character);\n CharacterFactory.listOfCharacters.push(character);\n\n form['name'].value = null;\n form['birth-place'].value = null;\n form.querySelector('#other').checked = true;\n btn.classList.remove('hidden');\n btn.classList.add('showing');\n }\n });\n\n // display all character save inside the list\n btn.addEventListener('click', event => {\n const display = document.querySelector('#characters-list ul');\n display.innerHTML = '';\n let stringBuilder = '';\n CharacterFactory.listOfCharacters.forEach(character => {\n stringBuilder += `<li><article> \n <h3 class=\"name\"> ${character.name} </h3>\n <img class=\"obj\" width=\"100\" height=\"100\" src=\"${character.image}\" />\n <div class=\"img\"> \n <span class=\"birth\">Birth: ${character.birthPlace}</span>\n <span class=\"att\">Att: ${character.attack}</span>\n <span class=\"def\">Def: ${character.defense}</span>\n <span class=\"mag\">Mag: ${character.magic}</span>\n <span class=\"type\">Job: ${character.job}</span>\n </div>\n </article></li>`;\n });\n display.insertAdjacentHTML(\"beforeend\", stringBuilder);\n });\n }", "updateForm() {\n this.$step.innerText = this.currentStep;\n\n // TODO: Validation\n\n this.slides.forEach(slide => {\n slide.classList.remove(\"active\");\n\n if (slide.dataset.step == this.currentStep) {\n slide.classList.add(\"active\");\n }\n });\n\n this.$stepInstructions[0].parentElement.parentElement.hidden = this.currentStep >= 6;\n this.$step.parentElement.hidden = this.currentStep >= 6;\n\n /** Get data from inputs and show them in summary */\n const category_array = [];\n this.$checkboxInputs.forEach(function (element) {\n if (element.checked === true) {\n category_array.push(element.value)\n }\n });\n if (this.currentStep === 5) {\n // console.log(this.$fifthStepDiv.querySelectorAll('li')[0].querySelector('span.summary--text').innerText);\n let textLi = this.$fifthStepDiv.querySelectorAll('li');\n textLi[0].querySelector('span.summary--text').innerHTML = this.$bagsInput.value + ' worki zawierające: <br>' + category_array.join(', ');\n this.$divsTitle.forEach(function (element) {\n if (element.parentElement.parentElement.firstChild.nextSibling.checked === true) {\n textLi[1].querySelector('span.summary--text').innerHTML = 'Dla fundacji ' + '\"' + element.innerText + '\"'\n }\n });\n textLi[2].innerHTML = this.$addressInput.value;\n textLi[3].innerHTML = this.$cityInput.value;\n textLi[4].innerHTML = this.$postcodeInput.value;\n textLi[5].innerHTML = this.$phoneInput.value;\n textLi[6].innerHTML = this.$dateInput.value;\n textLi[7].innerHTML = this.$timeInput.value;\n textLi[8].innerHTML = this.$commentTextarea.value;\n\n }\n\n\n }", "function submitForm(event){\n event.preventDefault();\n const arr = [];\n Object.entries(inputs).map(([key,val])=>{\n return arr.push(inputs[key][2])\n })\n Axios.post('/api/words/', arr).then((response)=>{\n history.push('/results/1')\n }).catch(err=>{\n console.log(err);\n })\n }", "function buildIdLists() {\n\n $A( $(\"have\").options ).each( function( opt ) {\n var i = document.createElement( \"input\" );\n i.type = \"hidden\";\n i.name = \"have\";\n i.value = opt.value;\n $(\"domainSearchForm\").appendChild( i );\n } );\n \n $A( $(\"not\").options ).each( function( opt ) {\n var i = document.createElement( \"input\" );\n i.type = \"hidden\";\n i.name = \"not\";\n i.value = opt.value;\n $(\"domainSearchForm\").appendChild( i );\n } );\n\n $('domainSearchForm').submit();\n}", "function addIngredientsFunction() {\n var fieldWrapper = $(\"<div class=\\\"fieldwrapper\\\"/>\");\n var fName = $(\"<textarea id=\\\"ingredients\\\" name=\\\"ingredients\\\" minlength=\\\"1\\\" maxlength=\\\"100\\\" class=\\\"validate materialize-textarea manual-feedback col s11\\\" placeholder=\\\"Example: Milk, Eggs, Chocolate, Flour\\\" required></textarea>\");\n var removeButton = $(\"<button class=\\\"btn remove-btn col s1\\\" value=\\\"-\\\" type=\\\"button\\\"><i class=\\\"fa fa-minus\\\" aria-hidden=\\\"true\\\"></i></button>\");\n var alertDiv = $(\"<div class=\\\"col s12 left-align alert-div\\\"></div>\");\n removeButton.click(function () {\n $(this).parent().remove();\n });\n fieldWrapper.append(fName);\n fieldWrapper.append(removeButton);\n fieldWrapper.append(alertDiv);\n $(\"#ingredientsform\").append(fieldWrapper);\n // Add event listeners when a new item is created (on advice of Xavier, tutor at Code Institute)\n feedbackFocusFunction();\n feedbackChangeFunction();\n }", "function checkSkill(value) {\n //Remove the skill from the select to prevent duplicates\n var select = document.getElementById(\"skill\");\n select.options[select.selectedIndex] = null;\n\n //Locate the outer container for adding\n var container = document.getElementById(\"skillContainer\");\n\n //Create a container for each new skill\n var p = document.createElement(\"p\");\n p.id = \"p\"+value;\n p.classList.add(\"mb04\");\n\n //Hidden input for processing in back-end\n var nameInput = document.createElement(\"input\");\n nameInput.type = \"hidden\";\n nameInput.name = \"skillName[]\";\n nameInput.value = value;\n\n //Create a new select for selecting expertise for each skill\n var expertiseInput = document.createElement(\"select\");\n expertiseInput.classList.add(\"ib\");\n expertiseInput.classList.add(\"nudgeUp\");\n expertiseInput.name = \"skillExpertise[]\";\n expertiseInput.id = value;\n //Loop through possible expertises and add each as an option in the select\n var array = [\"10\",\"9\",\"8\",\"7\",\"6\",\"5\",\"4\",\"3\",\"2\",\"1\"];\n for (var i = 0; i < array.length; i++) {\n var option = document.createElement(\"option\");\n option.setAttribute(\"value\", array[i]);\n option.text = array[i];\n expertiseInput.appendChild(option);\n }\n\n //Create button to remove skill\n var button = document.createElement(\"button\");\n button.id = \"b\"+value;\n button.name = value;\n button.setAttribute(\"onclick\", \"removeSkill(this.name)\");\n button.classList.add(\"button\");\n button.classList.add(\"nudgeUp\");\n button.classList.add(\"fieldButton\");\n button.innerHTML = 'Remove Skill';\n\n //Add all inputs to inner container and append it to outer container\n p.appendChild(document.createTextNode(value + \": \"));\n p.appendChild(nameInput);\n p.appendChild(expertiseInput);\n p.appendChild(button);\n container.appendChild(p);\n}", "function onAddButtonClick(ev) {\n var valueToAdd = textBoxAddControls.value;\n textBoxAddControls.value = \"\";\n addTextStrong.innerHTML = valueToAdd;\n resultList.appendChild(listItems.cloneNode(true));\n }", "function appendToList(text1) {\n let ul1 = document.getElementById(\"ul1\");\n ul1.appendChild(createListItem(text1));\n document.getElementById(\"text1\").value = '';\n}", "function add_activity() {\n\n create_new_activity.style.display = \"block\";\n let new_title = d.getElementById(\"title\");\n let new_desc = d.getElementById(\"desc\");\n let new_goal = d.getElementById(\"goal\");\n let confirm_new_activity = d.getElementById(\"confirm_new_activity\");\n\n function confirm() {\n let newActivity = new Activity();\n newActivity.title = new_title.value;\n newActivity.description = new_desc.value;\n newActivity.current_goal = new_goal.value;\n\n new_title.value = \"\";\n new_desc.value = \"\";\n new_goal.value = \"\";\n\n create_new_activity.style.display = \"none\";\n MyActivities.set(newActivity.title, newActivity);\n sauvegarde();\n list_activities();\n }\n\n confirm_new_activity.addEventListener('click', confirm);\n}", "function submitter(event) {\r\n // prevent the default behaviour of refreshing the page\r\n event.preventDefault();\r\n\r\n console.log(event);\r\n\r\n\r\n let name=event.target.nameField.value;\r\n console.log(name);\r\n\r\n let likes=event.target.likesField.value;\r\n console.log('likes',likes);\r\n \r\n\r\n // make an array for splitting\r\n let likesArray=likes.split(',');\r\n\r\n console.log(likesArray);\r\n\r\n let isGoodWithDogs=event.target.isGoodWithDogs.checked;\r\n console.log(isGoodWithDogs);\r\n\r\n let isGoodWithKids=event.target.isGoodWithKids.checked;\r\n console.log(isGoodWithKids);\r\n\r\n let isGoodWithOtherCats=event.target.isGoodWithCats.checked;\r\n console.log(isGoodWithOtherCats);\r\n\r\n let image='images/'+name+'.jpeg';\r\n \r\n // name, likes, img, isGoodWithKids, isGoodWithDogs, isGoodWithOtherCats, breed\r\n\r\n // new instance of the constructor with the new info\r\n let addedKitten=new Cat(name,likesArray,image,isGoodWithKids,isGoodWithDogs,isGoodWithOtherCats);\r\n console.log(addedKitten);\r\n\r\n // call methods for the added kitten\r\n // addedKitten.getAge();\r\n // addedKitten.render();\r\n\r\n console.log(cats);\r\n \r\n let container=document.getElementById('kittenProfiles');\r\n\r\n container.textContent='';\r\n \r\n for (let i = 0; i < cats.length; i++) {\r\n cats[i].getAge();\r\n cats[i].render();\r\n }\r\n \r\n\r\n}", "function add_spell(){\n let name = document.getElementById('spell_name').value;\n let dura = document.getElementById('duration').value;\n\n let s = new Spell(name, dura);\n s_list.push(s);\n\n document.getElementById('spell_name').value = \"\";\n document.getElementById('duration').value = \"\";\n}", "function lab07firstArrays() {\n // Your code goes in here.\n\t\n // Capture input\n var formInput;\n var formObject;\n \n formObject = document.getElementById('formId');\n formInput = formObject.input.value;\n \n // push input into array\n enteredStuffArray.push(formInput);\n \n // output array items into ol\n var outputBlock;\n outputBlock = document.getElementById('outputOl');\n var fullList = \"\";\n for (var index = 0; index < enteredStuffArray.length; index++) {\n fullList += \"<li>\" + enteredStuffArray[index] + \"</li>\";\n }\n outputBlock.innerHTML = fullList;\n \n return false;\n}", "function appendToWordList(){\n word = $(\"#word-guess\").val();\n $(\"#word-list\").append(`<li>${word}</li>`)\n}", "function recipeHandler(e) {\n e.preventDefault()\n\n titleValue = inputFields[0].value.trim();\n ingriValue = inputFields[1].value.trim();\n instrucValue = inputFields[2].value.trim();\n imgUrl = inputFields[3].value.trim();\n\n if (titleValue == '' || ingriValue == '' || instrucValue == '') {\n alert('Input fields can\\'t be empty')\n return;\n }\n \n const recipeManager = {\n title: titleValue,\n ingri: ingriValue,\n instruc: instrucValue,\n image: imgUrl,\n id : Math.random()\n }\n\n RecipeList.push(recipeManager);\n console.log(RecipeList, recipeManager.title);\n appendRecipe(recipeManager.title, recipeManager.ingri, recipeManager.instruc, recipeManager.image,recipeManager.id)\n clearInput()\n toggleIntroText();\n \n}", "function searchEngine(e){\n\n let input = document.getElementById('search-input');\n let html = '';\n let matchingResults = [];\n let heading = document.querySelector('.search-heading');\n\n// Find Matching Results\n if(input.value === ''){\n\n searchResults.forEach(function(obj){\n heading.textContent = 'Most Visited';\n\n if(obj.frequent === true){\n matchingResults.push(obj);\n }\n })\n } else {\n\n heading.textContent = 'Search Results';\n searchResults.forEach(function(obj){\n if(obj.title.toUpperCase().includes(input.value.toUpperCase())){\n matchingResults.push(obj);\n }\n })\n }\n\n\n\n if(matchingResults.length > 0){\n\n matchingResults.forEach(function(el){\n html += `<li><a class=\"grey-text\" href=\"${el.link}\">${boldString(el.title, input.value)}</a></li>`\n })\n document.querySelector('.popup-list').innerHTML = html;\n } else{\n html = `<li>There are no suggestions for your query.</li>`\n document.querySelector('.popup-list').innerHTML = html;\n }\n\n}", "function createAd(){\n // retrieves inputs\n let title = document.getElementById(\"createTitle\").value;\n let price = document.getElementById(\"createPrice\").value;\n let description = document.getElementById(\"createDescription\").value;\n\n // will handle the image inputs\n let uploadedImages = images;\n\n // removing onclick and opacity attributes\n for(let i = 0; i < uploadedImages.length; i++){\n uploadedImages[i].style.opacity = 1;\n uploadedImages[i].onclick = \"\";\n }\n\n // resets the image holder\n images = [];\n\n // pushes the ad to an array storing ads\n ads.push(new Ad(title, price, description, uploadedImages, currentUser));\n\n toggleView(\"ads\");\n}", "function edit(){\n toggle_all();\n let form = document.getElementById('editform');\n let header = document.createElement('h4');\n header.innerHTML = \"Select Tuning\";\n header.className = 'aaron-header';\n form.appendChild(header);\n\n let selector, option;\n\n //for each string\n for(let i = 6; i >= 1; i--){\n selector = document.createElement('select');\n\n //for each option for each string\n for(let i = 0; i < sounds.length; i++){\n option = document.createElement('option');\n option.text = sounds[i].name;\n selector.add(option);\n }\n\n //adding select element to page\n selector.className = \"w3-select w3-pale-purple\";\n selector.id = \"selector\"+i;\n selector.required = true;\n form.appendChild(selector);\n }\n\n //add confirm button to form\n let button = document.createElement('button');\n button.innerHTML = \"APPLY\";\n button.className = \"w3-btn w3-indigo\"\n button.onclick = confirm_edits;\n form.appendChild(button);\n add_cancel_button('editform');\n}", "function addActor() {\n var actorName;\n var birthday;\n var biography;\n var actorId;\n\n var elementNumFromGetSelItem2;\n var movies = [];\n var movie0, movie1, movie2, movie3, movie4;\n \n var elementNumFromGetSelItem2 = parseInt(strSel2, 10);\n \n\n actorName = document.getElementById(\"actorName\").value;\n console.log(actorName);\n \n birthday = document.getElementById(\"birthday\").value;\n console.log(birthday);\n\n biography = document.getElementById(\"bio\").value;\n console.log(biography);\n\n\n // Getting input for the movie stars associated with the movie, then clear text fields\n if (elementNumFromGetSelItem2 == 5) {\n movie0 = document.getElementById(\"4\").value;\n console.log(movie0);\n\n movies.push(movie0);\n \n // clear text fields\n document.getElementById(\"actorName\").value = \"\";\n document.getElementById(\"bio\").value = \"\";\n document.getElementById(\"birthday\").value = \"\";\n document.getElementById(\"4\").value = \"\";\n \n } else if (elementNumFromGetSelItem2 == 6) {\n movie0 = document.getElementById(\"4\").value;\n console.log(movie0);\n \n movie1 = document.getElementById(\"5\").value;\n console.log(movie1);\n\n //Pushing values to the choices array\n movies.push(movie0, movie1);\n \n // clear text fields\n document.getElementById(\"actorName\").value = \"\";\n document.getElementById(\"bio\").value = \"\";\n document.getElementById(\"birthday\").value = \"\";\n document.getElementById(\"4\").value = \"\";\n document.getElementById(\"5\").value = \"\";\n\n } else if (elementNumFromGetSelItem2 == 7) {\n movie0 = document.getElementById(\"4\").value;\n console.log(movie0);\n \n movie1 = document.getElementById(\"5\").value;\n console.log(movie1);\n\n movie2 = document.getElementById(\"6\").value;\n console.log(movie2);\n\n \n //Pushing values to the choices array\n movies.push(movie0, movie1, movie2);\n \n // clear text fields\n document.getElementById(\"actorName\").value = \"\";\n document.getElementById(\"bio\").value = \"\";\n document.getElementById(\"birthday\").value = \"\";\n document.getElementById(\"4\").value = \"\";\n document.getElementById(\"5\").value = \"\";\n document.getElementById(\"6\").value = \"\";\n\n }else if (elementNumFromGetSelItem2 == 8) {\n movie0 = document.getElementById(\"4\").value;\n console.log(movie0);\n \n movie1 = document.getElementById(\"5\").value;\n console.log(movie1);\n\n movie2 = document.getElementById(\"6\").value;\n console.log(movie2);\n\n movie3 = document.getElementById(\"7\").value;\n console.log(movie3);\n\n \n //Pushing values to the choices array\n movies.push(movie0, movie1, movie2, movie3);\n \n // clear text fields\n document.getElementById(\"actorName\").value = \"\";\n document.getElementById(\"bio\").value = \"\";\n document.getElementById(\"birthday\").value = \"\";\n document.getElementById(\"4\").value = \"\";\n document.getElementById(\"5\").value = \"\";\n document.getElementById(\"6\").value = \"\";\n document.getElementById(\"7\").value = \"\";\n\n }else if (elementNumFromGetSelItem2 == 9) {\n movie0 = document.getElementById(\"4\").value;\n console.log(movie0);\n \n movie1 = document.getElementById(\"5\").value;\n console.log(movie1);\n\n movie2 = document.getElementById(\"6\").value;\n console.log(movie2);\n\n movie3 = document.getElementById(\"7\").value;\n console.log(movie3);\n\n movie4 = document.getElementById(\"8\").value;\n console.log(movie4);\n\n \n //Pushing values to the choices array\n movies.push(movie0, movie1, movie2, movie3, movie4);\n \n // clear text fields\n document.getElementById(\"actorName\").value = \"\";\n document.getElementById(\"bio\").value = \"\";\n document.getElementById(\"birthday\").value = \"\";\n document.getElementById(\"4\").value = \"\";\n document.getElementById(\"5\").value = \"\";\n document.getElementById(\"6\").value = \"\";\n document.getElementById(\"7\").value = \"\";\n document.getElementById(\"8\").value = \"\";\n\n }\n\n console.log(movies);\n \n // Database steps\n var db = firebase.firestore();\n var doc = db.collection(\"Actors\").doc();\n \n \n var actors = {\n createdBy: firebase.auth().currentUser.uid,\n name: actorName,\n movies: movies,\n actorId: doc.id,\n birthday: birthday,\n bio: biography,\n dateCreated: new Date(),\n dateUpdated: new Date()\n };\n \n doc.set(actors);\n \n if (elementNumFromGetSelItem2 == 5) {\n \n document.getElementById(\"4\").remove();\n\n }else if (elementNumFromGetSelItem2 == 6) {\n document.getElementById(\"4\").remove();\n document.getElementById(\"5\").remove();\n \n }else if (elementNumFromGetSelItem2 == 7) {\n document.getElementById(\"4\").remove();\n document.getElementById(\"5\").remove();\n document.getElementById(\"6\").remove();\n\n }else if (elementNumFromGetSelItem2 == 8) {\n document.getElementById(\"4\").remove();\n document.getElementById(\"5\").remove();\n document.getElementById(\"6\").remove();\n document.getElementById(\"7\").remove();\n }else if (elementNumFromGetSelItem2 == 5) {\n document.getElementById(\"4\").remove();\n document.getElementById(\"5\").remove();\n document.getElementById(\"6\").remove();\n document.getElementById(\"7\").remove();\n document.getElementById(\"8\").remove();\n } \n // This will disable the get selected item button\n document.getElementById(\"clicky2\").disabled = false;\n\n document.getElementById(\"actorName\").value = \"\";\n document.getElementById(\"bio\").value = \"\";\n document.getElementById(\"birthday\").value = \"\";\n}", "function addField(){\n\n var subjectPlaceholder = \"Type a few characters and select a subject\";\n var yearPlaceholder = \"Type a few characters and select a year\";\n\n var form = document.getElementById(\"container\");\n //create container\n var div = document.createElement(\"div\");\n div.id = \"field_div_id_\"+fieldSet;\n\n div.innerHTML += \"<h5>Enter your subject</h5>\";\n //create subject field\n var subjectField = document.createElement(\"input\");\n subjectField.type = \"text\";\n subjectField.name = \"field_div_id_\"+fieldSet+\"_subject\";\n subjectField.id = \"field_div_id_\"+fieldSet+\"_subject\";\n subjectField.className = \"form__input\";\n subjectField.placeholder = subjectPlaceholder;\n div.appendChild(subjectField);\n\n div.innerHTML += \"<h5>Enter year</h5>\";\n //create year field\n var yearField = document.createElement(\"input\");\n yearField.type = \"text\";\n yearField.name = \"field_div_id_\" + fieldSet + \"_year\";\n yearField.id = \"field_div_id_\" + fieldSet + \"_year\";\n yearField.className = \"form__input\";\n yearField.placeholder= yearPlaceholder;\n div.appendChild(yearField);\n div.innerHTML += \"<br/>\";\n\n //create hidden counter\n form.appendChild(div);\n\n //Link sources\n $('#field_div_id_'+ fieldSet +'_subject').autocomplete({\n source:searchIndex,\n autoFocus:true\n });\n\n $('#filed_div_id' + fieldSet + '_year').autocomplete({\n source:years,\n autoFocus:true\n });\n\n fieldSet++;\n\n //Reassign click event\n $('#field_div_id_'+ (fieldSet-1)+ '_subject').focusin(function () {\n if (qa_checkbox_val){\n $('#pageslide').show().animate({\n left: '0'\n }, 400 );\n $('body').animate({\n marginLeft: window.innerWidth*0.05\n }, 400 );\n }\n });\n\n $('#field_div_id_'+ (fieldSet-1)+ '_subject').focusout(function () {\n if (qa_checkbox_val){\n var slideWidth = $('#pageslide').outerWidth();\n $('#pageslide').animate({\n left: '-'+slideWidth\n }, 400, function(){\n $('#pageslide').hide();\n } );\n $('body').animate({\n marginLeft: '0'\n }, 400 );\n\n $('.slideIt span').text('☰');\n }\n });\n\n //Re assign tab pressed\n $('#field_div_id_'+(fieldSet-1)+'_year').keydown(function (e) {\n var keyCode = e.keyCode || e.whichj ;\n if (keyCode == 9){\n //Tab pressed\n addField();\n }\n });\n\n //Reveal remove button\n var removeBtn = document.getElementById('removeBtn');\n removeBtn.style.display = \"inline\";\n\n //Reveal submit button\n var submitBtn = document.getElementById('submit');\n submitBtn.style.display = \"inline\";\n}", "function onSubmit(event){\n\n //preventing the form submission to the server\n event.preventDefault(); \n\n //retrieving the user entry\n let compo= retrieve(); \n //console.log(compo); \n \n //converting the user's entry into an array\n stringToArray= (composition) => composition.split(/[,.]/g).map(item => item.trim());\n let compoArray= stringToArray(compo); \n //console.log(compoArray); \n\n //comparing the user's entry with the ingredients array \n // console.log(ingredients); \n let ingredientsFound= document.getElementById('ingredients');\n for (let i= 0; i < ingredients.length; i++){\n \n let comedogenicIngredient = ingredients[i][0];\n console.log(comedogenicIngredient); \n let comedogenicRate = ingredients[i][1]; \n let irritationRate = ingredients[i][2]; \n\n //console.log(`Ingredient from the list : ${comedogenicIngredient}, comedogenic rate : ${comedogenicRate}, irritation rate : ${irritationRate}`); \n\n for (let i=0; i < compoArray.length; i++){\n let userEntryIngredient= compoArray[i];\n console.log(userEntryIngredient); \n //is there any ingredients in the user's entry that matches our list of comedogenic ingredients ? \n if (comedogenicIngredient === userEntryIngredient){\n //Yes, so if it's comedogenic, we display it\n document.getElementById('results').classList.remove('hidden'); \n document.getElementById('form').classList.add('hidden'); \n ingredientsFound.innerHTML+=`<p>${comedogenicIngredient.toUpperCase()}</p>`; \n console.log(\"This user's entry ingredient is comedogenic or irritating\"); \n //And is this ingredient comedogenic ?\n if (comedogenicRate > 0){\n //Yes, so we want to display its rate\n ingredientsFound.innerHTML+= `<span>comedogenic rate : ${comedogenicRate} </span>`; \n }\n //And is this ingredient irritating ?\n if (irritationRate > 0){\n //Yes, so we want to display its rate\n ingredientsFound.innerHTML+= `<span>irritation rate : ${irritationRate}</span>`; \n }\n }\n\n }//end of the user's entry loop\n\n }//end of the ingredient list loop\n\n //Once the comparison is done, if no matching ingredient is found, we want to inform the user that the composition of the product they entered is suitable for acne prone skin\n if (ingredientsFound.innerHTML === \"\"){\n ingredientsFound.innerHTML= \"There is no comedogenic nor irritaing ingredient in the product you entered !\"; \n console.log(\"empty\"); \n }\n\n //And finally, we allow the user to analyze another ingredient \n document.getElementById('start-again').addEventListener('click', function(){\n window.location.reload();\n });\n\n}", "onAddButton(){\n const {input} = this.props.value;\n if(input.length > 0) {\n\n const newValue = {\n ...this.props.value,\n tagsList: [\n ...this.props.value.tagsList,\n input\n ],\n input: ''\n };\n\n this.props.onChange({\n value: newValue\n })\n }\n\n }", "function addListItemsToPage(ev){\n ev.preventDefault()\n // 1. grab the user's input from the form\n const userInput = ev.target.input.value\n // 2. create a new <li> element\n const newLi = document.createElement('li')\n // 3. add the user input into the <li>'s innerText\n newLi.innerText = `${userInput}`\n // 4. append the <li> to the page\n unorderedList.append(newLi)\n}", "function addEnemyFightTogether(){\n fight.removeEventListener('click',fightOneAtATime) //change listener\n fight.addEventListener('click',fightTogether) \n chooseEnemy.style.display = 'block' \n for(let i=0;i<enemyList.length;i++){ \n chosenEnemy.value = i //add choice tags\n chosenEnemy.innerHTML = 'Enemy '+ (i+1) //add choice words\n chooseEnemy.appendChild(chosenEnemy.cloneNode(true)) //add to dropdown list\n }\n fightMechanic.insertBefore(document.createElement('br'),allEnemies)\n addEnemy()\n}", "function addShow(event) {\n // prevent default method to avoid submit form default\n event.preventDefault();\n // Get value of the user's input and save to var\n var input = $(\"#tv-input\").val().trim();\n // Clearing values in input field\n $(\"#tv-input\").val(\"\");\n // push new value into the topics array\n topics.push(input);\n // rerun function to populate buttons\n renderButtons();\n }", "function add_description()\n{\n if(product_description_input.value!= \"\")\n {\n let description = product_description_input.value;\n descriptions.push(description);\n display_descriptions();\n product_description_input.value = \"\";\n product_description_input.classList.remove(\"red_border\");\n }\n}", "function addResourcesInput(e) {\n e.preventDefault();\n // Variables\n let pageElementContainer;\n let resourcesCount;\n let parentArray; /* This is the parentArray */\n\n let pageResourcesInput_div;\n let pageResourcesInput_btn;\n let pageResourcesInput_input;\n let pageResourcesInput_textarea;\n let pageResourcesInput_preview;\n let htmlElementList_container = []; /* Array contains the whole input compound */\n let htmlElementData;\n let htmlElementData_2;\n // Conditions\n if(e.target.dataset.btn === \"btn--add-resources-material\") {\n pageElementContainer = formAddResourcesMaterialContainer;\n resourcesCount = `M${resourcesMaterialCount}:`;\n parentArray = resourcesMaterialElementArray;\n } else if (e.target.dataset.btn === \"btn--add-resources-video\") {\n pageElementContainer = formAddResourcesVideoContainer;\n resourcesCount = `V${resourcesVideoCount}:`;\n parentArray = resourcesVideoElementArray;\n } else if (e.target.dataset.btn === \"btn--add-resources-credits\") {\n pageElementContainer = formAddResourcesCreditsContainer;\n resourcesCount = `C${resourcesCreditsCount}:`;\n parentArray = resourcesCreditsElementArray;\n }\n // const btnResourcesVideoAddInput = document.querySelector('[data-btn=\"btn--add-resources-video\"]');\n\n\n // Create Input Fields\n /*====== Create the container \"form--resources-item\" ======*/\n const pageResourcesInput = document.createElement('div');\n pageResourcesInput.classList.add('form--resources-item');\n \n /*====== EXTRA-MATERIAL: ======*/\n if (e.target.dataset.btn !== \"btn--add-resources-credits\") {\n /*====== (1) URL: - Create the url input // For the credits it is the credit input ======*/\n pageResourcesInput_div = addSectionInput_Form_Elements('div', '', '', pageResourcesInput, '', '', '', '');\n addSectionInput_Form_Elements('p', 'html-gen-instruction', '', pageResourcesInput_div, `${resourcesCount} La url que lleva al material es:`, '', '', '');\n htmlElementData = Math.random();\n pageResourcesInput_input = addSectionInput_Form_Elements('input', 'html-gen-input', '', pageResourcesInput_div, '', 'data-input', htmlElementData, 'text');\n pageResourcesInput_input.spellcheck = false;\n // This EventListener changes the color of the input field as soon as text is entered\n pageResourcesInput_input.addEventListener('change', highlightGlobalInputField);\n // Upload element to array:\n updateSectionElement_childContainer('url', htmlElementData, '', htmlElementList_container, '')\n /*====== (2) TEXTAREA: - Create the textarea for the link text ======*/\n pageResourcesInput_div = addSectionInput_Form_Elements('div', 'd-flex', 'jc-space', pageResourcesInput, '', '', '', '');\n // Textarea\n htmlElementData = Math.random();\n pageResourcesInput_textarea = addSectionInput_Form_Elements('textarea', 'input--text-area-resources', '', pageResourcesInput_div, '1) Ingresa tu texto aquí. 2) Después elige la parte que debe servir como enlace y da click en el button para confirmar tu selección.', 'data-input', htmlElementData, 'text');\n pageResourcesInput_textarea.spellcheck = false;\n // Upload element to array:\n updateSectionElement_childContainer('a', htmlElementData, '', htmlElementList_container)\n // Button\n htmlElementData_2 = Math.random();\n pageResourcesInput_btn = addSectionInput_Form_Elements('button', 'html-gen-btn', 'btn-add-element-from-textarea', pageResourcesInput_div, '<i class=\"fas fa-link\"></i>', 'data-btn', htmlElementData_2, 'text');\n pageResourcesInput_btn.addEventListener('click', getSelectedLink);\n // This EventListener changes the color of the input field as soon as text is entered\n // pageResourcesInput_btn.addEventListener('change', highlightGlobalInputField);\n // Upload element to array:\n updateSectionElement_childContainer('btnSelectLink', htmlElementData_2, '', htmlElementList_container, '')\n /*====== (3) SELECTED LINK PREVIEW: - Create the preview box to display selection ======*/\n pageResourcesInput_div = addSectionInput_Form_Elements('div', 'form__selection', 'textarea-preview', pageResourcesInput, '', '', '', '');\n addSectionInput_Form_Elements('p', 'html-gen-instruction', 'textarea-preview__title', pageResourcesInput_div, `Como enlace se usara la parte:`, '', '', '');\n // Preview box\n htmlElementData = Math.random();\n pageResourcesInput_preview = addSectionInput_Form_Elements('p', 'textarea-preview__text', '', pageResourcesInput_div, '', 'data-output', htmlElementData, '');\n updateSectionElement_childContainer('preview', htmlElementData, '', htmlElementList_container, [])\n } else if (e.target.dataset.btn === \"btn--add-resources-credits\") {\n\n /*====== CREDITS: ======*/\n /*====== (1) CREDIT: - Create the credit input ======*/\n pageResourcesInput_div = addSectionInput_Form_Elements('div', '', '', pageResourcesInput, '', '', '', '');\n addSectionInput_Form_Elements('p', 'html-gen-instruction', '', pageResourcesInput_div, `${resourcesCount} El código del crédito es:`, '', '', '');\n htmlElementData = Math.random();\n pageResourcesInput_input = addSectionInput_Form_Elements('input', 'html-gen-input', '', pageResourcesInput_div, '', 'data-input', htmlElementData, 'text');\n pageResourcesInput_input.spellcheck = false;\n pageResourcesInput_input.placeholder = \"El código debe empezar directamente (sin espacios).\";\n // This EventListener changes the color of the input field as soon as text is entered\n pageResourcesInput_input.addEventListener('change', highlightGlobalInputField);\n // Upload element to array:\n // updateSectionElement_childContainer('credit', htmlElementData, '', htmlElementList_container, '')\n /*====== (2) NUMBER: - Select the position where we split it ======*/\n pageResourcesInput_div = addSectionInput_Form_Elements('div', '', '', pageResourcesInput, '', '', '', '');\n addSectionInput_Form_Elements('p', 'html-gen-instruction', '', pageResourcesInput_div, `¿En que posición quieres agregar el atributo (target=\"_blank\")?`, '', '', '');\n htmlElementData_2 = Math.random();\n pageResourcesInput_input = addSectionInput_Form_Elements('input', 'html-gen-input', 'html-gen-input-filled', pageResourcesInput_div, '', 'data-input', htmlElementData_2, 'text');\n pageResourcesInput_input.spellcheck = false;\n pageResourcesInput_input.type = \"number\";\n pageResourcesInput_input.value = \"3\";\n pageResourcesInput_input.placeholder = \"Solo se acepataran números. Un 0 significa que no quieres agregar el atributo.\";\n // This EventListener changes the color of the input field as soon as text is entered\n pageResourcesInput_input.addEventListener('change', highlightGlobalInputField);\n // Upload element to array with information of both:\n // (1) htmlElementData = credit (2) htmlElementData_2 = position where we splice\n updateSectionElement_childContainer('credit', htmlElementData, htmlElementData_2, htmlElementList_container, '')\n }\n\n// {/* <div class=\"form__selection textarea-preview\">\n// // <p class=\"html-gen-instruction textarea-preview__title\">Como enlace se usara la parte:</p>\n// // <p class=\"textarea-preview__text\" data-output=\"\">.......</p>\n// // </div> */}\n\n // Iterate the counter\n if(e.target.dataset.btn === \"btn--add-resources-material\") {\n resourcesMaterialCount++;\n } else if(e.target.dataset.btn === \"btn--add-resources-video\") {\n resourcesVideoCount++;\n } else if(e.target.dataset.btn === \"btn--add-resources-credits\") {\n resourcesCreditsCount++;\n }\n // Upload our container to the html preview\n pageElementContainer.appendChild(pageResourcesInput);\n parentArray.push(htmlElementList_container);\n \n\n console.log(parentArray);\n}", "function addOpp() {\n\n // Get Data from the input fields\n var newOpp = {\n title: $('#title').val(),\n category: $('#category').val(),\n desc: $('#desc').val(),\n fields: $('#fields').val(),\n period: $('#period').val(),\n }\n\n if ($('#reward-c').val() || $('#reward-h').val()) {\n let rewards = \"\";\n let first = true;\n if ($('#reward-c').val()) {\n rewards = rewards + $('#reward-c').val();\n }\n if ($('#reward-h').val()) {\n if (first) {\n first = false;\n rewards = rewards + $('#reward-h').val();\n } else {\n rewards = rewards + ', ' + $('#reward-h').val();\n }\n }\n newOpp.rewards = rewards;\n }\n\n if ($('#wage').val()) {\n newOpp.wage = $('#wage').val();\n }\n\n // Push new opportunity to the array of opportunities\n opps.push(newOpp);\n\n // display the new array of opportunities\n var oppScript = \"\";\n opps.forEach(function(opp) {\n oppScript = oppScript + '<div class=\"col-md-4 opp-col pb-4\"> <div class=\"opp-container\"> <h3>' + opp.title + '</h3> <p class=\"opp-category\">' + opp.category;\n oppScript = oppScript + '</p> <p class=\"opp-desc\">' + (opp.desc).substring(0, 50) + '...' + '</p> <p class=\"opp-field\">' + opp.fields;\n oppScript = oppScript + '</p> <p class=\"opp-period\">' + 'لمدة ' + opp.period + '</p>';\n if (typeof opp.wage != 'undefined') {\n oppScript = oppScript + '<p class=\"opp-wage\">' + opp.wage + ' ريال ' + '</p>'\n }\n oppScript = oppScript + '<div class=\"text-center\"> <a type=\"button\" class=\"btn\" href=\"opp.html\">التفاصيل</a> </div> </div> </div>'\n });\n $(\".opps-row\").html(oppScript);\n\n $('.message-container').slideDown();\n\n setTimeout(\n function() {\n $('.message-container').slideUp();\n }, 3000);\n\n // $('.message').append('<div class=\"message-container fixed-top\">تم إضافة الفرصة بنجاح!</div>');\n //\n // setTimeout(\n // function() {\n // $('.message').empty();\n // }, 5000);\n\n}", "function bookForm() {\n\n var c = [];\n\n c.push(\" <form class='w3-container w3-border w3-border-amber'>\");\n c.push(\"<br><span style='width: 8em; display: inline-block' class='w3-amber'>Title : </span><input type='text' required id='currentTitle' size='50' ><br>\");\n c.push(\"<span style='width: 8em; display: inline-block' class='w3-amber'>Author : </span><input type='text' required id='currentAuthor' size='50' ><br>\");\n c.push(\"<span style='width: 8em; display: inline-block' class='w3-amber'>Category : </span><input type='text' required id='currentCategory' size='50' ><br>\");\n c.push(\"<span style='width: 8em; display: inline-block' class='w3-amber'>Format : </span><input type='text' required id='currentFormat' size='50' ><br><br>\");\n c.push(\"<button type='button' id='add' class='w3-button w3-xlarge w3-border w3-border-amber w3-round-xxlarge'>Add book</button><br><br>\");\n c.push(\"</form>\");\n c.push(\"<br><p id='message' class='w3-amber w3-large'></p>\");\n\n\n $('#book').html(c.join(\"\"));\n\n document.getElementById(\"add\").onclick = function () {\n addBook();\n };\n\n }", "function addNewLiOnClick() {\n document.querySelector('form').addEventListener('click', function(event){\n addNewElementAsLi();\n input.value = \"\";\n });\n}", "function wraper() {\r\n if (div.length < 1) { // Solo crea el formulario una vez\r\n newElement('h2', 'VIAJE', div);\r\n newElement('label', 'Nombre: ', div);\r\n newElement('input', 'undefined', div, {'type': 'text', 'name': 'Nombre'});\r\n newElement('br', 'undefined', div);\r\n newElement('label', 'Descripcion: ', div);\r\n newElement('input', 'undefined', div, {'type': 'text', 'name': 'Descripcion'});\r\n newElement('br', 'undefined', div);\r\n newElement('label', 'Moneda: ', div);\r\n newElement('select', 'undefined', div, {'name': 'Frutas', 'id': 'curList'});\r\n newElement('br', 'undefined', div);\r\n newElement('input', 'undefined', div, {'type': 'submit', 'value' : 'ENVIAR' ,'class' : 'button', 'accesskey' : 'e'});\r\n newElement('br', 'undefined', div);\r\n let optionsList = document.getElementById('curList');\r\n addItems([\"Manzana\", \"Banana\"], optionsList)\r\n }\r\n}", "function addNewJoke() {\n let jokeToBeAdded = document.getElementById(IDaddJokeEx1Field).value;\n jokeFacade.addJoke(jokeToBeAdded);\n makeListItems();\n document.getElementById(IDprintJokeEx1P).innerHTML = jokeToBeAdded;\n\n // Clear text field\n document.getElementById(IDaddJokeEx1Field).value = \"\";\n}", "addWords(words) {}", "clicked() {\n const el_age_A = this.age_of_death_aTarget\n const el_year_A = this.year_of_death_aTarget\n const el_age_B = this.age_of_death_bTarget\n const el_year_B = this.year_of_death_bTarget\n\n const el_answer1 = this.answer1Target\n const el_answer2 = this.answer2Target\n const el_answer3 = this.answer3Target\n\n const age_A = el_age_A.value\n const year_A = el_year_A.value\n const age_B = el_age_B.value\n const year_B = el_year_B.value\n\n // Process for div#answer1\n this.people(\"A\", age_A, year_A)\n let killed_by_A = this.killed \n let answer_for_1 = this.answer\n el_answer1.innerHTML = answer_for_1\n\n // Process for div#answer2\n this.people(\"B\", age_B, year_B)\n let killed_by_B = this.killed \n let answer_for_2 = this.answer\n el_answer2.innerHTML = answer_for_2\n \n // Process for div#answer3\n let persons = [killed_by_A, killed_by_B]\n this.average(persons)\n let answer_for_3 = this.answer\n el_answer3.innerHTML = answer_for_3\n }", "function saveMentorForm(e) {\n e.preventDefault();\n var category = document.getElementById(\"category\").value;\n var paragraph = document.getElementById(\"paragraph\").value;\n saveMentor(category, currentMentor.fullName, currentMentor.job, currentMentor.company, paragraph, currentMentor.img, currentMentor.mail, currentMentor.linkedinLink, currentMentor.linkedinID);\n}", "function addListItem(e){\n e.preventDefault(); //prevent default event w/ form, submit event\n var newItem=$(\".toDoItem\").val(); //store the user's input\n itemId += 1;\n $(\".toDo\").append(\"<li class='item-\"+itemId+\"'>\"+newItem+\"</li>\");\n //use append method to add user's input to the ul as an li\n clearInput();\n toDoCount();\n\n}", "function animeListActions (e) {\n\te.preventDefault();\n\t\n\t//Removing request from database\n\tconst animeName = e.target.parentElement.parentElement.firstElementChild.innerText;\n\tlet modAnimeName = animeName.slice();\n\tmodAnimeName = modAnimeName.replace(/ /g, \"_\");\n\tconst deleteRequestUrl = '/suggestInfo/' + modAnimeName;\n\tconst deleteRequest = new Request(deleteRequestUrl, {\n method: 'delete'\n });\n\tfetch(deleteRequest)\n\t.then((res) => {\n\t\tif (res.status != 200) {\n\t\t\talert(\"There was an issue in removing the suggestion from the database\")\n\t\t}\n\t})\n\t\n\tconst animeElement = document.createElement('p');\n\tlet animePhrase = null;\n\tif (e.target.classList.contains('AddAnime')){ \n\t\t//Adding new anime to database\n\t\tconst url = '/animeInfo';\n\t\tlet data = {\n\t\t\tname: e.target.parentElement.parentElement.firstElementChild.innerText,\n\t\t\tdescription: e.target.parentElement.parentElement.children[1].innerText,\n\t\t\timageURL: e.target.parentElement.parentElement.children[2].firstElementChild.src,\n\t\t\taverageScore: 0,\n\t\t\tnReviews: 0\n\t\t};\n\t\n\t\tconst suggestion = new Request(url, {\n\t\t\tmethod: 'post', \n\t\t\tbody: JSON.stringify(data),\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});\n\t\n\t\tfetch(suggestion)\n\t\t.then(function(res) {\n\t\t\tif (res.status === 200) {\n\t\t\t\tanimePhrase = document.createTextNode(animeName + \" is being added to the anime list. Please wait.\");\n\t\t\t\tanimeElement.appendChild(animePhrase);\n\t\t\t\tsetTimeout(pageRefresh, 2000);\n \n\t\t\t} else {\n\t\t\t\tanimePhrase = document.createTextNode('The suggestion has failed to upload.');\n\t\t\t\tanimeElement.appendChild(animePhrase);\n\t\t\t}\n\t\t\t\n\t\t}).catch((error) => {\n\t\t\tanimePhrase = document.createTextNode('The suggestion has failed to upload.');\n\t\t\tanimeElement.appendChild(animePhrase);\n\t\t});\n\t\t//HTML modifiers\n\t\t\n\t\tconst animeDesc = e.target.parentElement.parentElement.children[2].innerText;\n\t\te.target.parentElement.parentElement.parentElement.removeChild(e.target.parentElement.parentElement);\n\t} else if (e.target.classList.contains('IgnoreAnime')) {\n\t\tanimePhrase = document.createTextNode(animeName + \" has not been added to the anime list. Please wait\");\n\t\tanimeElement.appendChild(animePhrase);\n\t\te.target.parentElement.parentElement.parentElement.removeChild(e.target.parentElement.parentElement);\n\t\tsetTimeout(pageRefresh, 2000);\n\t}\n\tif (animeChanged == false) {\n\t\tanimeChanged = true;\n\t\tanimeManager.appendChild(animeElement);\n\t} else {\n\t\tanimeManager.removeChild(animeManager.children[2])\n\t\tanimeManager.appendChild(animeElement);\n\t}\n}", "function fillForm(event, dogObj){// we need to get the dogs info so we pass in the dogobj here and line 33\nevent.preventDefault()\n// Pseudocode: \n// click on edit button\n// target the form\nlet form = document.getElementById(\"dog-form\") \n// target the name input\nlet inputName = document.querySelector(\"input[name=name]\")// \ninputName.value = dogObj.name\n// target the breed input\nlet inputBreed = document.querySelector(\"input[name=breed]\")\ninputBreed.value = dogObj.breed\n// target the sex input\nlet inputSex = document.querySelector(\"input[name=sex]\")\ninputSex.value = dogObj.sex\n// Make a dog editable. Clicking on the edit button next to a dog should populate the top form with that dog's current information.\n// add event listener to Form\nform.addEventListener(\"submit\",() => submitForm(event, dogObj, inputName,inputBreed, inputSex)) \n\n}", "function handleGoButtonClick(event) {\n \n addItem1ToList();\n \n domInput1(\"\");\n\n addItem2ToBeginningOfList();\n \n domInput2(\"\");\n \n printListToTextOutput();\n\n}", "function onClickAdd(ev) {\n ev.preventDefault();\n\n const name = inputFields[0].value;\n const hall = inputFields[1].value;\n const ticketPrice = Number(inputFields[2].value);\n if (!name || !hall || !ticketPrice) {\n return;\n }\n\n function createMovie() {\n const ticketsSold = document.createElement('input');\n ticketsSold.placeholder = 'Tickets Sold';\n const button = el('button', 'Archive');\n button.addEventListener('click', e => onClickArchive(e, name, ticketPrice, ticketsSold));\n return el('li',\n el('span', name),\n el('strong', 'Hall: ' + hall),\n el('div',\n el('strong', ticketPrice.toFixed(2)),\n ticketsSold,\n button,\n )\n );\n }\n\n onScreen.appendChild(createMovie());\n inputFields.forEach(e => e.value = '');\n }", "updateForm() {\n this.$step.innerText = this.currentStep;\n\n // TODO: Validation\n\n this.slides.forEach(slide => {\n slide.classList.remove(\"active\");\n\n if (slide.dataset.step == this.currentStep) {\n slide.classList.add(\"active\");\n }\n });\n\n if (this.currentStep === 5) {\n//step4\n const categories = document.getElementsByName('categories');\n const checkedCategories = [];\n for (let i = 0; i < categories.length; i++)\n if (categories[i].checked === true) {\n checkedCategories.push(categories[i].dataset.name);\n }\n\n const bags = document.getElementsByName('bags')[0].value;\n\n const organization = document.getElementsByName('organization');\n const checkedOrganization = [];\n for (let i = 0; i < organization.length; i++) {\n if (organization[i].checked === true) {\n checkedOrganization.push(organization[i].dataset.name);\n }\n }\n\n const address = document.getElementsByName('address')[0].value;\n const city = document.getElementsByName('city')[0].value;\n const postcode = document.getElementsByName('postcode')[0].value;\n const phone = document.getElementsByName('phone')[0].value;\n const date = document.getElementsByName('date')[0].value;\n const time = document.getElementsByName('time')[0].value;\n const more_info = document.getElementsByName('more_info')[0].value;\n\n//step5\n const bags_donation = document.getElementById('bag_donation');\n const organization_name = document.getElementById('organization');\n const address_phone = document.getElementById('address_phone');\n const date_time = document.getElementById('date_time');\n\n bags_donation.innerText = `${bags} worków ${checkedCategories},`;\n\n organization_name.innerText = `Dla ${checkedOrganization}`;\n\n address_phone.children[0].innerHTML = address;\n address_phone.children[1].innerHTML = city;\n address_phone.children[2].innerHTML = postcode;\n address_phone.children[3].innerHTML = phone;\n\n date_time.children[0].innerHTML = date;\n date_time.children[1].innerHTML = time;\n date_time.children[2].innerHTML = more_info;\n }\n this.$stepInstructions[0].parentElement.parentElement.hidden = this.currentStep >= 6;\n this.$step.parentElement.hidden = this.currentStep >= 6;\n\n // TODO: get data from inputs and show them in summary\n }", "function AdressDataList() {\r\n if (userAuthenticated) {\r\n PopupInner.innerHTML = nunjucks.renderString(deliveryAdressList, {adress_list : adressList, url : deliveryAdressURlSet});\r\n PopupWrapper.classList.add('active')\r\n form = PopupInner.querySelector('form')\r\n \r\n formValidate(form)\r\n \r\n let changeButton = PopupInner.querySelectorAll('.change')\r\n for (let i = 0; i < changeButton.length; i++) {\r\n let change = changeButton[i];\r\n change.onclick = () => { AdressChange(i) }\r\n }\r\n let addAdress = PopupInner.querySelector('.add_adress')\r\n addAdress.onclick = () => { AdressBlankForm() }\r\n } else {\r\n if (adressList.length > 0) {\r\n AdressChange(0)\r\n } else {\r\n AdressBlankForm() \r\n }\r\n \r\n }\r\n \r\n}", "function addAdvancedSearch() {\n //Copy the div that is already on the search form\n var oldDiv = $('.search-entry').last();\n\n //Clone the div and append it to the form\n //Passing true should copy listeners, interacts badly with Prototype.\n var div = oldDiv.clone();\n\n oldDiv.parent().append(div);\n\n var inputs = div.find('input');\n var selects = div.find('select');\n\n //Find the index of the last advanced search formlet and inc it\n //I.e. if there are two entries on the form, they should be named advanced[0], advanced[1], etc\n var inputName = inputs.last().attr('name');\n\n //Match the index, parse into integer, increment and convert to string again\n var index = inputName.match(/advanced\\[(\\d+)\\]/)[1];\n var newIndex = (parseInt(index, 10) + 1).toString();\n\n //Reset the selects and inputs\n inputs.val('');\n inputs.attr('name', function () {\n return this.name.replace(/\\d+/, newIndex);\n });\n\n selects.each(function () {\n this.selectedIndex = 0;\n });\n selects.attr('name', function () {\n return this.name.replace(/\\d+/, newIndex);\n });\n\n div.find('.advanced-search-terms').prop('disabled', false);\n //Add the event listener.\n div.find('button.remove_search').click(function () {\n removeAdvancedSearch(this);\n });\n\n handleRemoveButtons();\n }", "function form_submit() {\r\n\t \tvar newAttributeName = $(\"#newAttribute\").val();\r\n\t\tvar newAttributeValue = $(\"#attributeValue\").val();\r\n\t\tif(newAttributeName == ''){\r\n\t\t\t$('#newAttrNameEmptyMsg').show();\r\n\t\t\t\r\n\t\t\t\r\n\t\t}\r\n\t\tif(newAttributeValue == ''){\r\n\t\t\t$('#newAttrValueEmptyMsg').show();\r\n\t\t\t\r\n\t\t}\r\n\t\tvar content = \"<div class='col-md-3'><div class='form-group'><label for='man'>\"+newAttributeName+\"</label>\"\r\n +\"<input type='text' class='form-control' id='\"+newAttributeName+\"Id' value='\"+newAttributeValue+\"'></div></div>\";\r\n\t\tvar i;\r\n\t\tvar flag = true;\r\n\t\tvar newAttributeNames = newAttributeName.toUpperCase();\r\n\t\r\n\t\tfor (i = 0; i < currentAttributeArray.length; ++i) {\r\n\t\t\tif(newAttributeNames == currentAttributeArray [i] ){\r\n\t\t\t\t$('#newAttrNameAlready').show();\r\n\t\t\t\tflag = false;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(flag == true){\r\n\t\t\t$(\"#addAttributeDiv\").append(content);\r\n\t\t\tadditionalAttribute = additionalAttribute + newAttributeName+'~'+newAttributeValue+'?';\r\n\t\t\tcurrentAttributeArray.push(newAttributeNames);\r\n\t\t\t $('.close').trigger('click');\r\n\t \t\t//alert(\"additionalAttribute\"+additionalAttribute);\r\n\t\t}\r\n\t\t\r\n}", "function addAGuest (){\n\tif (originalGuestList.length < 6) {\n\t\toriginalGuestList.push(addGuest.value);\n\t\tprintList.textContent = \"You have added: \" + originalGuestList;\n addGuest.value = \"\";\n numOfGuestNames -= 1;\n\t\tguestCounter.textContent = numOfGuestNames;\n\t} else if (originalGuestList.length = 6){\n\t\tif (addGuest.value != \"\"){\n\t\t\toriginalGuestList.push(addGuest.value);\n\t\t\tprintList.textContent = \"The final guest list is: \" + originalGuestList;\n\t\t\taddGuest.value=\"\";\n\t\t\taddGuest.disabled=true;\n\t\t\tguestNameBtn.disabled=true;\n\t\t\ttoggleHide(guestH1);\n\t\t\ttoggleHide(addGuest);\n\t\t\ttoggleHide(guestNameBtn);\n\t\t\tcont1Btn.classList.remove(\"hide\");\t\n\t\t}\n\t} \n}", "updateForm() {\n this.$step.innerText = this.currentStep;\n\n // TODO: Validation --<< done\n\n var $organizationId = document.querySelectorAll(\"div[data-step='3'] > [data-institution]\");\n var selected_categories_name = [];\n var selected_categories_id = [];\n\n // Create an array of selected categories\n [...document.forms['form'].category].forEach(function (el) {\n if (el.checked) {\n selected_categories_id.push(parseInt(el.value));\n selected_categories_name.push(el.dataset.category_name)\n }\n });\n\n // Changing visibility of organizations, depends from selected categories\n for (let organization of $organizationId) {\n var org_categories = organization.dataset.categories_id.trim().split(' ').map(el => parseInt(el));\n var match_categories = [];\n selected_categories_id.forEach(function (category) {\n if (org_categories.includes(category)) {\n match_categories.push(category);\n }\n if (match_categories.length >= selected_categories_id.length) {\n organization.classList.remove(\"hidden-true\")\n } else {\n organization.classList.add(\"hidden-true\")\n }\n })\n }\n\n this.slides.forEach(slide => {\n slide.classList.remove(\"active\");\n\n if (slide.dataset.step == this.currentStep) {\n slide.classList.add(\"active\");\n }\n });\n\n this.$stepInstructions[0].parentElement.parentElement.hidden = this.currentStep >= 6;\n this.$step.parentElement.hidden = this.currentStep >= 6;\n\n // TODO: get data from inputs and show them in summary --<< done\n\n var $formSelector = document.querySelector(\".form--steps-container form\");\n var $summarySelector = $formSelector.querySelector(\"div [data-step='5']\");\n\n // Adding number of bags to summary\n var $summaryBags = $summarySelector.querySelector(\"div div ul li:nth-child(1)\").children[1];\n var $countBags = $formSelector.querySelector(\"input[name='bags']\");\n // var $categoriesList = $formSelector;\n // console.log($categoriesList);\n var $summaryBagsText = \"\";\n if ($countBags.value === \"1\") {\n $summaryBagsText = `${$countBags.value} worek zawierający: ${selected_categories_name.join(\", \")}`;\n }\n else if (parseInt($countBags.value) > 1 && parseInt($countBags.value) <=4) {\n $summaryBagsText = `${$countBags.value} worki zawierające: ${selected_categories_name.join(\", \")}`;\n }\n else if (parseInt($countBags.value) > 4) {\n $summaryBagsText = `${$countBags.value} worków zawierających: ${selected_categories_name.join(\", \")}`;\n }\n $summaryBags.innerHTML = $summaryBagsText;\n\n // Adding name of institution to summary\n var $allInstitution = $formSelector.querySelectorAll(\"input[name='organization']\");\n var $summaryInstitution = $summarySelector.querySelector(\"div div ul li:nth-child(2)\").children[1];\n var $checkedInstitution = $allInstitution[0];\n $allInstitution.forEach(function (value) {\n if (value.checked) {$checkedInstitution = value}\n });\n var $institutionText = $checkedInstitution.parentElement.querySelector(\"div.title\").innerHTML;\n $summaryInstitution.innerHTML = `Dla: ${$institutionText} z miasta ${$formSelector.city.value}`;\n\n // Adding pick-up address and date, time, more info\n var $summaryAddress = $summarySelector.querySelector(\"div.summary div:nth-child(2) ul\");\n var $summaryTermin = $summarySelector.querySelector(\"div.summary div:nth-child(2) div:nth-child(2) ul\");\n\n $summaryAddress.children[0].innerHTML = $formSelector.address.value;\n $summaryAddress.children[1].innerHTML = $formSelector.city.value;\n $summaryAddress.children[2].innerHTML = $formSelector.postcode.value;\n $summaryAddress.children[3].innerHTML = $formSelector.phone.value;\n $summaryTermin.children[0].innerHTML = $formSelector.data.value;\n $summaryTermin.children[1].innerHTML = $formSelector.time.value;\n $summaryTermin.children[2].innerHTML = $formSelector.more_info.value;\n\n }", "function validate_addition() {\n output = [];\n \n output[0] = \"(\" + document.getElementById('choose_article_title').value + \")\";\n \n var lines = $('textarea#text_area').val().split(/\\n/);\n for (var i=0; i < lines.length; i++) {\n if (/\\S/.test(lines[i])) {\n output.push($.trim(lines[i]));\n }\n }\n \n output[output.length] = document.getElementById('choose_article_n').value;\n \n docname = document.getElementById('doc_name').innerHTML;\n splitdocname = docname.split(\"Documento: \");\n output[output.length] = splitdocname[1];\n \n output[output.length] = document.getElementById('dd_data_hierarchy_doc').options[document.getElementById('dd_data_hierarchy_doc').selectedIndex].text;\n \n if (document.getElementById('dd_livro').options.length > 0 && document.getElementById('dd_livro').options[document.getElementById('dd_livro').selectedIndex].text != \"\") {\n output[output.length] = document.getElementById('dd_livro').options[document.getElementById('dd_livro').selectedIndex].text;\n } else { output[output.length] = '0'; }\n if (document.getElementById('dd_titulo').options.length > 0 && document.getElementById('dd_titulo').options[document.getElementById('dd_titulo').selectedIndex].text != \"\") {\n output[output.length] = document.getElementById('dd_titulo').options[document.getElementById('dd_titulo').selectedIndex].text;\n } else { output[output.length] = '0'; }\n if (document.getElementById('dd_subtitulo').options.length > 0 && document.getElementById('dd_subtitulo').options[document.getElementById('dd_subtitulo').selectedIndex].text != \"\") {\n output[output.length] = document.getElementById('dd_subtitulo').options[document.getElementById('dd_subtitulo').selectedIndex].text;\n } else { output[output.length] = '0'; }\n if (document.getElementById('dd_capitulo').options.length > 0 && document.getElementById('dd_capitulo').options[document.getElementById('dd_capitulo').selectedIndex].text != \"\") {\n output[output.length] = document.getElementById('dd_capitulo').options[document.getElementById('dd_capitulo').selectedIndex].text;\n } else { output[output.length] = '0'; }\n if (document.getElementById('dd_seccao').options.length > 0 && document.getElementById('dd_seccao').options[document.getElementById('dd_seccao').selectedIndex].text != \"\") {\n output[output.length] = document.getElementById('dd_seccao').options[document.getElementById('dd_seccao').selectedIndex].text;\n } else { output[output.length] = '0'; }\n if (document.getElementById('dd_subseccao').options.length > 0 && document.getElementById('dd_subseccao').options[document.getElementById('dd_subseccao').selectedIndex].text != \"\") {\n output[output.length] = document.getElementById('dd_subseccao').options[document.getElementById('dd_subseccao').selectedIndex].text;\n } else { output[output.length] = '0'; }\n if (document.getElementById('dd_divisao').options.length > 0 && document.getElementById('dd_divisao').options[document.getElementById('dd_divisao').selectedIndex].text != \"\") {\n output[output.length] = document.getElementById('dd_divisao').options[document.getElementById('dd_divisao').selectedIndex].text;\n } else { output[output.length] = '0'; }\n if (document.getElementById('dd_subdivisao').options.length > 0 && document.getElementById('dd_subdivisao').options[document.getElementById('dd_subdivisao').selectedIndex].text != \"\") {\n output[output.length] = document.getElementById('dd_subdivisao').options[document.getElementById('dd_subdivisao').selectedIndex].text;\n } else { output[output.length] = '0'; }\n \n var jsonString = JSON.stringify(output);\n if (confirm(\"Tem a certeza?\")) {\n var jsonString = JSON.stringify(output);\n $.ajax({\n type: \"POST\",\n url: \"http://localhost/BasicSite/model_save_file/save_addition_file\",\n data: {data : jsonString}, \n cache: false,\n\n success: function(){\n var split = window.location.pathname.split(\"/\");\n window.location.replace(window.location.protocol + \"//\" + window.location.host + \"/\" + split[1] + \"/backend/main_alteration\");\n }\n });\n } else {\n }\n}", "function addFields(){\n var container = document.getElementById(\"container\");\n var numOfPlayers = 10;\n\tdocument.getElementById(\"submit\").disabled = true;\n getData(); // Get the spells from API first\n\n\t// No textfields -> make textfields\n if (!newGame) {\n for (var i=0; i<numOfPlayers; i++) {\n var input = document.createElement(\"INPUT\");\n var datalist = document.createElement(\"DATALIST\");\n input.setAttribute(\"class\", \"champInput\");\n input.setAttribute(\"id\", \"champInput\" + i);\n input.setAttribute(\"list\", \"champions\" + i);\n input.setAttribute(\"placeholder\", \"Champion \" + (i+1));\n datalist.setAttribute(\"id\", \"champions\" + i);\n addChampsToField(datalist);\n container.appendChild(input);\n container.appendChild(datalist);\n }\n document.getElementById(\"submit\").style.display = \"inline-block\";\n newGame = true;\n }\n\n\t// Textfields -> clear existing ones\n\telse {\n var inputs = document.getElementsByClassName(\"champInput\");\n for (var i=0; i<inputs.length; i++) {\n inputs[i].value = \"\";\n }\n document.getElementById(\"results\").innerHTML = \"\";\n }\n}", "function addForm(){\r\n\r\n console.log(\"in the addform function\");\r\n //create variables to store the values from the form\r\n\r\n const name = document.querySelector(\"#full_name\").value;\r\n const email = document.querySelector(\"#email\").value;\r\n const tourPackage = document.querySelector(\"#tour_package\").value;\r\n const arrivalDate = document.querySelector(\"#arrival_date\").value;\r\n const paxNum = document.querySelector(\"#num_pax\").value;\r\n const discount = document.querySelector(\"#discount\").value;\r\n //check if any of the checkbox is checked, radio\r\n // if check is NOT true \r\n if(!isChecked) {\r\n //Show custom built -in validation message\r\n document.querySelector(\"#c_food\").setCustomValidity(\"Please select at least one experience\");//custom message for validity\r\n document.querySelector(\"#c_food\").reportValidity();//report the message on the screen\r\n }\r\n else\r\n {\r\n //submit the form- in this case: add the form value to an Array\r\n console.log(\"Form is submitted.\");\r\n addToList(name,email, tourPackage, arrivalDate,paxNum,checkboxChecked,discount);\r\n \r\n \r\n }\r\n}", "function add() {\n\n var input = $(this).parents('.little');\n var value = $(input).find('input:text');\n var littleText = $(value).val();\n if (littleText === '') {\n blankAlert();\n } else {\n\n var short = document.createElement('div');\n short.className = 'little little-new';\n\n var span = document.createElement('span');\n span.className = 'text';\n var toDo = document.createElement('h5');\n var p = value.closest('.to-do');\n var text = ' ' + littleText;\n $(span).append(text);\n var compl = $(p).children('.little-complete');\n var done = $(p).children('.done');\n var del = document.createElement('i');\n del.className = 'fa fa-minus-circle delete';\n var checkbox = document.createElement('input');\n checkbox.type = \"checkbox\";\n checkbox.className = 'little-check';\n // checkbox\n $(toDo).append(checkbox).append(span).append(del);\n\n $(short).append(toDo).toggle();\n $(p).append(short, input, compl, done);\n $(value).val('');\n value.select();\n };\n }", "function addListAfterClick(){\n\tif (inputLength() > 0) { //makes sure that an empty input field doesn't create a li\n\t\tcreateListElement();\n\t}\n}", "function addDogToEditForm(dogId, dogName, dogBreed, dogSex) {\n let dogForm = document.getElementById('dog-form')\n dogForm.children[0].value = dogName\n dogForm.children[1].value = dogBreed\n dogForm.children[2].value = dogSex\n dogForm.addEventListener(\"submit\", (e) => {\n e.preventDefault()\n updatedName = dogForm.children[0].value\n updatedBreed = dogForm.children[1].value\n updatedSex = dogForm.children[2].value\n let body = {\n name: updatedName,\n breed: updatedBreed,\n sex: updatedSex\n }\n let dogRow = document.querySelector(`tr[data-id=\"${dogId}\"]`)\n dogRow.children[0].innerHTML = updatedName\n dogRow.children[1].innerHTML = updatedBreed\n dogRow.children[2].innerHTML = updatedSex\n sendEditedDog(body, dogId)\n })\n}", "function addByClick(){\r\n\tif (inputValueLength())\r\n\t{\r\n\tinputItemsName()\r\n\t}\r\n}", "function saveList() {\n $('#custom-words .alert').alert('close');\n \n // Check to make sure that all words are only composed of\n // characters that we support.\n var pattern = new RegExp(\"^[a-zA-Z 0-9]*$\");\n var list = $(\"#list-entries\").children(\"tr\");\n var okay = true;\n var count = 0;\n var emptyRows = [];\n\n // Must have a list name\n var nameControl = $('#div_id_name');\n var name = nameControl.children().children(\"#id_name\").val().trim();\n if (name.length == 0) {\n okay = false;\n nameControl.addClass(\"error\");\n } else {\n nameControl.removeClass(\"error\");\n }\n if (!okay)\n $('#customlist-form').after(getErrorAlert(\"Enter a list name.\"));\n\n for (var i = 0; i < list.length; i++) {\n if ($(list[i]).is(\":visible\")) {\n var cols = $(list[i]).children(\"td\");\n var input = $(cols[0]).children();\n var text = input.children().children().val().trim(); // dependent on the form of the form\n var def = $(cols[1]).children();\n var defText = def.children().children().val().trim();\n \n // invalid or empty when required\n if ((!pattern.test(text) || text.length > 10) || text.length == 0 && defText.length != 0) {\n okay = false;\n input.addClass(\"error\");\n } else {\n input.removeClass(\"error\")\n }\n // There also must be a definition present\n if (defText.length == 0 && text.length != 0) {\n okay = false;\n def.addClass(\"error\");\n } else {\n def.removeClass(\"error\");\n }\n \n // Count only non-empty rows\n if (text.length != 0 && defText.length != 0) {\n count++;\n } else if (emptyRows.length < NUM_WORDS && text.length == 0 && defText.length == 0) {\n emptyRows.push([input, def]);\n }\n }\n }\n \n // Check whether empty rows are errors\n for (var i = 0; i < emptyRows.length; i++) {\n if (i < NUM_WORDS-count) {\n $.each(emptyRows[i], function(index, col) {\n col.addClass(\"error\");\n });\n } else {\n $.each(emptyRows[i], function(index, col) {\n col.removeClass(\"error\");\n });\n }\n }\n \n if (okay && count >= NUM_WORDS) {\n $('#custom-form').attr('action', '/save-customlist/');\n $('#custom-form').submit();\n $('#save-list').button('loading');\n }\n \n if (!okay)\n $('#customwords-formset').after(getErrorAlert(\"Each word must be paired with a definition.\"));\n if (count < NUM_WORDS)\n $('#customwords-formset').after(getErrorAlert(\"Enter at least 4 words.\"));\n}", "function submitAddTarefa() {\r\n\r\n /* Definicao das variaveis a serem usadas */\r\n let jsPref_1 = document.getElementById('pref_1').value;\r\n let jsPref_2 = document.getElementById('pref_2').value;\r\n let jsPref_3 = document.getElementById('pref_3').value;\r\n let peso1 = document.getElementById('pesoPref_1').value;\r\n let peso2 = document.getElementById('pesoPref_2').value;\r\n let peso3 = document.getElementById('pesoPref_3').value;\r\n let tManha = document.getElementById('turnoManha').checked;\r\n let tTarde = document.getElementById('turnoTarde').checked;\r\n let tNoite = document.getElementById('turnoNoite').checked;\r\n\r\n let turno;\r\n let cor1 = selecionadorCor(jsPref_1);\r\n let cor2 = selecionadorCor(jsPref_2);\r\n let cor3 = selecionadorCor(jsPref_3);\r\n\r\n //actionAddTarefa(\"hist\", \"#caeaf5\", \"mat\", \"#0e91bd \", \"port\", \"#f5deb3\", 1);\r\n\r\n\r\n if (validarInput() == false) {\r\n console.log('ERROR: Missing Field')\r\n }\r\n else {\r\n console.log('Todos campos preenchidos')\r\n btnCloseAdd()\r\n\r\n // Verificacao do turno\r\n if (tManha)\r\n turno = 1\r\n else if (tTarde)\r\n turno = 2\r\n else if (tNoite)\r\n turno = 3\r\n\r\n // Verificacao do peso \r\n if (peso1 > peso2 && peso2 > peso3)\r\n actionAddTarefa(jsPref_1, cor1, jsPref_2, cor2, jsPref_3, cor3, turno)\r\n\r\n else if (peso2 > peso1 && peso1 > peso3)\r\n actionAddTarefa(jsPref_2, cor2, jsPref_1, cor1, jsPref_3, cor3, turno)\r\n\r\n else if (peso3 > peso1 && peso1 > peso2)\r\n actionAddTarefa(jsPref_3, cor3, jsPref_1, cor1, jsPref_2, cor2, turno)\r\n\r\n else if (peso1 > peso3 && peso3 > peso2)\r\n actionAddTarefa(jsPref_1, cor1, jsPref_3, cor3, jsPref_2, cor2, turno)\r\n\r\n else if (peso2 > peso3 && peso3 > peso1)\r\n actionAddTarefa(jsPref_2, cor2, jsPref_3, cor3, jsPref_1, cor1, turno)\r\n\r\n else if (peso3 > peso2 && peso2 > peso1)\r\n actionAddTarefa(jsPref_3, cor3, jsPref_2, cor2, jsPref_1, cor1, turno)\r\n }\r\n\r\n console.log(`================================`);\r\n console.log(`cor1 = ${cor1}`);\r\n console.log(`cor2 = ${cor2}`);\r\n console.log(`cor3 = ${cor3}`);\r\n console.log(`================================`);\r\n}", "function addReview(doc) {\n reviews = getReviews(currentShoe)\n reviews += `<li class=\"list-group-item\">${doc.content}</li>`\n document.getElementById('reviews-list').innerHTML = reviews\n document.getElementById('review-content').value = ''\n formToggle.style.display = \"block\";\n reviewForm.style.display = \"none\";\n}", "updateForm() {\n this.$step.innerText = this.currentStep;\n\n // TODO: Validation\n\n this.slides.forEach(slide => {\n slide.classList.remove(\"active\");\n\n if (slide.dataset.step == this.currentStep) {\n slide.classList.add(\"active\");\n }\n });\n\n this.$stepInstructions[0].parentElement.parentElement.hidden = this.currentStep >= 5;\n this.$step.parentElement.hidden = this.currentStep >= 5;\n\n // TODO: get data from inputs and show them in summary\n var divs = form.querySelectorAll(\"div\");\n var categories = new Array();\n var bags = 0;\n var foundation = \"\";\n var street = \"\";\n var city = \"\";\n var zipCode = \"\";\n var pickDate = \"\";\n var pickTime = \"\";\n var pickComment = \"\";\n var phone = \"\";\n divs.forEach(d=>{\n if (d.dataset.step !== null) {\n if (d.dataset.step == 1) {\n var labels = d.querySelectorAll(\"label\")\n labels.forEach(l=>{\n var input = l.querySelector(\"input\")\n if(input.checked === true){\n categories.push(l.querySelector(\".description\").innerText);\n }\n })\n }\n\n if (d.dataset.step == 2) {\n var input = d.querySelector(\"input\");\n bags = input.value;\n }\n\n if (d.dataset.step == 3) {\n var labels = d.querySelectorAll(\"label\")\n labels.forEach(l=>{\n var input = l.querySelector(\"input\")\n if(input.checked === true){\n foundation = l.querySelector(\".title\")\n .innerText.replace('Fundacja', 'Dla fundacji:');\n }\n })\n }\n\n if (d.dataset.step == 4) {\n street = d.querySelector(\"#street\").value;\n city = d.querySelector(\"#city\").value;\n zipCode = d.querySelector(\"#zipCode\").value;\n // phone = d.querySelector(\"#phone\").value;\n pickDate = d.querySelector(\"#pickUpDate\").value;\n pickTime = d.querySelector(\"#pickUpTime\").value;\n pickComment = d.querySelector(\"#pickUpComment\").value;\n }\n\n if (d.dataset.step == 5) {\n var joinCategories = \"\";\n categories.forEach(c=>{\n joinCategories += c + \", \";\n })\n var bagSpan = d.querySelector(\".icon-bag\").nextElementSibling;\n bagSpan.innerHTML = bags + \" worki: \" + joinCategories.replace(/..$/,\".\");\n d.querySelector(\".icon-hand\").nextElementSibling.innerHTML = foundation;\n d.querySelector(\"#confirm-street\").innerHTML = street;\n d.querySelector(\"#confirm-city\").innerHTML = city;\n d.querySelector(\"#confirm-zipcode\").innerHTML = zipCode;\n d.querySelector(\"#confirm-phone\").innerHTML = \"phone n/a\";\n d.querySelector(\"#confirm-date\").innerHTML = pickDate;\n d.querySelector(\"#confirm-time\").innerHTML = pickTime;\n d.querySelector(\"#confirm-comments\").innerHTML = \"Uwagi: \" + pickComment;\n }\n }\n })\n }", "function addActivity(event) {\r\n event.preventDefault();\r\n let form = event.target;\r\n let memberName = form.name;\r\n let newActivity = form.elements[0].value;\r\n \r\n // add the activity to the object \r\n if (newActivity)\r\n {\r\n let list = document.getElementById(memberName);\r\n let li = document.createElement(\"li\");\r\n li.textContent = newActivity;\r\n list.appendChild(li);\r\n getMember(memberName).activities.push(newActivity);\r\n }\r\n else{\r\n window.alert(\"Please enter an activity\");\r\n return;\r\n }\r\n form.elements[0].value = null;\r\n } // End of callback function addActivity", "function insertCaseTag() {\n var myForm = document.getElementById('person_form');\n var myNotes = document.getElementById('annotation');\n var scrollPosition = myNotes.scrollTop;\n var myListBox = document.getElementById('caseTags');\n var selectedTags = new String(\"\");\n var myEl = document.getElementById('caseTags');\n myEl.removeAttribute('multiple', '');\n myEl.removeAttribute('size', '');\n\n if(myListBox.options.length > 0) {\n var NbSelect = 0;\n for(var i=0; i<myListBox.options.length; i++) {\n if (myListBox.options[i].selected){\n NbSelect++;\n selectedTags += '~~~' + myListBox.options[i].text + \"\\n\";\n }\n }\n selectedTags = selectedTags.toUpperCase(selectedTags);\n\n //IE support\n if (document.selection) {\n myNotes.focus();\n sel = document.selection.createRange();\n sel.text = selectedTags;\n myForm.insert.focus();\n }\n //MOZILLA/NETSCAPE support\n else if (myNotes.selectionStart || myNotes.selectionStart == \"0\") {\n var startPos = myNotes.selectionStart;\n var endPos = myNotes.selectionEnd;\n var strTags = myNotes.value;\n\n myNotes.value = strTags.substring(0, startPos)\n + selectedTags\n + strTags.substring(endPos, strTags.length);\n } else {\n myNotes.value += selectedTags;\n }\n myNotes.focus();\n myNotes.scrollTop = scrollPosition;\n }\n}", "function setSkills(e) {\n e.preventDefault();\n character.skillStats.acrobatics = document.getElementById('acroMODIFY').value;\n character.skillStats.animalHandling = document.getElementById('animalMODIFY').value;\n character.skillStats.arcana = document.getElementById('arcanaMODIFY').value;\n character.skillStats.athletics = document.getElementById('athlMODIFY').value;\n character.skillStats.deception = document.getElementById('deceptMODIFY').value;\n character.skillStats.history = document.getElementById('hisMODIFY').value;\n character.skillStats.insight = document.getElementById('insightMODIFY').value;\n character.skillStats.intimidation = document.getElementById('intimMODIFY').value;\n character.skillStats.investigation = document.getElementById('investMODIFY').value;\n character.skillStats.medicine = document.getElementById('mediMODIFY').value;\n character.skillStats.nature = document.getElementById('natMODIFY').value;\n character.skillStats.perception = document.getElementById('percMODIFY').value;\n character.skillStats.performance = document.getElementById('perfMODIFY').value;\n character.skillStats.persuasion = document.getElementById('persMODIFY').value;\n character.skillStats.religion = document.getElementById('reliMODIFY').value;\n character.skillStats.sleight = document.getElementById('sleightMODIFY').value;\n character.skillStats.stealth = document.getElementById('stealthMODIFY').value;\n character.skillStats.survival = document.getElementById('survMODIFY').value;\n character.loadFlags.emptySkillStatObject = false;\n}", "function catSoftwareOptions(value1, value2, value3)\r\n{\r\n let explanation = document.getElementById(\"explanation-text\");\r\n let buy = document.getElementById(\"buy-text\");\r\n\r\n // clear any existing text\r\n explanation.innerHTML = \"\";\r\n buy.innerHTML = \"\";\r\n\r\n //check the values and act on them\r\n if (value1 === \"yes\")\r\n {\r\n //text for explination pane\r\n let div = document.createElement(\"div\");\r\n let h6 = document.createElement(\"h6\");\r\n let ul = document.createElement(\"ul\");\r\n let li = document.createElement(\"li\");\r\n let headingText = document.createTextNode(\r\n \"Because you use Case CATalyst: \"\r\n );\r\n let text = document.createTextNode(\r\n \"You're in great shape for this!\" +\r\n \" Case CATalyst, with a CaseViewNet license, will\" +\r\n \" give you refresh of all editing changes!\"\r\n );\r\n explanation.appendChild(div); // create a <div> inside explanation\r\n div.appendChild(h6); // create a <h4> inside of the <div>\r\n h6.appendChild(headingText); // add the text to the <h4> element\r\n div.appendChild(ul); // create a <ul> element under the <h4> in the <div>\r\n ul.appendChild(li); // create a <li> element in the <ul>\r\n li.appendChild(text); // add the text to the <li> element\r\n\r\n //text for What to buy pane\r\n let div2 = document.createElement(\"div\");\r\n let h62 = document.createElement(\"h6\");\r\n let ul2 = document.createElement(\"ul\");\r\n let li2 = document.createElement(\"li\");\r\n let headingText2 = document.createTextNode(\r\n \"Because you use Case CATalyst: \"\r\n );\r\n let text2 =\r\n '<a href=\"http://www.stenograph.com\" class=\"badge badge-light\" target=\"_blank\">CaseViewNet License</a>';\r\n buy.appendChild(div2); // create a <div> inside explanation\r\n div2.appendChild(h62); // create a <h4> inside of the <div>\r\n h62.appendChild(headingText2); // add the text to the <h4> element\r\n div2.appendChild(ul2); // create a <ul> element under the <h4> in the <div>\r\n ul2.appendChild(li2); // create a <li> element in the <ul>\r\n li2.innerHTML = text2; // add the text to the <li> element\r\n }\r\n\r\n if (value1 === \"no\")\r\n {\r\n //text for explination pane\r\n let div = document.createElement(\"div\");\r\n let div2 = document.createElement(\"div\");\r\n let h6 = document.createElement(\"h6\");\r\n let ul = document.createElement(\"ul\");\r\n let li = document.createElement(\"li\");\r\n let headingText = document.createTextNode(\r\n \"Because you don't use Case CATalyst: \"\r\n );\r\n let text = document.createTextNode(\r\n \"You'll need a CaseViewNet Cloud Session Code and an Internet connection\"\r\n );\r\n explanation.appendChild(div); // create a <div> inside explanation\r\n div.appendChild(h6); // create a <h4> inside of the <div>\r\n h6.appendChild(headingText); // add the text to the <h4> element\r\n div.appendChild(ul); // create a <ul> element under the <h4> in the <div>\r\n ul.appendChild(li); // create a <li> element in the <ul>\r\n li.appendChild(text); // add the text to the <li> element\r\n\r\n //text for What to buy pane\r\n let h62 = document.createElement(\"h6\");\r\n let ul2 = document.createElement(\"ul\");\r\n let li2 = document.createElement(\"li\");\r\n let headingText2 = document.createTextNode(\r\n \"Because you don't use Case CATalyst: \"\r\n );\r\n let text2 =\r\n '<a href=\"http://www.stenograph.com\" class=\"badge badge-light\" target=\"_blank\">CaseViewNet Cloud Session Code</a>';\r\n buy.appendChild(div2); // create a <div> inside explanation\r\n div2.appendChild(h62); // create a <h4> inside of the <div>\r\n h62.appendChild(headingText2); // add the text to the <h4> element\r\n div2.appendChild(ul2); // create a <ul> element under the <h4> in the <div>\r\n ul2.appendChild(li2); // create a <li> element in the <ul>\r\n li2.innerHTML = text2; // add the text to the <li> element\r\n }\r\n}", "function watchForm() {\n $('.mainButton').click(function (event) {\n event.preventDefault();\n const diet = $('#diet').val();\n const calories = $('#calories').val();\n const exclude = $('#exclude').val();\n getMeals(diet, calories, exclude);\n\n\n })\n}", "function madlibsStart() {\n $(\".code-app\").html(\"\");\n $(\".code-app\").append(`<div class=\"card mx-auto\" style=\"width: 90%;\">\n <div class=\"card-body\">\n <h5 class=\"card-title\">Enter Your Words...</h5>\n <p class=\"card-text word-inputs\"> \n </p>\n <a href=\"#\" id=\"code-button\" class=\"btn btn-primary\">Show Me The MadLib!</a>\n </div>\n </div>`);\n\n //randomly select a madlib from JSON file and add to DOM $(\".word-inputs\")\n generateMadlibs(madlibs);\n\n //get all user values and pass to printMadlibs() along with last element from JSON file (madlibs solution)\n $(\"#code-button\").on(\"click\", () => {\n let array = [\n $(\"#word1\").val() ? $(\"#word1\").val() : \"\",\n $(\"#word2\").val() ? $(\"#word2\").val() : \"\",\n $(\"#word3\").val() ? $(\"#word3\").val() : \"\",\n $(\"#word4\").val() ? $(\"#word4\").val() : \"\",\n $(\"#word5\").val() ? $(\"#word5\").val() : \"\",\n $(\"#word6\").val() ? $(\"#word6\").val() : \"\",\n $(\"#word7\").val() ? $(\"#word7\").val() : \"\",\n $(\"#word8\").val() ? $(\"#word8\").val() : \"\",\n $(\"#word9\").val() ? $(\"#word9\").val() : \"\",\n $(\"#word10\").val() ? $(\"#word10\").val() : \"\",\n $(\"#word11\").val() ? $(\"#word10\").val() : \"\",\n $(\"#word12\").val() ? $(\"#word10\").val() : \"\",\n $(\"#word13\").val() ? $(\"#word10\").val() : \"\",\n $(\"#word14\").val() ? $(\"#word10\").val() : \"\",\n $(\"#word15\").val() ? $(\"#word10\").val() : \"\",\n \"\"\n ];\n printMadlibs(array, lib);\n });\n}", "function addNewSkill(newSkill) {\n\n //var newSkillDashed = newSkill.replace(/\\s+/g, '-').toLowerCase(); // replace spaces with '-' for css classes\n\n newSkill = escapeHtml(newSkill);\n // inject HTML for newly added skill\n $('.gcconnex-skills-skills-list-wrapper').append('<div class=\"gcconnex-skill-entry temporarily-added\" data-skill=\"' + newSkill + '\">' +\n '<span title=\"Number of endorsements\" class=\"gcconnex-endorsements-count\" data-skill=\"' + newSkill + '\">0</span>' +\n '<span data-skill=\"' + newSkill + '\" class=\"gcconnex-endorsements-skill\">' + newSkill + '</span>' +\n '<button class=\"delete-skill\" data-type=\"skill\" onclick=\"deleteEntry(this)\">' + '<i class=\"fa fa-trash-o delete-skill-img\"></i>Delete / Supprimer' + '</button></div>');\n $('.gcconnex-endorsements-input-skill').val(''); // clear the text box\n $('.gcconnex-endorsements-input-skill').typeahead('val', ''); // clear the typeahead box\n $('.gcconnex-endorsements-input-skill').hide(); // hide the text box\n if ( $('.gcconnex-skill-entry:visible').length < 15 ) {\n $('.gcconnex-endorsements-add-skill').show(); // show the 'add a new skill' link\n }\n $('.add-endorsements-' + newSkill).on('click', addEndorsement); // bind the addEndoresement function to the '+'\n $('.retract-endorsements-' + newSkill).on('click', retractEndorsement); // bind the retractEndorsement function to the '-'\n $('.delete-' + newSkill).on('click', deleteSkill); // bind the deleteSkill function to the 'Delete this skill' link\n}", "function addItem(e) {\n e.preventDefault(); // To stop page from reloading, because by default the form tag is going to reload or send the data,\n // to external source, generally server side and prevent keeps it on a client side in this case\n \n const text = (this.querySelector('[name=item]')).value; //this keyword is a form tag in this case, value is the values of the items\n const item = {\n text,\n done: false\n };\n items.push(item) // to put everything we inputted into the empty array;\n populateList(items, itemsList); // Everytime we add item it calls populateList function which is going to create- \n //list of item (<li>) with a label inside of it;\n//To store everything in localeStorage-\n localStorage.setItem('items', JSON.stringify(items)); // everything can be stored as a string only, otherwise browser will \n //convert under the hood to the string using toString method, so to avoid this \n //we have to convert our items going to the localStorage into JSON file.\n //When we go to our localStorage we can see that everything storaed as a big string;\n \n \n this.reset() //to reset all the input we have done\n}", "function addButton() {\n $('#searchButton').on('click', function(event) {\n //console.log('ive been clicked');\n event.preventDefault();\n var newTerm = $('#searchField').val().trim();\n //console.log(newTerm);\n topics.push(newTerm);\n //console.log(topics);\n buttonGenerate(topics);\n });\n}", "function updateValue(){\t\n\t\ttaval = [];\n\t\tlistbuilder.find('span.listbuilder-entry-text').each(function(){\n\t\t\ttaval.push($(this).text());\n\t\t});\n\t\ttaval.push( listbuilder.find('input').val() );\n\t\tel.val( taval.join(options.delimChar) );\n\t}", "function addGames() {\n $(\"#add-game\").on(\"click\", function () {\n event.preventDefault();\n\n gameTitle = $(\"#game-input\").val();\n\n if (gameTitle !== \"\") {\n topics.push(gameTitle);\n }\n\n renderButtons();\n });\n } /// addGames();", "function postAttraction() {\n if (document.getElementById(\"attractionsLimit\").value === \"\") {\n document.getElementById(\"attractionsLimit\").value = \"5\"\n }\n if (document.getElementById(\"attractionsRating\").value === \"\") {\n document.getElementById(\"attractionsRating\").value = \"3.0\"\n }\n document.getElementById(\"adultAttrNum\").value = attrFormAdults;\n document.getElementById(\"optionBestHotel\").value = bestHotel;\n document.getElementById(\"staySearching\").value = attractionsWithStaySearch;\n}", "function buildKeywordLists()\n {\n $(\"#themeKeywords option\").remove();\n $(\"#themeKeywords\").append($(\"#theme-keywords\").find(\"option\").clone().prop(\"selected\", true)).change();\n\n $(\"#placeKeywords option\").remove();\n $(\"#placeKeywords\").append($(\"#place-keywords\").find(\"option\").clone().prop(\"selected\", true)).change();\n\n $(\"#topicKeywords option\").remove();\n $(\"#topicKeywords\").append($(\"#topic-keywords\").find(\"option\").clone().prop(\"selected\", true)).change();\n }", "function loadData(){\n wordlist.innerHTML=\"\";\n\n var data = localData_get('new');\n\n\n \n \n \n for (let item of data) {\n let li = document.createElement('li');\n let li_href=document.createElement('a');\n let li_span = document.createElement('span');\n //li.innerHTML=item;\n li_span.textContent = item;\n li_href.textContent = 'remove';\n li_href.title=\"remove it when you do memorize it.\"\n li_href.style.float=\"right\";\n li_href.href=\"#\";\n li.append(li_span);\n li.append(li_href);\n \n li_href.addEventListener('click', function(element) {\n //searchinput.value=element.target.innerText;\n //translate(element.target.innerText);\n //removeData(element.target.innerText);\n removeData(item);\n element.stopPropagation();\n });\n \n li.addEventListener('click', function(element) {\n searchinput.value=item;\n translate(item);\n \n });\n wordlist.appendChild(li);\n }\n\n \n}", "function addToList() {\n $('#js-shopping-list-form').on('submit', event => {\n event.preventDefault();\n const itemName = $('#shopping-list-entry').val();\n $('.shopping-list').append(createNewItem(itemName));\n $('#shopping-list-entry').val('');\n });\n}", "function add(){\n listItem.innerHTML += \"<li>\"+enterHere.value+\"</li>\"\n enterHere.value = \"\"\n updateToDo()\n}", "function handleAddQuestion() {\n\n\n\n\n if (evaluateQuestion()) {\n\n\n let kof = document.querySelector('.kindofquestionType').value;\n let localStatment = statmentTxtArea.value;\n let localJustify;\n let hintText = questionHint.value;\n\n if (yesRdoBtn.checked) {\n localJustify = true;\n } else if (noRdoBtn.checked) {\n localJustify = false;\n }\n\n let valuesCounter = 0;\n let localOptions = [];\n vals = document.querySelectorAll('.values');\n var options = document.querySelectorAll('.option_content');\n\n options.forEach((val, i) => {\n\n\n\n let option = {\n statment: val.value,\n type: vals[i].value\n }\n\n valuesCounter++;\n localOptions.push(option);\n });\n\n\n\n let ref = database.ref('questions/').push();\n\n let activities = [];\n\n\n activitiesCheckBoxs.forEach((p) => {\n\n if (p.checked) {\n activities.push(p.value);\n }\n\n });\n\n let question = {\n id: ref.key,\n kindOfQuestion: kof,\n statment: localStatment,\n justify: localJustify,\n options: localOptions,\n activities,\n info: hintText,\n father: true\n\n }\n\n ref.set(question).then(\n () => {\n clearForm();\n }\n ).catch((error) => {\n console.log(error);\n });\n\n }\n\n}", "function handleMoodFormSubmit(event) {\n event.preventDefault();\n // Don't do anything if the name fields hasn't been filled out\n if (!red || !pink || !orange || !yellow || !green || !blue || !purple || !brown || !white || !grey) {\n return;\n }\n // Calling the upsertAuthor function and passing in the value of the name input\n upsertMood({\n name: red;\n name: pink;\n name: orange;\n name: yellow;\n name: green;\n name: blue;\n name: purple;\n name: brown;\n name: white;\n name: grey\n }", "function addBulletPoint() {\r\n let tmp1 = document.getElementById(\"temp-listObject\").content.cloneNode(true);\r\n let list = divSelectedSlide.querySelector(\".slide__list\");\r\n selectedSlide.data.list.push(list.value);\r\n\r\n let count = selectedSlide.data.list.length - 1;\r\n let id = count;\r\n\r\n tmp1.querySelector(\".slide__listText\").addEventListener(\"input\", (e) => {\r\n changeSlideList(selectedSlide, e.target, id);\r\n });\r\n\r\n tmp1.querySelector(\".slide__deleteListObj\").addEventListener(\"click\", (e) => {\r\n removeBulletPoint(id);\r\n });\r\n list.appendChild(tmp1);\r\n}", "function agregar(e) {\n e.preventDefault();\n //var ul = $('#list');\n // var inputValue = inputReparto.value;\n var reparto = $('#reparto').val();\n $('#list').append('<li>' + reparto + '</li>');\n // var li = $('li'); \n if (inputValue !== '') {\n li.innerHTML = inputValue\n ul.append('li');\n }\n inputReparto.value = '';\n}", "function prepareSubmission() {\n info_dict[\"language\"] = $('#input-language').val(); // prepare language\n var all_data = {};\n var flag = false;\n // Take details from the form\n $(\"form#info-form :input\").each(function () {\n var input = $(this); //get the object\n if(empty_not_allowed.indexOf(input.attr('id'))!= -1) {\n if(input.val() == \"\") {\n alert(\"Please fill the field \" + input.attr('placeholder'));\n flag = true;\n return false;\n }\n }\n // Save all lists in array by splitting it by comma and removing all spaces around the words\n var list_of_el = input.val().split(\",\");\n list_of_el = list_of_el.map(Function.prototype.call, String.prototype.trim);\n all_data[input.attr('id').split('-')[1]] = list_of_el;\n });\n if (flag) // If one of the must fields in empty, do not sent the data\n return;\n var e = document.getElementById(\"select-function_call_must_char\");\n all_data[\"function_call_must_char\"] = [e.options[e.selectedIndex].value];\n info_dict[\"all_data\"] = all_data;\n console.log(info_dict);\n add_language(info_dict); //Send to server the information collected from contributor\n}", "function createLib() {\n noun1result.textContent = noun1Input.value;\n presenttv1result.textContent = presenttv1Input.value;\n noun2result.textContent = noun2Input.value;\n pasttv1result.textContent = pasttv1Input.value;\n noun3result.textContent = noun3Input.value;\n adjective1result.textContent = adjective1Input.value;\n adverb1result.textContent = adverb1Input.value;\n presenttv2result.textContent = presenttv2Input.value;\n}" ]
[ "0.6291504", "0.6167496", "0.6037546", "0.6015859", "0.599327", "0.5981399", "0.59106576", "0.5880307", "0.58223295", "0.57768416", "0.57426405", "0.5727314", "0.572152", "0.56488866", "0.5647244", "0.56373197", "0.56308115", "0.55923796", "0.55520326", "0.55425507", "0.55364335", "0.55313414", "0.55225116", "0.55062735", "0.5488993", "0.5487924", "0.5484042", "0.5470128", "0.5460233", "0.54570365", "0.54543304", "0.54491854", "0.5439862", "0.54319674", "0.54300684", "0.54214686", "0.5421264", "0.5412766", "0.5407474", "0.54017025", "0.53900033", "0.5386593", "0.5384281", "0.5379756", "0.5371524", "0.5359996", "0.5356465", "0.5354876", "0.5354752", "0.53537846", "0.5352874", "0.53519076", "0.53496724", "0.534568", "0.53424066", "0.5342196", "0.53390104", "0.5334226", "0.5333535", "0.532961", "0.53269255", "0.53202677", "0.53176755", "0.5315755", "0.5314182", "0.5311591", "0.53070116", "0.52992445", "0.529703", "0.52968353", "0.5296376", "0.529472", "0.5294144", "0.5291863", "0.5290304", "0.5290128", "0.5288442", "0.5286862", "0.5285232", "0.5271209", "0.52706605", "0.52677524", "0.52643186", "0.5258501", "0.52510744", "0.52485436", "0.5246176", "0.5245591", "0.5239673", "0.523647", "0.523585", "0.5232637", "0.5229162", "0.52266234", "0.52252877", "0.52252316", "0.52248573", "0.52240324", "0.52232724", "0.5220524" ]
0.63710004
0
Display dog of wisdom
async function renderDog(options) { const styleElement = document.createElement("style"); styleElement.textContent = ` #dog { position: relative; box-shadow: 70px 10px 0 0 rgba(198,134,66,1), 80px 10px 0 0 rgba(198,134,66,1), 100px 10px 0 0 rgba(198,134,66,1), 70px 20px 0 0 rgba(198,134,66,1), 80px 20px 0 0 rgba(198,134,66,1), 90px 20px 0 0 rgba(198,134,66,1), 100px 20px 0 0 rgba(198,134,66,1), 110px 20px 0 0 rgba(198,134,66,1), 80px 30px 0 0 rgba(198,134,66,1), 90px 30px 0 0 #000000, 100px 30px 0 0 rgba(198,134,66,1), 110px 30px 0 0 rgba(198,134,66,1), 120px 30px 0 0 rgba(198,134,66,1), 130px 30px 0 0 #000000, 80px 40px 0 0 rgba(198,134,66,1), 90px 40px 0 0 rgba(198,134,66,1), 100px 40px 0 0 rgba(201,189,189,1), 110px 40px 0 0 rgba(201,189,189,1), 120px 40px 0 0 rgba(201,189,189,1), 130px 40px 0 0 rgba(201,189,189,1), 80px 50px 0 0 rgba(198,134,66,1), 90px 50px 0 0 rgba(201,189,189,1), 100px 50px 0 0 rgba(201,189,189,1), 110px 50px 0 0 rgba(201,189,189,1), 120px 50px 0 0 rgba(201,189,189,1), 80px 60px 0 0 rgba(198,134,66,1), 90px 60px 0 0 rgba(201,189,189,1), 100px 60px 0 0 rgba(201,189,189,1), 110px 60px 0 0 rgba(198,134,66,1), 80px 70px 0 0 rgba(198,134,66,1), 90px 70px 0 0 rgba(201,189,189,1), 100px 70px 0 0 rgba(201,189,189,1), 110px 70px 0 0 rgba(198,134,66,1), 80px 80px 0 0 rgba(198,134,66,1), 90px 80px 0 0 rgba(201,189,189,1), 100px 80px 0 0 rgba(201,189,189,1), 110px 80px 0 0 rgba(198,134,66,1), 80px 90px 0 0 rgba(198,134,66,1), 90px 90px 0 0 rgba(201,189,189,1), 100px 90px 0 0 rgba(201,189,189,1), 110px 90px 0 0 rgba(198,134,66,1), 70px 100px 0 0 rgba(198,134,66,1), 80px 100px 0 0 rgba(198,134,66,1), 90px 100px 0 0 rgba(201,189,189,1), 100px 100px 0 0 rgba(201,189,189,1), 110px 100px 0 0 rgba(198,134,66,1), 70px 110px 0 0 rgba(198,134,66,1), 80px 110px 0 0 rgba(198,134,66,1), 90px 110px 0 0 rgba(201,189,189,1), 100px 110px 0 0 rgba(201,189,189,1), 110px 110px 0 0 rgba(198,134,66,1), 60px 120px 0 0 rgba(198,134,66,1), 70px 120px 0 0 rgba(198,134,66,1), 80px 120px 0 0 rgba(198,134,66,1), 90px 120px 0 0 rgba(201,189,189,1), 100px 120px 0 0 rgba(201,189,189,1), 110px 120px 0 0 rgba(198,134,66,1), 120px 120px 0 0 rgba(198,134,66,1), 130px 120px 0 0 rgba(143,140,140,1), 140px 120px 0 0 rgba(143,140,140,1), 150px 120px 0 0 rgba(143,140,140,1), 30px 130px 0 0 rgba(143,140,140,1), 40px 130px 0 0 rgba(143,140,140,1), 50px 130px 0 0 rgba(143,140,140,1), 60px 130px 0 0 rgba(198,134,66,1), 70px 130px 0 0 rgba(198,134,66,1), 80px 130px 0 0 rgba(198,134,66,1), 90px 130px 0 0 rgba(201,189,189,1), 100px 130px 0 0 rgba(201,189,189,1), 110px 130px 0 0 rgba(198,134,66,1), 120px 130px 0 0 rgba(198,134,66,1), 130px 130px 0 0 rgba(232,232,232,1), 140px 130px 0 0 rgba(232,232,232,1), 150px 130px 0 0 rgba(232,232,232,1), 160px 130px 0 0 rgba(143,140,140,1), 20px 140px 0 0 rgba(143,140,140,1), 30px 140px 0 0 rgba(232,232,232,1), 40px 140px 0 0 rgba(232,232,232,1), 50px 140px 0 0 rgba(198,134,66,1), 60px 140px 0 0 rgba(232,232,232,1), 70px 140px 0 0 rgba(198,134,66,1), 80px 140px 0 0 rgba(232,232,232,1), 90px 140px 0 0 rgba(232,232,232,1), 100px 140px 0 0 rgba(232,232,232,1), 110px 140px 0 0 rgba(198,134,66,1), 120px 140px 0 0 rgba(232,232,232,1), 130px 140px 0 0 rgba(198,134,66,1), 140px 140px 0 0 rgba(201,189,189,1), 150px 140px 0 0 rgba(232,232,232,1), 160px 140px 0 0 rgba(232,232,232,1), 170px 140px 0 0 rgba(143,140,140,1), 10px 150px 0 0 rgba(143,140,140,1), 20px 150px 0 0 rgba(232,232,232,1), 30px 150px 0 0 rgba(232,232,232,1), 40px 150px 0 0 rgba(232,232,232,1), 50px 150px 0 0 rgba(201,189,189,1), 60px 150px 0 0 rgba(232,232,232,1), 70px 150px 0 0 rgba(201,189,189,1), 80px 150px 0 0 rgba(232,232,232,1), 90px 150px 0 0 rgba(232,232,232,1), 100px 150px 0 0 rgba(232,232,232,1), 110px 150px 0 0 rgba(201,189,189,1), 120px 150px 0 0 rgba(232,232,232,1), 130px 150px 0 0 rgba(232,232,232,1), 140px 150px 0 0 rgba(232,232,232,1), 150px 150px 0 0 rgba(232,232,232,1), 160px 150px 0 0 rgba(143,140,140,1), 170px 150px 0 0 rgba(143,140,140,1), 10px 160px 0 0 rgba(143,140,140,1), 20px 160px 0 0 rgba(232,232,232,1), 30px 160px 0 0 rgba(232,232,232,1), 40px 160px 0 0 rgba(232,232,232,1), 50px 160px 0 0 rgba(232,232,232,1), 60px 160px 0 0 rgba(232,232,232,1), 70px 160px 0 0 rgba(232,232,232,1), 80px 160px 0 0 rgba(232,232,232,1), 90px 160px 0 0 rgba(232,232,232,1), 100px 160px 0 0 rgba(232,232,232,1), 110px 160px 0 0 rgba(232,232,232,1), 120px 160px 0 0 rgba(232,232,232,1), 130px 160px 0 0 rgba(232,232,232,1), 140px 160px 0 0 rgba(143,140,140,1), 150px 160px 0 0 rgba(143,140,140,1), 160px 160px 0 0 rgba(232,232,232,1), 170px 160px 0 0 rgba(143,140,140,1), 10px 170px 0 0 rgba(143,140,140,1), 20px 170px 0 0 rgba(232,232,232,1), 30px 170px 0 0 rgba(232,232,232,1), 40px 170px 0 0 rgba(232,232,232,1), 50px 170px 0 0 rgba(232,232,232,1), 60px 170px 0 0 rgba(232,232,232,1), 70px 170px 0 0 rgba(232,232,232,1), 80px 170px 0 0 rgba(232,232,232,1), 90px 170px 0 0 rgba(232,232,232,1), 100px 170px 0 0 rgba(232,232,232,1), 110px 170px 0 0 rgba(232,232,232,1), 120px 170px 0 0 rgba(232,232,232,1), 130px 170px 0 0 rgba(232,232,232,1), 140px 170px 0 0 rgba(232,232,232,1), 150px 170px 0 0 rgba(232,232,232,1), 160px 170px 0 0 rgba(232,232,232,1), 170px 170px 0 0 rgba(143,140,140,1), 10px 180px 0 0 rgba(143,140,140,1), 20px 180px 0 0 rgba(232,232,232,1), 30px 180px 0 0 rgba(232,232,232,1), 40px 180px 0 0 rgba(232,232,232,1), 50px 180px 0 0 rgba(143,140,140,1), 60px 180px 0 0 rgba(232,232,232,1), 70px 180px 0 0 rgba(232,232,232,1), 80px 180px 0 0 rgba(232,232,232,1), 90px 180px 0 0 rgba(232,232,232,1), 100px 180px 0 0 rgba(232,232,232,1), 110px 180px 0 0 rgba(232,232,232,1), 120px 180px 0 0 rgba(232,232,232,1), 130px 180px 0 0 rgba(232,232,232,1), 140px 180px 0 0 rgba(232,232,232,1), 150px 180px 0 0 rgba(232,232,232,1), 160px 180px 0 0 rgba(143,140,140,1), 20px 190px 0 0 rgba(143,140,140,1), 30px 190px 0 0 rgba(143,140,140,1), 40px 190px 0 0 rgba(143,140,140,1), 50px 190px 0 0 rgba(232,232,232,1), 60px 190px 0 0 rgba(232,232,232,1), 70px 190px 0 0 rgba(232,232,232,1), 80px 190px 0 0 rgba(232,232,232,1), 90px 190px 0 0 rgba(232,232,232,1), 100px 190px 0 0 rgba(232,232,232,1), 110px 190px 0 0 rgba(232,232,232,1), 120px 190px 0 0 rgba(232,232,232,1), 130px 190px 0 0 rgba(232,232,232,1), 140px 190px 0 0 rgba(232,232,232,1), 150px 190px 0 0 rgba(232,232,232,1), 160px 190px 0 0 rgba(232,232,232,1), 170px 190px 0 0 rgba(143,140,140,1), 20px 200px 0 0 rgba(143,140,140,1), 30px 200px 0 0 rgba(232,232,232,1), 40px 200px 0 0 rgba(232,232,232,1), 50px 200px 0 0 rgba(232,232,232,1), 60px 200px 0 0 rgba(232,232,232,1), 70px 200px 0 0 rgba(232,232,232,1), 80px 200px 0 0 rgba(232,232,232,1), 90px 200px 0 0 rgba(232,232,232,1), 100px 200px 0 0 rgba(232,232,232,1), 110px 200px 0 0 rgba(232,232,232,1), 120px 200px 0 0 rgba(232,232,232,1), 130px 200px 0 0 rgba(232,232,232,1), 140px 200px 0 0 rgba(232,232,232,1), 150px 200px 0 0 rgba(232,232,232,1), 160px 200px 0 0 rgba(232,232,232,1), 170px 200px 0 0 rgba(143,140,140,1), 30px 210px 0 0 rgba(143,140,140,1), 40px 210px 0 0 rgba(232,232,232,1), 50px 210px 0 0 rgba(232,232,232,1), 60px 210px 0 0 rgba(232,232,232,1), 70px 210px 0 0 rgba(232,232,232,1), 80px 210px 0 0 rgba(143,140,140,1), 90px 210px 0 0 rgba(232,232,232,1), 100px 210px 0 0 rgba(232,232,232,1), 110px 210px 0 0 rgba(232,232,232,1), 120px 210px 0 0 rgba(232,232,232,1), 130px 210px 0 0 rgba(232,232,232,1), 140px 210px 0 0 rgba(232,232,232,1), 150px 210px 0 0 rgba(232,232,232,1), 160px 210px 0 0 rgba(232,232,232,1), 170px 210px 0 0 rgba(143,140,140,1), 30px 220px 0 0 rgba(143,140,140,1), 40px 220px 0 0 rgba(232,232,232,1), 50px 220px 0 0 rgba(232,232,232,1), 60px 220px 0 0 rgba(232,232,232,1), 70px 220px 0 0 rgba(232,232,232,1), 80px 220px 0 0 rgba(143,140,140,1), 90px 220px 0 0 rgba(232,232,232,1), 100px 220px 0 0 rgba(232,232,232,1), 110px 220px 0 0 rgba(232,232,232,1), 120px 220px 0 0 rgba(232,232,232,1), 130px 220px 0 0 rgba(143,140,140,1), 140px 220px 0 0 rgba(232,232,232,1), 150px 220px 0 0 rgba(232,232,232,1), 160px 220px 0 0 rgba(232,232,232,1), 170px 220px 0 0 rgba(143,140,140,1), 40px 230px 0 0 rgba(143,140,140,1), 50px 230px 0 0 rgba(232,232,232,1), 60px 230px 0 0 rgba(232,232,232,1), 70px 230px 0 0 rgba(232,232,232,1), 80px 230px 0 0 rgba(232,232,232,1), 90px 230px 0 0 rgba(143,140,140,1), 100px 230px 0 0 rgba(143,140,140,1), 110px 230px 0 0 rgba(143,140,140,1), 120px 230px 0 0 rgba(143,140,140,1), 130px 230px 0 0 rgba(232,232,232,1), 140px 230px 0 0 rgba(232,232,232,1), 150px 230px 0 0 rgba(232,232,232,1), 160px 230px 0 0 rgba(232,232,232,1), 170px 230px 0 0 rgba(143,140,140,1), 50px 240px 0 0 rgba(143,140,140,1), 60px 240px 0 0 rgba(143,140,140,1), 70px 240px 0 0 rgba(143,140,140,1), 80px 240px 0 0 rgba(143,140,140,1), 90px 240px 0 0 rgba(232,232,232,1), 100px 240px 0 0 rgba(232,232,232,1), 110px 240px 0 0 rgba(232,232,232,1), 120px 240px 0 0 rgba(232,232,232,1), 130px 240px 0 0 rgba(232,232,232,1), 140px 240px 0 0 rgba(232,232,232,1), 150px 240px 0 0 rgba(143,140,140,1), 160px 240px 0 0 rgba(143,140,140,1), 90px 250px 0 0 rgba(143,140,140,1), 100px 250px 0 0 rgba(143,140,140,1), 110px 250px 0 0 rgba(143,140,140,1), 120px 250px 0 0 rgba(143,140,140,1), 130px 250px 0 0 rgba(143,140,140,1), 140px 250px 0 0 rgba(143,140,140,1); height: 10.5px; width: 10.5px; margin-top: 0px; margin-bottom: 300px; margin-left: -10px; } `; document.head.appendChild(styleElement); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getDogTemplate(dog) {\n /* This gets the information but does not work for nulls, would have to implement loops and format correctly\n console.log(dog.shows[0].location);\n console.log(dog.shows[0].medals[0].title);\n return `<li>${dog.name} - ${dog.description} - ${dog.breed} - ${dog.shows[0].location}</li>`;\n */\n return `<li>${dog.name} - ${dog.description} - ${dog.breed} </li>`;\n}", "function sayMyDogs() {\n\tconsole.log(myDogs.join(' and '));\n}", "function showDog(name, breed, weight, handler) {\n // this.name = name;\n // this.breed = breed;\n // this.weight = weight;\n Dog.call(this, name, breed, weight);\n this.handler = handler;\n}", "function bark(doggo) {\n console.log(doggo.name + ' is barking: \"BARK! BARK! BARK!\"');\n}", "function getDescription(dog) {\n console.log(dog.description);\n\n}", "function myDog(husky) {\n console.log(`My dogs name is ${husky}`);\n}", "function myDog(husky) {\n console.log(`My dogs name is ${husky}`);\n}", "function adopt_t(dog) {\n console.log(\"We have adopted a dog: \" + dog.name + \", he/she is \" + dog.age + \" years old \" + (dog.microchipped ? 'vaccinated' : 'not vaccinated') + \" and is \" + (dog.sporty ? 'sporty' : 'not sporty'));\n}", "function Dog () {\n this.legs = 4;\n this.bark = function() {\n return 'arf arf;;\n }\n }", "function renderDogsToPage(dogs){\n dogs.map(renderSingleDogToPage).join('')\n }", "function myDog(husky) {\n console.log(`My dog's name is ${husky}`);\n}", "showDogsBreed(){\r\n const elem = document.querySelector(\".dogsBreed\");\r\n elem.innerHTML = '';\r\n for (let i = 0; i<this.dogsBreed.length; i++){\r\n let li = document.createElement('li');\r\n li.innerHTML = this.dogsBreed[i];\r\n elem.appendChild(li);\r\n }\r\n }", "function getDogTerm(){\n fetch('https://en.wikipedia.org/w/api.php?action=opensearch&origin=*&search=dog&formatversion=2')\n .then(checkStatus)\n .then(response => response.json())\n .then(data => displayDogInfo(data))\n .catch(error => notifyUser(error))\n}", "function dogFunction() {\r\n document.getElementById(\"New_and_This\").innerHTML =\r\n \"Kira has a \" + Kira.Dog_Breed + \" named \" + Kira.Dog_Name;\r\n}", "function dog(treat) {\n\t// prints parameter with strings\n\tprint('I want ' + treat + ' treats');\n}", "function dog(id, coat, nrg, eye, K_){\nthis.id = id;\nthis.color = coat;\nthis.nrg = nrg;\nthis.eyeColor = eye;\nthis.K = K_;\n}", "function Dog() {\n this.name = \"Rupert\";\n this.color = \"brown\";\n this.numLegs = 4;\n }", "function Dog() {\n this.name = \"Rupert\";\n this.color = \"brown\";\n this.numLegs = 4;\n }", "function allDogs() {\n\t// Displays the dogs name on the left in a 'jumbotron'\n\tdocument.getElementById('dogsContainer').innerHTML += '<h3 class=\"jumbotron col-md-4 bg-dark text-center\">' + dogs[i].name + '</h3>';\n\t// Displays an image of the dog itself\n\tdocument.getElementById('dogsContainer').innerHTML += '<img id=\"d' + id.toString() + '\" class=\"img-thumbnail col-md-4 my-dogs\" src=\"' + dogs[i].photo + '\"alt=\"Dog\">'; // ID is incremented automatically\n\t// Displays the remaining information about the dog taken from the array function\n\tdocument.getElementById('dogsContainer').innerHTML += '<ul class=\"jumbotron col-md-4 bg-custom\">' +\n\t'<li><b>ID#:</b> D' + id++ + '</li>' + \n\t'<li><b>Breed:</b> ' + dogs[i].breed + '</li>' + \n\t'<li><b>Colour:</b> ' + dogs[i].color + '</li>' + \n\t'<li><b>Height (cm):</b> ' + dogs[i].height + '</li>' +\n\t'<li><b>Age(Years): </b>' + dogs[i].age + '</li>' + \n\t'<li><b>Job: </b>' + dogs[i].job + '</li>' +\n\t'</ul>';\n}", "function Dog() {\n this.name = \"Albert\";\n this.color = \"blue\";\n this.numLegs = 4;\n }", "function Dog() {\n this.name = \"Albert\";\n this.color = \"brown\";\n this.numLegs = 4;\n }", "function callDog(dogName){\n\tconsole.log(\"Come here Brewster\");\n}", "function displayDogs(count) {\n $('#dogs').empty();\n for(var i=0; i<count; i++) {\n $('#dogs').append(\"<img src='\" + dog(i) + \"' />\");\n }\n}", "showOneHike(hikeName) {}", "function show() {\n best.html(population.pop[0].genes);\n averageFitness.html(population.averageFitness);\n generationNum.html(gNum);\n phrases.html(\"\");\n\n var phrs = \"\";\n\n for (let i = 1; i < population.pop.length && i < nPhrases.val(); i++) {\n phrs += '<span>' + population.pop[i].genes.join(\"\") + '</span>';\n }\n\n phrases.html(phrs);\n }", "function nuggetizer(animal) {\n return `${animal} stix`;\n}", "introduceCat() {\n console.log(`This is ${this._name}. It's a ${this._breed}.`);\n }", "function Dog () {\n this.legs = 4;\n }", "function calculateDogAge(age){\r\n document.writeln(`Your doggie is ${age*7} years old in dog years!`)\r\n}", "function Dog(name,breed,mood,hungry){\n this.name = name\n this.breed = breed\n this.mood = mood\n this.hungry = hungry\n}", "function feedDog(){\r\n\r\n\r\n\r\n\r\n}", "function showWords(){\n return profanities;\n }", "function show(i){\n document.getElementById('word_text').innerHTML = dictionary[i].word;\n document.getElementById('definition').innerHTML = dictionary[i].def;\n document.getElementById('related').innerHTML = dictionary[i].rel;\n}", "function Dog() {\nthis.name = \"Rupert\";\nthis.color = \"brown\";\nthis.numLegs = 4;\n}", "function Dog() {\n this.name = \"Rex\";\n this.color = \"Black\";\n this.numLegs = 4;\n}", "function pet(animal) {\n console.log(`My puppy's name is ${animal}!`)\n}", "function Dog (name, breed, mood, hungry) {\n this.name = name;\n this.breed = breed;\n this.mood = mood;\n this.hungry = hungry;\n}", "function Dog(name, breed, mood, hungry){\n\tthis.name = name;\n\tthis.breed = breed;\n\tthis.mood = mood;\n\tthis.hungry = hungry;\n}", "function dogToHuman(age) {\n console.log(\"The dog is \"+ age*7 +\" in human years\" )\n}", "function Dog({ id, name, image }) {\n return h(\n \"div\",\n { className: \"dog\" },\n h(\"h3\", {}, name, DeleteButton({ id, name })),\n h(\"img\", { src: image, alt: \"\", width: 400, height: 400 })\n );\n}", "function Dog(name, breed, mood, hungry){\n this.name = name;\n this.breed = breed;\n this.mood = mood;\n this.hungry = hungry;\n}", "function renderSingleDogToPage(dog){\n const tableBody = document.querySelector('#table-body')\n tableBody.innerHTML += `<tr data-id=\"${dog.id}\"><td id=\"dog-name\"> ${dog.name} </td> <td id=\"dog-breed\"> ${dog.breed} </td> <td id=\"dog-sex\"> ${dog.sex} </td> <td><button data-id=\"${dog.id}\" id=\"edit-btn\">Edit</button></td></tr>`\n }", "function doggy(name){\n this.name = name;\n }", "function displayBreed(response) {\n console.log(response);\n if (response.status === 'error') {\n $('#results').html(`<p> ${response.message} </p>`)\n }\n else \n $('#results').html(`\n <h2>Look at this dog</h2>\n <img src=\"${response.message}\" class=\"results-img\" alt='image'>`)\n}", "function findDog() {\n\tfor (i = 0; i < animals.length; i++){\n\t\tif (animals[i].species == \"cat\"){\n\t\t\tcats.push(animals[i])\n\t\t}\n\t}\n}", "function Dog(name, breed, mood, hungry) {\n this.name = name;\n this.breed = breed;\n this.mood = mood;\n this.hungry = hungry;\n}", "function Dog(name, breed, mood, hungry) {\n this.name = name;\n this.breed = breed;\n this.mood = mood;\n this.hungry = hungry;\n}", "function displayWord(hangmanWord) {\n\tvar showWord = \"\";\n\tfor (var i = 0; i < hangmanWord.correctLettersGuessed.length; i++) {\n\t\tshowWord += hangmanWord.correctLettersGuessed[i].letterGuessed;\n\t}\n\treturn showWord;\n}", "function Dog(name, age, color) {\n this.name = name;\n this.age = age;\n this.color = color;\n this.bark = function () {\n console.log(\n this.name +\n \" the \" +\n this.age +\n \" year old \" +\n this.color +\n \" dog\" +\n \" just barked!\"\n );\n };\n}", "displayWordInfo() {\r\n this.displayHangman();\r\n this.displayLives();\r\n this.displayLetters();\r\n this.displayLettersToGuess();\r\n }", "function displayDoctors() {\n\n // Reading Doctors file.\n var d = readFromJson('doc');\n\n // For loop to run till all the doctor's are printed.\n for (var i = 0; i < d.doctors.length; i++) {\n\n // Printing doctor's id, name & speciality.\n console.log(d.doctors[i].id + \". \" + d.doctors[i].name + \" (\" + d.doctors[i].special + \")\");\n }\n}", "function dogYears (humanAge){\n //Inpute a human year and spitout a dog year\n //Human age * 7 = dog age\n var dogAge= humanAge*7;\n\n //Print out\n console.log(\"A dog who is \" + humanAge + \" is \" + dogAge + \" in dog years.\");\n}", "function printWord() {\n\n printedWord = \"\\nW O R D: \"\n\n //This loop goes through the word object and grabs the correct values (strings or placeholders) and places them \n //in the printedWord variable.\n for ( let i=0; i<newWord.wordArray.length; i++ ) {\n\n if ( newWord.wordArray[i].boolean == true ) {\n\n printedWord += newWord.wordArray[i].string + \" \"\n } else {\n\n printedWord += newWord.wordArray[i].placeholder + \" \"\n }\n }\n\n //Place the printedWord in the console.\n printedWord += \"\\n\"\n console.log(printedWord)\n}", "function calculateDogAge(dogAge) {\n let humanYears = 7 * dogAge;\n console.log(`Your doggie is ${humanYears} years old in human years!`);\n}", "function showTitle() {\n g.selectAll(\"g\")\n .selectAll(\".cloudword\")\n .transition()\n .duration(300)\n .delay(function (d, i) {\n return 200 * (1 / parseInt(d.value));\n })\n .style(\"opacity\", 0);\n\n g.selectAll(\".womensday-title\")\n .transition()\n .duration(600)\n .attr(\"opacity\", 0);\n\n g.selectAll(\".osm-title\")\n .transition()\n .duration(1200)\n .attr(\"opacity\", 1.0);\n }", "function Dog () {\n this.status = \"\",\n this.color = \"\",\n this.hungry =\"\"\n}", "function listar(){ \n var dog = JSON.parse(tbDogs[tbDogs.length-1]);\n $(\"#vitrine\").append(\n '<div class=\"resultado-dog\">'+\n '<img class=\"img-dog\" src=\"'+dog.Foto+'\">'+\n '<div class=\"texto-foto '+dog.Cor+' '+dog.Font+'\">'+\n '<span>Raça:</span><span class=\"raca-resultado\">'+dog.Raca+'</span><br>'+\n '<span>Nome:</span><span class=\"nome-resultado\">'+dog.Nome+'</span>'+ \n '</div>'+ \n '</div>')\n \n }", "function Dog (name, breed) {\n this.name = name,\n this.breed = breed,\n this.sayName = function (sound) {\n console.log(`My name is ${this.name}. I am a ${this.breed}. I say ${sound}`);\n }\n}", "function displayNoDogs() {\r\n if (\r\n searchValue.toLowerCase() === 'dog' ||\r\n searchValue.toLowerCase() === 'dogs'\r\n ) {\r\n alert('Dogs?! 🙀 Oh the betrayal... ');\r\n }\r\n}", "function showPerson() {\n $('body').find('.name').text(\"Name: \" + muArray[number].name);\n $('body').find('.git').text(\"github: \" + muArray[number].git_username);\n $('body').find('.shoutout').text(\"Shoutout: \" + muArray[number].shoutout);\n }", "function Dog(age, legs, name) {\n this.age = age;\n this.legs = legs;\n this.name = name;\n\n var dogCounter = 0;\n\n this.bark = function() {\n ++dogCounter;\n console.log(`${this.name} barked! Count: ${dogCounter}`);\n }\n}", "function displayGame() {\n getAnimal();\n animalType.innerHTML = gameAnimalType;\n animalToGuess.innerHTML = handleGameWord(gameAnimalExample);\n document.getElementById(\"guess\").focus();\n document.getElementById(\"guess\").select();\n wordWrapper.classList.remove(\"vis-hidden\");\n }", "function dinner(main, side, drink){\n console.log(`For dinner, I had ${main} and ${side}. To wash it down, I had a ${drink}.`);\n }", "function showword(words){\n const randindex = Math.floor(Math.random() * words.length);\n\n //output random word\n currentword.innerHTML = words[randindex];\n}", "function Dog() {\n this.name = \"Rupert\";\n this.color = \"brown\";\n this.numLegs = 4;\n}", "function Dog() {\n this.name = \"Rupert\";\n this.color = \"brown\";\n this.numLegs = 4;\n}", "function Dog () {\n \t//this.bark = function() {\n \t//\treturn 'woof';\n \t//};\n }", "function calculateDogAge(humanYear) {\r\n let dogAge = 7 * humanYear;\r\n console.log(`Your doggie is ${dogAge} years old in dog years!`);\r\n}", "function showWord(words) {\n // Generate random array index\n const randIndex = Math.floor(Math.random() * words.length);\n // Output the random word\n currentWord.innerHTML = words[randIndex];\n}", "function pet(animal){\n console.log(`i have a ${animal} for a pet`);\n}", "function massHysteria(dogs, cats) {\n if (dogs.raining && cats.raining){\n console.log(\"DOGS AND CATS LIVING TOGETHER! MASS HYSTERIA!\")\n }\n}", "eat() {\n return 'Dog is eating!';\n }", "function displayVerbs() {\n // Select all of them in the array\n for (let i = 0; i < images[currentImage].verbs.length; i++) {\n // Create divs for them\n let $verbContainer = $('<div class=\"verbs\"></div>');\n // Put them in the container\n $verbContainer.appendTo(\".verbPool\");\n // Apply the text\n $verbContainer.text(images[currentImage].verbs[i]);\n }\n}", "function Dog(name) {\n this.name = name; \n }", "function displayWoof(show, owner, pet) {\n const woofOwnerHeading = document.querySelector('#owner-woof-heading');\n const petWoofHeading = document.querySelector('#pet-woof-heading');\n //if hiding\n if (!show) {\n //hide all labels and inputs\n document.querySelectorAll('#owner-woof > :not(.sub-headings), #pet-woof > :not(.sub-headings)').forEach(ele => {\n classChange(ele, ['hidden'], []);\n });\n //add current-woof class to headings\n classChange(woofOwnerHeading, ['current-woof'], []);\n classChange(petWoofHeading, ['current-woof'], []);\n //change inner text of heading to reflect owner/pet pairing\n woofOwnerHeading.innerText = `${names.cased.lower[owner]}`;\n petWoofHeading.innerText = `${names.cased.lower[pet]}`;\n } else if (show) { //if displaying\n //remove current-woof class from headings\n classChange(woofOwnerHeading, [], ['current-woof']);\n classChange(petWoofHeading, [], ['current-woof']);\n //reset inner text of headings\n woofOwnerHeading.innerText = 'Owner';\n petWoofHeading.innerText = 'Woof';\n };\n}", "function Dog(name, breed) {\n\t\tthis.name = name;\n\t\tthis.breed = breed;\n}", "function printFruitOrVeggie(word) {\n switch (word) {\n case 'banana':\n case 'apple':\n case 'kiwi':\n case 'cherry':\n case 'lemon':\n case 'grapes':\n case 'peach':\n console.log('fruit'); break;\n case 'tomato':\n case 'cucumber':\n case 'pepper':\n case 'onion':\n case 'parsley':\n case 'garlic':\n console.log('vegetable'); break;\n default:\n console.log('unknown');\n }\n }", "function Dog(name) {\n this.name = name;\n }", "function Dog() {\n this.name = \"Fluffers\";\n this.color = \"yellow\";\n this.numLegs = 4;\n}", "function Dog(name) {\n this.name = name; \n }", "function Dog(name,sound,image){\n\t\tFarmAnimal.call(this, name,sound,image);\n\t}", "function Dog() {\n this.name = \"Rusty\";\n this.color = \"Golden\";\n this.numLegs = 4;\n}", "function allMyDogs(smallHusky, bigHusky, borderCollie) {\n console.log(`My dogs are named ${smallHusky}, ${bigHusky}, ${borderCollie}`) {\n if (smallHusky === undefined || bigHusky === undefined || borderCollie === undefined){\n console.log('no arguements passed')\n } else {\n console.log(`my dogs are named ${smallHusky}, ${bigHusky}, ${borderCollie}`);\n }\n }\n}", "function showWord(rc, word) {\n//\t\trender();\n//\t\tdarken(rc);\n\t\tvar c=cipher[which];\n\t\tvar html = \"<table class=\\\"show\\\">\";\n\t\tvar row1 = \"<tr style=\\\"visibility:visible\\\">\";\n\t\tfor (var i=0; i<rc.length; i++) {\n\t\t\trow1 += \"<td>\"+getImgDarker(c[rc[i][0]].charAt(rc[i][1])) + \"</td>\";\n\t\t}\n\t\trow1 += \"</tr>\"\n\t\tvar row2 = \"<tr style=\\\"visibility:visible\\\">\";\n\t\tfor (var i=0; i<rc.length; i++) {\n\t\t\trow2 += \"<td><img src=\\\"\" + translate(c[rc[i][0]].charAt(rc[i][1]), word.charAt(i)) + \"\\\"></td>\";\n\t\t}\n\t\trow2 += \"</tr>\"\n\t\t\n\t\tif (row1 == row2) {\n\t\t\trow1 = row1.replace(\"visible\",\"hidden\");\n\t\t}\n\t\thtml += row1 + row2;\n\t\t\n\t\t\n\t\thtml += \"<tr>\"\n\t\tfor (var i=0; i<word.length; i++) {\n\t\t\thtml += \"<td>\" + word.charAt(i) + \"</td>\";\n\t\t}\n\t\thtml += \"</tr>\"\n\t\thtml += \"</table>\";\n\t\tdocument.getElementById(\"word\").innerHTML = html;\n\t}", "function displayDescription() {\n // get new random elements\n randomCondiment = getRandomElement(jsonData.condiments);\n randomCat = getRandomElement(jsonData.cats);\n randomRoom = getRandomElement(jsonData.rooms);\n randomName = getRandomElement(jsonData.firstNames);\n randomTitan = getRandomElement(jsonData.greek_titans);\n\n // Remove the past description\n $(\"body\").empty();\n\n // Check if the subject of the verb is plural for good conjugation\n let verb = \"is\";\n if (randomCondiment.charAt(randomCondiment.length - 1) === \"s\") {\n verb = \"are\";\n }\n\n // Check if the last letter of a possessive noun, adapt its form\n let possessive = \"'s\"\n if (randomName.charAt(randomName.length - 1) === \"s\") {\n possessive = \"'\";\n }\n\n // Check the first letter of the following noun to adapt its article\n let article = \"a\";\n let exceptions = [\"A\", \"E\", \"I\", \"O\", \"U\", \"H\"];\n for (let i = 0; i < exceptions.length; i++) {\n if (randomCat.charAt(0) === exceptions[i]) {\n article = \"an\";\n }\n }\n\n // Combine all parts and append it to the body\n let description = `${randomName}${possessive} ${randomCondiment} ${verb} like ${article} ${randomCat} in ${randomTitan}${possessive} ${randomRoom}.`;\n $(\"body\").append(description);\n}", "function tjekVictory() {\n $('<h2 class=\"victory\">VICTORY</h2>').appendTo('body');\n }", "function redisplay(gendr) {\n let wor;\n switch (gendr) {\n case \"neu\":\n wor = job_data.general.words;\n break;\n case \"man\":\n wor = job_data.genders.find(x => x.gender == \"M\").words;\n break;\n case \"wom\":\n wor = job_data.genders.find(x => x.gender == \"F\").words;\n break;\n default:\n wor = job_data.general.words;\n }\n let worWithoutSizAdj = [];\n wor.forEach(x => { worWithoutSizAdj.push({ size: x.size, text: x.text }) });\n drawWordCloud(wor, worWithoutSizAdj, job_data.totalCount);\n }", "function Dog(name, color) {\n this.name = name;\n this.color = color;\n this.numLegs = 4;\n}", "function draw() {\n // A nice green background\n background(100, 200, 100);\n\n // Calculate the distance to the dog from the mouse\n let d = dist(mouseX, mouseY, dog.x, dog.y);\n\n // If the mouse is over the dog, we found it\n if (d < dog.image.height / 2) {\n // Display the invisible dog (tinted to transparent because it's invisible, ha ha)\n push();\n tint(255, 0);\n image(dog.image, dog.x, dog.y);\n pop();\n // And display a nice yellow circle around it so you know where it is\n push();\n strokeWeight(0.5);\n stroke(255, 255, 0);\n noFill();\n ellipse(dog.x, dog.y, dog.image.width, dog.image.height);\n pop();\n }\n\n // Calculate and set volume of barking sound based on distance\n let newVolume = map(d, 0, width / 2, 1, 0);\n dog.sound.setVolume(newVolume);\n\n // Calculate and set pan of barking sound based on distance\n let dx = dog.x - mouseX; // The distance on x axis between mouse and dog\n let newPan = map(dx, -maxPanDistance, maxPanDistance, -1, 1);\n dog.sound.pan(newPan);\n}", "function renderPupCard(pup) {\n // Grab dog bar\n let dogBar = document.getElementById('dog-bar')\n // dogBar.innerHTML = \"\"\n \n // Create dog spans\n let span = document.createElement('span')\n span.innerText = pup.name\n dogBar.appendChild(span)\n \n span.addEventListener('click', () => showPupInfo(pup))\n \n}", "function Dog(name, color) {\n this.name = name;\n this.color = color;\n this.numLegs = 4;\n}", "function Dog() {\n this.name = \"Albert\";\n this.color = \"Brown\";\n this.numLegs = 4;\n}", "function displayWord(myword, desc){\r\n let display = \"\";\r\n for(let i = 0; i < myword.length; i++){\r\n if(i != myword.length - 1){\r\n display += myword.charAt(i) + \" \";\r\n } else {\r\n display += myword.charAt(i);\r\n }\r\n }\r\n document.getElementById(\"display\").innerHTML = display;\r\n document.getElementById(\"desc\").innerHTML = desc;\r\n}", "function showTags(){\n sendChatMessage(\"List of Monopoly tags:\")\n for (let i = 1; i <= tags.length; i++){\n sendChatMessage( i + \") \" + tags[i-1]);\n }\n sendChatMessage(\"Use '/Choosing a b ... c' to select 8 different tags by numbering with a space between each for the game\");\n sendChatMessage(\"Use '/Default' for Wolf's original tags...\");\n sendChatMessage(\"Note: The order of tags on the board will be the same as the order chosen.\");\n}", "function highlightDungeon(x){\r\n document.getElementById(\"caption\").innerHTML = dungeons[x].name;\r\n}", "function Dog(hungry) {\n\n this.status = \"normal\";\n this.color = \"black\";\n this.hungry = \"hungry\";\n}", "function Dog(name) {\n this.name = name;\n }", "function DisplayWord() {\n\tvar wordToPrint : String;\n\tvar hWord : GameObject;\n\t//var offset : float;\n\tswitch(this.kana) {\n\t\tcase \"a\":\n\t\t\twordToPrint = \"あ り\";\n\t\tbreak;\n\t\t\n\t\tcase \"i\":\n\t\t\twordToPrint = \"い な ず ま\";\n\t\tbreak;\n\t\t\n\t\tcase \"u\":\n\t\t\twordToPrint = \"う さ ぎ\";\n\t\tbreak;\n\t\t\t\t\t\n\t\tcase \"e\":\n\t\t\twordToPrint = \"え ん\";\n\t\tbreak;\n\t\t\t\n\t\tcase \"o\":\n\t\t\twordToPrint = \"お す\";\n\t\tbreak;\n\t\t\t\n\t\tcase \"ka\":\n\t\t\twordToPrint = \"か た な\";\n\t\tbreak;\n\t\t\t\n\t\tcase \"ki\":\n\t\t\twordToPrint = \"き り か ぶ\";\n\t\tbreak;\n\t\t\t\n\t\tcase \"ku\":\n\t\t\twordToPrint = \"く さ り\";\n\t\tbreak;\n\t\t\t\n\t\tcase \"ke\":\n\t\t\twordToPrint = \"け る\";\n\t\tbreak;\n\t\t\t\n\t\tcase \"ko\":\n\t\t\twordToPrint = \"こ ぶ し\";\n\t\tbreak;\n\t\t\n\t\tdefault:\n\t\t\t;\n\t\t\t\t\n\t}\n\t//hWord = Instantiate(this.word, this.player.transform.position, Quaternion.identity);\n\t//offset = .005 * wordToPrint.Length;\n\thWord = Instantiate(this.word, new Vector3(0.45, 0.6, -8), Quaternion.identity);\n\thWord.guiText.text = wordToPrint;\n}", "function showWord(words) {\n const randIndex = Math.floor(Math.random() * words.length);\n currentWord.innerHTML = words[randIndex];\n}", "function Dog(name, color) {\n\tthis.name = name;\n\tthis.color = color;\n\tthis.numLegs = 4;\n}", "function Dog() {\n this.name = \"Tarzan\";\n this.color = \"brown\";\n this.numLegs = 4;\n}" ]
[ "0.68896824", "0.668071", "0.66536146", "0.6564212", "0.65638226", "0.64804375", "0.6476078", "0.6460854", "0.645515", "0.6359697", "0.63347614", "0.6293919", "0.6204158", "0.617158", "0.6086753", "0.60790515", "0.6055192", "0.6055192", "0.6045834", "0.6032376", "0.6029511", "0.6021331", "0.59883076", "0.59410006", "0.59372026", "0.5926632", "0.59222806", "0.5861907", "0.58616", "0.58561015", "0.5856055", "0.5845586", "0.5832942", "0.5818626", "0.58138716", "0.5812801", "0.5804708", "0.58011293", "0.5799333", "0.57912195", "0.57844305", "0.57823306", "0.57811666", "0.5767634", "0.5764854", "0.5757472", "0.5757472", "0.57452166", "0.5744565", "0.57381535", "0.5730308", "0.57279205", "0.57003164", "0.5696026", "0.5690679", "0.56893694", "0.56892246", "0.56888723", "0.5678733", "0.56751835", "0.56735533", "0.567155", "0.56708294", "0.56695825", "0.56683683", "0.56683683", "0.566756", "0.56617683", "0.56562394", "0.56542754", "0.56444263", "0.56435937", "0.5642979", "0.56324273", "0.5625524", "0.5621741", "0.56164294", "0.5616087", "0.56150067", "0.56121796", "0.56092656", "0.56082994", "0.5605515", "0.5600358", "0.5598727", "0.5596329", "0.5593776", "0.5585845", "0.55857676", "0.5585486", "0.5577732", "0.5575002", "0.55703133", "0.5567422", "0.55668133", "0.55667216", "0.5565202", "0.5564282", "0.55634063", "0.5560762", "0.55559003" ]
0.0
-1
Include fade and show method in my library
function ourJquery(elements){ this.elements = elements; this.on = function(eventName, f){ for (let i = 0; i < this.elements.length; i++) { this.elements[i].addEventListener(eventName, f); } return this; } this.addClass = function(name){ for (let i = 0; i < this.elements.length; i++) { this.elements[i].classList.add(name); } return this; } this.removeClass = function(name){ for (let i = 0; i < this.elements.length; i++) { this.elements[i].classList.remove(name); } return this; } this.html = function(html){ if(typeof(html) ==='undefined'){ return this.elements[0].innerHTML; } for (let i = 0; i < this.elements.length; i++){ this.elements[i].innerHTML = html; } return this; } this.fade = function(t, f) { for (let i = 0; i < this.elements.length; i++) { this.elements[i].addEventListener('click', function(){ fade(this, t, f); }); } return this; } this.hide = function(){ for (let i = 0; i < this.elements.length; i++) { this.elements[i].style.display = 'none'; } return this; } this.show = function(){ for (let i = 0; i < this.elements.length; i++) { this.elements[i].style.display = 'block'; } return this; } this.click = function(f) { this.f = f; for (let i = 0; i < this.elements.length; i++) { this.elements[i].addEventListener('click', f); } return this; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function show() {\n\t var time = arguments.length <= 0 || arguments[0] === undefined ? 200 : arguments[0];\n\t\n\t this.transition().duration(time).style('opacity', 1);\n\t }", "show() {\n css(document.body, {\n opacity: 1,\n animation: 'none'\n });\n this.isShow = true;\n this._showTiming = Date.now();\n this.trigger('show', this._showTiming);\n }", "render_display() {\n this.element.fadeIn();\n this.visible = true;\n }", "function showProducts() {\n $productsShown = true;\n $products.fadeIn();\n}", "fadeIn(callback) {\n this.recipeWindow.style.display = \"flex\";\n this.recipeWindow\n .animate(\n { opacity: [0, 1] },\n { duration: this.animationTime, easing: \"ease-out\" }\n )\n .finished.then(() => {\n this.show(callback);\n });\n }", "CrossFade() {}", "function FadeIn(element, callback) { StartShow(element, Config.Timer.Fade, Type.Fade, callback); }", "function show() {\n\t\ttID = null;\n\t\tif ((!IE || !$.fn.bgiframe) && settings(current).fade) {\n\t\t\tif (helper.parent.is(\":animated\"))\n\t\t\t\thelper.parent.stop().show().fadeTo(settings(current).fade, current.tOpacity);\n\t\t\telse\n\t\t\t\thelper.parent.is(':visible') ? helper.parent.fadeTo(settings(current).fade, current.tOpacity) : helper.parent.fadeIn(settings(current).fade);\n\t\t} else {\n\t\t\thelper.parent.show();\n\t\t}\n\t\tupdate();\n\t}", "show () {\n // its already visible\n if (this.isVisible) {\n return Promise.resolve();\n }\n\n let $wrapper = this.$wrapper;\n return new Promise((resolve) => {\n this.$wrapper.css('visibility', 'visible').fadeTo(\n FADE_DURATION_MS,\n 1,\n () => {\n this.isVisible = true;\n resolve();\n }\n );\n });\n }", "#listen() {\n this.#vanillaFade();\n this.#jqueryFade();\n }", "startFade(){\n this.last_update = Date.now();\n this.color = \"#f4d742\";\n this.fade_rate = .2; //fades 20% every 100 ms\n this.transparency = 1;\n }", "function fadeStuffs() {\n $(\".hidden\").fadeIn('slow', 'swing').removeClass('hidden');\n }", "function showLogoRed() {\n $.logoRed.animate({ opacity:1.0, duration:250 });\n $.logoWhite.animate({ opacity:0.0, duration:250 });\n\n $.helpLight.animate({ opacity:1.0, duration:250 });\n $.helpDark.animate({ opacity:0.0, duration:250 });\n}", "async onShow() {\n\t}", "function show() {\n let body = document.querySelector('body');\n opacity = Number(window.getComputedStyle(body).getPropertyValue('opacity'));\n if(opacity < 1){\n // edit the + [value] to change rate at which the body fades in \n opacity = opacity + 0.009;\n body.style.opacity = opacity;\n }\n else {\n clearInterval(timeInterval);\n }\n}", "fadeIn() {\n const self = this;\n const $el = $(this.newContainer);\n // Hide old Container\n $(this.oldContainer).hide();\n\n $el.css({\n visibility: 'visible',\n opacity: 0\n });\n\n TweenMax.to($el, 0.4, {\n opacity: 1,\n onComplete: () => {\n this.done();\n }\n });\n }", "function effectFade () {\n pauseSlideshow();\n effect = 1;\n runSlideshow();\n }", "show(option) {\n Animated.sequence([\n Animated.delay(option.delay), // Option\n Animated.parallel([\n Animated.timing( \n this.state.fade,\n {\n toValue: 1, \n duration: 200, \n }\n )\n ])\n ]).start(() => {\n this.setState({\n visible: true\n });\n \n if (this.props.onFinishAnim)\n this.props.onFinishAnim()\n })\n }", "function showContent (show) { $.container.style.opacity = show ? 1 : 0; }", "show() {\n if (this.closeCallback !== undefined) {\n this.closeCallback();\n this.closeCallback = undefined;\n }\n\n this.applied = false;\n this.frame.style.display = 'block';\n this._generateHueCircle();\n }", "function fadeInDisplay(el) {\nel.style.display = 'block';\nel.style.opacity = 0;\nvar last = +new Date();\nvar tick = function() {\n el.style.opacity = +el.style.opacity + (new Date() - last) / 400;\n last = +new Date();\n if (+el.style.opacity < 1) {\n (window.requestAnimationFrame && requestAnimationFrame(tick)) || setTimeout(tick, 16);\n }\n};\ntick();\n}", "function invFade(obj)\n {\n obj.removeClass('invisible')\n .addClass('animated fadeIn')\n }", "function espereshow ()\n{\n $('.espere').fadeIn('fast');\n}", "show (args){ this.transitioner.show(args) }", "async show() {\n \n }", "function helm_show(show) {\n\n //var helmRequestComplete = new $.Deferred();\n\n var $blockTheWholeHelm = $(\"#HelmContent_BlockUI\");\n var $helmWrapper = $(\"#HelmWrapper\");\n\n if (show) {\n //Fade Helm Into by fading out a opaque gray div that overlays the entire helm.\n\n $blockTheWholeHelm.fadeOut(420, function() {\n //$helmWrapper.toggleClass(\"helmSetHeight\", false);\n });\n\n } else { //hide\n $blockTheWholeHelm.fadeIn(420, function() {\n //$helmWrapper.toggleClass(\"helmSetHeight\", true);\n });\n }\n\n //helmRequestComplete.resolve();\n //return helmRequestComplete.promise();\n\n }", "function show() {\n $( \"#target\" ).show(1000);}", "show() {\n\n }", "get fadeIn() {\n return this._fadeIn;\n }", "setupFade(fadeTime, from, to, onFadeDone) {}", "function fadeIn() {\n $( \"#target\" ).fadeIn();}", "#vanillaFade() {\n let img = document.getElementById('alternative');\n let btn = document.getElementById('vanilla');\n btn.addEventListener('click', () => {\n if (img.className.indexOf('hide') !== -1) {\n this.#fadeIn(img);\n } else {\n this.#fadeOut(img);\n }\n });\n }", "function fadeIn(o) {\n o.obj.removeAttribute('display');\n o.obj.setAttribute('opacity', 0);\n const func = (t) => {\n o.obj.setAttribute('opacity', t);\n };\n const update = () => {\n o.obj.setAttribute('opacity', 1);\n o.variables.set('opacity', 1);\n o.variables.delete('display', 1);\n };\n return [func, update];\n}", "function startFade() {\n fader.addClass('fadeOut');\n setTimeout(teardownFade, FADE_DURATION_MS);\n }", "function chaining() {\n $( \"#target\" ).hide().show(1000).toggle().toggle().slideUp().slideDown().fadeIn().fadeOut().show(1500);}", "function ws_fade(c,a,b){var e=jQuery,g=e(this),d=e(\".ws_list\",b),h={position:\"absolute\",left:0,top:0,width:\"100%\",height:\"100%\",maxHeight:\"none\",maxWidth:\"none\",transform:\"translate3d(0,0,0)\"},f=e(\"<div>\").addClass(\"ws_effect ws_fade\").css(h).css(\"overflow\",\"hidden\").appendTo(b);this.go=function(i,j){var k=e(a.get(i)),m={width:k.width(),height:k.height()};k=k.clone().css(h).css(m).appendTo(f);if(!c.noCross){var l=e(a.get(j)).clone().css(h).css(m).appendTo(f);wowAnimate(l,{opacity:1},{opacity:0},c.duration,function(){l.remove()})}wowAnimate(k,{opacity:0},{opacity:1},c.duration,function(){g.trigger(\"effectEnd\");k.remove()})}}", "function showSlider() {\n let sliderCoords = getObjectCoords(slider);\n let slideInfo = $(\".slide.current .slide__info\");\n\n if (!slideInfo.hasClass(\"animate\")) slideInfo.addClass(\"animate\");\n\n slider.css(\n \"opacity\",\n `${normalize($(window).height(), 0, 0, 100, sliderCoords.top)}%`\n );\n }", "function showLogoWhite() {\n $.logoRed.animate({ opacity:0.0, duration:250 });\n $.logoWhite.animate({ opacity:1.0, duration:250 });\n\n $.helpLight.animate({ opacity:0.0, duration:250 });\n $.helpDark.animate({ opacity:1.0, duration:250 });\n}", "function showCallback(sketch) {\n var state = this.hideShowState,\n now = Number(new Date()),\n fade = (now - state.startTime) / (state.timeToComplete - state.startTime);\n \n if (!state.oneTimeShow) {\n this.eachParent(function(index, parent) {\n if( parent.style.hidden) {\n parent.state.fade = 1;\n parent.show();\n }\n });\n state.oneTimeShow = true;\n }\n \n if (now >= state.timeToComplete) {\n this.eachParent(function(index, parent) {\n this.state.fade = undefined;\n sketch.invalidateGeom(this);\n }, false); \n\n this.state.isActive = false;\n this.hideShowState = undefined;\n sketch.invalidateGeom(this);\n } else {\n this.eachParent(function(index, parent) {\n if( undefined !== parent.state.fade) {\n parent.state.fade = 1 - fade;\n sketch.invalidateAppearance(parent);\n }\n }, false); \n sketch.addDeferredCall(this, showCallback);\n }\n }", "function showLoader(loader_id) {\r\n $(loader_id).fadeIn(\"fast\");\r\n}", "function show(element)\n\t\t{\n\t\t\tvar effect = element.closest('.PW_Archives').data('js_effect');\n\t\t\tswitch ( effect ) {\n\t\t\t\tcase 'SLIDE' :\t\t\t\t\t\n\t\t\t\t\telement.removeClass('hide').children(\"ul\").eq(0).slideDown(333);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'FADE' :\n\t\t\t\t\telement.removeClass('hide').children(\"ul\").eq(0).fadeIn(333);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault :\n\t\t\t\t\telement.removeClass('hide').children(\"ul\").eq(0).show();\n\t\t\t}\n\t\t}", "function fadeInPage() {\n const fader = document.getElementById('fader');\n fader.classList.add('fade-out');\n}", "function showOverlay() {\n addClass(overlay, showClass);\n reflow(overlay);\n}", "_show() {\n $.setDataset(this._target, { uiAnimating: 'in' });\n\n $.addClass(this._target, 'active');\n $.addClass(this._node, 'active');\n\n $.fadeIn(this._target, {\n duration: this._options.duration,\n }).then((_) => {\n $.setAttribute(this._node, { 'aria-selected': true });\n $.removeDataset(this._target, 'uiAnimating');\n $.triggerEvent(this._node, 'shown.ui.tab');\n }).catch((_) => {\n if ($.getDataset(this._target, 'uiAnimating') === 'in') {\n $.removeDataset(this._target, 'uiAnimating');\n }\n });\n }", "static fadeIn(element, display)\n {\n element.style.opacity = 0;\n element.style.display = display || \"block\";\n\n (function fade() {\n let val = parseFloat(element.style.opacity);\n if (!((val += .1) > 1)) {\n element.style.opacity = val;\n requestAnimationFrame(fade);\n }\n })();\n }", "function addFadeIn (val) {\n val.classList.add(\"fadeInAnimation\"); // add fade in animation to the content\n val.style.opacity = 1; // set the content to be visible after the animation\n}", "function Show(element, animList, callback) { StartShow(element, Config.Timer.ShowHide, animList, callback); }", "function showLoading(show) { $.overlay.style.opacity = show ? 1 : 0; }", "function ShowHighlight() {\n \n // Change Scene\n if ( current_Scene.attr('id') != 'Highlight' ) {\n \n current_Scene.fadeOut(1000);\n current_Scene = $('#Highlight');\n current_Scene.fadeIn(1000); \n AdobeEdge.getComposition('OTF-Highlight').getStage().getSymbol('Highlight_All').getSymbol('HighLight_PInfo').stop(0);\n AdobeEdge.getComposition('OTF-Highlight').getStage().getSymbol('Highlight_All').getSymbol('HighLight_PInfo2').stop(0);\n AdobeEdge.getComposition('OTF-Highlight').getStage().play(0);\n \n }\n \n}", "#jqueryFade() {\n this.#jquery.on('click', () => {\n $('#alternative').fadeToggle(600);\n });\n }", "function FADER() {\n $('.FADE').hide(0).delay(500).fadeIn(500);\n console.log('done');\n }", "show() {\n this.visible = true;\n }", "function hide() {\n\t var time = arguments.length <= 0 || arguments[0] === undefined ? 200 : arguments[0];\n\t\n\t this.transition().duration(time).style('opacity', 0);\n\t }", "function Show() {\n count+=.10;\n // here I call the function I made above\n fade();\n if (count < 1){\n // Set the time to show after 100\n setTimeout(Show, 100);\n }\n}", "function show()\n{\n update();\n}", "function showOverlay(item){\n\t\titem.fadeIn(1000);\n\t\tchangeOpacity();\n\t}", "function initFE() {\r\n\t$(\"#fe\").hide();\r\n\t$(\"#fe_intro_stars\").html(\r\n\t\t\"<ul class='fade_in'>\" +\r\n\t\t\t\"<li class='pulse'></li>\" +\r\n\t\t\t\"<li class='pulse'></li>\" +\r\n\t\t\t\"<li class='pulse'></li>\" +\r\n\t\t\t\"<li class='pulse'></li>\" +\r\n\t\t\"</ul>\"\r\n\t).hide();\r\n\t$(\"#fe_controls\").hide();\r\n}", "function allFadeIn(){\n $('.info').fadeIn();\n}", "function apcFadeIn()\n {\n apc.addClass('fadeIn');\n setTimeout(function()\n {\n apc.removeClass(\"animated fadeOut fadeIn\");\n }, 800);\n }", "CrossFadeQueued() {}", "function show(target) {\n $('#general').hide();\n $('#addProduct').hide();\n $('#editCategory').hide();\n $('#addCategory').hide();\n $('#editProduct').hide();\n $('#productInfo').hide();\n $('#' + target).fadeIn(1300);\n}", "function fadeIn()\n{\n $(this).fadeIn(\"fast\");\n}", "show() {\n super.show();\n this.overlay.classList.remove(\"hidden\");\n blurBaseElements(this);\n }", "function showControllers(show){\n\tif(show){\n\t\tback.style = \"opacity:1;\"\n\t\tnext.style = \"opacity:1;\"\n\t}else{\n\t\tback.style = \"opacity:0;\"\n\t\tnext.style = \"opacity:0;\"\n\t}\n}", "function fadeInit(){\n\toNews = new makeNewsObj('divNews','divNewsCont',nFont,nFontsize,\"nColor\",\"nNews\",nFadespeed,nBetweendelay,nSlidespeed,nWorks,nNewsheight)\n\toNewsCont = new makeNewsObj('divNewsCont')\n\tworks = !oNews.works?0:oNews.works==1?1:Math.round(Math.random())\n\tif (works==0) oNews.fadeIn(0,0)\n\telse if (works==1) oNews.slideIn(0,0)\n\toNewsCont.css.visibility = \"visible\"\n}", "onShown() {\r\n // Stub\r\n }", "function ws_fade(c, a, b) {\n var e = jQuery, g = e(this),\n d = e(\".ws_list\", b),\n h = { position: \"absolute\", left: 0, top: 0, width: \"100%\", height: \"100%\", maxHeight: \"none\", maxWidth: \"none\", transform: \"translate3d(0,0,0)\" },\n f = e(\"<div>\").addClass(\"ws_effect ws_fade\").css(h).css(\"overflow\", \"hidden\").appendTo(b);\n this.go = function (i, j) {\n var k = e(a.get(i)), m = { width: k.width(), height: k.height() };\n k = k.clone().css(h).css(m).appendTo(f);\n if (!c.noCross) {\n var l = e(a.get(j)).clone().css(h).css(m).appendTo(f);\n wowAnimate(l,\n { opacity: 1 },\n { opacity: 0 },\n c.duration,\n function() {\n l.remove();\n });\n }\n wowAnimate(k,\n { opacity: 0 },\n { opacity: 1 },\n c.duration,\n function() {\n g.trigger(\"effectEnd\");\n k.remove();\n });\n }\n}", "show() {\n if (!this.isOpened || !this.inAnimation) {\n this.inAnimation = true;\n this.mainWrap.classList.add(this.classOpened);\n this.buttons.toggle.classList.add(this.classOpened);\n setTimeout(() => {\n this.inAnimation = false;\n this.isOpened = true;\n }, this.timeAnimation);\n }\n }", "render_hide() {\n this.element.fadeOut();\n this.visible = false;\n }", "function main() {\n $('.skillset').hide();\n $('.skillset').fadeIn(1000);\n}", "function main() {\n $('.skillset').hide();\n $('.skillset').fadeIn(1000);\n}", "function main() {\n $('.skillset').hide();\n $('.skillset').fadeIn(1000);\n}", "function main() {\n $('.skillset').hide();\n $('.skillset').fadeIn(1000);\n}", "function main() {\n $('.skillset').hide();\n $('.skillset').fadeIn(1000);\n}", "function startLoader() {\r\n\t$(\"#fe\").show();\r\n\t$(\"#fe_intro_moon\").html(\"<img src='img/hf_moon_state_0.png'><p></p>\");\r\n\tanimateLoader();\r\n}", "show() {\n this.$fakeLoader.show();\n }", "function fadeIn(config, $previous, $targets) {\n // Clear previous active class + styles touched by tram\n // We cannot remove the whole inline style because it could be dynamically bound\n $previous.removeClass(tabActive).css({\n opacity: '',\n transition: '',\n transform: '',\n width: '',\n height: ''\n });\n // Add active class to new target\n\n $targets.addClass(tabActive).each(ix.intro);\n Webflow.redraw.up();\n // Set opacity immediately if intro is zero\n\n if (!config.intro) {\n return tram($targets).set({\n opacity: 1\n });\n }\n // Otherwise fade in opacity\n\n tram($targets).set({\n opacity: 0\n }).redraw().add('opacity ' + config.intro + 'ms ' + config.easing, {\n fallback: safari\n }).start({\n opacity: 1\n });\n }", "function fadeInPage() {\n if (!window.AnimationEvent) { return; }\n var fader = document.getElementById('fader');\n fader.classList.add('fade-out');\n}", "function showLoader()\n {\n\t\t// $('.loader-container').show();\n // $('.loader-container').preloader({\n // zIndex: 1000,\n // setRelative: false\n // });\n // $('.loader-back').show();\n }", "function loading_show(){\n $('#loading').html(\"<img src='../assets/img/loading.gif'/>\").fadeIn('fast');\n }", "function fadeOut(a){return a.style.opacity=1,function b(){(a.style.opacity-=.1)<0?a.style.display=\"none\":requestAnimationFrame(b)}(),!0}", "function opacityOn(ocultar){\n\t\t$(\".u-bodyOpacity\").fadeIn();\n\t\t$(\".u-bodyOpacity\").click(ocultar);\n\t}", "function innlasting() {\n $('.sitat').fadeIn(2000);\n $('.hvaOgHvem').fadeIn(2000);\n}", "function callFadeIN(){\n\t\t\tcontentTimer = setInterval(fadeIN, \"100\");\n\t\t}", "function fadeInSlide(next) {\n next.fadeIn(animationDuration);\n }", "firstShow() {\n $('.card-unmatched').css('opacity', 1);\n setTimeout(function () {\n $('.card-unmatched').css('opacity', 0);\n }, 1000);\n }", "function loading_show(){\n $('#loading5').html(\"<img src='../assets/img/loading.gif'/>\").fadeIn('fast');\n }", "function onPageShow()\n{\n // Fade in main part of <body>\n $(\"#body-center\").css(\"display\", \"none\");\n $(\"#body-center\").fadeIn(BODY_FADE_TIME);\n\n // Make sure normal css styles are restored\n $(\".navbar-link\").css(\"opacity\",\"0.3\");\n $(\"#navbar-current\").css(\"opacity\",\"1\");\n}", "function showJordi(){\n var jordi = document.getElementById(\"jordi\");\n jordi.style.opacity = 1;\n setTimeout(function(){\n jordi.style.opacity = 0;\n }, 700);\n }", "function fadeOrderSummary() {\n\tdisableEditButton();\n\tdisableHeaderLinks();\n\t$(\"progressIndicator\").appear({ duration: 0});\n\n\toptions = { duration: 0.2, from: 1.0, to: 0.55 }\n\t$(\"orderSummary\").fade(options);\n\t$(\"header\").fade(options);\n\t$(\"footer\").fade(options);\n}", "fadeInDialog() {\n let drop = document.getElementById(\"modal_ink_drop\");\n if (!isNullOrUndefined(drop)) {\n drop.style.opacity = \"1\";\n }\n }", "function loading_show(){\n $('#loading3').html(\"<img src='../assets/img/loading.gif'/>\").fadeIn('fast');\n }", "function myFade(elem) {\n if (elem.fadePower == 1) {\n elem.fadePower = 0.3;\n } else {\n elem.fadePower = 1;\n }\n elem.fadeTo('fast', elem.fadePower);\n }", "function displayOptionalPalettes(){\n\t $('#palettes-div').toggle(\"fade\"); \n}", "function loading(){\n\t\n \n $('#loading-zone,#loading-zone-content').bind('show-loading',function(e){\n $(this).fadeIn();\t\n });\n\n $('#loading-zone,#loading-zone-content').bind('hide-loading',function(e){\n\n $(this).fadeOut();\t\n });\n}", "function mouseOn() {\n $(this).fadeTo(20,1);\n }", "show(options) {\n // Override default options if options parameter exist.\n this.setOptions(options);\n\n // Add spinner stylesheet from https://cdn.jsdelivr.net in head.\n this.addSpinnerStylesheet();\n\n // Generate spinner html element.\n this.generateSpinnerElement();\n\n if (this.options.lockScroll) {\n document.body.style.overflow = 'hidden';\n document.documentElement.style.overflow = 'hidden';\n }\n\n // Generate overlay html element in full page.\n this.generateAndAddOverlayElement();\n }", "function mostrarCurriculum() {\n $(\"#offside\").show();\n $(\"#curriculum\").fadeOut(2000);\n $(\"#curriculum\").css(\"display\", \"grid\");\n $(\"#restaurar\").show();\n $(\"#curriculum\").fadeIn(2000);\n\n}", "function dfShow($items, defer) {\n\t\tvar fulltime = $items.length * 40;\n\n\t\t_.each($items, function(item, index) {\n\n\t\t\tsetTimeout(function() {\n\t\t\t\t$(item).animate({ opacity: 1 }, 450);\n\t\t\t}, index * 40);\n\t\t});\n\n\t\tsetTimeout(function() {\n\t\t\tdefer.resolve();\n\t\t}, fulltime);\n\t}", "function loading_show(){\n \t\t$('#loading').html(\"<img src='img/loading.gif'/>\").fadeIn('fast');\n }", "function fadeIn(elem) {\n setTimeout(function () {\n var op = 0;\n var timer = setInterval(function () {\n if (op >= 1) {\n clearInterval(timer);\n } else {\n elem.style.opacity = op;\n elem.style.filter = 'alpha(opacity=' + op * 100 + \")\";\n op += 0.1;\n }\n }, 10);\n }, 200);\n }" ]
[ "0.75376755", "0.73079294", "0.7169497", "0.7160678", "0.7085705", "0.70742327", "0.7014087", "0.7000536", "0.6939595", "0.6933693", "0.6855245", "0.68315166", "0.67445904", "0.6693928", "0.6691486", "0.6676829", "0.66531414", "0.66396374", "0.6639126", "0.6634664", "0.6616567", "0.6587401", "0.65825915", "0.6578924", "0.65707636", "0.6570186", "0.6546893", "0.6545535", "0.6542343", "0.6529193", "0.6509743", "0.65023607", "0.64739764", "0.6466554", "0.64652497", "0.6457404", "0.64521307", "0.64373666", "0.642634", "0.6328764", "0.632761", "0.63273716", "0.6326523", "0.6326024", "0.6325432", "0.63179475", "0.631113", "0.6297982", "0.6295874", "0.6289432", "0.6284561", "0.6281768", "0.62765324", "0.62736905", "0.62735814", "0.6263155", "0.6252154", "0.625207", "0.62496793", "0.6243041", "0.6239579", "0.623567", "0.621829", "0.62164634", "0.6213816", "0.61964154", "0.61881274", "0.6181603", "0.6175056", "0.61745316", "0.61745316", "0.61745316", "0.61745316", "0.61745316", "0.6173413", "0.61710083", "0.6170076", "0.61654764", "0.61639875", "0.6163762", "0.61611015", "0.6157609", "0.6153502", "0.61482817", "0.6148258", "0.61476576", "0.61448914", "0.6141898", "0.6139041", "0.61389124", "0.6132103", "0.6131172", "0.612167", "0.61147285", "0.6112251", "0.6111397", "0.6110125", "0.6107929", "0.6107872", "0.6106538", "0.6102169" ]
0.0
-1
That metods checks if someone has written obj instanceof Person
static [Symbol.hasInstance](obj) { return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function is(type, obj) {\n \treturn objectType(obj) === type;\n }", "function is(obj, type) {\n return typeof obj === type;\n }", "function is(obj, type) {\n return typeof obj === type;\n }", "function is( obj, type ) {\n return typeof obj === type;\n }", "function is( obj, type ) {\n return typeof obj === type;\n }", "function is( obj, type ) {\n return typeof obj === type;\n }", "function is( obj, type ) {\n return typeof obj === type;\n }", "function is( obj, type ) {\n return typeof obj === type;\n }", "function is( obj, type ) {\n return typeof obj === type;\n }", "function is( obj, type ) {\n return typeof obj === type;\n }", "function is( obj, type ) {\n return typeof obj === type;\n }", "function is( obj, type ) {\n return typeof obj === type;\n }", "function is( obj, type ) {\n return typeof obj === type;\n }", "function is( obj, type ) {\n return typeof obj === type;\n }", "function is( obj, type ) {\n return typeof obj === type;\n }", "function is( obj, type ) {\n return typeof obj === type;\n }", "function is( obj, type ) {\n return typeof obj === type;\n }", "function is( obj, type ) {\n return typeof obj === type;\n }", "function is( obj, type ) {\n return typeof obj === type;\n }", "function is( obj, type ) {\n return typeof obj === type;\n }", "function is( obj, type ) {\n return typeof obj === type;\n }", "function is( obj, type ) {\n return typeof obj === type;\n }", "function is( obj, type ) {\n return typeof obj === type;\n }", "static isInstance(obj) {\n if (obj === undefined || obj === null) {\n return false;\n }\n return obj['__pulumiType'] === UserProfile.__pulumiType;\n }", "static isStudent(obj) {\n return obj.constructor === Student;\n }", "function isInstance(obj, type) {\n\t\treturn obj instanceof type || obj != null && obj.constructor != null && obj.constructor.name != null && obj.constructor.name === type.name;\n\t}", "function isInstance(obj, type) {\n return (\n obj instanceof type ||\n (obj != null &&\n obj.constructor != null &&\n obj.constructor.name != null &&\n obj.constructor.name === type.name)\n );\n }", "function isInstance(obj,type){return obj instanceof type||obj!=null&&obj.constructor!=null&&obj.constructor.name!=null&&obj.constructor.name===type.name;}", "function isInstance(obj,type){return obj instanceof type||obj!=null&&obj.constructor!=null&&obj.constructor.name!=null&&obj.constructor.name===type.name;}", "function isInstance(obj,type){return obj instanceof type||obj!=null&&obj.constructor!=null&&obj.constructor.name!=null&&obj.constructor.name===type.name;}", "function isInstance(obj, type) {\n return (\n obj instanceof type ||\n (obj != null &&\n obj.constructor != null &&\n obj.constructor.name != null &&\n obj.constructor.name === type.name)\n );\n }", "function isInstance(obj, type) {\n return obj instanceof type ||\n (obj != null && obj.constructor != null && obj.constructor.name != null &&\n obj.constructor.name === type.name)\n }", "function is_a(thing, obj) {\n if (('string' === typeof (obj)) && obj.toLowerCase() !== 'string') {\n return (thing instanceof eval(obj));\n } else {\n return (thing instanceof obj);\n }\n}", "static isInstance(obj) {\n if (obj === undefined || obj === null) {\n return false;\n }\n return obj['__pulumiType'] === OrganizationCustomRule.__pulumiType;\n }", "static isInstance(obj) {\n if (obj === undefined || obj === null) {\n return false;\n }\n return obj['__pulumiType'] === Authorizer.__pulumiType;\n }", "function isInstance (obj, type) {\r\n return obj instanceof type ||\r\n (obj != null && obj.constructor != null && obj.constructor.name != null &&\r\n obj.constructor.name === type.name)\r\n}", "function isInstance (obj, type) {\r\n return obj instanceof type ||\r\n (obj != null && obj.constructor != null && obj.constructor.name != null &&\r\n obj.constructor.name === type.name)\r\n}", "function is(el, obj){\r\n return el instanceof obj\r\n}", "function isInstance (obj, type) {\n return obj instanceof type ||\n (obj != null && obj.constructor != null && obj.constructor.name != null &&\n obj.constructor.name === type.name)\n}", "function isInstance (obj, type) {\n return obj instanceof type ||\n (obj != null && obj.constructor != null && obj.constructor.name != null &&\n obj.constructor.name === type.name)\n}", "function isInstance (obj, type) {\n return obj instanceof type ||\n (obj != null && obj.constructor != null && obj.constructor.name != null &&\n obj.constructor.name === type.name)\n}", "function isInstance (obj, type) {\n return obj instanceof type ||\n (obj != null && obj.constructor != null && obj.constructor.name != null &&\n obj.constructor.name === type.name)\n}", "function isInstance (obj, type) {\n return obj instanceof type ||\n (obj != null && obj.constructor != null && obj.constructor.name != null &&\n obj.constructor.name === type.name)\n}", "function isInstance (obj, type) {\n return obj instanceof type ||\n (obj != null && obj.constructor != null && obj.constructor.name != null &&\n obj.constructor.name === type.name)\n}", "function isInstance (obj, type) {\n return obj instanceof type ||\n (obj != null && obj.constructor != null && obj.constructor.name != null &&\n obj.constructor.name === type.name)\n}", "function isInstance (obj, type) {\n return obj instanceof type ||\n (obj != null && obj.constructor != null && obj.constructor.name != null &&\n obj.constructor.name === type.name)\n}", "function isInstance (obj, type) {\n return obj instanceof type ||\n (obj != null && obj.constructor != null && obj.constructor.name != null &&\n obj.constructor.name === type.name)\n}", "function isInstance (obj, type) {\n return obj instanceof type ||\n (obj != null && obj.constructor != null && obj.constructor.name != null &&\n obj.constructor.name === type.name)\n}", "function isInstance (obj, type) {\n return obj instanceof type ||\n (obj != null && obj.constructor != null && obj.constructor.name != null &&\n obj.constructor.name === type.name)\n}", "function isInstance (obj, type) {\n return obj instanceof type ||\n (obj != null && obj.constructor != null && obj.constructor.name != null &&\n obj.constructor.name === type.name)\n}", "function isInstance (obj, type) {\n return obj instanceof type ||\n (obj != null && obj.constructor != null && obj.constructor.name != null &&\n obj.constructor.name === type.name)\n}", "function isInstance (obj, type) {\n return obj instanceof type ||\n (obj != null && obj.constructor != null && obj.constructor.name != null &&\n obj.constructor.name === type.name)\n}", "function isInstance (obj, type) {\n return obj instanceof type ||\n (obj != null && obj.constructor != null && obj.constructor.name != null &&\n obj.constructor.name === type.name)\n}", "function isInstance (obj, type) {\n return obj instanceof type ||\n (obj != null && obj.constructor != null && obj.constructor.name != null &&\n obj.constructor.name === type.name)\n}", "function isInstance (obj, type) {\n return obj instanceof type ||\n (obj != null && obj.constructor != null && obj.constructor.name != null &&\n obj.constructor.name === type.name)\n}", "function isInstance (obj, type) {\n return obj instanceof type ||\n (obj != null && obj.constructor != null && obj.constructor.name != null &&\n obj.constructor.name === type.name)\n}", "function isInstance (obj, type) {\n return obj instanceof type ||\n (obj != null && obj.constructor != null && obj.constructor.name != null &&\n obj.constructor.name === type.name)\n}", "function isInstance (obj, type) {\n return obj instanceof type ||\n (obj != null && obj.constructor != null && obj.constructor.name != null &&\n obj.constructor.name === type.name)\n}", "function isInstance (obj, type) {\n return obj instanceof type ||\n (obj != null && obj.constructor != null && obj.constructor.name != null &&\n obj.constructor.name === type.name)\n}", "function isInstance (obj, type) {\n return obj instanceof type ||\n (obj != null && obj.constructor != null && obj.constructor.name != null &&\n obj.constructor.name === type.name)\n}", "function isInstance (obj, type) {\n return obj instanceof type ||\n (obj != null && obj.constructor != null && obj.constructor.name != null &&\n obj.constructor.name === type.name)\n}", "function isInstance (obj, type) {\n return obj instanceof type ||\n (obj != null && obj.constructor != null && obj.constructor.name != null &&\n obj.constructor.name === type.name)\n}", "function isInstance (obj, type) {\n return obj instanceof type ||\n (obj != null && obj.constructor != null && obj.constructor.name != null &&\n obj.constructor.name === type.name)\n}", "function isInstance (obj, type) {\n return obj instanceof type ||\n (obj != null && obj.constructor != null && obj.constructor.name != null &&\n obj.constructor.name === type.name)\n}", "function isInstance (obj, type) {\n return obj instanceof type ||\n (obj != null && obj.constructor != null && obj.constructor.name != null &&\n obj.constructor.name === type.name)\n}", "function isInstance (obj, type) {\n return obj instanceof type ||\n (obj != null && obj.constructor != null && obj.constructor.name != null &&\n obj.constructor.name === type.name)\n}", "function isInstance (obj, type) {\n return obj instanceof type ||\n (obj != null && obj.constructor != null && obj.constructor.name != null &&\n obj.constructor.name === type.name)\n}", "function isInstance (obj, type) {\n return obj instanceof type ||\n (obj != null && obj.constructor != null && obj.constructor.name != null &&\n obj.constructor.name === type.name)\n}", "function isInstance (obj, type) {\n return obj instanceof type ||\n (obj != null && obj.constructor != null && obj.constructor.name != null &&\n obj.constructor.name === type.name)\n}", "function isInstance (obj, type) {\n return obj instanceof type ||\n (obj != null && obj.constructor != null && obj.constructor.name != null &&\n obj.constructor.name === type.name)\n}", "function isInstance (obj, type) {\n return obj instanceof type ||\n (obj != null && obj.constructor != null && obj.constructor.name != null &&\n obj.constructor.name === type.name)\n}", "function isInstance (obj, type) {\n return obj instanceof type ||\n (obj != null && obj.constructor != null && obj.constructor.name != null &&\n obj.constructor.name === type.name)\n}", "function isInstance (obj, type) {\n return obj instanceof type ||\n (obj != null && obj.constructor != null && obj.constructor.name != null &&\n obj.constructor.name === type.name)\n}", "function isInstance (obj, type) {\n return obj instanceof type ||\n (obj != null && obj.constructor != null && obj.constructor.name != null &&\n obj.constructor.name === type.name)\n}", "function isInstance (obj, type) {\n return obj instanceof type ||\n (obj != null && obj.constructor != null && obj.constructor.name != null &&\n obj.constructor.name === type.name)\n}", "function isInstance (obj, type) {\n return obj instanceof type ||\n (obj != null && obj.constructor != null && obj.constructor.name != null &&\n obj.constructor.name === type.name)\n}", "function isInstance (obj, type) {\n return obj instanceof type ||\n (obj != null && obj.constructor != null && obj.constructor.name != null &&\n obj.constructor.name === type.name)\n}", "function isInstance (obj, type) {\n return obj instanceof type ||\n (obj != null && obj.constructor != null && obj.constructor.name != null &&\n obj.constructor.name === type.name)\n}", "function isInstance (obj, type) {\n return obj instanceof type ||\n (obj != null && obj.constructor != null && obj.constructor.name != null &&\n obj.constructor.name === type.name)\n}", "function isInstance (obj, type) {\n return obj instanceof type ||\n (obj != null && obj.constructor != null && obj.constructor.name != null &&\n obj.constructor.name === type.name)\n}", "function isInstance (obj, type) {\n return obj instanceof type ||\n (obj != null && obj.constructor != null && obj.constructor.name != null &&\n obj.constructor.name === type.name)\n}", "function isInstance (obj, type) {\n return obj instanceof type ||\n (obj != null && obj.constructor != null && obj.constructor.name != null &&\n obj.constructor.name === type.name)\n}", "function isInstance (obj, type) {\n return obj instanceof type ||\n (obj != null && obj.constructor != null && obj.constructor.name != null &&\n obj.constructor.name === type.name)\n}", "function isInstance (obj, type) {\n return obj instanceof type ||\n (obj != null && obj.constructor != null && obj.constructor.name != null &&\n obj.constructor.name === type.name)\n}", "function isInstance (obj, type) {\n return obj instanceof type ||\n (obj != null && obj.constructor != null && obj.constructor.name != null &&\n obj.constructor.name === type.name)\n}", "function isInstance (obj, type) {\n return obj instanceof type ||\n (obj != null && obj.constructor != null && obj.constructor.name != null &&\n obj.constructor.name === type.name)\n}", "function isInstance (obj, type) {\n return obj instanceof type ||\n (obj != null && obj.constructor != null && obj.constructor.name != null &&\n obj.constructor.name === type.name)\n}", "function isInstance (obj, type) {\n return obj instanceof type ||\n (obj != null && obj.constructor != null && obj.constructor.name != null &&\n obj.constructor.name === type.name)\n}", "function isInstance (obj, type) {\n return obj instanceof type ||\n (obj != null && obj.constructor != null && obj.constructor.name != null &&\n obj.constructor.name === type.name)\n}", "function isInstance (obj, type) {\n return obj instanceof type ||\n (obj != null && obj.constructor != null && obj.constructor.name != null &&\n obj.constructor.name === type.name)\n}", "function isInstance (obj, type) {\n return obj instanceof type ||\n (obj != null && obj.constructor != null && obj.constructor.name != null &&\n obj.constructor.name === type.name)\n}", "function isInstance (obj, type) {\n return obj instanceof type ||\n (obj != null && obj.constructor != null && obj.constructor.name != null &&\n obj.constructor.name === type.name)\n}", "function isInstance (obj, type) {\n return obj instanceof type ||\n (obj != null && obj.constructor != null && obj.constructor.name != null &&\n obj.constructor.name === type.name)\n}", "function isInstance (obj, type) {\n return obj instanceof type ||\n (obj != null && obj.constructor != null && obj.constructor.name != null &&\n obj.constructor.name === type.name)\n}", "function isInstance (obj, type) {\n return obj instanceof type ||\n (obj != null && obj.constructor != null && obj.constructor.name != null &&\n obj.constructor.name === type.name)\n}", "function isInstance (obj, type) {\n return obj instanceof type ||\n (obj != null && obj.constructor != null && obj.constructor.name != null &&\n obj.constructor.name === type.name)\n}", "function isInstance (obj, type) {\n return obj instanceof type ||\n (obj != null && obj.constructor != null && obj.constructor.name != null &&\n obj.constructor.name === type.name)\n}", "function isInstance (obj, type) {\n return obj instanceof type ||\n (obj != null && obj.constructor != null && obj.constructor.name != null &&\n obj.constructor.name === type.name)\n}", "function isInstance (obj, type) {\n return obj instanceof type ||\n (obj != null && obj.constructor != null && obj.constructor.name != null &&\n obj.constructor.name === type.name)\n}", "function isInstance (obj, type) {\n return obj instanceof type ||\n (obj != null && obj.constructor != null && obj.constructor.name != null &&\n obj.constructor.name === type.name)\n}", "function isInstance (obj, type) {\n return obj instanceof type ||\n (obj != null && obj.constructor != null && obj.constructor.name != null &&\n obj.constructor.name === type.name)\n}" ]
[ "0.7082793", "0.69942194", "0.69942194", "0.69892055", "0.69667614", "0.69667614", "0.69667614", "0.69667614", "0.69667614", "0.69667614", "0.69667614", "0.69667614", "0.69667614", "0.69667614", "0.69667614", "0.69667614", "0.69667614", "0.69667614", "0.69667614", "0.69667614", "0.69667614", "0.69667614", "0.69667614", "0.6936739", "0.6923541", "0.691848", "0.691314", "0.69032127", "0.69032127", "0.69032127", "0.68886745", "0.6876634", "0.67025954", "0.6701746", "0.6691083", "0.6679467", "0.6679467", "0.664445", "0.6641082", "0.6641082", "0.6641082", "0.6641082", "0.6641082", "0.6641082", "0.6641082", "0.6641082", "0.6641082", "0.6641082", "0.6641082", "0.6641082", "0.6641082", "0.6641082", "0.6641082", "0.6641082", "0.6641082", "0.6641082", "0.6641082", "0.6641082", "0.6641082", "0.6641082", "0.6641082", "0.6641082", "0.6641082", "0.6641082", "0.6641082", "0.6641082", "0.6641082", "0.6641082", "0.6641082", "0.6641082", "0.6641082", "0.6641082", "0.6641082", "0.6641082", "0.6641082", "0.6641082", "0.6641082", "0.6641082", "0.6641082", "0.6641082", "0.6641082", "0.6641082", "0.6641082", "0.6641082", "0.6641082", "0.6641082", "0.6641082", "0.6641082", "0.6641082", "0.6641082", "0.6641082", "0.6641082", "0.6641082", "0.6641082", "0.6641082", "0.6641082", "0.6641082", "0.6641082", "0.6641082", "0.6641082", "0.6641082" ]
0.0
-1
Instead of [object Object]
get [Symbol.toStringTag]() { return Person; // Returns [object Person] }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function e(A){return null==A?\"\":\"object\"==typeof A?JSON.stringify(A,null,2):String(A)}", "function obj(objec){\nreturn objec;\n}", "function ro(t){return Object.prototype.toString.call(t)===\"[object Object]\"}", "function o(e){return e&&\"object\"==typeof e&&!Array.isArray(e)}", "objd(obj) {\n\n return toObject(obj);\n }", "function i(e){return null==e?\"\":\"object\"==typeof e?JSON.stringify(e,null,2):String(e)}", "function a(e){return null==e?\"\":\"object\"==typeof e?JSON.stringify(e,null,2):String(e)}", "function t(e){return null==e?\"\":\"object\"==typeof e?JSON.stringify(e,null,2):String(e)}", "function ra(t){return Object.prototype.toString.call(t)===\"[object Object]\"}", "function o(e){return\"[object Object]\"==={}.toString.call(e)}", "function r(e){return e&&\"object\"==typeof e&&!Array.isArray(e)}", "function r(e){return e&&\"object\"==typeof e&&!Array.isArray(e)}", "function r(e){return e&&\"object\"==typeof e&&!Array.isArray(e)}", "function s(e){return\"[object Object]\"===Object.prototype.toString.call(e)}", "function r(e){return null==e?\"\":\"object\"==typeof e?JSON.stringify(e,null,2):String(e)}", "function r(e){return null==e?\"\":\"object\"==typeof e?JSON.stringify(e,null,2):String(e)}", "function isObject(e){return Object.prototype.toString.call(e)===\"[object Object]\"}", "function n(e){return\"[object Object]\"==={}.toString.call(e)}", "function n(e){return\"[object Object]\"==={}.toString.call(e)}", "function lo(obj) {\n\treturn (JSON.parse(JSON.stringify(obj)));\n}", "function xS(e){return\"[object Object]\"===Object.prototype.toString.call(e)}", "function s(t){return null!=t&&\"object\"===typeof t&&!1===Array.isArray(t)}", "function n(t){return\"[object Object]\"===Object.prototype.toString.call(t)}", "function n(t){return\"[object Object]\"===Object.prototype.toString.call(t)}", "function i(e){return\"[object Object]\"===Object.prototype.toString.call(e)}", "function n(t){return\"[object Object]\"==={}.toString.call(t)}", "function c(e){return null!==e&&\"object\"==typeof e}", "function typeStr (obj) {\n\t return isArray(obj) ? 'array' : typeof obj;\n\t }", "function typeStr (obj) {\n\t return isArray(obj) ? 'array' : typeof obj;\n\t }", "function objectArray(){\n return arguments[0]\n}", "function n(e){return null==e?\"\":\"object\"==typeof e?JSON.stringify(e,null,2):String(e)}", "function n(e){return null==e?\"\":\"object\"==typeof e?JSON.stringify(e,null,2):String(e)}", "function n(e){return null==e?\"\":\"object\"==typeof e?JSON.stringify(e,null,2):String(e)}", "function n(e){return null==e?\"\":\"object\"==typeof e?JSON.stringify(e,null,2):String(e)}", "function n(e){return null==e?\"\":\"object\"==typeof e?JSON.stringify(e,null,2):String(e)}", "function n(e){return null==e?\"\":\"object\"==typeof e?JSON.stringify(e,null,2):String(e)}", "function n(e){return null==e?\"\":\"object\"==typeof e?JSON.stringify(e,null,2):String(e)}", "function n(e){return null==e?\"\":\"object\"==typeof e?JSON.stringify(e,null,2):String(e)}", "function n(e){return null==e?\"\":\"object\"==typeof e?JSON.stringify(e,null,2):String(e)}", "function n(e){return null==e?\"\":\"object\"==typeof e?JSON.stringify(e,null,2):String(e)}", "function n(e){return null==e?\"\":\"object\"==typeof e?JSON.stringify(e,null,2):String(e)}", "function n(e){return null==e?\"\":\"object\"==typeof e?JSON.stringify(e,null,2):String(e)}", "function n(e){return null==e?\"\":\"object\"==typeof e?JSON.stringify(e,null,2):String(e)}", "function n(e){return null==e?\"\":\"object\"==typeof e?JSON.stringify(e,null,2):String(e)}", "function n(e){return null==e?\"\":\"object\"==typeof e?JSON.stringify(e,null,2):String(e)}", "function n(e){return null==e?\"\":\"object\"==typeof e?JSON.stringify(e,null,2):String(e)}", "function n(e){return null==e?\"\":\"object\"==typeof e?JSON.stringify(e,null,2):String(e)}", "function n(e){return null==e?\"\":\"object\"==typeof e?JSON.stringify(e,null,2):String(e)}", "function n(e){return null==e?\"\":\"object\"==typeof e?JSON.stringify(e,null,2):String(e)}", "function r(e){return\"[object Object]\"==={}.toString.call(e)}", "function r(e){return\"[object Object]\"==={}.toString.call(e)}", "function r(t){return\"[object Object]\"==={}.toString.call(t)}", "function r(t){return\"[object Object]\"==={}.toString.call(t)}", "function r(e){return\"[object Object]\"===Object.prototype.toString.call(e)}", "function np(e){return\"[object Object]\"===Object.prototype.toString.call(e)}", "function r(e){return null!=e&&\"object\"==typeof e&&!1===Array.isArray(e)}", "function r(e){return null!=e&&\"object\"==typeof e&&!1===Array.isArray(e)}", "function r(e){return null!=e&&\"object\"==typeof e&&!1===Array.isArray(e)}", "function typeStr (obj) {\r\n return isArray(obj) ? 'array' : typeof obj;\r\n }", "function G(e){return\"[object Object]\"===Object.prototype.toString.call(e)}", "function _(e){return\"[object Object]\"===Object.prototype.toString.call(e)}", "function r(t){return null==t?\"\":\"object\"==typeof t?JSON.stringify(t,null,2):String(t)}", "function r(t){return null==t?\"\":\"object\"==typeof t?JSON.stringify(t,null,2):String(t)}", "function i(t){return null!==t&&\"object\"==typeof t}", "function toArray(obj) {\n\t return isArray(obj) ? obj : [obj];\n\t }", "get serializedObject() {}", "function isObject$1(e){return\"[object Object]\"===Object.prototype.toString.call(e)}", "function dereference(obj) {\n\treturn JSON.parse(JSON.stringify(obj));\n}", "function object (data) {\n return Object.prototype.toString.call(data) === '[object Object]';\n }", "toString() {\n return (JSON.stringify(this.object));\n }", "function Il(e){return\"[object Object]\"===Object.prototype.toString.call(e)}", "function r(t){return t&&\"object\"==typeof t&&!Array.isArray(t)}", "function manipulationBareObj( value ) {\n\treturn value;\n}", "function typeStr (obj) {\n return isArray(obj) ? 'array' : typeof obj;\n }", "function typeStr (obj) {\n return isArray(obj) ? 'array' : typeof obj;\n }", "function typeStr (obj) {\n return isArray(obj) ? 'array' : typeof obj;\n }", "function typeStr (obj) {\n return isArray(obj) ? 'array' : typeof obj;\n }", "function typeStr (obj) {\n return isArray(obj) ? 'array' : typeof obj;\n }", "function typeStr (obj) {\n return isArray(obj) ? 'array' : typeof obj;\n }", "function typeStr (obj) {\n return isArray(obj) ? 'array' : typeof obj;\n }", "function typeStr (obj) {\n return isArray(obj) ? 'array' : typeof obj;\n }", "function typeStr (obj) {\n return isArray(obj) ? 'array' : typeof obj;\n }", "function typeStr (obj) {\n return isArray(obj) ? 'array' : typeof obj;\n }", "function typeStr (obj) {\n return isArray(obj) ? 'array' : typeof obj;\n }", "function typeStr (obj) {\n return isArray(obj) ? 'array' : typeof obj;\n }", "function typeStr (obj) {\n return isArray(obj) ? 'array' : typeof obj;\n }", "function typeStr (obj) {\n return isArray(obj) ? 'array' : typeof obj;\n }", "function typeStr (obj) {\n return isArray(obj) ? 'array' : typeof obj;\n }", "function typeStr (obj) {\n return isArray(obj) ? 'array' : typeof obj;\n }", "function typeStr (obj) {\n return isArray(obj) ? 'array' : typeof obj;\n }", "function o(n){return null!==n&&\"object\"==typeof n}", "function iterable(object){\n\t\tif ((object instanceof Array) || (object instanceof NodeList)){\n\t\t\treturn object;\n\t\t}\n\t\treturn [object];\n\t}", "function n(t){return null==t?\"\":\"object\"==typeof t?JSON.stringify(t,null,2):String(t)}", "function n(t){return null==t?\"\":\"object\"==typeof t?JSON.stringify(t,null,2):String(t)}", "function n(t){return null==t?\"\":\"object\"==typeof t?JSON.stringify(t,null,2):String(t)}", "function n(t){return null==t?\"\":\"object\"==typeof t?JSON.stringify(t,null,2):String(t)}", "function n(t){return null==t?\"\":\"object\"==typeof t?JSON.stringify(t,null,2):String(t)}", "function n(t){return null==t?\"\":\"object\"==typeof t?JSON.stringify(t,null,2):String(t)}", "function n(t){return null==t?\"\":\"object\"==typeof t?JSON.stringify(t,null,2):String(t)}", "function n(t){return null==t?\"\":\"object\"==typeof t?JSON.stringify(t,null,2):String(t)}", "function n(t){return null==t?\"\":\"object\"==typeof t?JSON.stringify(t,null,2):String(t)}" ]
[ "0.66159385", "0.6598941", "0.65987206", "0.655291", "0.6509143", "0.6467227", "0.6466849", "0.64547175", "0.64215934", "0.64211017", "0.6406228", "0.6406228", "0.6406228", "0.63902116", "0.6344434", "0.6344434", "0.63356024", "0.63175327", "0.63175327", "0.6288995", "0.6271162", "0.6262109", "0.6252795", "0.6252795", "0.6252742", "0.62455386", "0.6240801", "0.6225187", "0.6225187", "0.62206346", "0.6211004", "0.6211004", "0.6211004", "0.6211004", "0.6211004", "0.6211004", "0.6211004", "0.6211004", "0.6211004", "0.6211004", "0.6211004", "0.6211004", "0.6211004", "0.6211004", "0.6211004", "0.6211004", "0.6211004", "0.6211004", "0.6211004", "0.6206645", "0.6206645", "0.6189429", "0.6189429", "0.6185538", "0.6165665", "0.61515737", "0.61515737", "0.61515737", "0.61196727", "0.61133355", "0.6109822", "0.6089626", "0.6089626", "0.6082186", "0.60705805", "0.6068918", "0.6063064", "0.6044435", "0.6042999", "0.6039524", "0.6039411", "0.60385513", "0.60309285", "0.6025638", "0.6025638", "0.6025638", "0.6025638", "0.6025638", "0.6025638", "0.6025638", "0.6025638", "0.6025638", "0.6025638", "0.6025638", "0.6025638", "0.6025638", "0.6025638", "0.6025638", "0.6025638", "0.6025638", "0.60246754", "0.6023703", "0.6018816", "0.6018816", "0.6018816", "0.6018816", "0.6018816", "0.6018816", "0.6018816", "0.6018816", "0.6018816" ]
0.0
-1
When js tries to convert obj to primitive value e.g. String employee + "some string"
[Symbol.toPrimitive]() { return this.sayHello(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function coercePrimitiveToObject(obj) {\n if(isPrimitiveType(obj)) {\n obj = object(obj);\n }\n if(noKeysInStringObjects && isString(obj)) {\n forceStringCoercion(obj);\n }\n return obj;\n }", "function getObjValue(obj){\n\tswitch(getType(obj)){\n\t\tcase \"number\":\n\t\tcase \"date\":\n\t\tcase \"string\":\n\t\t\treturn obj;\n\t\tdefault:\n\t\t\treturn objToString(obj);\n\t}\n}", "function coercePrimitiveToObject(obj) {\n if (isPrimitive(obj)) {\n obj = Object(obj);\n }\n // istanbul ignore next\n if (NO_KEYS_IN_STRING_OBJECTS && isString(obj)) {\n forceStringCoercion(obj);\n }\n return obj;\n }", "function _stringCoerce(obj) {\n return obj;\n}", "function _functionCoerce(obj) {\n return obj.name + '=>' + obj.toString();\n}", "function forceStringCoercion(obj) {\n var i = 0, chr;\n while(chr = obj.charAt(i)) {\n obj[i++] = chr;\n }\n }", "function forceStringCoercion(obj) {\n var i = 0, chr;\n while (chr = obj.charAt(i)) {\n obj[i++] = chr;\n }\n }", "function setAsPrimitive(obj) {\n obj[primitiveKey] = true;\n }", "function setAsPrimitive(obj) {\n\t obj[primitiveKey] = true;\n\t}", "function _numberCoerce(obj) {\n return obj.toString();\n}", "[Symbol.toPrimitive]() {\n return this.toString();\n }", "function setAsPrimitive(obj) {\n obj[primitiveKey] = true;\n }", "function setAsPrimitive(obj) {\n obj[primitiveKey] = true;\n }", "function setAsPrimitive(obj) {\n obj[primitiveKey] = true;\n}", "function setAsPrimitive(obj) {\n obj[primitiveKey] = true;\n}", "function setAsPrimitive(obj) {\n obj[primitiveKey] = true;\n}", "function setAsPrimitive(obj) {\n obj[primitiveKey] = true;\n}", "function setAsPrimitive(obj) {\n obj[primitiveKey] = true;\n}", "function setAsPrimitive(obj) {\n obj[primitiveKey] = true;\n}", "function setAsPrimitive(obj) {\n obj[primitiveKey] = true;\n}", "function setAsPrimitive(obj) {\n obj[primitiveKey] = true;\n}", "function setAsPrimitive(obj) {\n obj[primitiveKey] = true;\n}", "function setAsPrimitive(obj) {\n obj[primitiveKey] = true;\n}", "function setAsPrimitive(obj) {\n obj[primitiveKey] = true;\n}", "function isPrimitiveType (obj) {\r\n return ( typeof obj === 'boolean' ||\r\n typeof obj === 'number' ||\r\n typeof obj === 'string' ||\r\n obj === null ||\r\n util.isDate(obj) ||\r\n util.isArray(obj));\r\n}", "function toObject(primitive) {\n if(typeof primitive == \"object\" && null != primitive) {\n return primitive;\n }\n else {\n /* if input isn't null, undefined, boolean, or infinity */\n if(typeof primitive != \"undefined\" &&\n typeof primitive != \"boolean\" &&\n primitive != Infinity &&\n null != primitive) {\n /* return an object */\n return new String(primitive);\n }\n else {\n /* otherwise, return an empty object */\n return [];\n }\n }\n }", "[Symbol.toPrimitive](coercionType) {\n console.log('trying to convert to', coercionType)\n }", "function isPrimitiveType(obj) {\n return (\n typeof obj === 'boolean' ||\n typeof obj === 'number' ||\n typeof obj === 'string' ||\n obj === null ||\n util.isDate(obj) ||\n util.isArray(obj)\n );\n}", "function isPrimitive(value){return typeof value==='string'||typeof value==='number';}", "convertToString(obj, level){\n\t\tif (!rtl.implements(obj, SerializeInterface)){\n\t\t\tif (Utils.isPrimitiveValue(obj)){\n\t\t\t\treturn this.convertToPrimitiveValue(obj, level);\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\t\tvar names = new Vector();\n\t\tvar classname = obj.getClassName();\n\t\tobj.getVariablesNames(names);\n\t\tvar data = new Map();\n\t\tif (this._display_class_name){\n\t\t\tdata.set(\"__class_name__\", classname);\n\t\t}\n\t\tfor (var i = 0; i < names.count(); i++){\n\t\t\tvar key = names.item(i);\n\t\t\tvar value = obj.takeValue(key);\n\t\t\tdata.set(key, value);\n\t\t}\n\t\tvar res_str = this.convertToPrimitiveValue(data, level);\n\t\treturn res_str;\n\t}", "objd(obj) {\n\n return toObject(obj);\n }", "function isPrimitive(obj)\r\n{\r\n\treturn (obj !== Object(obj));\r\n}", "function isValueObject(obj) {\n\treturn (obj instanceof Number) || (obj instanceof String) || (obj instanceof Boolean) || (obj === null);\n}", "function _toString(val){return val==null?'':(typeof val==='undefined'?'undefined':_typeof(val))==='object'?JSON.stringify(val,null,2):String(val);}", "function _booleanCoerce(obj) {\n return obj ? '1' : '0';\n}", "function isPrimitive(v) {\n if (v === undefined) return false;\n if (v === null) return true;\n if (v.constructor == String) return true;\n if (v.constructor == Number) return true;\n if (v.constructor == Boolean) return true;\n if (v.constructor.name == 'ObjectID') return true;\n return false;\n }", "function isPrimitive(value){return typeof value==='string'||typeof value==='number'||typeof value==='boolean';}", "function isPrimitive(value){return typeof value==='string'||typeof value==='number'||typeof value==='boolean';}", "function string(val) {\n return {value: val, type: 'string'};\n}", "static toComparable(obj) {\n // When outputting strings, we prefix with a letter for the type, to guarantee uniqueness of different types.\n if (typeof obj === \"string\") {\n return \"s\" + obj;\n } else if (typeof obj === \"number\") {\n return obj;\n } else if (Buffer.isBuffer(obj)) {\n return \"b\" + obj.toString(\"base64\");\n } else if (typeof obj === \"boolean\") {\n return obj;\n } else if (Long.isLong(obj)) {\n return \"l\" + obj.toString();\n } else if (obj.constructor && typeof obj.constructor.encode === \"function\" && obj.constructor.$type) {\n return \"p\" + obj.constructor.encode(obj).finish().toString(\"base64\");\n } else if (typeof obj === \"object\") {\n return \"j\" + stableJsonStringify(obj);\n } else {\n throw new Error(util.format(\"Object %o is not a protobuf object, object or supported primitive type, and \" +\n \"hence can't be dynamically serialized.\", obj));\n }\n }", "function obj(objec){\nreturn objec;\n}", "function isPrimitive(val) {\n return isVoid(val) || isBoolean(val) || isString(val) || isNumber(val);\n }", "function isPrimitive(val) {\n return isVoid(val) || isBoolean(val) || isString(val) || isNumber(val);\n }", "toString () {\n return JSON.stringify(this.valueOf())\n }", "toString(val) {\n return val == null ? '' : typeof val === 'object' ? JSON.stringify(val, null, 2) : String(val)\n }", "function typeStr(obj) {\n return isArray(obj) ? 'array' : typeof obj === 'undefined' ? 'undefined' : _typeof(obj);\n }", "function ToPrimitive(input /* [, PreferredType] */) { // eslint-disable-line no-unused-vars\n\tvar PreferredType = arguments.length > 1 ? arguments[1] : undefined;\n\t// 1. Assert: input is an ECMAScript language value.\n\t// 2. If Type(input) is Object, then\n\tif (Type(input) === 'object') {\n\t\t// a. If PreferredType is not present, let hint be \"default\".\n\t\tif (arguments.length < 2) {\n\t\t\tvar hint = 'default';\n\t\t\t// b. Else if PreferredType is hint String, let hint be \"string\".\n\t\t} else if (PreferredType === String) {\n\t\t\thint = 'string';\n\t\t\t// c. Else PreferredType is hint Number, let hint be \"number\".\n\t\t} else if (PreferredType === Number) {\n\t\t\thint = 'number';\n\t\t}\n\t\t// d. Let exoticToPrim be ? GetMethod(input, @@toPrimitive).\n\t\tvar exoticToPrim = typeof this.Symbol === 'function' && typeof this.Symbol.toPrimitive === 'symbol' ? GetMethod(input, this.Symbol.toPrimitive) : undefined;\n\t\t// e. If exoticToPrim is not undefined, then\n\t\tif (exoticToPrim !== undefined) {\n\t\t\t// i. Let result be ? Call(exoticToPrim, input, « hint »).\n\t\t\tvar result = Call(exoticToPrim, input, [hint]);\n\t\t\t// ii. If Type(result) is not Object, return result.\n\t\t\tif (Type(result) !== 'object') {\n\t\t\t\treturn result;\n\t\t\t}\n\t\t\t// iii. Throw a TypeError exception.\n\t\t\tthrow new TypeError('Cannot convert exotic object to primitive.');\n\t\t}\n\t\t// f. If hint is \"default\", set hint to \"number\".\n\t\tif (hint === 'default') {\n\t\t\thint = 'number';\n\t\t}\n\t\t// g. Return ? OrdinaryToPrimitive(input, hint).\n\t\treturn OrdinaryToPrimitive(input, hint);\n\t}\n\t// 3. Return input\n\treturn input;\n}", "function isPrimitive(val) {\n return isVoid(val) || isBoolean(val) || isString(val) || isNumber(val);\n }", "function isPrimitive(val) {\n return isVoid(val) || isBoolean(val) || isString(val) || isNumber(val);\n }", "function toString(val){return val==null?'':(typeof val===\"undefined\"?\"undefined\":_typeof2(val))==='object'?JSON.stringify(val,null,2):String(val);}", "function toString(val){return val==null?'':(typeof val===\"undefined\"?\"undefined\":_typeof2(val))==='object'?JSON.stringify(val,null,2):String(val);}", "function objectToString(obj) {\n return stringifiers[(0, typeGuess_1.guessType)(obj)](obj);\n }", "function evaluateExpression() { \n value = expression.call(context, o_O.helpers); \n if(value instanceof String) value = value.toString(); // strange problem\n }", "static objectToTrytes(obj) {\n const json = JSON.stringify(obj);\n const encoded = TextHelper.encodeNonASCII(json);\n return encoded ? TrytesHelper.fromAscii(encoded) : \"\";\n }", "function isPrimitive(value) {\n\t\t return typeof value === 'string' || typeof value === 'number';\n\t\t}", "function ToPrimitive(input /* [, PreferredType] */) { // eslint-disable-line no-unused-vars\n\t\tvar PreferredType = arguments.length > 1 ? arguments[1] : undefined;\n\t\t// 1. Assert: input is an ECMAScript language value.\n\t\t// 2. If Type(input) is Object, then\n\t\tif (Type(input) === 'object') {\n\t\t\t// a. If PreferredType is not present, let hint be \"default\".\n\t\t\tif (arguments.length < 2) {\n\t\t\t\tvar hint = 'default';\n\t\t\t\t// b. Else if PreferredType is hint String, let hint be \"string\".\n\t\t\t} else if (PreferredType === String) {\n\t\t\t\thint = 'string';\n\t\t\t\t// c. Else PreferredType is hint Number, let hint be \"number\".\n\t\t\t} else if (PreferredType === Number) {\n\t\t\t\thint = 'number';\n\t\t\t}\n\t\t\t// d. Let exoticToPrim be ? GetMethod(input, @@toPrimitive).\n\t\t\tvar exoticToPrim = typeof self.Symbol === 'function' && typeof self.Symbol.toPrimitive === 'symbol' ? GetMethod(input, self.Symbol.toPrimitive) : undefined;\n\t\t\t// e. If exoticToPrim is not undefined, then\n\t\t\tif (exoticToPrim !== undefined) {\n\t\t\t\t// i. Let result be ? Call(exoticToPrim, input, « hint »).\n\t\t\t\tvar result = Call(exoticToPrim, input, [hint]);\n\t\t\t\t// ii. If Type(result) is not Object, return result.\n\t\t\t\tif (Type(result) !== 'object') {\n\t\t\t\t\treturn result;\n\t\t\t\t}\n\t\t\t\t// iii. Throw a TypeError exception.\n\t\t\t\tthrow new TypeError('Cannot convert exotic object to primitive.');\n\t\t\t}\n\t\t\t// f. If hint is \"default\", set hint to \"number\".\n\t\t\tif (hint === 'default') {\n\t\t\t\thint = 'number';\n\t\t\t}\n\t\t\t// g. Return ? OrdinaryToPrimitive(input, hint).\n\t\t\treturn OrdinaryToPrimitive(input, hint);\n\t\t}\n\t\t// 3. Return input\n\t\treturn input;\n\t}", "_encodeObject(object) {\n return object.termType === 'Literal' ? this._encodeLiteral(object) : this._encodeIriOrBlank(object);\n }", "function primitives (value) {\n return value instanceof Primitive ? Primitive(value) : value\n }", "type(_obj) {\n return this.typeChr(_obj);\n }", "function isRealValue(obj){\n return obj && obj !== \"null\" && obj!== \"undefined\";\n}", "function a(e){return null==e?\"\":\"object\"==typeof e?JSON.stringify(e,null,2):String(e)}", "convert(value) {\n return value instanceof expressionProperties_1.StringExpression ? value : new expressionProperties_1.StringExpression(value);\n }", "function typeStr(obj) {\n return isArray(obj) ? 'array' : typeof obj === 'undefined' ? 'undefined' : _typeof(obj);\n }", "function e(A){return null==A?\"\":\"object\"==typeof A?JSON.stringify(A,null,2):String(A)}", "static _append(str, obj) {\r\n if (Array.isArray(obj)) {\r\n return HookManager._appendArrayString(str, obj);\r\n }\r\n else if (typeof obj == \"object\") {\r\n return HookManager._appendObjectString(str, obj);\r\n }\r\n else if (typeof obj == \"function\")\r\n str += obj.toString().replace(/\\s/g, \"\");\r\n else if (typeof obj == \"bigint\")\r\n str += util.inspect(obj);\r\n else\r\n str += JSON.stringify(obj);\r\n return str;\r\n }", "static castToPrimitiveType(field, data) {\n if (data.hasOwnProperty(field)) {\n if (Array.isArray(data[field])) {\n data[field] = data[field].map(val => detectType(val));\n } else {\n data[field] = detectType(data[field]);\n }\n }\n }", "function ToPrimitive(input /* [, PreferredType] */) { // eslint-disable-line no-unused-vars\n var PreferredType = arguments.length > 1 ? arguments[1] : undefined;\n // 1. Assert: input is an ECMAScript language value.\n // 2. If Type(input) is Object, then\n if (Type(input) === 'object') {\n // a. If PreferredType is not present, let hint be \"default\".\n if (arguments.length < 2) {\n var hint = 'default';\n // b. Else if PreferredType is hint String, let hint be \"string\".\n } else if (PreferredType === String) {\n hint = 'string';\n // c. Else PreferredType is hint Number, let hint be \"number\".\n } else if (PreferredType === Number) {\n hint = 'number';\n }\n // d. Let exoticToPrim be ? GetMethod(input, @@toPrimitive).\n var exoticToPrim = typeof this.Symbol === 'function' && typeof this.Symbol.toPrimitive === 'symbol' ? GetMethod(input, this.Symbol.toPrimitive) : undefined;\n // e. If exoticToPrim is not undefined, then\n if (exoticToPrim !== undefined) {\n // i. Let result be ? Call(exoticToPrim, input, « hint »).\n var result = Call(exoticToPrim, input, [hint]);\n // ii. If Type(result) is not Object, return result.\n if (Type(result) !== 'object') {\n return result;\n }\n // iii. Throw a TypeError exception.\n throw new TypeError('Cannot convert exotic object to primitive.');\n }\n // f. If hint is \"default\", set hint to \"number\".\n if (hint === 'default') {\n hint = 'number';\n }\n // g. Return ? OrdinaryToPrimitive(input, hint).\n return OrdinaryToPrimitive(input, hint);\n }\n // 3. Return input\n return input;\n }", "function isPrimitive(v) {\n\t\treturn typeof v === \"string\";\n\t}", "function convertObjToString(obj) {\n try {\n var s = stringify(obj);\n return s;\n } catch (ex) {\n console_log(ex.name + \":\" + ex.message + \":\" + ex.location + \":\" + ex.text);\n }\n }", "function ue(t) {\n return {\n integerValue: \"\" + t\n };\n}", "function realRuntimeType(obj) {\n let result = checkPrimitiveType(obj);\n if (result !== null) return result;\n // TODO(vsm): Should we treat Dart and JS objects differently here?\n // E.g., we can check if obj instanceof core.Object to differentiate.\n result = obj[_runtimeType];\n if (result) return result;\n result = obj.constructor;\n if (result == Function) {\n return getFunctionType(obj);\n }\n return result;\n }", "function primitives(value) {\n return value instanceof Primitive ? Primitive(value) : value;\n }", "function SN(obj) {\n if (obj instanceof N) {\n return obj;\n }\n\n var ret = obj;\n\n if (typeof ret !== \"string\") {\n if (typeof ret === \"number\") {\n return toFlonum(ret);\n }\n if (ret instanceof Number) {\n return toFlonum(+ret);\n }\n\n if (ret == null) {\n // XXX Rethink this.\n return (ret === null ? INEXACT_ZERO : NAN);\n }\n\n ret = ret.valueOf();\n if (typeof ret === \"number\") {\n return toFlonum(ret);\n }\n ret = String(ret);\n }\n ret = stringToNumber(ret);\n if (ret === false) {\n raise(\"&assertion\", \"not a number\", obj);\n }\n return ret;\n}", "function converter (obj) {\n\t\n\t\tarr.push(obj.value) //push in the value\n\n\t\tif(obj.rest !== null){\n\n\t\t\tconverter(obj.rest); //keep calling the rest in the object\n\t\n\t\t}\n\t}", "static isString(obj) {\n return typeof obj === 'string';\n }", "function extractAndConvert(obj, key) {\n return 'Value: ' + obj[key];\n }", "function isPrimitive(o) {\r\n return o !== Object(o);\r\n }", "function isString(obj){\r\n\treturn typeof(obj) == 'string';\r\n}", "function valString(ob) {\n if (ob instanceof Array) {\n if(ob.length==0){return \"[]\"}\n var ret = \"[\"\n for(var v in ob){\n ret = ret + valString(ob[v])+\",\"\n }\n return ret.slice(0,-1)+\"]\"\n }\n if (isAbstract(ob)){\n return ob.id\n }\n if (isClosure(ob)) {\n// throw new Error(\"Tracer valString received closure object. That makes it sad.\")\n return escodegen.generate(ob) //FIXME: doesn't capture env variables.\n }\n if (typeof ob === \"boolean\"\n || typeof ob === \"number\") {\n return ob.toString()\n }\n if (typeof ob === \"string\") {\n return \"'\"+ob.toString()+\"'\"\n }\n if (typeof ob === \"undefined\") {\n return \"undefined\"\n }\n if (typeof ob == \"function\") {\n return ob.sourcename //the original id in the js environment.\n }\n //otherwise generate json parsable representation:\n var json = JSON.stringify(ob)\n if(json == undefined){\n throw new Error(\"Tracer valString() dosen't know how to convert \"+ob+\" to a string.\")\n } else {\n return \"JSON.parse('\" + json + \"')\"\n }\n}", "function i(e){return null==e?\"\":\"object\"==typeof e?JSON.stringify(e,null,2):String(e)}", "function getValuePreview(type, object, value) {\n if (type === 'null' || type === 'undefined') {\n return type;\n }\n if (type === 'string' || type === 'stringifiable') {\n value = '\"' + escapeString(value) + '\"';\n }\n if (type === 'function') {\n // Remove content of the function\n return object.toString()\n .replace(/[\\r\\n]/g, '')\n .replace(/\\{.*\\}/, '') + '{…}';\n }\n return value;\n }", "function coercion() { \r\ndocument.write(\"10\" + 5);\r\n}//thus would return 105 - tacks 5 onto the string\"10\"", "function isPrimitive (value) {\n\t return typeof value === 'string' || typeof value === 'number'\n\t}", "function isPrimitive (value) {\n\t return typeof value === 'string' || typeof value === 'number'\n\t}", "function isPrimitive (value) {\n\t return typeof value === 'string' || typeof value === 'number'\n\t}", "function isPrimitive (value) {\n\t return typeof value === 'string' || typeof value === 'number'\n\t}", "function isPrimitive (value) {\n\t return typeof value === 'string' || typeof value === 'number'\n\t}", "function isPrimitive (value) {\n\t return typeof value === 'string' || typeof value === 'number'\n\t}", "function isPrimitive (value) {\n\t return typeof value === 'string' || typeof value === 'number'\n\t}", "function isPrimitive (value) {\n\t return typeof value === 'string' || typeof value === 'number'\n\t}", "function _toString(val) {\n\t\t return val == null ? '' : typeof val === 'object' ? JSON.stringify(val, null, 2) : String(val);\n\t\t}", "function extractAndConvert(obj, key) {\n return \"Value: \" + obj[key];\n}", "function isPrimitive(value) {\n\t return typeof value === 'string' || typeof value === 'number';\n\t}", "function isPrimitive(value) {\n\t return typeof value === 'string' || typeof value === 'number';\n\t}", "clean_object(val) {\n if (!this.is_object(val)) return val;\n return this.lower_props(this.trim_values(val));\n }", "function parsePrimitive(info, name, value) {\n var result = value;\n if (info.number || info.positiveNumber) {\n if (!isNaN(result) && result !== '') {\n result = Number(result);\n }\n } else if (info.boolean || info.overloadedBoolean) {\n // Accept `boolean` and `string`.\n if (typeof result === 'string' && (result === '' || normalize(value) === normalize(name))) {\n result = true;\n }\n }\n return result;\n}", "function typeStr (obj) {\r\n return isArray(obj) ? 'array' : typeof obj;\r\n }", "value(obj){\n return obj == null ? null : obj.address || obj;\n }", "function type(obj){\n var result = Object.prototype.toString.call(obj).replace(/\\[object /,'').replace(']','').toLowerCase();\n if(result === 'object' && !obj){\n return obj === null ? 'null' : 'undefined';\n }else{\n return result;\n }\n}", "function standardiseObject(obj) {\n return JSON.parse(JSON.stringify(obj));\n}", "function convertStringToObj(str) {\n try {\n var o = eval(\"(\" + str + \")\"); // eval(str);\n return o;\n } catch (ex) {\n console_log(ex.name + \":\" + ex.message + \":\" + ex.location + \":\" + ex.text);\n }\n }" ]
[ "0.7187065", "0.67569697", "0.6425605", "0.6368825", "0.63613397", "0.633806", "0.63107574", "0.62271416", "0.61952853", "0.6169306", "0.6162352", "0.6143464", "0.6143464", "0.60651433", "0.6045882", "0.6045882", "0.6045882", "0.6045882", "0.6045882", "0.6045882", "0.6045882", "0.6045882", "0.6045882", "0.6045882", "0.60288155", "0.5982679", "0.595344", "0.5913438", "0.5863279", "0.5836168", "0.58335996", "0.5757804", "0.57552665", "0.575053", "0.5719765", "0.57111967", "0.57098997", "0.57098997", "0.5686496", "0.56588006", "0.5634097", "0.56191593", "0.56191593", "0.5606516", "0.5588169", "0.55553895", "0.55553377", "0.55473244", "0.55473244", "0.5544368", "0.5544368", "0.5531401", "0.5526841", "0.5522654", "0.55190027", "0.55167174", "0.5507381", "0.55058014", "0.54983205", "0.548728", "0.5478189", "0.54726267", "0.5469185", "0.5461124", "0.545418", "0.54508954", "0.54440945", "0.5435498", "0.54345423", "0.5431547", "0.5431295", "0.54221594", "0.5420178", "0.5415477", "0.54120076", "0.5410953", "0.54101306", "0.5402647", "0.5400056", "0.5384499", "0.53818864", "0.5380212", "0.53790814", "0.53790814", "0.53790814", "0.53790814", "0.53790814", "0.53790814", "0.53790814", "0.53790814", "0.5374716", "0.53710765", "0.5367625", "0.5367625", "0.5365906", "0.5365843", "0.53560394", "0.53427786", "0.5340417", "0.5338435", "0.53364956" ]
0.0
-1
public method to stop watching all of the instance target elements for visibility changes
destroy() { this.instance.disconnect(); return; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "stopHides(){\n\n\t\t\t// containing element.\n\t\t\tvar sel = this.$refs.hidables || this.$el;\n\t\t\tvar hideElms = sel.querySelectorAll('.hidable');\n\t\t\tif (!hideElms) return;\n\n\t\t\t// remove event listeners.\n\t\t\tfor( let i = hideElms.length-1; i>= 0; i--) {\n\n\t\t\t\tvar h = hideElms[i];\n\n\t\t\t\th.removeEventListener('pointerdown', this.onTogHide, true );\n\t\t\t\th.classList.remove('configHiding', 'inConfig');\n\n\t\t\t}\n\n\t\t\tthis.onTogHide = null;\n\t\t\tthis.inConfig = false;\n\n\t\t}", "stopObservingAllElements() {\n this._observer.disconnect();\n }", "removeDisplayedListeners() {\n if ( this.visibilityTracker ) {\n this.visibilityTracker.removeListener( this.boundVisibilityListener );\n this.visibilityTracker.dispose();\n this.visibilityTracker = null;\n }\n if ( this.node ) {\n this.node.changedInstanceEmitter.removeListener( this.boundInstancesChangedListener );\n this.node = null;\n }\n }", "clickAll_disappearing(timeout = timeoutWdio) {\n this.logAndWait([\n { text: '👇 ', style: log.style.emoji },\n { text: 'Click to remove all instances of ', style: log.style.verb },\n { text: `${this.elementName} `, style: log.style.object },\n { text: this.selector, style: log.style.selector }, timeout]);\n\n this.click_waitForChange({ doLog: false });\n\n while (this.isExisting()) {\n this.click_waitForChange({ doLog: false });\n }\n }", "hide() {\n if (this[$visible]) {\n this[$visible] = false;\n this[$updateVisibility]({ notify: true });\n }\n }", "stopObservation() {\n\t\tif (!this.observer || !this.config.query || !this.wrapperElement) {\n\t\t\treturn\n\t\t}\n\t\tthis.observer.disconnect()\n\t}", "_onStop(){\n\t\tthis._isWatching = false\n\t}", "function stop() {\n /*\n Iterates over all of the visualizations and stop the visualization.\n */\n for (let i = 0; i < config.visualizations.active.length; i++) {\n config.visualizations.active[i].stopVisualization();\n }\n\n /*\n Clear the active visualizations.\n */\n config.visualizations.active = [];\n }", "_pauseEvents() {\n this.isOn = false;\n this.$element.off({\n '.zf.equalizer': this._bindHandler.onPostEqualizedBound,\n 'resizeme.zf.trigger': this._bindHandler.onResizeMeBound,\n\t 'mutateme.zf.trigger': this._bindHandler.onResizeMeBound\n });\n }", "function stopWatchingWindow() {\n\n\t\t\tisWatchingWindow = false;\n\n\t\t\t// Stop watching for window changes.\n\t\t\twin.off(\"resize.bnLazySrc\");\n\t\t\twin.off(\"scroll.bnLazySrc\");\n\n\t\t\t// Stop watching for document changes.\n\t\t\tclearInterval(documentTimer);\n\n\t\t}", "@autobind\n unPauseVisuals() {\n this.pause = false;\n this.animate();\n }", "handleTrailVisibilityChange() {\n if ( this.visibilityTracker && !this.visibilityTracker.trailVisibleProperty.value ) {\n this.focusProperty.value = null;\n this.onRemoveFocus();\n }\n }", "destroy() {\n\t\tthis.runFinalReadReport()\n\t\tthis.stopObservation()\n\t\tthis.currentlyObservedElements = new Set()\n\t\tthis.visibleElements = new Set()\n\t}", "function stopObserving() {\n if (refCount > 0) {\n refCount -= 1;\n }\n\n if (refCount === 0) {\n _resetState();\n }\n}", "function stopObserving() {\n if (refCount > 0) {\n refCount -= 1;\n }\n\n if (refCount === 0) {\n _resetState();\n }\n}", "function stopObserving() {\n if (refCount > 0) {\n refCount -= 1;\n }\n\n if (refCount === 0) {\n _resetState();\n }\n}", "_hideAll() {\n this.views.directorySelection.hide();\n this.views.training.hide();\n this.views.messages.hide();\n this.views.directorySelection.css('visibility', 'hidden');\n this.views.training.css('visibility', 'hidden');\n this.views.messages.css('visibility', 'hidden');\n }", "function stopWatchingWindow() {\n\n isWatchingWindow = false;\n\n // Stop watching for window changes.\n win.off(\"resize.bnLazySrc\");\n win.off(\"scroll.bnLazySrc\");\n\n // Stop watching for document changes.\n clearInterval(documentTimer);\n\n }", "detached() {\n this.vGridObservables.disableObservablesAttributes();\n this.vGridObservables.disableObservablesCollection();\n this.vGridObservables.disableObservablesArray();\n }", "detached() {\n this.vGridObservables.disableObservablesAttributes();\n this.vGridObservables.disableObservablesCollection();\n this.vGridObservables.disableObservablesArray();\n }", "function stopWatchingForValueChange() {\n if (!activeElement) return;\n activeElement.detachEvent('onpropertychange', handlePropertyChange);\n activeElement = null;\n activeElementInst = null;\n }", "function stopWatchingForValueChange() {\n if (!activeElement) {\n return;\n }\n activeElement.detachEvent('onpropertychange', handlePropertyChange);\n activeElement = null;\n activeElementInst = null;\n }", "stop() {\n\t\tthis._stopAtNextUpdate = true;\n\t}", "function stop() {\n \tclearInterval(watch);\n }", "function stopWatchingForValueChange() {\n if (!activeElement) {\n return;\n }\n\n activeElement.detachEvent(\n 'onpropertychange',\n handlePropertyChange,\n );\n activeElement = null;\n activeElementInst = null;\n }", "_stopObserver() {\n for (var i = 0; i < this.__eventNames.length; i++) {\n qx.bom.Event.removeNativeListener(\n this.__defaultTarget,\n this.__eventNames[i],\n this.__wrappedListener\n );\n }\n }", "handleVisibilityChange() {\n switch (document.visibilityState) {\n case 'visible':\n this.update();\n this.continue();\n break;\n\n case 'hidden':\n this.pause();\n break;\n\n default:\n }\n }", "function stopWatchingForValueChange(){if(!activeElement){return;}activeElement.detachEvent('onpropertychange',handlePropertyChange);activeElement=null;activeElementInst=null;}", "function stopWatchingForValueChange(){if(!activeElement){return;}activeElement.detachEvent('onpropertychange',handlePropertyChange);activeElement=null;activeElementInst=null;}", "function stopWatchingForValueChange(){if(!activeElement){return;}activeElement.detachEvent('onpropertychange',handlePropertyChange);activeElement=null;activeElementInst=null;}", "function stopWatchingForValueChange(){if(!activeElement){return;}activeElement.detachEvent('onpropertychange',handlePropertyChange);activeElement=null;activeElementInst=null;}", "function stopWatchingForValueChange(){if(!activeElement){return;}activeElement.detachEvent('onpropertychange',handlePropertyChange);activeElement=null;activeElementInst=null;}", "function stopWatchingForValueChange(){if(!activeElement){return;}activeElement.detachEvent('onpropertychange',handlePropertyChange);activeElement=null;activeElementInst=null;}", "function stopWatchingForValueChange(){if(!activeElement){return;}activeElement.detachEvent('onpropertychange',handlePropertyChange);activeElement=null;activeElementInst=null;}", "function stopWatchingForValueChange(){if(!activeElement){return;}activeElement.detachEvent('onpropertychange',handlePropertyChange);activeElement=null;activeElementInst=null;}", "function stopWatchingForValueChange(){if(!activeElement){return;}activeElement.detachEvent('onpropertychange',handlePropertyChange);activeElement=null;activeElementInst=null;}", "function stopWatchingForValueChange(){if(!activeElement){return;}activeElement.detachEvent('onpropertychange',handlePropertyChange);activeElement=null;activeElementInst=null;}", "function stopWatchingForValueChange(){if(!activeElement){return;}activeElement.detachEvent('onpropertychange',handlePropertyChange);activeElement=null;activeElementInst=null;}", "function stopWatchingForValueChange(){if(!activeElement){return;}activeElement.detachEvent('onpropertychange',handlePropertyChange);activeElement=null;activeElementInst=null;}", "function stopWatchingForValueChange() {\n if (!activeElement) {\n return;\n }\n activeElement.detachEvent('onpropertychange', handlePropertyChange);\n activeElement = null;\n activeElementInst = null;\n }", "function stopWatchingForValueChange() {\n if (!activeElement) {\n return;\n }\n activeElement.detachEvent('onpropertychange', handlePropertyChange);\n activeElement = null;\n activeElementInst = null;\n }", "function stopWatchingForValueChange() {\n if (!activeElement) {\n return;\n }\n activeElement.detachEvent('onpropertychange', handlePropertyChange);\n activeElement = null;\n activeElementInst = null;\n }", "function stopWatchingForValueChange() {\n if (!activeElement) {\n return;\n }\n activeElement.detachEvent('onpropertychange', handlePropertyChange);\n activeElement = null;\n activeElementInst = null;\n }", "function stopWatchingForValueChange() {\n if (!activeElement) {\n return;\n }\n\n activeElement.detachEvent('onpropertychange', handlePropertyChange);\n activeElement = null;\n activeElementInst = null;\n }", "function stopWatchingForValueChange() {\n if (!activeElement) {\n return;\n }\n\n activeElement.detachEvent('onpropertychange', handlePropertyChange);\n activeElement = null;\n activeElementInst = null;\n }", "function stopWatchingForValueChange() {\n if (!activeElement) {\n return;\n }\n\n activeElement.detachEvent('onpropertychange', handlePropertyChange);\n activeElement = null;\n activeElementInst = null;\n }", "function stopWatchingForValueChange() {\n if (!activeElement) {\n return;\n }\n\n activeElement.detachEvent('onpropertychange', handlePropertyChange);\n activeElement = null;\n activeElementInst = null;\n }", "function stopWatchingForValueChange() {\n if (!activeElement) {\n return;\n }\n\n activeElement.detachEvent('onpropertychange', handlePropertyChange);\n activeElement = null;\n activeElementInst = null;\n }", "function stopWatchingForValueChange() {\n if (!activeElement) {\n return;\n }\n\n activeElement.detachEvent('onpropertychange', handlePropertyChange);\n activeElement = null;\n activeElementInst = null;\n }", "function stopWatchingForValueChange() {\n if (!activeElement) {\n return;\n }\n\n activeElement.detachEvent('onpropertychange', handlePropertyChange);\n activeElement = null;\n activeElementInst = null;\n }", "function stopWatchingForValueChange() {\n if (!activeElement) {\n return;\n }\n\n activeElement.detachEvent('onpropertychange', handlePropertyChange);\n activeElement = null;\n activeElementInst = null;\n }", "function stopWatchingForValueChange() {\n if (!activeElement) {\n return;\n }\n\n activeElement.detachEvent('onpropertychange', handlePropertyChange);\n activeElement = null;\n activeElementInst = null;\n }", "function stopWatchingForValueChange() {\n if (!activeElement) {\n return;\n }\n\n activeElement.detachEvent('onpropertychange', handlePropertyChange);\n activeElement = null;\n activeElementInst = null;\n }", "function stopWatchingForValueChange() {\n if (!activeElement) {\n return;\n }\n\n activeElement.detachEvent('onpropertychange', handlePropertyChange);\n activeElement = null;\n activeElementInst = null;\n }", "function stopWatchingForValueChange() {\n if (!activeElement) {\n return;\n }\n\n activeElement.detachEvent('onpropertychange', handlePropertyChange);\n activeElement = null;\n activeElementInst = null;\n }", "function stopWatchingForValueChange() {\n if (!activeElement) {\n return;\n }\n\n activeElement.detachEvent('onpropertychange', handlePropertyChange);\n activeElement = null;\n activeElementInst = null;\n }", "function stopWatchingForValueChange() {\n activeElement && (activeElement.detachEvent(\"onpropertychange\", handlePropertyChange), \n activeElement = null, activeElementInst = null);\n}", "function unbindGlobalEvents() {\n\t\t\t$el.off('hd:change:value');\n\t\t\t$el.off('hd:list:show');\n\t\t\t$el.off('hd:list:hide');\n\t\t}", "hoverListenersOff() {\n for (const button of this.buttonsAsArray.filter(x => x.type !== 'label')) {\n button.hoverListenerOff();\n }\n }", "function stopWatch() {\r\n if (watcher) {\r\n watcher();\r\n watcher = null;\r\n }\r\n }", "function delayOnVisibilityChange() {\n if ($document[0].hidden) {\n poller.delayAll();\n } else {\n poller.resetDelay();\n }\n }", "_unbindEvents() {\n if (this._internalWidget) {\n this._internalWidget.unbind(window.SC.Widget.Events.PLAY);\n this._internalWidget.unbind(window.SC.Widget.Events.PAUSE);\n this._internalWidget.unbind(window.SC.Widget.Events.FINISH);\n }\n }", "function destroy() {\n\t\t\t// Iterate over each matching element.\n\t\t\t$el.each(function() {\n\t\t\t\tvar el = this;\n\t\t\t\tvar $el = $(this);\n\n\t\t\t\t// Destroy completely the element and remove event listeners\n\t\t\t\t$(window).off('resize.timeliny');\n\t\t\t\t$el.find('.' + options.className + '-timeblock:not(.inactive) .' + options.className + '-dot').off('click');\n\t\t\t\t$(document).off('mousemove.timeliny');\n\t\t\t\t$(document).off('mouseup.timeliny');\n\t\t\t\t$el.first().off('mousedown');\n\t\t\t\t$el.remove();\n\t\t\t\thook('onDestroy');\n\n\t\t\t\t// Remove Plugin instance from the element.\n\t\t\t\t$el.removeData('plugin_timeliny');\n\t\t\t});\n\t\t}", "stop() {\n this.target = null;\n }", "function stopWatchingForValueChange() {\n\t if (!activeElement) {\n\t return;\n\t }\n\t activeElement.detachEvent('onpropertychange', handlePropertyChange);\n\n\t activeElement = null;\n\t activeElementInst = null;\n\t}", "function stopWatchingForValueChange() {\n\t if (!activeElement) {\n\t return;\n\t }\n\t activeElement.detachEvent('onpropertychange', handlePropertyChange);\n\n\t activeElement = null;\n\t activeElementInst = null;\n\t}", "function stopWatchingForValueChange() {\n\t if (!activeElement) {\n\t return;\n\t }\n\t activeElement.detachEvent('onpropertychange', handlePropertyChange);\n\n\t activeElement = null;\n\t activeElementInst = null;\n\t}", "function stopWatchingForValueChange() {\n\t if (!activeElement) {\n\t return;\n\t }\n\t activeElement.detachEvent('onpropertychange', handlePropertyChange);\n\n\t activeElement = null;\n\t activeElementInst = null;\n\t}", "function stopWatchingForValueChange() {\n\t if (!activeElement) {\n\t return;\n\t }\n\t activeElement.detachEvent('onpropertychange', handlePropertyChange);\n\n\t activeElement = null;\n\t activeElementInst = null;\n\t}", "function stopWatchingForValueChange() {\n\t if (!activeElement) {\n\t return;\n\t }\n\t activeElement.detachEvent('onpropertychange', handlePropertyChange);\n\n\t activeElement = null;\n\t activeElementInst = null;\n\t}", "function stopWatchingForValueChange() {\n\t if (!activeElement) {\n\t return;\n\t }\n\t activeElement.detachEvent('onpropertychange', handlePropertyChange);\n\n\t activeElement = null;\n\t activeElementInst = null;\n\t}", "function stopWatchingForValueChange() {\n\t if (!activeElement) {\n\t return;\n\t }\n\t activeElement.detachEvent('onpropertychange', handlePropertyChange);\n\n\t activeElement = null;\n\t activeElementInst = null;\n\t}", "function stopWatchingForValueChange() {\n\t if (!activeElement) {\n\t return;\n\t }\n\t activeElement.detachEvent('onpropertychange', handlePropertyChange);\n\t activeElement = null;\n\t activeElementInst = null;\n\t}", "function stopWatchingForValueChange() {\n if (!activeElement) {\n return;\n }\n activeElement.detachEvent('onpropertychange', handlePropertyChange);\n activeElement = null;\n activeElementInst = null;\n}", "function stopWatchingForValueChange() {\n if (!activeElement) {\n return;\n }\n activeElement.detachEvent('onpropertychange', handlePropertyChange);\n activeElement = null;\n activeElementInst = null;\n}", "function stopWatchingForValueChange() {\n if (!activeElement) {\n return;\n }\n activeElement.detachEvent('onpropertychange', handlePropertyChange);\n activeElement = null;\n activeElementInst = null;\n}", "function stopWatchingForValueChange() {\n if (!activeElement) {\n return;\n }\n activeElement.detachEvent('onpropertychange', handlePropertyChange);\n activeElement = null;\n activeElementInst = null;\n}", "function stopWatchingForValueChange() {\n if (!activeElement) {\n return;\n }\n activeElement.detachEvent('onpropertychange', handlePropertyChange);\n activeElement = null;\n activeElementInst = null;\n}", "function stopWatchingForValueChange() {\n if (!activeElement) {\n return;\n }\n activeElement.detachEvent('onpropertychange', handlePropertyChange);\n activeElement = null;\n activeElementInst = null;\n}", "function stopWatchingForValueChange() {\n if (!activeElement) {\n return;\n }\n activeElement.detachEvent('onpropertychange', handlePropertyChange);\n activeElement = null;\n activeElementInst = null;\n}", "function stopWatchingForValueChange() {\n if (!activeElement) {\n return;\n }\n activeElement.detachEvent('onpropertychange', handlePropertyChange);\n activeElement = null;\n activeElementInst = null;\n}", "function stopWatchingForValueChange() {\n if (!activeElement) {\n return;\n }\n activeElement.detachEvent('onpropertychange', handlePropertyChange);\n activeElement = null;\n activeElementInst = null;\n}", "function stopWatchingForValueChange() {\n if (!activeElement) {\n return;\n }\n activeElement.detachEvent('onpropertychange', handlePropertyChange);\n activeElement = null;\n activeElementInst = null;\n}", "function stopWatchingForValueChange() {\n if (!activeElement) {\n return;\n }\n activeElement.detachEvent('onpropertychange', handlePropertyChange);\n activeElement = null;\n activeElementInst = null;\n}", "function stopWatchingForValueChange() {\n if (!activeElement) {\n return;\n }\n activeElement.detachEvent('onpropertychange', handlePropertyChange);\n activeElement = null;\n activeElementInst = null;\n}", "function stopWatchingForValueChange() {\n if (!activeElement) {\n return;\n }\n activeElement.detachEvent('onpropertychange', handlePropertyChange);\n activeElement = null;\n activeElementInst = null;\n}", "function stopWatchingForValueChange() {\n if (!activeElement) {\n return;\n }\n activeElement.detachEvent('onpropertychange', handlePropertyChange);\n activeElement = null;\n activeElementInst = null;\n}", "function stopWatchingForValueChange() {\n if (!activeElement) {\n return;\n }\n activeElement.detachEvent('onpropertychange', handlePropertyChange);\n activeElement = null;\n activeElementInst = null;\n}", "function stopWatchingForValueChange() {\n if (!activeElement) {\n return;\n }\n activeElement.detachEvent('onpropertychange', handlePropertyChange);\n activeElement = null;\n activeElementInst = null;\n}", "function stopWatchingForValueChange() {\n if (!activeElement) {\n return;\n }\n activeElement.detachEvent('onpropertychange', handlePropertyChange);\n activeElement = null;\n activeElementInst = null;\n}", "function stopWatchingForValueChange() {\n if (!activeElement) {\n return;\n }\n activeElement.detachEvent('onpropertychange', handlePropertyChange);\n activeElement = null;\n activeElementInst = null;\n}", "function stopWatchingForValueChange() {\n if (!activeElement) {\n return;\n }\n activeElement.detachEvent('onpropertychange', handlePropertyChange);\n activeElement = null;\n activeElementInst = null;\n}", "function stopWatchingForValueChange() {\n if (!activeElement) {\n return;\n }\n activeElement.detachEvent('onpropertychange', handlePropertyChange);\n activeElement = null;\n activeElementInst = null;\n}", "function stopWatchingForValueChange() {\n if (!activeElement) {\n return;\n }\n activeElement.detachEvent('onpropertychange', handlePropertyChange);\n activeElement = null;\n activeElementInst = null;\n}", "function stopWatchingForValueChange() {\n if (!activeElement) {\n return;\n }\n activeElement.detachEvent('onpropertychange', handlePropertyChange);\n activeElement = null;\n activeElementInst = null;\n}", "function stopWatchingForValueChange() {\n if (!activeElement) {\n return;\n }\n activeElement.detachEvent('onpropertychange', handlePropertyChange);\n activeElement = null;\n activeElementInst = null;\n}", "function stopWatchingForValueChange() {\n if (!activeElement) {\n return;\n }\n activeElement.detachEvent('onpropertychange', handlePropertyChange);\n activeElement = null;\n activeElementInst = null;\n}", "function stopWatchingForValueChange() {\n if (!activeElement) {\n return;\n }\n activeElement.detachEvent('onpropertychange', handlePropertyChange);\n activeElement = null;\n activeElementInst = null;\n}", "function stopWatchingForValueChange() {\n if (!activeElement) {\n return;\n }\n activeElement.detachEvent('onpropertychange', handlePropertyChange);\n activeElement = null;\n activeElementInst = null;\n}", "function stopWatchingForValueChange() {\n if (!activeElement) {\n return;\n }\n activeElement.detachEvent('onpropertychange', handlePropertyChange);\n activeElement = null;\n activeElementInst = null;\n}", "function stopWatchingForValueChange() {\n if (!activeElement) {\n return;\n }\n activeElement.detachEvent('onpropertychange', handlePropertyChange);\n activeElement = null;\n activeElementInst = null;\n}" ]
[ "0.7124831", "0.6957715", "0.65686077", "0.62781113", "0.6217269", "0.6103131", "0.6100018", "0.607912", "0.60761625", "0.60573286", "0.60523576", "0.60389674", "0.6031797", "0.5996578", "0.5996578", "0.5996578", "0.59733784", "0.59409344", "0.59361076", "0.59361076", "0.5915645", "0.590556", "0.58905995", "0.58897024", "0.58880347", "0.58633894", "0.58588576", "0.5843855", "0.5843855", "0.5843855", "0.5843855", "0.5843855", "0.5843855", "0.5843855", "0.5843855", "0.5843855", "0.5843855", "0.5843855", "0.5843855", "0.58435094", "0.58435094", "0.58435094", "0.58435094", "0.58396393", "0.58396393", "0.58396393", "0.58396393", "0.58396393", "0.58396393", "0.58396393", "0.58396393", "0.58396393", "0.58396393", "0.58396393", "0.58396393", "0.58396393", "0.58378506", "0.5823727", "0.58044857", "0.5798772", "0.5792547", "0.57742476", "0.5768167", "0.57626945", "0.5757652", "0.5757652", "0.5757652", "0.5757652", "0.5757652", "0.5757652", "0.5757652", "0.5757652", "0.575155", "0.575019", "0.575019", "0.575019", "0.575019", "0.575019", "0.575019", "0.575019", "0.575019", "0.575019", "0.575019", "0.575019", "0.575019", "0.575019", "0.575019", "0.575019", "0.575019", "0.575019", "0.575019", "0.575019", "0.575019", "0.575019", "0.575019", "0.575019", "0.575019", "0.575019", "0.575019", "0.575019", "0.575019" ]
0.0
-1
Initialize the typing tutor
function init() { // Get all necessary HTML elements for (var elementID in my.html) { my.html[elementID] = document.getElementById(elementID) } // Get user settings resetSettings() loadSettings() // Initialize the user interface showPracticePanelWrapper() updateUnitFromURL() hideGuide() // Event handlers window.onhashchange = processURLChange my.html.input.onkeyup = updatePracticePane guideLink.onclick = toggleGuide }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function initTypedJs() {\r\n new Typed(\".typed\", {\r\n strings: [\"A Coder.\",\"Frontend.\", \"Analytical.\", \"A Web Developer.\", \"A Gamer.\"],\r\n typeSpeed: 85,\r\n loop: true,\r\n });\r\n}", "function init() {\r\n const txtElement = document.querySelector('.txt-type');\r\n const words = JSON.parse(txtElement.getAttribute('data-words'));\r\n const wait = txtElement.getAttribute('data-wait');\r\n new TypeWriter(txtElement, words, wait);\r\n}", "function init () {\n // we need to grab the span and the attributes data-words data-wait\n const txtElement = document.querySelector('.txt-type')\n\n // we need to parse the words array because for now it is just a string by using JSON.parse()\n const words = JSON.parse(txtElement.getAttribute('data-words'))\n\n const wait = txtElement.getAttribute('data-wait')\n\n // init TypeWriter construction function\n new TypeWriter(txtElement, words, wait)\n}", "function init(){\n source = converterData.getNodeTags();\n\n $(\"#txtStart\").typeahead({ source: source });\n $(\"#txtEnd\").typeahead({ source: source });\n $(\"#ownStart\").typeahead({ source: source });\n\n\n }", "function init () {\n // Here below all inits you need\n }", "function init() {}", "function init() {}", "function init() {}", "function init() {}", "function init() {}", "function init() {}", "function init() {}", "function init() {}", "function init() {}", "function init() {}", "function init() {\n updateResults();\n bind.typeaheadKeys();\n bind.searchFocus();\n bind.searchChange();\n bind.searchSubmit();\n bind.historyState();\n}", "function init(){}", "init(){}", "function typistInit(element, state = TYPIST_TYPING, charDelay = 60, textDelay = 2000) {\n\n var startText = element.innerHTML;\n var texts = element.getAttribute(\"typist-extra\");\n texts = texts.split(\",\");\n texts.splice(0, 0, startText);\n texts = texts.map(s => s.trim());\n \n var state = {\n element: null,\n state: TYPIST_TYPING,\n currentTextIndex: 0,\n currentTypedChars: 0,\n texts: texts,\n charDelay: charDelay,\n textDelay: textDelay\n };\n\n return state;\n}", "function init() { }", "function init() { }", "function typing() {\n let options = {\n strings: [\"Hello, Adventurer... ^1000\", \"Shall we begin?\"],\n loop: false,\n smartBackspace: true,\n backSpeed: 50,\n typeSpeed: 100,\n showCursor: false\n }\n let typed = new Typed(\".type-intro\", options);\n \n setTimeout(function(){\n $(\".formy\").fadeIn(8000);\n }, 5000)\n}", "function init() {\n\t//TODO\n}", "function _init() {\n }", "async init(){}", "function init() {\n }", "initialise () {}", "function init() {\n\n\t\t// Bind the editor elements to variables\n\t\tbindElements();\n\n\t\t// Create event listeners for keyup, mouseup, etc.\n\t\tcreateEventBindings();\n\t}", "function init() {\r\n }", "function init() {\r\n\r\n }", "function init()\n{}", "init() {}", "init() {}", "init() {}", "init() {}", "init() {}", "init() {}", "init() {}", "init() {}", "init() {}", "init() {}", "init() {}", "init() {}", "init() {}", "init () {}", "init () {}", "function init () {\n}", "function init() {\n\n }", "function init() {\n\n }", "init() { }", "init() { }", "init() { }", "init() { }", "init() { }", "function init() {\n\n }", "function init() {\n\n }", "_init() {\n this._addBreakpoints();\n this._generateRules();\n this._reflow();\n }", "function init() {\n\n\n\n\t}", "function _init() {\n }", "function _init() {\n }", "function _init() {\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 }", "init () {\n }", "function changeTyped(text1,text2) {\n\ttyped.destroy();\n\t\ttyped = new Typed(\".typed\", {\n\t\tstrings: [text1, text2],\n\t\ttypeSpeed: 70,\n\t\tloop: true,\n\t\tstartDelay: 1000,\n\t\tshowCursor: false\n\t});\n}", "function _initVar(htOptions){\n\t\t\thtVar.nTotalPages = htOptions.nTotalPages || 1;\n\t\t\thtVar.oTypeahead = new hive.ui.Typeahead(\"input[name=authorLoginId]\", {\n\t\t\t\t\"sActionURL\": \"/users\"\n\t\t\t});\n\t\t}", "function init() {\n getContentTypes();\n getProperties();\n }", "function init() {\n\t \t\n\t }", "_init() {\r\n this.initAttentionArea(this.attentionRange); // From CanAttack component\r\n this.owner.aggroAreas.add(this.attentionArea);\r\n }", "init() {\n }", "function init() {\n}", "function init() {\n}", "function init() {\n\n if (isInitialized) {\n return;\n }\n\n isInitialized = true;\n\n isSpeechEnabled = pref.get('ttsOn');\n\n localizedSpeechString = locale.translate('speech');\n\n toggleListeners(true);\n\n events.on('bp/did-expand', function() { toggleListeners(true); });\n events.on('bp/will-shrink', function() { toggleListeners(false); });\n\n updateTTSStateView(isSpeechEnabled);\n\n waveAnimationStepNum = 0;\n }", "constructor(type) { \n this.type = type \n this.parser = null\n }", "init() {\n }", "init() {\n }", "init() {\n }", "function init () {\n\n}", "init(){\n \n }", "init () {\n }", "constructor() { \n \n ConversationTypingEventAllOfPayload.initialize(this);\n }", "initialize() {}", "initialize() {}", "initialize() {}", "initialize() {}", "initialize() {}", "initialize() {}", "function Initizlize()\r\n {\r\n /*PropertyChangedCallback*/var typographyChanged = new PropertyChangedCallback(null, OnTypographyChanged);\r\n\r\n // Registering typography properties metadata\r\n /*DependencyProperty[]*/var typographyProperties = Typography.TypographyPropertiesList; \r\n for (var i = 0; i < typographyProperties.Length; i++) \r\n {\r\n typographyProperties[i].OverrideMetadata(FlowDocument.Type, new FrameworkPropertyMetadata(typographyChanged)); \r\n }\r\n\r\n DefaultStyleKeyProperty.OverrideMetadata(FlowDocument.Type, new FrameworkPropertyMetadata(FlowDocument.Type));\r\n FocusableProperty.OverrideMetadata(FlowDocument.Type, new FrameworkPropertyMetadata(true)); \r\n }", "function init() {\n //UH HUH, THIS MY SHIT!\n }", "constructor() {\n this.init();\n }", "static initialize(obj, type) { \n obj['type'] = type;\n }", "static initialize(obj, type) { \n obj['type'] = type;\n }", "static initialize(obj, type) { \n obj['type'] = type;\n }", "function init(){\n\n }", "init() {\n const { type } = argv;\n this.type = type || '';\n }", "function typeahead_initialize() {\n var cityAirports = new Bloodhound({\n datumTokenizer: Bloodhound.tokenizers.whitespace,\n queryTokenizer: Bloodhound.tokenizers.whitespace,\n \n remote: {\n url: '/airports/autocomplete?query=%QUERY',\n wildcard: '%QUERY',\n }\n });\n \n $('.query').typeahead(null, {\n source: cityAirports,\n limit: 10\n });\n}", "function init() {\n var autocomplete = new google.maps.places.Autocomplete(input);\n }", "function init() {\n \n}", "function init() {\n \n}", "init () {\n\n }", "function Init()\n{\n\t// initiate counters\n\ttrialNum = 0;\n\n\t// timing params\n\ttrial_timeout = 6000;\n\t\n\t// init params\n\tresponse_time = -2;\n\tcurrent_time = -2;\n \n drag_stream = [];\n\n\t// global cogtask variables\n\tSetName(GetName());\n\n\t// turn bloat on/off for dev\n\tbloat = 999;\n\tbloat_calc = 0;\n}", "constructor()\n {\n this.init();\n }" ]
[ "0.73594135", "0.71510375", "0.6862224", "0.65771204", "0.62815624", "0.61259204", "0.61259204", "0.61259204", "0.61259204", "0.61259204", "0.61259204", "0.61259204", "0.61259204", "0.61259204", "0.61259204", "0.6108672", "0.609411", "0.6074737", "0.6069408", "0.605327", "0.605327", "0.59799296", "0.5949424", "0.58970964", "0.58884525", "0.58787376", "0.58671093", "0.5864394", "0.5855966", "0.58433115", "0.58433074", "0.5830402", "0.5830402", "0.5830402", "0.5830402", "0.5830402", "0.5830402", "0.5830402", "0.5830402", "0.5830402", "0.5830402", "0.5830402", "0.5830402", "0.5830402", "0.58287084", "0.58287084", "0.5809886", "0.5802966", "0.5802966", "0.58013994", "0.58013994", "0.58013994", "0.58013994", "0.58013994", "0.5779856", "0.5779599", "0.5779222", "0.57784337", "0.57765424", "0.57765424", "0.57765424", "0.5768632", "0.57603234", "0.5748727", "0.5748147", "0.57440716", "0.5735557", "0.5727084", "0.5719527", "0.57195115", "0.57195115", "0.57148737", "0.5706961", "0.57068044", "0.57068044", "0.57068044", "0.5677234", "0.567505", "0.5674833", "0.5674556", "0.56649274", "0.56649274", "0.56649274", "0.56649274", "0.56649274", "0.56649274", "0.56556433", "0.5652539", "0.5633683", "0.56329423", "0.56329423", "0.56329423", "0.5631026", "0.56303996", "0.5624894", "0.56246734", "0.5618297", "0.5618297", "0.56140834", "0.56126195", "0.56089073" ]
0.0
-1
Set the logging function to be called to write logs. Argument: logFunction Logging function
function setLogFunction(logFunction) { my.logFunction = logFunction }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "setLog(log) {\n module.exports.log = typeof log === 'function' ? log : null;\n }", "log(message) {\n this.loggingFunction(message);\n }", "function log() {\n //log here\n }", "function log()\n {\n if (my.logFunction == null)\n return\n\n var meta = ['name', 'QuickQWERTY']\n var data = Array.prototype.slice.call(arguments)\n my.logFunction.apply(this, meta.concat(data))\n }", "function logSomething(log) { log.info('something'); }", "function Log() {}", "function _____INTERNAL_log_functions_____(){}\t\t//{", "function setLoggingFunctions(message, error, stop) {\n _message = message;\n _error = error;\n _stop = stop;\n }", "function setLogMode(mode) {\n logMode = mode;\n }", "function log(s) {\r\n logFn && logFn(s);\r\n }", "function logger() {}", "log() {}", "function logger() {\r\n // if $log fn is called directly, default to \"info\" message\r\n logger.info.apply(logger, arguments);\r\n }", "function log(){\n console.log('logging');\n}", "function enableLogging() {\n logEnabled = true;\n}", "enableLogging (config = {}) {\n // Only attempt to enable logging from an object definition\n if (typeof config === 'object') {\n // Loop through logging config by method (function name)\n Object.keys(config).forEach(method => {\n // Get the current method configuration from the logging config by method\n const methodConfig = config[method]\n\n // Don't allow provided setting to override existing properties\n if (typeof this[method] !== 'undefined') {\n throw new Error(`Cannot override method for logging: '${method}' ... it already exists!`)\n }\n\n // Create the logging method as a function on the current Logger instance\n this[method] = (...args) => {\n // Determine whether or not to show the message\n // - If method isn't verbose only OR verbose flag is set\n // - AND\n // - The quiet flag is NOT set\n if ((!methodConfig.verbose || this.options.verbose) && !this.options.quiet) {\n // Get the console method to be used for this logging function\n // Check to see if the \"console\" object has the same function, otherwise just use \"log\"\n const consoleMethod = (typeof console[method] === 'function' ? console[method] : console['log'])\n\n // Get the prefix from method config, otherwise set it to blank\n const prefix = (typeof methodConfig.prefix === 'string' ? methodConfig.prefix : '')\n\n // Get the color from the method config, otherwise set it to blank\n const color = (typeof colors[methodConfig.color] === 'function' ? methodConfig.color : '')\n\n // Create the output variable\n let output = Logger.colorize(args, color)\n\n // If a prefix is set, prepend it to the previously created output\n if (prefix.trim() !== '') {\n output = Logger.colorize([prefix], color).concat(output)\n }\n\n // If the stamp flag is set, prepend the output with a timestamp\n if (methodConfig.stamp) {\n const timeStamp = this.getTimeStamp()\n output = Logger.colorize([`[${timeStamp}]`], color).concat(output)\n }\n\n // Use the console method obtained above, print the generated output\n consoleMethod(...output)\n\n // If the throws flag is set, and the force flag isn't allowed AND set\n if (methodConfig.throws === true && !(this.settings.allowForceNoThrow && this.options.force)) {\n // Throw the args as an error\n throw new Error(args)\n }\n }\n }\n })\n }\n }", "function apiLog(functionName, CMIElement, logMessage, messageLevel) {\n logMessage = formatMessage(functionName, CMIElement, logMessage);\n\n if (messageLevel >= this.apiLogLevel) {\n switch (messageLevel) {\n case constants.LOG_LEVEL_ERROR:\n console.error(logMessage);\n break;\n case constants.LOG_LEVEL_WARNING:\n console.warn(logMessage);\n break;\n case constants.LOG_LEVEL_INFO:\n console.info(logMessage);\n break;\n }\n }\n }", "function logTheArgument(someFunction) {\r\n someFunction();\r\n}", "function log (level, message) {\r\n\r\n}", "static usingFunction( logEvent ) {\n\n\t\tvar monitor = new AbstractLoggingMonitor();\n\n\t\t// Override the abstract method, completing the implementation.\n\t\tmonitor.logEvent = logEvent;\n\n\t\treturn( monitor );\n\n\t}", "setLoggingLevel(logLevel) {\n this.logLevel = logLevel;\n }", "function log(str) { Logger.log(str); }", "function genaLog(func) {\n return function() {\n let abc = func.apply(this, arguments);\n console.log(\"called\");\n return abc;\n }\n}", "function LogWrapper (isLogging) {\n if (this.constructor.name === 'Function') {\n throw new Error('Missing object context')\n }\n\n if (!isLogging) {\n // stub the logger out\n this.logger = {}\n\n this.logger.info = function () {}\n this.logger.error = function () {}\n this.logger.warn = function () {}\n return\n }\n\n // Else config winston for logging\n const Winston = require('winston')\n\n let winstonTransport = new (Winston.transports.Console)({\n json: false,\n colorize: true\n })\n\n this.logger = new (Winston.Logger)({\n transports: [winstonTransport]\n })\n}", "function PrintLog(a)\n{\nlogger.info(a);\n}", "function setLogger(newLogger) {\n\t\tif (logger) {\n\t\t\tlogger.close();\n\t\t\tfor (let funcName of logger._logFuncs) {\n\t\t\t\tdelete module.exports[funcName];\n\t\t\t}\n\t\t}\n\t\tlogger = newLogger;\n\t\tmodule.exports.logger = newLogger;\n\t\tfor (let funcName of logger._logFuncs) {\n\t\t\tmodule.exports[funcName] = function(...args) {\n\t\t\t\treturn logger[funcName](...args);\n\t\t\t};\n\t\t}\n\t}", "function LogOperator(){}", "log(message) {\n console.log(`[Function/${this.name}] INFO: ${message}`);\n }", "function setLogLevel(logLevel) {\r\n (0,_firebase_logger__WEBPACK_IMPORTED_MODULE_1__.setLogLevel)(logLevel);\r\n}", "function doLog() {\n console.log(\"This is a log message.\");\n}", "write(message) {\n message_log.write(message)\n }", "function myLog(message, logIt)\n{\n\tif (logIt)\n\t{\n\t\tconsole.log(message);\n\t}\n}", "function logIt(someMessage) {\n if (useLogging) {\n console.log(someMessage);\n }\n}", "function logIt(someMessage) {\n if (useLogging) {\n console.log(someMessage);\n }\n}", "function logIt(someMessage) {\n if (useLogging) {\n console.log(someMessage);\n }\n}", "function logger(logString){\n\tif (debugMode){\n\t\tconsole.log(logString);\n\t}\n}", "function logger(logString){\n\tif (debugMode){\n\t\tconsole.log(logString);\n\t}\n}", "function logger(logString){\n\tif (debugMode){\n\t\tconsole.log(logString);\n\t}\n}", "function lemurlog_DoWriteLogFile(fileName, text) {\n lemurlog_WriteLogFile(fileName, text);\n lemurlog_checkAutoUpload();\n}", "debug(logFunction) {\n logFunction(data)\n return this\n }", "function consoleLogger() {\n\t//This is the function body. All of the code between the {} gets executed when a function is called\n\t//The value of parameter is set when the function is called and it becomes \n\t//a locally scoped variable within the scope of the function\n\tconsole.log(\"I am a log\");\n}", "enableLogging() {\n this.loggingEnabled = true;\n }", "function setLogger(l){\n\tlogger = l;\n}", "function hook_log(){\n var Log = Java.use(\"android.util.Log\")\n\n var logMethods = ['d', 'e', 'i', 'v', 'w']\n\n logMethods.forEach(function(method, i) {\n Log[method].overload('java.lang.String','java.lang.String').implementation = function(tag, msg) {\n send('Log: ' + tag + '|' + msg);\n var ret = this[method](tag, msg);\n return ret;\n }\n Log[method].overload('java.lang.String','java.lang.String','java.lang.Throwable').implementation = function(tag, msg, th) {\n send('Log: ' + tag + '|' + msg);\n var ret = this[method](tag, msg, th);\n return ret;\n } \n });\n}", "interceptLog(originalFn: Function, callback: Function) {\n return function() {\n let args = Array.prototype.slice.apply(arguments)\n callback && callback(args)\n return originalFn.apply(console, args)\n }\n }", "function log() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i - 0] = arguments[_i];\n }\n if (!args.length) {\n return;\n }\n var id = args[0] + '';\n var fn = logMap[id];\n if (fn) {\n fn.apply(void 0, args.slice(1));\n }\n else {\n console.log('log: ' + JSON.stringify(args));\n }\n}", "setLogLevel(logLevel) {\n if (this.availableLogLevels.indexOf(logLevel) > -1) {\n this.logLevel = logLevel;\n }\n }", "function logFunct(_function, _text, _type) {\n\n\tif (trace) {\n\t\tif (_type == INFO) {\n\t\t\tconsole.info(\"%c\" + _function + ': ' + _text, \"color:\" + _type);\n\t\t}\n\t\tif (_type == WARN) {\n\t\t\tconsole.warn(\"%c\" + _function + ': ' + _text, \"color:\" + _type);\n\t\t}\n\t\tif (_type == ERROR) {\n\t\t\tconsole.error(\"%c\" + _function + ': ' + _text, \"color:\" + _type);\n\t\t}\n\t}\n}", "function setLogEnabled(enabled) {\n logEnabled = enabled;\n}", "function writeLog (taId, event, message) {\n\t\tvar ta = Ext.getCmp (taId);\n\t\tta.setValue (ta.getValue () + event + ': ' + message + '\\n');\n\t}", "log(_args) {\n\n }", "function log(data, info, logCommand) { // log(param1, param2) and use parameters to log the data in log.txt\r\n\r\n if (logCommand === \"concert-this\") {\r\n var command = \"concert-this \" + info;\r\n } else if (logCommand === \"spotify-this-song\") {\r\n var command = \"spotify-this-song \" + info;\r\n } else if (logCommand === \"movie-this\") {\r\n var command = \"movie-this \" + info;\r\n }\r\n var log = \"\\n\" + \"Command: \" + command + \"\\n\" + data + \"\\n\" + \"===========\" + \"\\n\";\r\n fs.appendFile(\"log.txt\",log, function(error) {\r\n if (error) {\r\n return console.log(error);\r\n }\r\n \r\n })\r\n}", "function log(message){\n console.log(message);\n }", "function FunctionBreakpoint(functionName, enabled, condition, hitCondition, logMessage) {\n var _this = _super.call(this, enabled, condition, hitCondition, logMessage) || this;\n _this.functionName = functionName;\n return _this;\n }", "function l(pvScriptName,pvFunctionName,pvMessage,pvLevel){\n\n // This function can be passed a pre-formatted log string, usually passed back from the balu-parse-server.\n // In this case, just console.log it, without the preceeding or trailing carriage returns\n if(typeof pvFunctionName === 'undefined' &&\n typeof pvMessage === 'undefined' &&\n typeof pvLevel === 'undefined') {\n console.log(pvScriptName.substring(1,pvScriptName.length));\n return '\\n' + pvScriptName.substring(1,pvScriptName.length);\n }\n\n var lvMaxAppNameLength = 22;\n var lvPadding = ' '.substring(0,lvMaxAppNameLength - gvAppName.length + 1);\n var lvLogText = '';\n\n switch(pvLevel) {\n\n case 'ERROR':\n if (gvLogErrors) {\n lvLogText = gvAppName.substring(0,lvMaxAppNameLength) + lvPadding + '| ' + pvLevel + ': ' + pvScriptName + '.' + pvFunctionName + ': ' + pvMessage;\n console.log(lvLogText);\n lvLogText = '\\n' + lvLogText;\n }\n break;\n\n case 'PROCS':\n // Short for \"process\", these are the ubiquitous logs that\n // track (at the least) the start of every function, as well\n // as other key points\n // On by default\n if (gvLogProcs) {\n lvLogText = gvAppName.substring(0,lvMaxAppNameLength) + lvPadding + '| ' + pvLevel + ': ' + pvScriptName + '.' + pvFunctionName + ': ' + pvMessage;\n console.log(lvLogText);\n lvLogText = '\\n' + lvLogText;\n }\n break;\n\n case 'ROUTE':\n // Similar to PROCS, but for the web server routes\n // On by default\n if (gvLogRoutes) {\n lvLogText = gvAppName.substring(0,lvMaxAppNameLength) + lvPadding + '| ' + pvLevel + ': ' + pvScriptName + '.' + pvFunctionName + ': ' + pvMessage;\n console.log(lvLogText);\n lvLogText = '\\n' + lvLogText;\n }\n break;\n\n case ' INFO':\n // Additional to PROCS, these don't just track process, they\n // record information as well. Similar to DEBUG.\n // Off by default\n if (gvLogInfos){\n lvLogText = gvAppName.substring(0,lvMaxAppNameLength) + lvPadding + '| ' + pvLevel + ': ' + pvScriptName + '.' + pvFunctionName + ': ' + pvMessage;\n console.log(lvLogText);\n lvLogText = '\\n' + lvLogText;\n }\n break;\n\n case 'DEBUG':\n // Useful log points for debugging\n // Off by default\n if (gvLogDebugs){\n lvLogText = gvAppName.substring(0,lvMaxAppNameLength) + lvPadding + '| ' + pvLevel + ': ' + pvScriptName + '.' + pvFunctionName + ': ' + pvMessage;\n console.log(lvLogText);\n lvLogText = '\\n' + lvLogText;\n }\n break;\n\n case 'INITS':\n // Rather than putting PROCS in init functions (which always fire\n // and, once the app is working reliably, aren't particularly interesting)\n // Off by default\n if (gvLogInits){\n lvLogText = gvAppName.substring(0,lvMaxAppNameLength) + lvPadding + '| ' + pvLevel + ': ' + pvScriptName + '.' + pvFunctionName + ': ' + pvMessage;\n console.log(lvLogText);\n lvLogText = '\\n' + lvLogText;\n }\n break;\n\n case ' AJAX':\n if (gvLogAJAX){\n lvLogText = gvAppName.substring(0,lvMaxAppNameLength) + lvPadding + '| ' + pvLevel + ': ' + pvScriptName + '.' + pvFunctionName + ': ' + pvMessage;\n console.log(lvLogText);\n lvLogText = '\\n' + lvLogText;\n }\n break;\n\n case 'LSTNR':\n // Rather than putting PROCS in listeners (which can fire\n // continually in some scenarios), use LSTNR and keep them ...\n // Off by default\n if (gvLogLstnrs){\n lvLogText = gvAppName.substring(0,lvMaxAppNameLength) + lvPadding + '| ' + pvLevel + ': ' + pvScriptName + '.' + pvFunctionName + ': ' + pvMessage;\n console.log(lvLogText);\n lvLogText = '\\n' + lvLogText;\n }\n break;\n\n case ' TEMP':\n // What it says on the tin. These should not stay in the code for long\n // On by default\n if (gvLogTemps){\n lvLogText = gvAppName.substring(0,lvMaxAppNameLength) + lvPadding + '| ' + pvLevel + ': ' + pvScriptName + '.' + pvFunctionName + ': ' + pvMessage;\n console.log(lvLogText);\n lvLogText = '\\n' + lvLogText;\n }\n break;\n\n default:\n lvLogText = gvAppName.substring(0,lvMaxAppNameLength) + lvPadding + '| ' + 'UNKWN' + ': ' + pvScriptName + '.' + pvFunctionName + ': ' + pvMessage;\n console.log(lvLogText);\n lvLogText = '\\n' + lvLogText;\n }\n return lvLogText; // Set to '' if logging is off for the given level.\n}", "function logGreeting(fn) {\n fn();\n}", "function log(foo){\n\tconsole.log(foo);\n}", "function logger(){\n console.log(\"you logged in\");\n}", "log(event, options = {}) {\n Log.trigger(event, Object.assign(options, { id: this.id }), this.element)\n }", "function log(log_text) {\n\t//Global function used for logging in the web console.\n\t\n\tvar curr_time = new Date();\n\tvar curr_time = curr_time.getHours() + \":\" + curr_time.getMinutes() + \":\" + curr_time.getSeconds();\t\t\n\tlog_entry = \">>> \" + curr_time + \": \" + log_text\n\tlog_list.push(log_entry)\n}", "function log(a) {\n a();\n}", "function log(a) {\n a();\n}", "function log() {\n\t\t//var args = [].slice.call(arguments);\n\t\t//send('LOG', args);\n\t}", "_subscribeForLogging() {\n const oThis = this;\n\n oThis.client.on('log', function(level, className, message, furtherInfo) {\n const msg = `cassandra log event: ${level} -- ${message}`;\n\n switch (level) {\n case 'info': {\n break;\n }\n case 'warning': {\n logger.warn('l_cw_2', msg);\n break;\n }\n case 'error': {\n logger.error('l_cw_3', msg);\n const errorObject = responseHelper.error({\n internal_error_identifier: 'l_cw_3',\n api_error_identifier: 'something_went_wrong',\n debug_options: {\n message: message,\n className: className,\n furtherInfo: furtherInfo\n }\n });\n\n createErrorLogsEntry.perform(errorObject, errorLogsConstants.highSeverity);\n break;\n }\n case 'verbose': {\n break;\n }\n default: {\n logger.log(`Current level: ${level}.--${msg}`);\n break;\n }\n }\n });\n }", "function writeLog(logData) {\n if (!CONFIG.USE_MOCK_SERVICES) {\n angular.extend(logData, {\n url: $window.location.href\n });\n\n Accela.XHR.post(CONFIG.LOG_URL, logData, CONFIG.LOG_ACCESS_KEY);\n }\n }", "function log(logmessage) {\n\tconsole.log(logmessage);\n}", "function touchlog() {\n //log.apply(undefined, arguments);\n}", "function logWrapper(f) {\n return function () {\n console.log(\"log :: before\")\n f();\n console.log(\"log :: after\")\n }\n}", "setup(consoleMinLogLevel, _logFilePath, prependTimestamp = true) {\n const logFilePath = typeof _logFilePath === 'string' ?\n _logFilePath :\n (_logFilePath && this._logFilePathFromInit);\n if (this._currentLogger) {\n const options = {\n consoleMinLogLevel,\n logFilePath,\n prependTimestamp\n };\n this._currentLogger.setup(options).then(() => {\n // Now that we have a minimum logLevel, we can clear out the queue of pending messages\n if (this._pendingLogQ) {\n const logQ = this._pendingLogQ;\n this._pendingLogQ = null;\n logQ.forEach(item => this._write(item.msg, item.level));\n }\n });\n }\n }", "function logCallback(event) {\n\t\tconsole.log('Callback triggered:', this, event);\n\t\tlog.value = event.detail.action + ' ' +\n\t\t\t(event.type === 'toggle'\n\t\t\t\t? this.node.classList[0]\n\t\t\t\t: this.node.classList[1])\n\t\t\t+ '\\n' + log.value;\n\t}", "function setLogger(obj) {\n logger = obj;\n}", "log(kind, msg, data){ this.logger(kind, msg, data) }", "function logA() {\n console.log(\"A\");\n}", "function Logarithm() {\r\n}", "function _log() {\n // logger.trace.apply(logger, arguments)\n}", "function logMethod(method) {\n return function() {\n return this._log[method].apply(this, arguments);\n };\n }", "function logEvents(flowFn, eventWildcard) {\n if (typeof(flowFn) !== 'function') { // only wildcard provided\n eventWildcard = flowFn;\n flowFn = undefined;\n }\n if (!flowFn) flowFn = autoflow; // use global\n trackTasks();\n return logEventsMod.logEvents(flowFn, eventWildcard);\n }", "function enableLogfile() {\n exports.logfile.enabled = true;\n const removeANSIPattern = [\n '[\\\\u001B\\\\u009B][[\\\\]()#;?]*(?:(?:(?:[a-zA-Z\\\\d]*(?:;[-a-zA-Z\\\\d\\\\/#&.:=?%@~_]*)*)?\\\\u0007)',\n '(?:(?:\\\\d{1,4}(?:;\\\\d{0,4})*)?[\\\\dA-PR-TZcf-ntqry=><~]))',\n ].join('|');\n const removeANSIRe = new RegExp(removeANSIPattern, 'g');\n const removeANSI = (s) => s.replace(removeANSIRe, '');\n debug_1.default.log = function (...args) {\n const formatted = util_1.default.format(args[0], ...args.slice(1)) + '\\n';\n exports.logfile.write(removeANSI(formatted));\n process.stderr.write(formatted);\n };\n}", "function writeLogs() {\n cslogging.loadConfig('./testConfig.json');\n\n // the configFile set the maxSize to be 1K and maxFiles to be 10\n // So we need to write out a bit more then 10*1K of bytes of logs\n var testLogger = cslogging.getLogger('test');\n\n console.log('writing logs!');\n for(var i=0; i < 20; i++) {\n var chr = String.fromCharCode(97 + i);\n var logwriting = createLogWritingFunction(testLogger, chr, 1000);\n\n setTimeout(logwriting, i*100);\n }\n\n}", "function sendLog(malfunctionId){\n timestamp = userActions[1][0];\n userActions = JSON.stringify(userActions);\n $.ajax({\n url: myApp.urSrvURL + \"log.php\",\n type: \"POST\",\n data: ({\"logData\": userActions, \"timestamp\": timestamp, \"malfunctionId\": malfunctionId})\n });\n }", "function logger() {\n console.log('foo');\n}", "function _log() {\n// console.log.apply(console, arguments);\n }", "function initLogModule (logFilename, logLevel, fileMaxsize, fileMaxfiles, needConsoleLog, needFileLog, callback)\n{\n\twinston.remove(winston.transports.Console) ; // Be default it is ON\n\tif (needConsoleLog)\n\t{\n\t\twinston.add(winston.transports.Console, {level: logLevel });\n\t}\n\tif (needFileLog)\n\t{\n\t\twinston.add(winston.transports.File, { filename: logFilename, level: logLevel, maxsize: fileMaxsize, maxFiles: fileMaxfiles, json: false });\n\t}\n\tdefine.winston = winston ;\n\n\tcallback (0) ; // return Success\n}", "function addLog (thisString) {\n// Writes the provided string to the console and also appends it to the log.txt file.\n console.log(thisString);\n try {\n fs.appendFileSync(\"./log.txt\", thisString + \"\\n\")\n } catch (err) {\n console.log(\"* * * Warning: Error writting to log file:\" + err);\n };\n}", "function lemurlog_Switch(event, mode)\n{\n // don't allow switch if we're in private browse mode!\n if (!lemurlogtoolbar_inPrivateBrowseMode) {\n var time = new Date().getTime();\n \n lemurlog_g_enable = !lemurlog_g_enable;\n if(lemurlog_g_enable)\n {\n lemurlog_DoWriteLogFile(lemurlog_LOG_FILE, \"StartLogging\\t\" + time + \"\\n\");\n }\n else\n {\n lemurlog_g_enable = true; // crazy hack to allow writing in log file.\n lemurlog_DoWriteLogFile(lemurlog_LOG_FILE, \"PauseLogging\\t\" + time + \"\\n\");\n lemurlog_g_enable = false;\n }\n lemurlog_SetButtons();\n }\n}", "set logLevel(level) {\n winston.level = level\n winston.debug('Requested log level to to: ' + level)\n winston.debug('Log level is now: ' + winston.level)\n }", "sendLogs() {\n this.log.info('logging from tests');\n }", "function _logWrapper(sev) {\n var fn = function(message, isPublic) {\n return this.log(sev, message, isPublic);\n };\n return fn;\n}", "log() {\n\n this.respond(undefined, \"log\", undefined, undefined, arguments);\n\n }", "function writeLog(logData) {\n var url = CONFIG.USE_MOCK_SERVICES ? 'mock-api/logClientMsg.json' : CONFIG.LOG_URL;\n\n angular.extend(logData, Accela.settings, {\n url: $window.location.href\n });\n\n Accela.Utils.XmlHttp.post(url, logData, CONFIG.LOG_ACCESS_KEY);\n }", "function logger() {\n console.log('logger');\n\n}", "static setLogLevel(logLevel) {\n logLevel = logLevel.toUpperCase();\n const logLevels = Object.keys(this.LOG_LEVELS);\n if (logLevels.indexOf(logLevel) > -1) {\n if (window && window.sessionStorage) { // for browser env.\n window.sessionStorage.setItem('konsole.LOG_LEVEL', logLevel);\n }\n this.logLevel = logLevel;\n }\n else {\n console.error(`Error, invalid logLevel, it must be one of ${logLevels}`);\n }\n }", "function checkLogs(){\n\n}", "function onLog(logCallback, options) {\r\n if (logCallback !== null && typeof logCallback !== 'function') {\r\n throw ERROR_FACTORY.create(\"invalid-log-argument\" /* INVALID_LOG_ARGUMENT */);\r\n }\r\n (0,_firebase_logger__WEBPACK_IMPORTED_MODULE_1__.setUserLogHandler)(logCallback, options);\r\n}", "enableLogging() {\n /**\n * GENERIC ERROR LOGGING\n */\n this.conn.on('error', (err) => {\n this.logMessage(err, false);\n });\n if (!this.verbose) {\n return;\n }\n /**\n * VERBOSE EVENT LOGGING\n */\n this.conn.on('connect', (conn) => {\n this.logMessage(`Connection established to ${conn.currentServer.url.host}`);\n });\n this.conn.on('disconnect', () => {\n this.logMessage('Disconnected', false);\n });\n this.conn.on('reconnect', () => {\n this.logMessage('Reconnected', false);\n });\n this.conn.on('close', () => {\n this.logMessage('Connection closed');\n });\n }", "function logGreeting(fn){\n fn();\n}", "set logLevel(aLogLevel) {\n if (!aLogLevel ||\n !((aLogLevel == Ci.gsILoggingService.LEVEL_OFF) ||\n (aLogLevel == Ci.gsILoggingService.LEVEL_FATAL) ||\n (aLogLevel == Ci.gsILoggingService.LEVEL_ERROR) ||\n (aLogLevel == Ci.gsILoggingService.LEVEL_WARN) ||\n (aLogLevel == Ci.gsILoggingService.LEVEL_DEBUG) ||\n (aLogLevel == Ci.gsILoggingService.LEVEL_INFO) ||\n (aLogLevel == Ci.gsILoggingService.LEVEL_TRACE))) {\n dump(\"LoggingService.set logLevel called with invalid argument.\\n\");\n throw Cr.NS_ERROR_INVALID_ARG;\n }\n\n this._firefoxPreferenceService.\n setIntPref(GS_PREFERENCE_LOGLEVEL, aLogLevel);\n }", "function logged(constructorFn) {\n console.log(\"hi\");\n console.log(constructorFn);\n}", "interceptLogs() {\n const context = {};\n context.console = console;\n\n context.console.log = this._log.bind(this, 'log');\n context.console.warn = this._log.bind(this, 'warn');\n context.console.error = this._log.bind(this, 'error');\n context.console.info = this._log.bind(this, 'info');\n context.console.debug = this._log.bind(this, 'debug');\n context.console.trace = this._log.bind(this, 'trace');\n context.console.dir = this._log.bind(this, 'dir');\n }", "function uiLog_log(event, target, id) {\n // creates an entry\n var entry = new Array();\n entry[\"event\"] = event;\n entry[\"target\"] = target;\n entry[\"id\"] = id;\n entry[\"time\"] = (new Date()).getTime();\n\n // adds all extra parameters to the entry\n var paramNumber = arguments.length-3;\n entry[\"paramNumber\"] = paramNumber;\n for(var i = 0; i < paramNumber; i++)\n entry[\"param\"+i] = arguments[i+3];\n\n // add the entry to the log variable\n _uiLog_entries[_uiLog_entries.length] = entry;\n\n // flush log 15 seconds later if no flush has been set\n if(_uiLog_flushSet == null)\n _uiLog_flushSet = setTimeout(\"uiLog_flush()\", 15000);\n}" ]
[ "0.68975186", "0.67589045", "0.6642748", "0.6397973", "0.63949114", "0.6261316", "0.62445617", "0.6176604", "0.61177546", "0.6078538", "0.60657465", "0.59924805", "0.5958662", "0.5945363", "0.58728874", "0.58673686", "0.5862124", "0.58538395", "0.58296937", "0.58278614", "0.5808897", "0.5746046", "0.5719085", "0.5675827", "0.5667716", "0.56441987", "0.56169176", "0.5616495", "0.5608392", "0.5600344", "0.5595151", "0.5593735", "0.559244", "0.559244", "0.559244", "0.55869573", "0.55869573", "0.55869573", "0.5586634", "0.55300677", "0.5528118", "0.5500628", "0.5489899", "0.54830706", "0.5479481", "0.5475406", "0.54689395", "0.54625297", "0.545948", "0.5452868", "0.54340917", "0.5424759", "0.5418935", "0.5414103", "0.5404085", "0.5398063", "0.5394169", "0.5392245", "0.5391967", "0.53910995", "0.53780484", "0.5377342", "0.5376268", "0.53716356", "0.5371389", "0.53698057", "0.5367048", "0.5366215", "0.5365645", "0.5363423", "0.5362964", "0.53530216", "0.5352751", "0.5349262", "0.53436613", "0.53397006", "0.5339076", "0.5329966", "0.5327737", "0.5327401", "0.5327206", "0.5318353", "0.53111243", "0.53073424", "0.5303729", "0.52969015", "0.5293639", "0.5292924", "0.5278513", "0.5276975", "0.52750754", "0.52741784", "0.526816", "0.52636015", "0.5257078", "0.52362317", "0.5232217", "0.5231592", "0.5229575", "0.5223602" ]
0.8587265
0
Write logs via a configured logging function. Arguments: key, value, ... An even number of string arguments
function log() { if (my.logFunction == null) return var meta = ['name', 'QuickQWERTY'] var data = Array.prototype.slice.call(arguments) my.logFunction.apply(this, meta.concat(data)) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function log() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i - 0] = arguments[_i];\n }\n if (!args.length) {\n return;\n }\n var id = args[0] + '';\n var fn = logMap[id];\n if (fn) {\n fn.apply(void 0, args.slice(1));\n }\n else {\n console.log('log: ' + JSON.stringify(args));\n }\n}", "log(_args) {\n\n }", "function log() {\n return stream.write(util$3.format.apply(util$3, arguments) + '\\n');\n}", "function log() {\n return stream.write(util$3.format.apply(util$3, arguments) + '\\n');\n}", "function logger(...params){\n console.log(params);\n}", "function logSomething(log) { log.info('something'); }", "function testLog(...args) {\n const rendered = args.map(arg =>\n typeof arg === 'string' ? arg : JSON.stringify(arg, abbreviateReplacer),\n );\n ephemeral.log.push(rendered.join(''));\n }", "function log() {\n\t\t return stream.write(util.format.apply(util, arguments) + '\\n');\n\t\t}", "function log() {\n return stream.write(util.format.apply(util, arguments) + '\\n');\n}", "function log() {\n return stream.write(util.format.apply(util, arguments) + '\\n');\n}", "function log() {\n return stream.write(util.format.apply(util, arguments) + '\\n');\n}", "function log() {\n return stream.write(util.format.apply(util, arguments) + '\\n');\n}", "function log() {\n return stream.write(util.format.apply(util, arguments) + '\\n');\n}", "function log() {\n return stream.write(util.format.apply(util, arguments) + '\\n');\n}", "function log() {\n return stream.write(util.format.apply(util, arguments) + '\\n');\n}", "function log() {\n return stream.write(util.format.apply(util, arguments) + '\\n');\n}", "function log() {\n return stream.write(util.format.apply(util, arguments) + '\\n');\n}", "function log() {\n return stream.write(util.format.apply(util, arguments) + '\\n');\n}", "function log() {\n return stream.write(util.format.apply(util, arguments) + '\\n');\n}", "function log() {\n return stream.write(util.format.apply(util, arguments) + '\\n');\n}", "function log() {\n return stream.write(util.format.apply(util, arguments) + '\\n');\n}", "function log() {\n return stream.write(util.format.apply(util, arguments) + '\\n');\n}", "function log() {\n return stream.write(util.format.apply(util, arguments) + '\\n');\n}", "function log() {\n return stream.write(util.format.apply(util, arguments) + '\\n');\n}", "function log() {\n return stream.write(util.format.apply(util, arguments) + '\\n');\n}", "function log() {\n return stream.write(util.format.apply(util, arguments) + '\\n');\n}", "function log() {\n return stream.write(util.format.apply(util, arguments) + '\\n');\n}", "function log() {\n return stream.write(util.format.apply(util, arguments) + '\\n');\n}", "function log() {\n return stream.write(util.format.apply(util, arguments) + '\\n');\n}", "function log() {\n return stream.write(util.format.apply(util, arguments) + '\\n');\n}", "function log() {\n return stream.write(util.format.apply(util, arguments) + '\\n');\n}", "function log() {\n return stream.write(util.format.apply(util, arguments) + '\\n');\n}", "function log() {\n return stream.write(util.format.apply(util, arguments) + '\\n');\n}", "function log() {\n return stream.write(util.format.apply(util, arguments) + '\\n');\n}", "function log() {\n return stream.write(util.format.apply(util, arguments) + '\\n');\n}", "function log() {\n return stream.write(util.format.apply(util, arguments) + '\\n');\n}", "function log() {\n return stream.write(util.format.apply(util, arguments) + '\\n');\n}", "function log() {\n return stream.write(util.format.apply(util, arguments) + '\\n');\n}", "function log() {\n return stream.write(util.format.apply(util, arguments) + '\\n');\n}", "function log() {\n return stream.write(util.format.apply(util, arguments) + '\\n');\n}", "function log() {\n return stream.write(util.format.apply(util, arguments) + '\\n');\n}", "function log() {\n return stream.write(util.format.apply(util, arguments) + '\\n');\n}", "function log() {\n return stream.write(util.format.apply(util, arguments) + '\\n');\n}", "function log() {\n return stream.write(util.format.apply(util, arguments) + '\\n');\n}", "function log() {\n return stream.write(util.format.apply(util, arguments) + '\\n');\n}", "function log() {\n return stream.write(util.format.apply(util, arguments) + '\\n');\n}", "function log() {\n return stream.write(util.format.apply(util, arguments) + '\\n');\n}", "function log() {\n return stream.write(util.format.apply(util, arguments) + '\\n');\n}", "function log() {\n return stream.write(util.format.apply(util, arguments) + '\\n');\n}", "function log() {\n return stream.write(util.format.apply(util, arguments) + '\\n');\n}", "function log() {\n return stream.write(util.format.apply(util, arguments) + '\\n');\n}", "function log() {\n return stream.write(util.format.apply(util, arguments) + '\\n');\n}", "function log() {\n return stream.write(util.format.apply(util, arguments) + '\\n');\n}", "function log() {\n return stream.write(util.format.apply(util, arguments) + '\\n');\n}", "function log() {\n return stream.write(util.format.apply(util, arguments) + '\\n');\n}", "function log() {\n return stream.write(util.format.apply(util, arguments) + '\\n');\n}", "function log() {\n return stream.write(util.format.apply(util, arguments) + '\\n');\n}", "function log() {\n return stream.write(util.format.apply(util, arguments) + '\\n');\n}", "function log() {\n\t return stream.write(util.format.apply(util, arguments) + '\\n');\n\t}", "function log() {\n\t return stream.write(util.format.apply(util, arguments) + '\\n');\n\t}", "function log (level, message) {\r\n\r\n}", "function log() {\n dump(Array.slice(arguments).join(' ') + '\\n');\n }", "function logger() {\n //arguments object (an array-like structure) is available and\n //contains all the arguments passed to this function\n for (var i = 0; i < arguments.length; i++) {\n console.log(arguments[i]);\n }\n}", "function logFuncDuration(funcName, args, duration) {\n let str = config.log;\n str = str.replace('${function}', funcName);\n str = str.replace('${arguments}', getArgStr(args));\n str = str.replace('${duration}', getDurationStr(duration));\n str = str.replace('${units}', config.units);\n\n config.logFunction(str);\n}", "function log() {\n var logger = arguments[0],\n level = arguments[1],\n args = Array.prototype.slice.call(arguments, 2);\n\n if (levels[level] < logger.level) {\n return;\n }\n\n var callerInfo = !(logger.options.disableCallerInfo || globalOptions.disableCallerInfo) && getCallerInfo();\n var transports = globalTransports.concat(logger.transports);\n\n for (var i = 0; i < transports.length; i++) {\n var t = transports[i];\n var l = t[level];\n\n if (l && typeof l === \"function\") {\n var logPrefixes = [];\n logPrefixes.push(new Date().toISOString());\n\n if (logger.id) {\n logPrefixes.push(\"[\" + logger.id + \"]\");\n }\n\n if (callerInfo && callerInfo.methodName.length > 1) {\n logPrefixes.push(\"<\" + callerInfo.methodName + \">: \");\n }\n\n var fullLogParts = logPrefixes.concat(args);\n l.bind(t).apply(t, fullLogParts);\n }\n }\n}", "function appendToLogs(level, args) {\n if (!args) return;\n\n var message;\n\n try {\n message = OT.$.JSONify(args);\n } catch(e) {\n message = args.toString();\n }\n\n if (message.length <= 2) return;\n\n _logs.push(\n [level, formatDateStamp(), message]\n );\n}", "log(...args) {\n return this.getInstance().log(...args);\n }", "function LOG() {\n let msg = arguments[0];\n if (arguments.length > 1) {\n [].shift.call(arguments);\n msg = ''.format.apply(msg, arguments);\n }\n log(msg);\n}", "function log() {\n if ( arguments.length === 0 ) { return; }\n \n var sep = ', ';\n var message = arguments[0];\n for (var i=1; i<arguments.length; i++ ) {\n message += sep + arguments[i];\n }\n \n console.log( message );\n logStream.write( message + '\\n' );\n}", "write(message) {\n message_log.write(message)\n }", "static log() {\n var str;\n str = Util.toStrArgs('', arguments);\n Util.consoleLog(str);\n }", "function logger() {}", "function dataLog() {\n fs.appendFile(\"./log.txt\", \", \" + arguTwo)}", "log (messageParms) {\n this._print(arguments)\n }", "log (messageParms) {\n this._print(arguments)\n }", "function log() {\n\t\t//var args = [].slice.call(arguments);\n\t\t//send('LOG', args);\n\t}", "function log(str) { Logger.log(str); }", "function touchlog() {\n //log.apply(undefined, arguments);\n}", "function LogToFile(args)\n{\n var d = new Date();\n if (arguments.length) {\n msg = d.getFullYear() + '-' + Pad2(d.getMonth()+1) + '-' + Pad2(d.getDate()) + ' ' +\n Pad2(d.getHours()) + ':' + Pad2(d.getMinutes()) + ':' +\n Pad2(d.getSeconds()) + ' ' + Array.from(arguments).join(' ');\n } else {\n msg = '';\n }\n fs.appendFile('cute_server_'+d.getFullYear()+Pad2(d.getMonth()+1)+'.log', msg+'\\n', \n function(error) {\n if (error) console.log(error, 'writing log file');\n }\n );\n return msg;\n}", "function log(data, info, logCommand) { // log(param1, param2) and use parameters to log the data in log.txt\r\n\r\n if (logCommand === \"concert-this\") {\r\n var command = \"concert-this \" + info;\r\n } else if (logCommand === \"spotify-this-song\") {\r\n var command = \"spotify-this-song \" + info;\r\n } else if (logCommand === \"movie-this\") {\r\n var command = \"movie-this \" + info;\r\n }\r\n var log = \"\\n\" + \"Command: \" + command + \"\\n\" + data + \"\\n\" + \"===========\" + \"\\n\";\r\n fs.appendFile(\"log.txt\",log, function(error) {\r\n if (error) {\r\n return console.log(error);\r\n }\r\n \r\n })\r\n}", "function logger() {\r\n // if $log fn is called directly, default to \"info\" message\r\n logger.info.apply(logger, arguments);\r\n }", "function log(...args) {\n console.log(...args);\n}", "function log() {\n console.log('%s - %s', timestamp(), exports.format.apply(exports, arguments));\n}", "function log() {\n console.log('%s - %s', timestamp(), format.apply(null, arguments));\n}", "function log() {\n console.log('%s - %s', timestamp(), format.apply(null, arguments));\n}", "function log() {\n console.log('%s - %s', timestamp(), format.apply(null, arguments));\n }", "function log$2() {\n console.log('%s - %s', timestamp(), format.apply(null, arguments));\n}", "static log(...args) {\n if (this.toLog('LOG')) {\n console.log.apply(console, arguments);\n }\n }", "function writeLogs() {\n cslogging.loadConfig('./testConfig.json');\n\n // the configFile set the maxSize to be 1K and maxFiles to be 10\n // So we need to write out a bit more then 10*1K of bytes of logs\n var testLogger = cslogging.getLogger('test');\n\n console.log('writing logs!');\n for(var i=0; i < 20; i++) {\n var chr = String.fromCharCode(97 + i);\n var logwriting = createLogWritingFunction(testLogger, chr, 1000);\n\n setTimeout(logwriting, i*100);\n }\n\n}", "function dummyLogging()\n{\n console.log.apply(console, arguments);\n}", "log(message) {\n this.loggingFunction(message);\n }", "function log() {\n\t console.log('%s - %s', timestamp(), format$1.apply(null, arguments));\n\t}", "function log() {\n\t console.log('%s - %s', timestamp(), format$1.apply(null, arguments));\n\t}", "function log() {\n\t console.log('%s - %s', timestamp(), format$1.apply(null, arguments));\n\t}", "function log() {\n return stream.write(util.format.apply(this, arguments) + '\\n');\n }", "function log() {\n return stream.write(util.format.apply(this, arguments) + '\\n');\n}", "function log() {\n\t return stream.write(util.format.apply(this, arguments) + '\\n');\n\t}", "function log() {\n\t return stream.write(util.format.apply(this, arguments) + '\\n');\n\t}", "function log() {\n\t return stream.write(util.format.apply(this, arguments) + '\\n');\n\t}", "function log() {\n\t return stream.write(util.format.apply(this, arguments) + '\\n');\n\t}" ]
[ "0.67879707", "0.6533823", "0.6361992", "0.6361992", "0.6291028", "0.6206539", "0.619093", "0.61777097", "0.61760527", "0.61760527", "0.61760527", "0.61760527", "0.61760527", "0.61760527", "0.61760527", "0.61760527", "0.61760527", "0.61760527", "0.61760527", "0.61760527", "0.61760527", "0.61760527", "0.61760527", "0.61760527", "0.61760527", "0.61760527", "0.61760527", "0.61760527", "0.61760527", "0.61760527", "0.61760527", "0.61760527", "0.61760527", "0.61760527", "0.61760527", "0.61760527", "0.61760527", "0.61760527", "0.61760527", "0.61760527", "0.61760527", "0.61760527", "0.61760527", "0.61760527", "0.61760527", "0.61760527", "0.61760527", "0.61760527", "0.61760527", "0.61760527", "0.61760527", "0.61760527", "0.61760527", "0.61760527", "0.61760527", "0.61760527", "0.61760527", "0.61760527", "0.61745965", "0.61745965", "0.6172899", "0.61317945", "0.6098692", "0.60912067", "0.60812706", "0.6067712", "0.6050372", "0.60304", "0.60154325", "0.5957955", "0.5949784", "0.59327865", "0.59237146", "0.592054", "0.592054", "0.5909166", "0.5896283", "0.58896357", "0.5886531", "0.588254", "0.58817923", "0.58804107", "0.5866931", "0.5866383", "0.5866383", "0.58421105", "0.5840579", "0.5835742", "0.58353394", "0.5831248", "0.5830196", "0.58206546", "0.58206546", "0.58206546", "0.58135664", "0.5812519", "0.58065385", "0.58065385", "0.58065385", "0.58065385" ]
0.6722094
1
Reset the user settings in my.settings to default values.
function resetSettings() { my.settings.unit = my.UNIT.MAIN }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function resetSettings() {\n let ns = Connector.getNamespace().toLowerCase();\n\n let removeSettings = st => {\n let us = st.userSettings;\n if (us) {\n let o = JSON.parse(us);\n delete o[ns];\n st.userSettings = JSON.stringify(o);\n }\n };\n\n // Remove both from local and session storage\n removeSettings(sessionStorage);\n try {\n removeSettings(localStorage);\n } catch(e) {}\n\n reloadPage();\n }", "reset() {\n settings = $copy(defaults);\n }", "resetUserSettings(newSettings, options = {}) {\n this._resetSettings(newSettings, options);\n }", "function reset() {\n return settings(defaults());\n }", "function reset() {\n settings = _Utils_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].clone(defaultSettings);\n }", "function resetValues() {\n\t\tsetValues( Defaults );\n\t\t\n\t\tpreferences.save();\n\t}", "function resetSettings() {\r\n\t\tvar keys = GM_listValues();\r\n\t\tfor (var i=0, key=null; key=keys[i]; i++) {\r\n\t\t\tGM_deleteValue(key);\r\n\t\t}\r\n\t}", "function resetValues () {\n Preferences.set('visualCascade', false);\n Preferences.set('browsers', Preferences.defaults.browsers);\n\n init();\n }", "resetSettings() {\n RoKA.Preferences.reset();\n new RoKA.Options();\n RoKA.Preferences.set(\"lastRunVersion\", Options.getExtensionVersionNumber());\n }", "static reset() {\n Preferences.preferenceCache = {};\n switch (RoKA.Utilities.getCurrentBrowser()) {\n case Browser.CHROME:\n chrome.storage.sync.remove(Object.keys(Preferences.defaults));\n break;\n }\n }", "static reset() {\n Preferences.preferenceCache = {};\n switch (RoKA.Utilities.getCurrentBrowser()) {\n case Browser.CHROME:\n chrome.storage.sync.remove(Object.keys(Preferences.defaults));\n break;\n }\n }", "function clearSettings() {\n localStorage.removeItem('emailSwitch');\n localStorage.removeItem('publickSwitch');\n localStorage.removeItem('timezone');\n}", "function reset() {\n\tchrome.runtime.getBackgroundPage(background => {\n\t\tconst ExtensionOptions = background.ExtensionOptions;\n\t\tconst ChromeStorage = background.ChromeStorage;\n\n\t\tExtensionOptions.onChange.once(load);\n\n\t\tChromeStorage.clear().then(() => {\n\t\t\tshowMessage('Settings reset!');\n\t\t});\n\t});\n}", "resetSettings(state) {\n // Reset settings\n for (const key in DEFAULT_SETTINGS) {\n if (!DEFAULT_SETTINGS.hasOwnProperty(key)) continue\n if (state[key] == null || state[key] == undefined) continue\n state[key] = DEFAULT_SETTINGS[key]\n }\n\n // Reset dashboard settings\n for (let c of state.containers) {\n if (c.panel === 'TabsPanel') {\n c.lockedTabs = false\n c.lockedPanel = false\n c.proxy = null\n c.proxified = false\n c.sync = false\n c.noEmpty = false\n c.lastActiveTab = -1\n }\n }\n }", "clear() {\n return clearUserSettings();\n }", "function resetSettingsUI () {\n range.value = convertMillisToRange(appState.interval)\n speak.checked = appState.speak\n notification.checked = appState.notification\n}", "function clearSettings() {\n localStorage.removeItem(\"emailToggle\");\n localStorage.removeItem(\"privacyToggle\");\n localStorage.removeItem(\"timezone\");\n}", "function vc_timetable_settings_reset()\n\t{\n\t\tfor(var prop in vc_tt_fields) {\n\t\t\tif(!vc_tt_fields.hasOwnProperty(prop))\n\t\t\t\tcontinue;\n\t\t\tvar field = vc_tt_fields[prop],\n\t\t\t\t$field = $(field.selector);\n\t\t\tif([\"textfield\", \"textarea\",\"multidropdown\", \"dropdown\"].indexOf(field.type)!==-1)\n\t\t\t\t$field.val(field.default);\n\t\t\tif([\"font\"].indexOf(field.type)!==-1)\n\t\t\t\t$field.val(field.default).trigger(\"change\");\n\t\t\tif([\"colorpicker\"].indexOf(field.type)!==-1)\n\t\t\t\t$field.val(field.default).trigger(\"keyup\", [1]);\n\t\t}\n\t}", "function resetVars() {\n wordBank = defaults.words;\n score = defaults.score;\n lives = defaults.lives;\n userGuesses = [];\n}", "function resetVars() {\n wordBank = defaults.words;\n score = defaults.score;\n lives = defaults.lives;\n userGuesses = [];\n}", "resetSettings() {\n\t\tthis.setState( { loading: true } );\n\n\t\tthis.state.api.post( 'minify_reset_settings' ).then( () => {\n\t\t\tWPHB_Admin.notices.show( __( 'Settings restored to defaults' ) );\n\t\t\tthis.setState( {\n\t\t\t\tassets: {\n\t\t\t\t\tstyles: {},\n\t\t\t\t\tscripts: {},\n\t\t\t\t},\n\t\t\t\tenabled: {\n\t\t\t\t\tstyles: true,\n\t\t\t\t\tscripts: true,\n\t\t\t\t},\n\t\t\t\texclusions: {\n\t\t\t\t\tstyles: {},\n\t\t\t\t\tscripts: {},\n\t\t\t\t},\n\t\t\t\tloading: false,\n\t\t\t} );\n\t\t} );\n\t}", "function restoreSettings()\n{\n var tmp = System.Gadget.Settings.readString(\"user_name\");\n\tif (tmp != \"\") userName = tmp;\n\ttmp = System.Gadget.Settings.readString(\"api_key\");\n\tif (tmp != \"\") apiKey = tmp;\n\ttmp = System.Gadget.Settings.readString(\"poll_freq\");\n\tif (tmp != \"\") pollFreq = tmp;\n\tvar nameField = document.getElementById(\"user_name\");\n\tnameField.value = userName;\n\tvar keyField = document.getElementById(\"api_key\");\n\tkeyField.value = apiKey;\n\tvar pollField = document.getElementById(\"poll_freq\");\n\tpollField.value = pollFreq;\n\tSystem.Gadget.onSettingsClosing = SettingsClosing;\n}", "function resetLoginAndPassword() {\n\tsettings.set('User', {\n\t\t'SerialNo': 'null',\n\t\t'CtlUrl': 'null',\n\t\t'Mail': 'null',\n\t\t'Nick': 'null'\n\t});\n}", "function _resetUserOptions () {\n var options = _readUserOptions();\n\n if (options) {\n if (options.mode) {\n $travel_options.find('a[data-mode=\"' + options.mode + '\"]').trigger('click');\n }\n if (options.location) {\n current_visitor_location = options.location;\n $location_field.val(options.location);\n }\n\n /**\n * If both location options are present then enable submit button\n */\n if (options.location && options.latlng) {\n _changedLocationField();\n }\n }\n }", "resetDefaults() {\n this.checked = false;\n this.blocked = false;\n this.start = false;\n this.inShortestPath = false;\n this.end = false;\n }", "static reset() {\n // Use the defaults\n Object.assign(Flags, FlagDefaults);\n // Overwrite the defaults with the testFlags.\n if (typeof global !== 'undefined') {\n Object.assign(Flags, global['testFlags']);\n }\n }", "function reset() {\n userSupplierManager.reset();\n UserCache._clear();\n ScoreBooster.reset();\n }", "function reset() {\n userSupplierManager.reset();\n UserCache._clear();\n ScoreBooster.reset();\n }", "function clearSettingsFile() {\n fs.writeFileSync('json/logins.json', '');\n}", "function setDefaults() {\n\tconfig.all = {\n\t\ttitleStyle: {\n\t\t\t'font-src': 'http://fonts.googleapis.com/css?family=Chango',\n\t\t\t'font-family': 'Chango, cursive',\n\t\t\t'color': '#000000',\n\t\t\t'font-size': '48px'\n\t\t},\n\t\ttimerStyle: {\n\t\t\t'background-color': '#32cd32',\n\t\t\t'font-src': 'http://fonts.googleapis.com/css?family=Chango',\n\t\t\t'font-family': 'Chango, cursive',\n\t\t\t'color': '#000000',\n\t\t\t'font-size': '48px'\n\t\t},\n\t\ttimers: [],\n\t\twindowSettings: {\n\t\t\twidth: 650,\n\t\t\theight: 350\n\t\t},\n\t\tusername: '',\n\t\tpassword: '',\n\t\tchannel: '',\n\t\tidInc: 0,\n\t\tactiveID: null\n\t}\n}", "function resetConfig() {\n writeConfig(skyuxConfigOriginal);\n}", "reset() {\n UtilsSettings_1.UtilsSettings.deepCopyProperties(this, TextSettings_1.TextSettings.defaultStyle, TextSettings_1.TextSettings.defaultStyle);\n }", "function setDefaultCurrentSettings(settings) {\r\n\t\tdebug('setDefaultCurrentSettings');\r\n\t\tcurrentSettings = $.extend(true, {}, $.fn.nyroModal.settings, settings);\r\n\t\tcurrentSettings.selector = '';\r\n\t\tcurrentSettings.borderW = 0;\r\n\t\tcurrentSettings.borderH = 0;\r\n\t\tcurrentSettings.resizable = true;\r\n\t\tsetMargin();\r\n\t}", "function resetAll(){\n\t\t\t\tlogger.debug(\"Resetting all variables\");\n\t\t\t\tisAudioOn = true;\n\t\t\t\tlpChatFontSize = 13;\n\t\t\t\tchatWinCloseable = true;\n\t\t\t\tlpInteractiveChat = false;\n\t\t\t\tlpVisitorTypingMsg = false;\n\t\t\t \tofflineSurveyNameOverride = \"\";\n\t\t\t\tpreChatSurveyNameOverride = \"\";\n\t\t\t\texitSurveyNameOverride = \"\";\n\t\t\t\tscreenState = '';\n\t\t\t\twindowState = windowStateType.READY;\n\t\t\t\tchatInstanceReady = false;\n\t\t\t\tcollaborationInstanceReady=false;\n\t\t\t}", "reset() {\r\n return this.config.initial = 'normal'\r\n }", "function reset (callback) {\n\tvar options = defaults();\n\tchrome.storage.local.set(options, function () {\n\t\tcallback(options);\n\t});\n}", "function setDefaults(){\n // Default debug email from current user\n if(userProp.getProperty(g_debugEmail_key) === null)\n userProp.setProperty(g_debugEmail_key, Session.getActiveUser().getEmail());\n\n // Default debug state\n if(userProp.getProperty(g_debug_key) === null)\n userProp.setProperty(g_debug_key, g_debug_val);\n}", "function setDefaultSettings() {\n\n // Reset volume to default\n volumeEle.value = DEFAULT_VOLUME * 100 // Just for the user's display\n volumeCB.checked = volumeEle.value > 0 ? false : true\n volumeDispl.innerHTML = `${DEFAULT_VOLUME*100}` // Just for the user's display\n Sounds.setGameVolume(DEFAULT_VOLUME)\n\n // Reset scoreboard visibility\n scoreboardCB.checked = true\n scoreBoard.style.display = 'flex'\n \n // Reset snake speed to default\n snakeSpeedEle.value = DEFAULT_SNAKE_SPEED // Just for the user's display\n snakeSpeedDispl.innerHTML = `${DEFAULT_SNAKE_SPEED} ticks per second` // Just for the user's display\n setSnakeSpeed(DEFAULT_SNAKE_SPEED)\n\n // Reset snake expansion rate to default\n expansionRateEle.value = DEFAULT_EXPANSION_RATE // Just for the user's display\n expansionDispl.innerHTML = `${DEFAULT_EXPANSION_RATE} blocks per food` // Just for the user's display\n setExpansionRate(DEFAULT_EXPANSION_RATE)\n\n changeUIColors({ \n bg: '#3f3f44', \n gb: '#f7f7f7', \n snake: '#fca356', \n food: '#cceabb', \n hTxt: 'firebrick', \n sTxt: '#3f3f44', \n btnTxt: 'white', \n border: '#3f3f44', \n btnBG: 'linear-gradient(270deg, rgba(169,91,219,1) 0%, rgba(219,91,91,1) 24%, rgba(213,219,91,1) 50%, rgba(91,219,106,1) 76%, rgba(91,158,219,1) 100%)'\n })\n \n localStorage.removeItem('volume')\n localStorage.removeItem('showScoreboard')\n localStorage.removeItem('snakeSpeed')\n localStorage.removeItem('snakeExpansionRate')\n localStorage.removeItem('accessibility')\n }", "restoreDefault() {\n this.resetCCSetting();\n }", "function reset() {\n oConfig = {};\n oConfig = jQuery.extend({}, {}, oConfigDefaults);\n aLastResults = [];\n }", "function resetBlueprintSettings()\n{\n\t//Assign default values into defaults form.\n\tdocument.getElementById('FontSize').value = nDefaultFontSize;\n\tdocument.getElementById('ColumnWidth').value = nDefaultColumnWidth;\n\tdocument.getElementById('ColumnGutter').value = nDefaultColumnGutter;\n\tdocument.getElementById('Columns').value = nDefaultColumns;\n\tdocument.getElementById('MaxGridHang').value = nDefaultMaxGridHang;\n\tdocument.getElementById('MaxGridLift').value = nDefaultMaxGridLift;\n\tdocument.getElementById('MaxGridPress').value = nDefaultMaxGridPress;\n\tdocument.getElementById('MaxGridStretch').value = nDefaultMaxGridStretch;\n\n\treturn;\n}", "onResetSettings_(e) {\n this.browserProxy.setOriginPermissions(\n this.origin_, this.getCategoryList(), ContentSetting.DEFAULT);\n if (this.getCategoryList().includes(ContentSettingsTypes.PLUGINS)) {\n this.browserProxy.clearFlashPref(this.origin_);\n }\n\n this.onCloseDialog_(e);\n }", "clear() {\n this.data = DEFAULT_SETTINGS;\n return this.store.clear();\n }", "function loadDefaultPreferences() {\n \tfor (var key in defaultPreferences) {\n \t\t// Skip this ones.\n \t\tif (/firstrun|version|updatechecktime/.test(key))\n \t\t\tcontinue;\n\n \t\tpref.setPref(key, defaultPreferences[key]);\n \t}\n\n \tlog.info(\"prefs:\",\n \t\t\"Preferences are (re)setted to default values.\"\n \t);\n }", "function reset () {\n\t\tw.localStorage.removeItem('addToHome');\n\t\tw.sessionStorage.removeItem('addToHomeSession');\n\t}", "function reset() {\r\n restore_options();\r\n update_status(\"已还原\");\r\n}", "function setDefaultCurrentSettings(settings) {\n debug('setDefaultCurrentSettings');\n currentSettings = $.extend(true, {}, $.fn.nyroModal.settings, settings);\n currentSettings.selector = '';\n currentSettings.borderW = 0;\n currentSettings.borderH = 0;\n currentSettings.resizable = true;\n setMargin();\n }", "function clearSettings() {\n writeCookie('canitube_Settings_Performance', 'smooth', 1000000);\n writeCookie('canitube_Settings_Display', 'simple', 1000000);\n}", "function reset(){\n emailCheck.checked = false;\n profileCheck.checked = false;\n timeZone.value = 'Select a time zone';\n localStorage.clear();\n alert('Your settings have been removed successfully');\n}", "function cleanDefaultAuth () {\n defaultAuth = undefined;\n}", "_default_settings(settings) {\n\t\t// Can't do anything if OBS Studio is not connected.\n\t\tif (!this.obs.connected()) return;\n\n\t\tswitch (settings.type) {\n\t\t\tcase \"set\":\n\t\t\tcase \"adjust\":\n\t\t\tcase \"mute\":\n\t\t\tcase \"monitor\":\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tsettings.type = \"mute\";\n\t\t}\n\n\t\tif ((settings.source === undefined) || (typeof (settings.source) !== \"string\")) {\n\t\t\tsettings.source = undefined;\n\t\t}\n\n\t\tswitch (settings.style) {\n\t\t\tcase \"static\":\n\t\t\tcase \"sliderVertical\":\n\t\t\tcase \"sliderHorizontal\":\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tsettings.style = \"static\";\n\t\t}\n\n\t\tif (typeof (settings.step) !== \"number\") {\n\t\t\tsettings.step = parseFloat(settings.step);\n\t\t}\n\t\tif (isNaN(settings.step) || !isFinite(settings.step)) {\n\t\t\tsettings.step = 1.0;\n\t\t}\n\n\t\tif (typeof (settings.volume) !== \"number\") {\n\t\t\tsettings.volume = parseFloat(settings.volume);\n\t\t}\n\t\tif (isNaN(settings.volume) || !isFinite(settings.volume)) {\n\t\t\tsettings.volume = 0.5;\n\t\t}\n\n\t\tswitch (settings.mode) {\n\t\t\tcase \"toggle\":\n\t\t\tcase \"mute\":\n\t\t\tcase \"talk\":\n\t\t\tcase \"setmute\":\n\t\t\tcase \"setunmute\":\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tsettings.mode = \"toggle\";\n\t\t}\n\t}", "function resetSettings() {\n topHourSetText.innerHTML = hourOnD.toString();\n topTenSetText.innerHTML = tenMinOnD.toString();\n topMinSetText.innerHTML = minOnD.toString();\n bottomHourSetText.innerHTML = hourOffD.toString();\n bottomTenSetText.innerHTML = tenMinOffD.toString();\n bottomMinSetText.innerHTML = minOffD.toString();\n}", "reset() {\n this.reqUserAction = true;\n this.supported = true;\n }", "function mqc_clear_default_config() {\n try {\n var config = localStorage.getItem(\"mqc_config\");\n if (!config) {\n return;\n } else {\n config = JSON.parse(config);\n }\n for (var c in config) {\n if (config.hasOwnProperty(c)) {\n config[c]['default'] = false;\n }\n }\n localStorage.setItem(\"mqc_config\", JSON.stringify(config));\n $('<p class=\"text-danger\" id=\"mqc-cleared-success\">Unset default.</p>').hide().insertBefore($('#mqc_loadconfig_form .actions')).slideDown(function () {\n setTimeout(function () {\n $('#mqc-cleared-success').slideUp(function () { $(this).remove(); });\n }, 5000);\n var name = $('#mqc_loadconfig_form select option:contains(\"default\")').text();\n $('#mqc_loadconfig_form select option:contains(\"default\")').remove();\n name = name.replace(' [default]', '');\n $('#mqc_loadconfig_form select').append('<option>'+name+'</option>').val(name);\n });\n } catch (e) {\n console.log('Could not access localStorage');\n }\n}", "resetConfig()\n {\n this.config = this._defaultConfig();\n }", "resetConfig()\n {\n this.config = this._defaultConfig();\n }", "function reset_options()\n{\n\tchrome.storage.local.set({\n\t\t'leap_motion_user_prefer_hand': 'right',\n\t\t'leap_motion_fingers': 'yes',\n\t\t'leap_motion_color': 'rainbow',\n\t\t'leap_motion_click': 'enabled',\n\t\t'leap_motion_scrolling': 'enabled',\n\t\t'leap_motion_history': 'enabled',\n\t\t'leap_motion_open_or_close_tab': 'enabled',\n\t\t'leap_motion_switch_tab': 'enabled',\t\t\n\t\t'leap_motion_zoom': 'disabled'\n\t});\n\n\tjQuery('#user_prefer_hand').val('right');\n\tjQuery('#fingers').val('yes');\n\tjQuery('#color').val('rainbow');\n\tjQuery('#click').val('enabled');\n\tjQuery('#scrolling').val('enabled');\n\tjQuery('#history').val('enabled');\n\tjQuery('#open_or_close_tab').val('enabled');\n\tjQuery('#switch_tab').val('enabled');\n\tjQuery('#zoom').val('disabled');\n\n\t// Update status to let user know options were saved.\n\t$('#status').html('Options Reset').fadeIn();\n\n\tsetTimeout(function(){ $('#status').fadeOut(); }, 3000);\n}", "function reset()\n{\n\tneedsReset = 1;\n\t\n\t/*\n\tpost(\"Setting needsReset\");\n\tpost();\n\t*/\n}", "function setToDefault() {\n\t\tkeys = {\n\t\t\tupgradeKey: KeyEvent.DOM_VK_U,\n\t\t\tsellKey: KeyEvent.DOM_VK_S,\n\t\t\tstartWaveKey: KeyEvent.DOM_VK_G,\n\t\t\tquitKey: KeyEvent.DOM_VK_ESCAPE\n\t\t}\n\n\t\t// save these defaults\n\t\tlocalStorage['VWL&AdityaTowerDefense.keysettings'] = JSON.stringify(keys);\n\n\t\tfor(var property in keys) {\n\t\t\tif(keys.hasOwnProperty(property)) {\n\t\t\t\tconsole.log(property);\n\t\t\t\tvar output = document.getElementById(property + '-out');\n\t\t\t\toutput.innerHTML = getKeyWindowOutput(keys[property]) + ' ';\n\t\t\t}\n\t\t}\n\n\t\tif(rebinding) { //if still rebinding when setToDefalut is pressed remove key listener\n\t\t\twindow.removeEventListener('keydown', finishRebind);\n\t\t}\n\n\t\trebinding = false;\n\t\tlastKey = undefined;\n\t}", "function reset() {\n setGuesses([]);\n setGuess(\"\");\n setHints([]);\n setStatus(\"\");\n setSecret(generateSecret);\n }", "function fillSettings() {\n fs.readFile(\n path.join(appPath, 'settings.json'),\n 'utf8',\n (error, data) => {\n if (error) {\n return logger.error(\n 'Unable to read app/settings.json:',\n error\n )\n }\n\n try {\n data = JSON.parse(data)\n } catch (error) {\n return logger.error(\n 'Unable to parse app/settings.json:',\n error\n )\n }\n\n lastSaveTime = Date.now() + 1\n\n for (let section in data) {\n for (let subSection in data[section]) {\n if (typeof data[section][subSection] === 'object') {\n let keyGroup = section + '.' + subSection\n if (\n typeof data[section][subSection].map ===\n 'string'\n ) {\n keyGroup = data[section][subSection].map\n }\n keyGroup += '.'\n\n let entries = data[section][subSection].entries\n\n for (let option in entries) {\n if (!settings.has(keyGroup + option)) {\n settings.set(\n keyGroup + option,\n entries[option].default\n )\n }\n }\n }\n }\n }\n }\n )\n }", "resetSettings() {\n document.getElementById('marot-scoring-unit').value = 'segments';\n this.mqmWeights = JSON.parse(JSON.stringify(mqmDefaultWeights));\n this.mqmSlices = JSON.parse(JSON.stringify(mqmDefaultSlices));\n this.setUpScoreSettings();\n this.updateSettings();\n }", "function reset() {\n // noop\n location.reload();\n }", "reset() {\n this.token = DEFAULT_TOKEN\n this.user = null\n this.institution = null\n api.unsetToken()\n }", "function resetToOptions(){\n\tconsole.log(\"Resetting to initial\", viewerParams.parts.options_initial);\n\tviewerParams.parts.options = JSON.parse(JSON.stringify(viewerParams.parts.options_initial));\n\tresetViewer();\n}", "function resetUserBlacklist(){\n if(mode == \"userset\"){\n removeUserSet();\n }\n usersetWebsites = {};\n chrome.storage.sync.set({'websites': usersetWebsites})\n}", "function reset() {\n UsersRelatedToContent.reset();\n }", "function reset() {\n UsersRelatedToContent.reset();\n }", "function resetGlobalState() {\n var defaultGlobals = new MobXGlobals();\n for (var key in defaultGlobals)\n if (persistentKeys.indexOf(key) === -1)\n globalState[key] = defaultGlobals[key];\n globalState.allowStateChanges = !globalState.enforceActions;\n}", "function resetGlobalState() {\n var defaultGlobals = new MobXGlobals();\n for (var key in defaultGlobals)\n if (persistentKeys.indexOf(key) === -1)\n globalState[key] = defaultGlobals[key];\n globalState.allowStateChanges = !globalState.enforceActions;\n}", "reset() {\r\n this.state = this.config.initial;\r\n }", "function resetGlobalState() {\n var defaultGlobals = new MobXGlobals();\n\n for (var key in defaultGlobals) if (persistentKeys.indexOf(key) === -1) globalState[key] = defaultGlobals[key];\n\n globalState.allowStateChanges = !globalState.enforceActions;\n}", "function reset() {\n save(null);\n }", "function resetGlobalState() {\n var defaultGlobals = new MobXGlobals();\n for (var key in defaultGlobals) {\n if (persistentKeys.indexOf(key) === -1) globalState[key] = defaultGlobals[key];\n }globalState.allowStateChanges = !globalState.enforceActions;\n}", "function resetDebug() {\n userProp.deleteProperty(g_debugEmail_key);\n userProp.deleteProperty(g_debug_key);\n setDefaults();\n loadMenu(userProp.getProperty(g_debug_key));\n}", "function reset()\n\t{\n\t\tsetValue('')\n\t}", "function resetDefault(){\n fillDefault();\n}", "function reset() {\n RelatedUsersSupplier.reset();\n ServerUsersSupplier.reset();\n RecentUsersSupplier._clear();\n }", "function reset() {\n RelatedUsersSupplier.reset();\n ServerUsersSupplier.reset();\n RecentUsersSupplier._clear();\n }", "function resetGlobalState() {\r\n var defaultGlobals = new MobXGlobals();\r\n for (var key in defaultGlobals)\r\n if (persistentKeys.indexOf(key) === -1)\r\n globalState[key] = defaultGlobals[key];\r\n globalState.allowStateChanges = !globalState.enforceActions;\r\n}", "function restoreSettings() {\n for (let index = 0; index < settingsStorage.length; index++) {\n let key = settingsStorage.key(index);\n if (key) {\n let data = {\n key: key,\n newValue: settingsStorage.getItem(key)\n };\n sendVal(data);\n }\n }\n // Let the device know settings are done\n let data = {\n key: \"settingsready\",\n newValue: \"done\"\n };\n sendVal(data);\n}", "function settingsSetup() {\n updateSettingsValues();\n }", "function resetVar() {\n debug(\"Resetting global bulkWhois object\");\n returnValue = JSON.parse(JSON.stringify(defaultBulkWhois));\n debug(\"bulkWhois object: {0}\".format(returnValue));\n return returnValue;\n}", "function reset() {\n // noop\n }", "function resetEverything(){\n resetImages();\n resetPlay();\n resetPause();\n }", "function purgePrefs() {\n\tfor (var key in localStorage) {\n\t\tif (key.indexOf(\"mtd_\") >= 0) {\n\t\t\tlocalStorage.removeItem(key);\n\t\t\tconsole.log(\"Removing key \"+key+\"...\");\n\t\t}\n\t}\n\tif (isApp) {\n\t\tconst Store = require('electron-store');\n\t\tconst store = new Store({name:\"mtdsettings\"});\n\t\tstore.clear();\n\t\tconsole.log(\"Clearing electron-store...\");\n\t}\n}", "function resetVariables() {\n userExiste = false;\n activeUser;\n arrayComments = [];\n //console.log(\"Reseted variables\")\n}", "function _reset() {\n FocusOnService.focus('username');\n\n $scope.user = {\n username : '',\n firstName : '',\n lastName : '',\n admin : false,\n passports : {\n password : '',\n protocol : 'local'\n },\n password_confirmation : '',\n }\n }", "function resetSettings(sendResponseFunction) {\n\t// reset the data\n\tvar data = {\n\t\t\tvLoc: \"bottom\",\n\t\t\thLoc: \"right\",\n\t\t\tvisibilityBehav: \"alwaysshow\",\n\t\t\tscrSpeed: \"1200\",\n\t\t\ticonTransparency: \"0.5\",\n\t\t\tblackAndWhite: \"false\",\n\t\t\t\n\t\t\tarrowType: \"1\",\n\t\t\t\n\t\t\tsmartDirection: \"false\",\n\t\t\tcontrolOption: \"pager\",\n\t\t\thideControls: \"true\",\n\t\t\ticonSize: \"48\",\n\t\t\ticonLib: \"1\",\n\t\t\t\n\t\t\tdArrang: \"hr\",\n\t\t\tdIconLib: \"1\",\n\t\t\t\n\t\t\thOffset: \"20\",\n\t\t\tvOffset: \"20\",\n\t\t\tremovedSites: \"mail.google.com/mail;google.com/calendar;\"\n\t\t};\n\t\n\taddLocalSettingsWithResetValue(data);\n\t\n\tsaveSettings(data, sendResponseFunction);\n}", "static purgeSettings() {\n for (const value of GM_listValues()) {\n GM_deleteValue(value);\n }\n }", "function resetConfig() {\r\n\tGM_setValue(\"emule_config\",0);\r\n\tscriptConfig();\r\n}", "function setDefaults(options){for(var key in options){_defaults[key]=options[key];}}", "function resetValues() {\n professorName = \"\";\n ratingsPageURL = \"\";\n searchPageURL = \"\";\n professorRating = \"\";\n}", "function initUser() {\n setUserProfile(null);\n service.init();\n }", "function clearUserData()\n {\n userData = userDataDefault;\n window.localStorage.setItem(localStorageName, JSON.stringify(userData));\n }", "function clearUserFields() {\n\t\t$(\"span.fullName\").html(\"\");\n\t\t$(\"span.email a\").attr(\"href\", \"mailto:\");\n\t\t$(\"span.role\").text(\"\");\n\t\t$(\"span.role\").html(\"Role: \");\n\t\t$(\"span.school\").html(\"School: \");\n\n\t\t$(\"form.edit-profile\")[0].reset();\n\t}", "function restoreDefaults() {\n console.log('[PROTOCOL restoreDefaults()]', arguments);\n var newGame = angular.copy(club.defaultGame);\n newGame.metadata = vm.game.metadata;\n handleLoadedGame(vm.game, club.defaultGame);\n }", "function reset() {\r\n // noop\r\n }", "clearUser() {\n this.inputValue = '';\n this.selected_user = undefined;\n this.not_found = false;\n }", "async reset(username) {\n\t\tif (username) {\n\t\t\t// Nuke only one user.\n\t\t\tsay(`reset: clear vars for user ${username}`)\n\t\t\treturn await this.redisDel(username);\n\t\t}\n\n\t\t// Nuking ALL the users.\n\t\tlet usernames = await this.allUsernames();\n\t\tsay(`reset: delete users ${usernames}`);\n\t\tfor (let user of usernames) {\n\t\t\tawait this.redisDel(user);\n\t\t}\n\t}" ]
[ "0.77598494", "0.7392073", "0.7301513", "0.7296523", "0.719829", "0.70321774", "0.6965988", "0.67659426", "0.6680002", "0.66172194", "0.66172194", "0.6614615", "0.6613346", "0.6611796", "0.65568125", "0.64913183", "0.64834046", "0.64734983", "0.6391904", "0.6391904", "0.63799936", "0.62830055", "0.6260884", "0.62378", "0.61035335", "0.6088891", "0.6075273", "0.6075273", "0.6057983", "0.6052247", "0.6051262", "0.60467064", "0.60360277", "0.60324025", "0.6021067", "0.5999717", "0.59855217", "0.598299", "0.59822154", "0.59751296", "0.59649116", "0.59550995", "0.5944403", "0.59293574", "0.59210086", "0.5915859", "0.591545", "0.59131265", "0.590999", "0.59050184", "0.5903738", "0.5886268", "0.58774745", "0.5843943", "0.5827579", "0.5827579", "0.57974386", "0.5792951", "0.5771214", "0.57708836", "0.57551974", "0.57498765", "0.5728114", "0.5718468", "0.5708898", "0.5706537", "0.5704755", "0.5704755", "0.5699266", "0.5699266", "0.5694594", "0.56929684", "0.56853807", "0.5682443", "0.56794065", "0.56753546", "0.56703556", "0.56677634", "0.56677634", "0.5658606", "0.56515515", "0.5650917", "0.5645241", "0.5644937", "0.5639861", "0.5635631", "0.5632786", "0.56254953", "0.5620604", "0.5613592", "0.5604667", "0.5602715", "0.5596263", "0.5595512", "0.55938363", "0.5593179", "0.55920076", "0.55912167", "0.5586208", "0.5585282" ]
0.72418845
4
Load settings from local storage to my.settings object.
function loadSettings() { if (typeof localStorage.unit != 'undefined') { my.settings.unit = localStorage.unit } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setFromLocal () {\n _.each(settings, (v, k) => {\n var value = localStorage.getItem(k);\n if (value) {\n settings[k] = JSON.parse(value);\n }\n });\n}", "static load() { return JSON.parse(window.localStorage.getItem('settings')) || {}; }", "function loadSettings() {\n const jsonSettings = localStorage.getItem(\"mafiaSettings\");\n try {\n if (jsonSettings) {\n settings = JSON.parse(jsonSettings);\n }\n } catch (e) {\n debug.log(\"String is not valid JSON\");\n // No point storing it then\n localStorage.removeItem(\"mafiaSettings\");\n // Use the current definition of settings (above)\n }\n}", "function loadLocalSettings() {\n if (typeof (window.localStorage) === 'undefined') {\n console.log(\"Local settings cannot be saved. No web storage support!\");\n return;\n }\n\n if (typeof (localStorage.favoritePresets) !== 'undefined' && localStorage.favoritePresets !== null) {\n favoritePresetID = JSON.parse(localStorage.favoritePresets);\n console.log(\"Loading Parameter [localStorage.favoritePresets]:\");\n console.log(favoritePresetID);\n }\n\n if (typeof (localStorage.currentAddress) !== 'undefined' && localStorage.currentAddress !== null) {\n address = localStorage.currentAddress;\n console.log(\"Loading Parameter [localStorage.currentAddress]:\");\n console.log(address);\n }\n}", "function getSettings(){\n if(localStorage.getItem('settings') !== null){\n settings = JSON.parse(localStorage.getItem('settings'));\n }\n}", "function loadSettings() {\r\n// load settings, if nothing is loaded, use default settings\r\n\tlet loadedSettings = localStorage.getItem(\"highlightFriendsSettings\");\r\n\tif (loadedSettings !== null) {\r\n\t\tsaveData = JSON.parse(loadedSettings);\r\n\t}\r\n}", "function loadLocalSettings(items)\n\t{\n\t\tshowAvatars = items[\"avatars\"];\n\t\tif (showAvatars === false)\n\t\t\t$('.userpic-holder').hide();\n\t\tconsole.log(\"Loaded avatar settings from local storage: \" + showAvatars);\n\t\tupdateAvatarText();\n\n\t\tif (showAvatars === true)\n\t\t{\n\t\t\t$('.userpic-holder').show();\n\t\t}\n\n\t\tallowNWS = items[\"nws\"];\n\t\tallowNWS ? $('#nws-toggle').text(\"NWS On\") : $('#nws-toggle').text(\"NWS Off\");\n\t\tconsole.log(\"Loaded nws settings from local storage: \" + allowNWS);\n\n\t\tvar nwsColor = items['nwsColor'];\n\t\tconsole.log(\"Loaded NWS link color settings from local storage: \" + nwsColor);\n\n\t\tvar nwsChangeColor = items['nwsChangeColor'];\n\t\tif (nwsChangeColor === true)\n\t\t{\n\t\t\t$(\".fr:contains('NWS')\").closest(\"td\").children(\".fl\").children(\"a\").not(\".appended\").css('color', nwsColor);\n\t\t}\n\n\t\tvar rowColor = items['rowColor'];\n\t\tconsole.log(\"Loaded row color settings from local storage: \" + rowColor);\n\t\t\n\t\tvar rowChangeColor = items['rowChangeColor'];\n\t\tif (rowChangeColor === true)\n\t\t{\n\t\t\t$(\".grid tr td\").hover(\n\t\t\t\tfunction()\n\t\t\t\t{\n\t\t\t\t\t$(this).closest(\"tr\").children(\"td\").css(\"background-color\", rowColor);\n\t\t\t\t\t$(this).find(\".appended\").show();\n\t\t\t\t},\n\t\t\t\tfunction()\n\t\t\t\t{\n\t\t\t\t\t$(this).closest(\"tr\").children(\"td\").css(\"background-color\", \"\");\n\t\t\t\t\t$(this).find(\".appended\").hide();\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\t\t\n\t}", "function loadSettings () {\n storage.get(vatobeStorage, function (error, data) {\n if (error) throw error\n // load storage into app state\n var intervalRange = data.intervalRange || data.interval // for backwards compatibility\n appState.interval = convertRangeToMillis(intervalRange)\n appState.speak = data.speak\n appState.notification = data.notification\n // match UI to the stored settings\n range.value = data.intervalRange\n speak.checked = data.speak\n notification.checked = data.notification\n })\n}", "function storeSettings(){\n localStorage.setItem('settings', JSON.stringify(settings));\n}", "function syncToStorage() {\n\tvar settings_object = {};\n\tObject.keys(localStorage).forEach(function(key) {\n\t\tsettings_object[key] = localStorage[key];\n\t});\n\tchrome.storage.sync.set(settings_object);\n}", "function loadSettings(){\n\t//Load the user settings from the local storage\n\tvar settings = JSON.parse(localStorage.getItem(\"settings\"));\n\t\n\t//If there were settings to load\n\tif(settings !== null){\n\t\t//Load all settings\n\t\tif (typeof settings.country !== \"undefined\") country = settings.country;\n\t\tif (typeof settings.includeOldResults !== \"undefined\") includeOldResults = settings.includeOldResults;\n\t\tif (typeof settings.searchStrings !== \"undefined\") searchStrings = settings.searchStrings;\n\t\tif (typeof settings.locations !== \"undefined\") locations = settings.locations;\n\t\tif (typeof settings.radiuses !== \"undefined\") radiuses = settings.radiuses;\n\n\t\tconsole.log(\"checkbox is \" + includeOldResults);\n\t\t//Update HTML values\n\t\tdocument.getElementById(\"country\").value = country;\n\t\tif(includeOldResults == \"true\") document.getElementById(\"includeOldResults\").checked = true;\n\t\telse document.getElementById(\"includeOldResults\").checked = false;\n\n\t\t//Add required search boxes\n\t\tfor(var i = searches; i < searchStrings.length; i++){\n\t\t\taddSearch(false);\n\t\t}\n\n\t\t//For all searches, update HTML values\n\t\tfor(var i = 1; i <= searchStrings.length; i++){\n\t\t\tdocument.getElementById(\"searchString\" + i).value = searchStrings[i-1];\n\t\t\tdocument.getElementById(\"location\" + i).value = locations[i-1];\n\t\t\tdocument.getElementById(\"radius\" + i).value = radiuses[i-1];\n\t\t}\n\t}\n\n\tconsole.log(\"Settings loaded\");\n}", "function load_settings() {\n chrome.storage.local.get(usedKeys, function (result) {\n enabled.checked = result[usedKeys[0]];\n interval.value = result[usedKeys[1]];\n });\n}", "loadSettings() {\n this.hasLoadedIntoDOM = false;\n if (!localStorage.getItem('workSessionDuration')) {\n SettingsController.setDefaultValuesInStorage();\n }\n this.loadStoredInputValues();\n this.hasLoadedIntoDOM = true;\n }", "function loadSettings() {\n let savedSettings = {};\n try {\n savedSettings = readFileSync(SETTINGS_FILE, SETTINGS_TYPE);\n if (typeof savedSettings === 'undefined') {\n savedSettings = {};\n }\n } catch (ex) {\n // Allow fallthrough\n }\n\n return objectAssign(getDefaultSettings({ hasElevationGain }), savedSettings);\n}", "static save(settings) { window.localStorage.setItem('settings', JSON.stringify(settings)); }", "function loadExtSettings() {\n extSettings = JSON.parse(localStorage.getItem(\"perpectiveGridSettings\"));\n }", "function retrieveSettingsFromPersistantStorage() {\n\tconsole.log('Retrieving settings from persistent storage...');\n\n\n\treturn localforage.getItem(playgroundSettingsStoreKey).then((value) => {\n\t\tlet parsedObject = JSON.parse(value) || {};\n\t\tsettings = settings.mergeDeep(parsedObject);\n\t})\n\t.then(function() {\n\t\t// Look through the settings and fire off the actions since we just updated them from localforage\n\t\titerateOverObjectRecursively(settings, (path, value) => {\n\t\t\tif(Immutable.Map.isMap(value)) {\n\t\t\t\tlet actionCallback = value.get('action');\n\n\t\t\t\tif(actionCallback) {\n\t\t\t\t\tactionCallback(value.get('value'));\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t})\n\t.catch(function(e) {\n\t\tconsole.log('Error retrieving', e);\n\n\t\tthrow e;\n\t});\n}", "getStoredSettings(level) {\n if (window.localStorage && window.localStorage.getItem(`SNAKE_SETTINGS_${level}`)) {\n let settings = new Settings(level, JSON.parse(window.localStorage.getItem(`SNAKE_SETTINGS_${level}`)));\n return settings;\n } else {\n return null;\n }\n }", "import() {\n settings.importFromFile(this.files[0])\n .then(restore)\n .catch(() => notifier.error('Cannot import settings file'));\n }", "configure(level) {\n const storage = window.localStorage;\n const key = `SNAKE_SETTINGS_${level}`;\n if (storage && storage.getItem(key)) {\n this.settings = new Settings(level, this.getStoredSettings(level));\n\n } else {\n this.settings = new Settings(level);\n this.saveHighScore(this.settings, level);\n this.updateStoredSettings(settings, level)\n }\n return this.settings;\n }", "function loadPageVariables() {\r\n \"use strict\";\r\n var tmp = JSON.parse(localStorage.getItem('TrimpzSettings'));\r\n if (tmp !== null) {\r\n trimpzSettings = tmp;\r\n }\r\n}", "_loadSettings(settings) {\n const editorState = this.getContext().editorState;\n editorState.settings.load(settings);\n editorState._setDirty('settings');\n editorState.propagateUpdates();\n }", "function LocalSettingStorage() {\n}", "function saveSettings(){\n\t//Get the user settings\n\tgetSettings();\n\n\t//Create a variable with all user settings\n\tvar settings = {\n\t\tcountry: country,\n\t\tincludeOldResults: String(includeOldResults),\n\t\tsearchStrings: searchStrings,\n\t\tlocations: locations,\n\t\tradiuses: radiuses,\n\t}\n\n\t//Save the user settings to the local storage\n\tlocalStorage.setItem(\"settings\",JSON.stringify(settings));\n\n\tconsole.log(\"Settings saved\");\n\tconsole.log(JSON.stringify(settings));\n}", "function init() {\n\t\tif (!localStorage.getItem(SETTINGS_NAME)){\n\t\t\tlocalStorage.setItem(SETTINGS_NAME, JSON.stringify({}))\n\t\t}\n\n\t\t$('#importButton').click(() => {\n\t\t\tlet importSuccess = importSettingsHanlder($('textarea#importExportTextarea').val())\n\t\t\tif (importSuccess) {\n\t\t\t\tmarkProblem('textarea#importExportTextarea', false)\n\t\t\t}\n\t\t\telse {\n\t\t\t\tmarkProblem('textarea#importExportTextarea', true)\n\t\t\t}\n\t\t})\n\n\t\t$('#exportButton').click(() => {\n\t\t\t$('textarea#importExportTextarea').val(exportSettings())\n\t\t})\n\n\t\t$('#downloadSettingsLink').click(() => {\n\t\t\tlet link = document.getElementById('downloadSettingsLink');\n\t\t\tlink.href = makeTextFile(localStorage.getItem(SETTINGS_NAME))\n\t\t\t$('#downloadSettingsLink').attr('download', `rph-tools-settings.txt`)\n\t\t})\n\n\t\t$('#importFileInput').change(() => {\n\t\t\tlet file = $(\"#importFileInput\")[0].files[0];\n\t\t\t(async () => {\n\t\t\t\tfileContent = await file.text();\n\t\t\t\tlet successfulImport = importSettingsHanlder(fileContent)\n\n\t\t\t\tif (successfulImport === false) {\n\t\t\t\t\t$('#importSettingsStatus').first().text('There was a problem with the import')\t\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$('#importSettingsStatus').first().text('Import successful')\n\t\t\t\t}\n\t\t\t})();\n\t\t})\n\t\n\n\t\t$('#printSettingsButton').click(() => {\n\t\t\tprintSettings()\n\t\t})\n\n\t\t$('#deleteSettingsButton').click(() => {\n\t\t\tdeleteSettingsHanlder()\n\t\t})\n\t}", "function loadPageVariables() {\n var tmp = JSON.parse(localStorage.getItem('autoTrimpSettings'));\n if (tmp !== null) {\n autoTrimpSettings = tmp;\n }\n}", "function getSettings(){\n\tchrome.storage.sync.get(\n\t\tsettings,\n\t\tfunction(results){\n\t\t\tupdateSettings(results);\n\t\t}\n\t);\n}", "function loadSettings() {\n try {\n return fs.readFileSync(SETTINGS_FILE, SETTINGS_TYPE);\n } catch (ex) {\n return {};\n }\n}", "function updateSettings() {\n localStorage.setItem(\"mafiaSettings\", JSON.stringify(settings));\n}", "function getLocalSettings() {\n var settings = Windows.Storage.ApplicationData.current.localSettings.values['serversEnabled'];\n if (settings != undefined && settings != null) {\n serversSettings = JSON.parse(settings);\n list.notifyReload();\n }\n }", "function saveToStorage(){\n\tchrome.storage.sync.set(settings);\n}", "function saveSettings() {\r\n \"use strict\";\r\n localStorage.setItem('TrimpzSettings', JSON.stringify(trimpzSettings));\r\n}", "function storeSettings() {\n check();\n browser.storage.local.set(f2j(form));\n}", "function loadsettings() {\r\n _('loadsettings');\r\n refreshuser();\r\n if (!status.settingsloaded) {\r\n var settings = storage.get(':TWEETFILTER:', {});\r\n if (!defined(settings[user.id])) {\r\n settings[user.id] = {};\r\n }\r\n settings = settings[user.id];\r\n queries = [];\r\n if (!defined(settings.queries)) {\r\n settings.queries = [];\r\n }\r\n for (var q=0,len=settings.queries.length;q<len;q++) {\r\n addquery(settings.queries[q].query, settings.queries[q].enabled);\r\n }\r\n options = $.extend({}, optiondefaults);\r\n if (!defined(settings.options)) {\r\n settings.options = {};\r\n }\r\n for (var option in settings.options) {\r\n if (defined(optiondefaults[option], 'boolean')) {\r\n options[option] = settings.options[option];\r\n }\r\n }\r\n if (defined(settings.relationships)) {\r\n relationships = settings.relationships;\r\n }\r\n savesettings();\r\n status.settingsloaded = true;\r\n }\r\n }", "function storeSettings () {\n // convert app state to settings\n var settings = {\n intervalRange: convertMillisToRange(appState.interval),\n speak: appState.speak,\n notification: appState.notification\n }\n storage.set(vatobeStorage, settings, function (error) {\n if (error) throw error\n })\n}", "function loadSettings() {\n var settings;\n if (!localStorage.getItem(\"PWDSettings\")) {\n localStorage.setItem(\"PWDSettings\", JSON.stringify(require(\"./defaultSettings.json\")));\n }\n\n settings = JSON.parse(localStorage.getItem(\"PWDSettings\"));\n document.querySelector(\"body\").style.backgroundImage = \"url(\" + settings.wallpaper + \")\";\n\n if (settings.dockPosition === \"top\") {\n document.querySelector(\"#dock\").classList.add(\"dockTop\");\n } else {\n document.querySelector(\"#dock\").classList.add(\"dockBottom\");\n }\n}", "async save() {\n const settings = await Settings.getData();\n settings[this.id] = this.settings;\n\n await storage.init();\n await storage.setItem(\"settings\", settings);\n }", "function storeSettings(settings = []) {\n localStorage.setItem('settings', JSON.stringify(settings));\n saveSettings.innerHTML = 'SAVED'\n}", "loadFromLocal() {\n if (localStorage.getItem(\"alarmTime\")) {\n let alarmsJson= localStorage.getItem(\"alarmTime\");\n this.alarms = JSON.parse(alarmsJson);\n };\n if (localStorage.getItem(\"currentId\")) {\n let currentIdString = localStorage.getItem(\"currentId\");\n this.currentId = Number(currentIdString);\n } \n }", "init() {\n for (const itemKey in this._config) {\n // confirm itemKey isn't from prototype\n if (this._config.hasOwnProperty(itemKey)) {\n const itemValue = localStorage.getItem(itemKey);\n if (itemValue !== null) {\n this._config[itemKey] = itemValue;\n }\n }\n }\n }", "readLocal() {\n // Get data from the local storage\n const dark = JSON.parse(localStorage.getItem('dark'));\n // If local storage has data, save to the object\n if (dark) this.dark = dark;\n }", "static setSettings(prop) {\n const obj = JSON.parse(localStorage.getItem(\"settings\"));\n\n const updatedObj = { ...obj, ...prop };\n\n localStorage.setItem(\"settings\", JSON.stringify(updatedObj));\n }", "function saveSettings() {\n // debug('Saved');\n localStorage.setItem('autoTrimpSettings', JSON.stringify(autoTrimpSettings));\n}", "loadSettings() {\n try {\n let displaySettingsChanged = false;\n let json = localStorage.getItem(\"weather-settings\");\n if (json == null) {\n json = localStorage.getItem(\"settings\");\n if (json) {\n localStorage.setItem(\"weather-settings\", json);\n localStorage.removeItem(\"settings\");\n }\n }\n\n let settings = Object.assign(WeatherDefaultSettings, JSON.parse(json || \"{}\"));\n\n // Clock settings\n if (this.language() !== settings.language) {\n this.language(settings.language);\n displaySettingsChanged = true;\n }\n if (this.units() !== settings.units) {\n this.units(settings.units);\n displaySettingsChanged = true;\n }\n if (this.twelveHourTime() !== settings.twelveHourTime) {\n this.twelveHourTime(settings.twelveHourTime);\n displaySettingsChanged = true;\n }\n if (this.useLocationTime() !== settings.useLocationTime) {\n this.useLocationTime(settings.useLocationTime);\n displaySettingsChanged = true;\n }\n if (this.hoursAhead() !== settings.hoursAhead) {\n this.hoursAhead(settings.hoursAhead);\n displaySettingsChanged = true;\n }\n if (this.daysAhead() !== settings.daysAhead) {\n this.daysAhead(settings.daysAhead);\n displaySettingsChanged = true;\n }\n if (this.useTwitterEmoji() !== settings.useTwitterEmoji) {\n this.useTwitterEmoji(settings.useTwitterEmoji);\n displaySettingsChanged = true;\n }\n\n // Display settings that don't require re-post\n this.displayHumidity(settings.displayHumidity);\n\n // Location settings\n this.defaultLatitude(settings.latitude);\n this.defaultLongitude(settings.longitude);\n this.useGeolocation(settings.useGeolocation);\n this.useTwitterEmoji(settings.useTwitterEmoji);\n\n this.theme(settings.theme || \"compact-light\");\n\n // If one of the time display settings changed, we'll want to refresh.\n // Otherwise, we only need to refresh if our location has changed.\n this.update(displaySettingsChanged ? true : false);\n } catch (e) {\n console.error(e);\n this.error(\"Could not load settings.\");\n }\n }", "function getStoredSettings() {\n\t\t// Remove old ITG Appen settings\n\t\tif (localStorage.getItem(\"firstTime\")) localStorage.removeItem('firstTime');\n\t\tif (localStorage.getItem(\"myScheduleName\")) localStorage.removeItem(\"myScheduleName\");\n\t\tif (localStorage.getItem(\"myScheduleID\")) localStorage.removeItem(\"myScheduleID\")\n\t\tif (localStorage.getItem(\"myScheduleSource\")) localStorage.removeItem(\"myScheduleSource\");\n\t\tif (localStorage.getItem(\"otherScheduleName\")) localStorage.removeItem(\"otherScheduleName\");\n\t\tif (localStorage.getItem(\"otherScheduleID\")) localStorage.removeItem(\"otherScheduleID\");\n\t\tif (localStorage.getItem(\"otherScheduleSource\")) localStorage.removeItem(\"otherScheduleSource\");\n\t\tif (localStorage.getItem(\"doubleSchedules\")) localStorage.removeItem(\"doubleSchedules\");\n\t\tif (localStorage.getItem(\"calendarID\")) localStorage.removeItem(\"calendarID\");\n\t\tif (localStorage.getItem(\"calendarSource\")) localStorage.removeItem(\"calendarSource\");\n\n\t\tvar stored = (localStorage.getItem('itgappen_settings')) ? JSON.parse(localStorage.getItem('itgappen_settings')):{};\n\t\treturn stored;\n }", "function loadSettings() {\r\n\tvar fileId = BumpTop.openFile(\"sharing.json\", \"r\");\r\n\tif (fileId !== -1) {\r\n\t\tvar contents = BumpTop.readFile(fileId);\r\n\t\tBumpTop.closeFile(fileId);\r\n\t\tvar settings = JSON.parse(contents);\r\n\t\tdebug.assert(typeof settings !== \"undefined\");\r\n\t\tif (!$.isArray(settings)) {\r\n\t\t\tsettings = [settings];\r\n\t\t}\r\n\t\tfor (var i = 0; i < settings.length; i++) {\r\n\t\t\ttabArray.push(new Tab(settings[i]));\r\n\t\t}\r\n\t}\r\n}", "function settings_load(){\n\t\tvar send_params = {};\n\t\tsend_params['_object'] = 'settings';\n\t\tsend_params['_action'] = 'get';\n\t\tapi_get(send_params, settings_load_callback);\n\t}", "function saveSettings() {\n\tlocalStorage.mylanguagesetting = \"en\"\n }", "function loadSettings(){\n var obj;\n fs.readFile('settings.json', 'utf8', (err, data) => {\n if(err){\n console.log(\"settings file doesnt exist\"); // we create one later\n return;\n }\n obj = JSON.parse(data);\n settings = {\n channel: obj.channel,\n botName: obj.botName,\n botPw: obj.botPw,\n ytKey: obj.ytKey\n }\n console.log(\"loaded settings: \" + settings.channel);\n });\n}", "function loadSettings() {\r\r if ( !app.project.file ) {\r alert(\"No AEP opened\");\r return null;\r }\r\r aepPath = app.project.file.toString();\r aepDir = aepPath.match( /^(.*)\\// )[1]; \r settingsPath = aepDir + '/project-settings.json';\r settingsFile = File( settingsPath );\r\r if ( settingsFile === false ) { // if it is really there\r alert(\"Cannot open project-settings.json\");\r return null;\r }\r\r try {\r settingsFile.open('r');\r var content = settingsFile.read(); \r settings = JSON.parse( content );\r settingsFile.close();\r \r } catch ( err ) {\r alert(\"Cannot parse project-settings.json\");\r }\r\r settings[\"project_path\"] = aepDir;\r\r return settings;\r}", "function saveLocalSettings() {\n if (typeof (window.localStorage) === 'undefined') {\n console.log(\"Local settings cannot be saved. No web storage support!\");\n return;\n }\n\n localStorage.favoritePresets = JSON.stringify(favoritePresetID);\n console.log(\"Saving Parameter [localStorage.favoritePresets]:\");\n console.log(localStorage.favoritePresets);\n\n localStorage.currentAddress = address;\n console.log(\"Saving Parameter [localStorage.currentAddress]:\");\n console.log(localStorage.currentAddress);\n}", "function loadConfiguration() {\n\n var alreadyLoaded = localStorage.getItem(SUConsts.configurationFullyLoadedFlag);\n // This value is loaded as a string - therefore it is always true from a javascript truthiness standpoint and we need to explicitly test the text\n if (alreadyLoaded === \"true\") {\n var config = localStorage.getItem(SUConsts.configurationKey);\n if (config) {\n SUConsts.configuration = JSON.parse(config);\n }\n }\n else {\n var config = localStorage.getItem(SUConsts.configurationKey);\n mergeConfiguration(config);\n\n // Loading ExternalConfig from local storage if exists\n // External Configuration set by DownloadManager etc. is stronger and overrides\n // configuration set by publisher\n var externalConfig = localStorage.getItem(SUConsts.configurationExtraKey);\n manageExtraConfiguration(externalConfig);\n\n localStorage.setItem(SUConsts.configurationKey, JSON.stringify(SUConsts.configuration));\n localStorage.setItem(SUConsts.configurationFullyLoadedFlag, \"true\");\n }\n\n\n configurationLoaded = true;\n\n }", "function loadConfig() {\n\n //First local.\n let localConfig = JSON.parse(localStorage.getItem('config'))\n if (localConfig) {\n config = localConfig\n }\n emit('config-changed', config)\n\n //Then check chrom storage.\n if (!chrome.storage) return\n chrome.storage.sync.get(['config'], function(item) {\n if (item.config && item.config !== null) {\n config = JSON.parse(item.config)\n emit('config-changed', config)\n emit('language-changed', config.language)\n }\n })\n\n}", "function saveToStorage(){\n console.debug('saving settings', self);\n\n try {\n localStorage.setItem(self.name, JSON.stringify(self.data));\n } catch (e) {\n }\n }", "get(keys, callback) {\n // Convert string (1 key) to array so that settings can be added\n if (typeof keys === \"string\") {\n keys = [ keys ];\n }\n\n // Add settings\n if (keys) {\n keys.push(\"settings\");\n }\n\n return chrome.storage.local.get(keys, function(items) {\n // Process settings and replace\n items.settings_raw = items.settings;\n items.settings = settings.getAll(items.settings);\n\n if (callback) {\n return callback(items);\n } else {\n return console.debug(items);\n }\n });\n }", "function loadAppSettings() {\n\twindow.requestFileSystem(LocalFileSystem.PERSISTENT, 0, function (fs) {\n\t\tconsole.log('loadAppSettings() successfully accessed filesystem: ' + fs.name);\n\t\t\n\t\treadAppSettings('appSettings.json', fs);\n\t},\n\tfunction(fileSystemError) {\n\t\talert(fileSystemError);\n\t});\n}", "saveSettings() {\n if (!this.options_.persistTextTrackSettings) {\n return;\n }\n\n const values = this.getValues();\n\n try {\n if (Object.getOwnPropertyNames(values).length > 0) {\n window.localStorage.setItem('vjs-simple-text-track-settings', JSON.stringify(values));\n } else {\n window.localStorage.removeItem('vjs-simple-text-track-settings');\n }\n } catch (e) {\n log.warn(e);\n }\n }", "function load_settings() {\n var defaults = {\n lock: 100,\n display_as: \"score\",\n display_lessons_left: false,\n apprentice1: 1,\n apprentice2: 1,\n apprentice3: 1,\n apprentice4: 1,\n guru1: 0,\n guru2: 0,\n master: 0,\n enlightened: 0\n };\n return wkof.Settings.load('lesson_lock', defaults);\n }", "function load(){\n\t\tsettingsLink = addSettingsLink();\n\t\tcreateCheckboxes();\n\t\tloadSettings();\n\t}", "function loadSettings() {\n settings = require('Storage').readJSON(\"qmsched.json\", true) || {};\n\n if (Array.isArray(settings)) {\n // migrate old file (plain array of schedules, qmOptions stored in global settings file)\n require(\"Storage\").erase(\"qmsched.json\"); // need to erase old file, or Things Break, somehow...\n let bOptions = require('Storage').readJSON('setting.json',true)||{};\n settings = {\n options: bOptions.qmOptions || {},\n scheds: settings,\n };\n // store new format\n save();\n // and clean up qmOptions from global settings file\n delete bOptions.qmOptions;\n require('Storage').writeJSON('setting.json',bOptions);\n }\n // apply defaults\n settings = Object.assign({\n options: {}, // Bangle options to override during quiet mode, default = none\n scheds: [\n // default schedule:\n {\"hr\": 8, \"mode\": 0},\n {\"hr\": 22, \"mode\": 1},\n ],\n }, settings);\n scheds = settings.scheds; options = settings.options;\n\n if (scheds.length && scheds.some(s => \"last\" in s)) {\n // cleanup: remove \"last\" values (used by older versions)\n set('scheds', scheds.map(s => {\n delete s.last;\n return s;\n }));\n }\n}", "function _getSettings(){\n var keys = ManagerSettings.getKeys();\n keys.forEach(function(key){\n settings[key] = ManagerSettings.get(key)\n }); // keys.forEach\n}", "function getSettings () {\n return new Promise(function(resolve) {\n browser.storage.sync.get(['settings'], function(storage) {\n settings = storage.settings\n resolve()\n }); \n });\n}", "function loadLocalStore(key) {\n var localString = localStorage.getItem(key);\n // catch undefined case\n localString = (localString) ? localString : \"{}\";\n return JSON.parse(localString);\n}", "function initSettings() {\n\tvar default_settings = [\n\t\t{name: \"Links\", status: \"on\", id: \"#links-container\"},\n\t\t{name: \"Weather\", status: \"on\", id: \"#tempContainer\"},\n\t\t{name: \"Quote\", status: \"on\", id: \"#quote-container\"},\n\t\t{name: \"Focus\", status: \"off\", id: \"#focusContainer\"},\n\t\t{name: \"To-Do\", status: \"on\", id: \"#todo-container\"}\n\t];\n\n\t// get settings from local storage\n\tsettings_string = localStorage.getItem(\"settings\");\n\tif (settings_string) {\n\t\tsettings = JSON.parse(settings_string);\n\t}\n\telse {\n\t\tsettings = default_settings;\n\t\tlocalStorage.setItem(\"settings\", JSON.stringify(settings));\n\t}\n\t$(\".setting-toggle\").each(function(i) {\n\t\tvar index = $(this).parent().index();\n\t\tif (settings[index].status === \"on\") {\n\t\t\t$(this).html(\"<i class='fa fa-check-square-o' aria-hidden='true'></i>\");\n\t\t\t$(settings[index].id).show();\n\t\t}\n\t\telse {\n\t\t\t$(this).html(\"<i class='fa fa-square-o' aria-hidden='true'></i>\");\n\t\t\t$(settings[index].id).hide();\n\t\t}\n\t});\n\n\t// initialize button to open div\n\t$(\"#expand-settings\").on(\"click\", function() {\n\t\t$(\"#settings\").toggle();\n\t});\n\n\t// function to turn items on and off\n\t$(\".setting-toggle\").on(\"click\", function() {\n\t\tvar index = $(this).parent().index();\n\t\tconsole.log(settings[index]);\n\t\tif (settings[index].status === \"on\") {\n\t\t\t$(this).html(\"<i class='fa fa-square-o' aria-hidden='true'></i>\");\n\t\t\tsettings[index].status = \"off\";\n\t\t\t$(settings[index].id).hide();\n\t\t}\n\t\telse {\n\t\t\t$(this).html(\"<i class='fa fa-check-square-o' aria-hidden='true'></i>\");\n\t\t\tsettings[index].status = \"on\";\n\t\t\t$(settings[index].id).show();\n\t\t}\n\n\n\t\tlocalStorage.setItem(\"settings\", JSON.stringify(settings));\n\t});\n}", "function saveSettingsLocalStorage(){\n settingsObject = {email: emailSwitch.checked, profile: profileSwitch.checked, timezone: timezoneSelect.selectedIndex}; \n localStorage.setItem('settings', JSON.stringify(settingsObject));\n \n}", "function settingsInit() {\r\n\tvar settingsCookie = cookieRead('settings');\r\n\t\r\n\t// If the cookie exists, read it into settings, otherwise load the defaults\r\n\ttry {\r\n\t\tsettings = JSON.parse( decodeURIComponent(settingsCookie) );\r\n\t\t\r\n\t\tif ( settingsUpdate() )\r\n\t\t\tsettingsSave();\r\n\t\t\t\r\n\t} catch (err) {\r\n\t\talert('Your saved settings are corrupt, so the defaults have been loaded instead.\\nIf you have saved your settings, try to import them.\\nError: '+err);\r\n\t\tcookieDelete('settings');\r\n\t\tindexReload();\r\n\t}\r\n\t\r\n\tsettingsElements = {};\t\t\r\n}", "loadStoredInputValues() {\n this.workSessionDuration = localStorage.getItem('workSessionDuration');\n this.shortBreakDuration = localStorage.getItem('shortBreakDuration');\n this.longBreakDuration = localStorage.getItem('longBreakDuration');\n this.numSessionsBeforeLongBreak = localStorage.getItem('numSessionsBeforeLongBreak');\n this.pauseBeforeBreak = localStorage.getItem('pauseBeforeBreak') === 'true';\n this.pauseAfterBreak = localStorage.getItem('pauseAfterBreak') === 'true';\n this.hideSeconds = localStorage.getItem('hideSeconds') === 'true';\n this.muteAudio = localStorage.getItem('muteAudio') === 'true';\n this.hideAlerts = localStorage.getItem('hideAlerts') === 'true';\n this.pomodoroSession.loadTimerSettings();\n }", "function getSettingsValues(){\n const settingsValues = localStorage.getItem('settingValues');\n if(settingsValues){\n return JSON.parse(settingsValues);\n }else{\n return[];\n }\n}", "async function load() {\n const str = await localStorage.getItem(KEY);\n if (!str) return;\n let initialState;\n ({ path, text, revision, lineCount, store: initialState } = JSON.parse(\n str\n ));\n store = createStore(reducer, initialState);\n }", "async readSettings() {\n try {\n const raw = (await util.promisify(fs.readFile)(this.settingsPath, \"utf8\")).trim();\n this.settings = raw ? JSON.parse(raw) : {};\n }\n catch (error) {\n if (error.code !== \"ENOENT\") {\n this.services.get(log_1.ILogService).warn(error.message);\n }\n }\n return this.settings;\n }", "function getStorage() {\n data.projects = JSON.parse(localStorage.getItem('projects'));\n }", "function checkSavedSettings()\n {\n if(localStorage.getItem(\"startTime\") != null)\n {\n startTime = parseInt(localStorage.getItem(\"startTime\"));\n endTime = parseInt(localStorage.getItem(\"endTime\"));\n timeFormat = localStorage.getItem(\"timeFormat\");\n }\n else\n {\n startTime = 7;\n endTime = 17;\n timeFormat = \"12\";\n }\n }", "updateStoredSettings(obj, level) {\n if (window.localStorage) {\n window.localStorage.setItem(`SNAKE_SETTINGS_${level}`, JSON.stringify(obj));\n }\n }", "load() {\n if (localStorage.getItem('tasks')) {\n const tasksJson = localStorage.getItem('tasks');\n this.tasks = JSON.parse(tasksJson);\n }\n if (localStorage.getItem('currentId')) {\n const currentId = localStorage.getItem('currentId');\n this.currentId = Number(currentId);\n }\n }", "function saveSettings() {\n localStorage.setItem(\"emailToggle\", emailToggleButton.checked);\n localStorage.setItem(\"privacyToggle\", privacyToggleButton.checked);\n localStorage.setItem(\"timezone\", select.value);\n}", "function loadFromLocalStorage () {\n try {\n const serialisedState = localStorage.getItem('persistantState')\n if (serialisedState === null) return undefined\n return JSON.parse(serialisedState)\n } catch (e) {\n console.warn(e)\n return undefined\n }\n}", "_setInitialSettings() {\n let settings = [\n {\n id: 'adrenaline_timer',\n title: 'Minuteur d\\'adrénaline',\n value: '3'\n },\n {\n id: 'adrenaline_unit',\n title: 'Quantité d\\'adrénaline injectée',\n value: '1'\n },\n {\n id: 'adrenaline_repeat',\n title: 'Répéter l\\'alerte d\\'adrénaline',\n value: '2'\n }\n ]\n AsyncStorage.setItem(\"settings\",JSON.stringify(settings))\n }", "function loadLocalStorage() {\n var retval = localStorage.getItem(LOCAL_STORAGE_KEY);\n if (retval == null) {\n retval = DEFAULT_STORAGE_DATA;\n localStorage.setItem(LOCAL_STORAGE_KEY, JSON.stringify(retval));\n } else {\n retval = JSON.parse(retval);\n }\n localStorageData = retval;\n return retval;\n}", "function preLoad() {\n\n\t\t\tangular.forEach($localStorage, function(value, key) {\n\t\t\t\tlocalStorageObj[key] = value\n\t\t\t});\n\n\t\t}", "function restoreSettings() {\n function setCurrentChoice(result) {\n if(result !== undefined && result.insert !== undefined && result.insert !== \"\"){\n document.getElementById('cmn-toggle-1').checked = result.insert;\n }\n else{\n console.log(\"No Settings Found\");\n return null;\n }\n }\n\n chrome.storage.local.get(\"insert\", setCurrentChoice);\n chrome.storage.local.get(\"lang\", function(result) {\n if(result !== undefined && result.lang !== undefined && result.lang !== \"\") {\n lang = result.lang;\n updateStrings();\n var select = document.getElementById('lang-sel').value = result.lang;\n }\n });\n}", "function saveSettings(){\n\n showMenu();\n\n for (key in settingTmp){\n if (settingTmp.hasOwnProperty(key)){\n setting[key] = settingTmp[key];\n }\n }\n\n PopupModule.hide();\n }", "function getOptionSetting() {\n return localStorage;\n}", "function readSetting (szKey)\n{\n var szResult = '';\n \n if(typeof(Storage) !== \"undefined\")\n {\n szResult = localStorage.getItem(szKey);\n }\n \n return szResult;\n}", "function saveSettings() {\n\tif (typeof (Storage) !== \"undefined\") {\n\t\tlocalStorage.fixIncome = document.getElementById(\"fixIncome\").value;\n\t\tlocalStorage.fixCost = document.getElementById(\"fixCost\").value;\n\t\tlocalStorage.fixSaving = document.getElementById(\"fixSaving\").value;\n\t\tlocalStorage.interval = document.getElementById(\"interval\").selectedIndex + 1;\n\t} else {\n\t\talert(\"Ihr Browser unterstützt LocalStage nicht!!!\");\n\t}\n}", "function addSettings() {\n localStorage.setItem('emailSwitch', email_onoffswitch.checked);\n localStorage.setItem('publickSwitch', public_onoffswitch.checked);\n localStorage.setItem('timezone', timezone.value)\n}", "function initStorage() {\n _storage = localStorage;\n}", "function loadStoredInfo() {\n try {\n const stored = JSON.parse(localStorage.getItem('FULL_STATE'));\n return Object.assign(initialState, stored);\n }\n catch (err) {\n console.error(err);\n return initialState;\n }\n}", "function setPreferencesOnLocalStore(){\n \n kony.store.setItem(\"preferences\", preferencesArray);\n alert(\"Preferences stored successfully: \" + JSON.stringify(kony.store.getItem(\"preferences\")));\n \n}", "setFromStorage() {\n const storageItems = localStorage[this.storageKey]\n this.items = storageItems ? JSON.parse(storageItems) : []\n }", "setSettings(NSettings){\n this.setState({\n Settings: NSettings\n });\n localStorage.setItem('DogWeather', JSON.stringify(NSettings));\n }", "function saveSettingsValues() {\n browser.storage.local.set({delayBeforeClean: document.getElementById(\"delayBeforeCleanInput\").value});\n\n browser.storage.local.set({activeMode: document.getElementById(\"activeModeSwitch\").checked});\n\n browser.storage.local.set({statLoggingSetting: document.getElementById(\"statLoggingSwitch\").checked});\n\n browser.storage.local.set({showNumberOfCookiesInIconSetting: document.getElementById(\"showNumberOfCookiesInIconSwitch\").checked});\n\n browser.storage.local.set({notifyCookieCleanUpSetting: document.getElementById(\"notifyCookieCleanUpSwitch\").checked});\n\n browser.storage.local.set({contextualIdentitiesEnabledSetting: document.getElementById(\"contextualIdentitiesEnabledSwitch\").checked});\n\n page.onStartUp();\n}", "function checkStoredSettings(storedSettings) {\n\tvar temp = storedSettings.configs;\n\tbrowser.storage.local.set({\n\t\tconfigs : configs\n\t});\n\tif(temp){\n\t\tbrowser.storage.local.set({\n\t\t\tconfigs : temp\n\t\t});\n\t}\n}", "function loadSettings() {\n // Unblocks all skins without the need for FB sharing.\n window.localStorage.setItem('edttsg', '1');\n // Remove social\n window.social.remove();\n if (window.localStorage.getItem('nick') !== null) {\n var nick = window.localStorage.getItem('nick');\n document.getElementById('nick').value = nick;\n }\n\n if (window.localStorage.getItem('high-score') !== null) {\n highScore = parseInt(window.localStorage.getItem('high-score'));\n highscoreContainer.textContent = 'High Score: ' + highScore;\n }\n\n if (window.localStorage.getItem('graphics-mode') !== null) {\n var mode = parseInt(window.localStorage.getItem('graphics-mode'));\n if (mode >= 1 && mode <= 4) {\n graphicsMode = mode;\n }\n } else {\n window.localStorage.setItem('graphics-mode', '4');\n }\n\n if (window.localStorage.getItem('background-image') !== null) {\n backgroundImage = window.localStorage.getItem('background-image');\n randomizeBackground = (backgroundImage == '-2' && graphicsMode == '4') ? true : false;\n } else {\n window.localStorage.setItem('background-image', '-2');\n }\n\n if (window.localStorage.getItem('server-selected') !== null) {\n selectedServer = window.localStorage.getItem('server-selected');\n } else {\n window.localStorage.setItem('server-selected', selectedServer);\n }\n\n if (window.localStorage.getItem('server-manual') !== null) {\n manualServer = window.localStorage.getItem('server-manual');\n } else {\n window.localStorage.setItem('server-manual', false);\n }\n\n if (window.localStorage.getItem('skin-select') !== null) {\n selectedSkinOption = window.localStorage.getItem('skin-select');\n } else {\n window.localStorage.setItem('skin-select', selectedSkinOption);\n }\n\n if (window.localStorage.getItem('snakercv') !== null) {\n selectedSkin = window.localStorage.getItem('snakercv');\n }\n }", "function saveLocalConfig() {\n return new Promise(((resolve) => {\n localStorage.setItem(\"YTBSP_useRemoteData\", config.useRemoteData ? \"1\" : \"0\");\n localStorage.setItem(\"YTBSP_hideSeenVideos\", config.hideSeenVideos ? \"1\" : \"0\");\n localStorage.setItem(\"YTBSP_hideEmptySubs\", config.hideEmptySubs ? \"1\" : \"0\");\n localStorage.setItem(\"YTBSP_maxSimSubLoad\", config.maxSimSubLoad);\n localStorage.setItem(\"YTBSP_maxVidsPerRow\", config.maxVidsPerRow);\n localStorage.setItem(\"YTBSP_maxVidsPerSub\", config.maxVidsPerSub);\n localStorage.setItem(\"YTBSP_enlargeDelay\", config.enlargeDelay);\n localStorage.setItem(\"YTBSP_enlargeFactor\", config.enlargeFactor);\n localStorage.setItem(\"YTBSP_enlargeFactorNative\", config.enlargeFactorNative);\n localStorage.setItem(\"YTBSP_playerQuality\", config.playerQuality);\n localStorage.setItem(\"YTBSP_timeToMarkAsSeen\", config.timeToMarkAsSeen);\n localStorage.setItem(\"YTBSP_screenThreshold\", config.screenThreshold);\n localStorage.setItem(\"YTBSP_autoPauseVideo\", config.autoPauseVideo ? \"1\" : \"0\");\n resolve();\n }));\n}", "function loadSettings(settings) {\n try {\n return __webpack_require__(\"./settings sync recursive ^\\\\.\\\\/.*\\\\.json$\")(\"./\" + settings + '.json');\n } catch(e) {\n return {};\n }\n}", "function loadFromLocalStorage() {\n try {\n const serializedState = localStorage.getItem(\"state\");\n if (serializedState === null) return undefined;\n return JSON.parse(serializedState);\n } catch (e) {\n console.error(e);\n return undefined;\n }\n }", "function retrieveAndSetPreference(){\n if(typeof(Storage) !== \"undefined\") { //Check if the browser supports local storage\n if(localStorage.guddi_ca_xkcd_user_preference){\n var userPreferenceRetrieved = JSON.parse(localStorage.getItem(\"guddi_ca_xkcd_user_preference\"));\n totWords.value = userPreferenceRetrieved[0];\n totSpChars.value = userPreferenceRetrieved[1];\n totNumbers.value = userPreferenceRetrieved[2];\n useSeparator.value = userPreferenceRetrieved[3];\n wordCase.value = userPreferenceRetrieved[4];\n savePreference.checked = userPreferenceRetrieved[5];\n } //End of inner IF\n } else {\n console.log(\"Error log: Web local storage is not supported in this browser!\");\n }//End of outer IF\n }", "function saveExtSettings() {\n var settings = {\n \"showFoldersInList\": showFoldersInList,\n \"showSortDataInList\": showSortDataInList,\n \"numberOfFiles\": numberOfFiles,\n \"zoomFactor\": zoomFactor,\n \"orderBy\": orderBy\n };\n localStorage.setItem('perpectiveGridSettings', JSON.stringify(settings));\n }", "async function load_Prefs() {\r\n let prefs = await browser.storage.local.get(\"Prefs\");\r\n let settings = prefs.Prefs;\r\n if (settings != null && settings != undefined){\r\n for (let key of Object.keys(settings)){\r\n let elem = document.getElementById(key);\r\n if (!elem) {\r\n continue;\r\n }\r\n if (elem.type == \"checkbox\") {\r\n elem.checked = settings[key];\r\n } else {\r\n elem.value = settings[key];\r\n }\r\n }\r\n }else{\r\n resetValues();\r\n }\r\n update_shown_Values();\r\n}", "function loadAppSettings() {\n 'use strict';\n \n var _filePath = path.normalize('./config/settings.json');\n var _configAppString = '';\n \n switch(process.env.NODE_ENV) {\n case 'production':\n\t _filePath = path.normalize('./config/production.json');\n\t break;\n case 'test':\n\t _filePath = path.normalize('./config/test.json');\n\t break;\n case 'development':\n\t _filePath = path.normalize('./config/development.json');\n\t break;\n\tdefault:\n\t _filePath = path.normalize('./config/settings.json');\n\t break;\n }\n \n try {\n _configAppString = fs.readFileSync(_filePath, 'utf8');\n _configApp = JSON.parse(_configAppString);\n } catch(e) {\n _configApp = {};\n }\n}" ]
[ "0.8117892", "0.7734274", "0.7706927", "0.7586188", "0.73927504", "0.7311781", "0.7292711", "0.7158328", "0.7084832", "0.7049127", "0.691942", "0.67259115", "0.6705844", "0.66738683", "0.66423076", "0.6636781", "0.6593012", "0.65749013", "0.65747625", "0.6559844", "0.65414655", "0.65133727", "0.6488675", "0.6455411", "0.6400145", "0.6398444", "0.6386049", "0.6375675", "0.6371675", "0.6363455", "0.6332428", "0.63228023", "0.6304971", "0.6288856", "0.6286862", "0.628038", "0.6244309", "0.6241812", "0.62092733", "0.61797", "0.61676306", "0.61595726", "0.61593616", "0.61479187", "0.6139693", "0.6139142", "0.6118196", "0.61169016", "0.61139196", "0.61093163", "0.61032426", "0.6101318", "0.6097569", "0.60720414", "0.6067633", "0.6048249", "0.6045387", "0.6032015", "0.60252714", "0.5990913", "0.5990271", "0.5986918", "0.5978138", "0.59720695", "0.5942318", "0.5940292", "0.5899145", "0.5891992", "0.5876417", "0.58597827", "0.5859764", "0.5859377", "0.5844922", "0.5844577", "0.58357966", "0.583274", "0.5829413", "0.5826903", "0.5822621", "0.5821971", "0.58129996", "0.5802218", "0.57998496", "0.57964426", "0.5794176", "0.5785545", "0.5784374", "0.57781166", "0.57709014", "0.5753605", "0.5752855", "0.57408047", "0.5734143", "0.57297266", "0.57249916", "0.57246673", "0.5723233", "0.5720925", "0.57070804", "0.57056713" ]
0.77185714
2
Return unit number m. Argument: m Unit number Return: Unit object
function unit(m) { if (alternateUnitAvailable(m) && my.settings.unit == my.UNIT.ALTERNATE) { return Units.alternate[m - Units.alternateStart] } else { return Units.main[m - 1] } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function m(t, n, r) {\n return t.units[n][r];\n }", "get unit () {\n\t\treturn this._unit;\n\t}", "function calculateUnitValue(i) {\n\tif (getUnit(i) === \"in\") return 1;\n\telse if (getUnit(i) === \"cm\") return .3937;\n\telse return 0;\n}", "get unit() {\n\t\treturn this.__unit;\n\t}", "function cmToMm(cm) {\n const mm = cm * 10;\n return mm;\n}", "function kilometerToMeter(kmUnit) {\n \n var meter = kmUnit * 1000;\n\n if (kmUnit > 0) {\n return meter;\n }\n else {\n return \"Length cannot be Negative\";\n }\n}", "function handleUnit(unit) {\n switch(unit) {\n case \"MT\":\n return \"Minutes\";\n case \"HT\":\n return \"Hours\";\n case \"D\":\n return \"Days\";\n case \"M\":\n return \" Months\";\n default:\n return \"\";\n }\n}", "function getMaterialConversionUnit() {\n\tif (!material_conversion['conversion_flag']) {\n\t return 'KG';\n\t} else {\n return material_conversion[getFieldValueById('trxtransactiondetails-net_unit')]['unit'];\n\t}\n}", "function getUnit(input) {\n return String(input).match(/[\\d.\\-+]*\\s*(.*)/)[1] || '';\n} // Emulate the sass function \"unitless\"", "function getUnit(input) {\n return String(input).match(/[\\d.\\-+]*\\s*(.*)/)[1] || '';\n} // Emulate the sass function \"unitless\"", "function getUnit(input) {\n return String(input).match(/[\\d.\\-+]*\\s*(.*)/)[1] || '';\n} // Emulate the sass function \"unitless\"", "function getUnit(input) {\n return String(input).match(/[\\d.\\-+]*\\s*(.*)/)[1] || '';\n} // Emulate the sass function \"unitless\"", "function getUnit(input) {\n return String(input).match(/[\\d.\\-+]*\\s*(.*)/)[1] || '';\n} // Emulate the sass function \"unitless\"", "function getUnit(input) {\n return String(input).match(/[\\d.\\-+]*\\s*(.*)/)[1] || '';\n} // Emulate the sass function \"unitless\"", "function getUnit(input) {\n return String(input).match(/[\\d.\\-+]*\\s*(.*)/)[1] || '';\n} // Emulate the sass function \"unitless\"", "function getUnit(input) {\n return String(input).match(/[\\d.\\-+]*\\s*(.*)/)[1] || '';\n} // Emulate the sass function \"unitless\"", "function getUnit(input) {\n return String(input).match(/[\\d.\\-+]*\\s*(.*)/)[1] || '';\n} // Emulate the sass function \"unitless\"", "function getUnit(input) {\n return String(input).match(/[\\d.\\-+]*\\s*(.*)/)[1] || '';\n} // Emulate the sass function \"unitless\"", "static setUnitMetric(unit) {\n if (unit === 'm' || unit === 'metres') {\n return `&units=metric`;\n }\n return ``;\n }", "function units(num) {\n\treturn num*CELL_SIZE + UNIT_NAME;\n}", "units() {\n return this.growRight('#Unit').match('#Unit$')\n }", "function get_units() {\n switch(cookie['units'])\t{\n case \"mi\":\treturn \"Miles\"; break;\n case \"nm\":\treturn \"Naut.M\"; break;\n default:\treturn \"KM\"; break;\n }\n}", "function toMm(val) {\n if (val === undefined) {\n return undefined;\n }\n var unit = val.substring(val.length - 2);\n var value = stripUnit(val);\n if (unit === \"cm\") {\n return value * 10;\n } else if (unit === \"in\") {\n return value * 25.4;\n } else if (unit === \"pt\" || unit === \"px\") {\n return value * 25.4 / 72;\n } else if (unit === \"pc\") {\n return value * 25.4 / 72 * 12;\n } else if (unit === \"mm\") {\n return value;\n } else {\n return undefined;\n }\n\n function stripUnit(val) {\n return new Number(val.substring(0, val.length - 2));\n}\n\n}", "function getUnitValue(u) { return (u.value != undefined) ? u.value : u; }", "get unitFormatted() {\r\n\t\treturn this.count > 1 ? this.unit + 's' : this.unit;\r\n\t}", "function kilometerToMeter(kiloMeterUnit) {\n if (kiloMeterUnit > 0) {\n var meterUnit = kiloMeterUnit*1000;\n return meterUnit;\n\n\n }\n else {\n return \"The meter unit value can not be negative\";\n }\n}", "function em(value) {\n return unit * value;\n}", "function em(value) {\n return unit * value;\n}", "function em(value) {\n return unit * value;\n}", "function em(value) {\n return unit * value;\n}", "get units() {\n return this._units;\n }", "function centimeterToMetre(cm) {\n const meter = cm / 100;\n return meter;\n}", "function unit(i, units) {\n\t if ((typeof i === \"string\") && (!i.match(/^[\\-0-9\\.]+$/))) {\n\t return i;\n\t } else {\n\t return \"\" + i + units;\n\t }\n\t }", "function GetInternalUnit()\n{\n\treturn m_internalUnit;\n}", "function toCm(n, unit) {\n // as defined in http://www.w3.org/TR/css3-values/#absolute-lengths\n if (unit === 'cm') return n;else if (unit === 'mm') return n * 0.1;else if (unit === 'in') return n * 2.54;else if (unit === 'px') return n * toCm(1 / 96, 'in');else if (unit === 'pt') return n * toCm(1 / 72, 'in');else if (unit === 'pc') return n * toCm(12, 'pt');\n }", "function getUnit(args, transitionProperty) {\n\n var item;\n var count = args.length;\n var unit = '';\n\n while (--count >= 0) {\n item = args[count];\n if (typeof item === 'string') {\n unit = item\n .replace(parseInt(item, 10) + '', '');\n }\n }\n\n // Defaults unit to px if transition property isn't opacity\n if (transitionProperty !== 'opacity' && unit === '') {\n unit = 'px';\n }\n\n return unit;\n\n }", "function unit(i, units) {\r\n\t\tif ((typeof i === 'string') && (!i.match(/^[\\-0-9\\.]+$/))) {\r\n\t\t\treturn i;\r\n\t\t} else {\r\n\t\t\treturn '' + i + units;\r\n\t\t}\r\n\t}", "function parseMeasure(m) {\n var o = parseMeasure2(m);\n if (isNaN(o.value)) {\n stop('Invalid parameter:', m);\n }\n return o;\n }", "function kilometerToMeter(km) \n{\n var meter =km*1000; \n return meter;\n}", "function kilometerToMeter(km){\n var meter = km * 1000;\n return meter;\n}", "function YLightSensor_get_unit()\n { var json_val = this._getFixedAttr('unit');\n return (json_val == null ? Y_UNIT_INVALID : json_val);\n }", "function parseUnit(n) {\n var unit = (0, _cssGetUnit2.default)(n);\n var value = parseFloat(n);\n return { unit: unit, value: value };\n }", "function getI(name,un_name) \n{\n\tvar x=getVar(name);\n\tvar unit=getVtext(un_name);\n\tif(\"mA\"==unit) return x/=1e3;\n\tif(\"A\"==unit) return x;\n\tif(\"uA\"==unit) return x/=1e6;\n\tif(\"pA\"==unit) return x/=1e9;\n\treturn x;\n}", "function getAdjustedUnitForNumber(ms) {\n return getAdjustedUnit(ms, function(unit) {\n return trunc(withPrecision(ms / unit.multiplier, 1));\n });\n }", "function unit(i, units) {\n if ((typeof i === \"string\") && (!i.match(/^[\\-0-9\\.]+$/))) {\n return i;\n } else {\n return \"\" + i + units;\n }\n }", "function unit(i, units) {\n if ((typeof i === \"string\") && (!i.match(/^[\\-0-9\\.]+$/))) {\n return i;\n } else {\n return \"\" + i + units;\n }\n }", "function unit(i, units) {\n if ((typeof i === \"string\") && (!i.match(/^[\\-0-9\\.]+$/))) {\n return i;\n } else {\n return \"\" + i + units;\n }\n }", "function unit(i, units) {\n if ((typeof i === \"string\") && (!i.match(/^[\\-0-9\\.]+$/))) {\n return i;\n } else {\n return \"\" + i + units;\n }\n }", "get_mult(units) {\n var mult = 0;\n if (units === 'minutes') {\n mult = 1;\n } else if (units === 'hours') {\n mult = 60;\n } else if (units === 'days') {\n mult = 60 * 24;\n } else if (units === 'months') {\n mult = 30 * 60 * 24;\n } else if (units === 'years') {\n mult = 365 * 60 * 24;\n } else {\n throw new TypeError;\n }\n return mult;\n }", "function getSpeed(unit){\n\treturn parseFloat(unitConfig.find(unit+\" speed\").text());\n}", "function getUnitFromInput() {\n\t\tvar unit_id = $(\"#units-select\").val();\n\t\treturn units[unit_id];\n\t}", "unit() {\n return new Vector(Math.cos(this.phase), Math.sin(this.phase));\n }", "function m2s( m ) {\n\t\treturn m * 60;\n\t}", "function getDocUnit() {\n var unit = activeDocument.rulerUnits.toString().replace('RulerUnits.', '');\n if (unit === 'Centimeters') unit = 'cm';\n else if (unit === 'Millimeters') unit = 'mm';\n else if (unit === 'Inches') unit = 'in';\n else if (unit === 'Pixels') unit = 'px';\n else if (unit === 'Points') unit = 'pt';\n return unit;\n}", "function PropulsionUnit() {\n }", "function PropulsionUnit() {\n }", "function formatUnit(unit) {\r\n\t\r\n\tvar isInt = parseInt(unit);\r\n\r\n\treturn isInt ? isInt : 0;\r\n}", "static stringToMs(unit, value)\n {\n switch(unit.toUpperCase())\n {\n case \"SECOND\":\n return value * 1000;\n \n case \"MINUTE\":\n return value * 60000;\n \n case \"HOUR\":\n return value * 3600000;\n } \n \n return value; \n }", "function getMeasureUnit(type) {\n switch (type) {\n case 2: // Temperature\n return '°C';\n case 1: // Intensity\n case 4: // Curtains aperture\n default:\n return '%';\n }\n }", "function PropulsionUnit() {\n\t}", "function ev(mile, units) {\n mile = parseFloat(mile);\n let ev;\n switch (units) {\n case 'Car/ Light Van':\n ev = 0;\n break;\n case 'Medium Van':\n ev = 0;\n break;\n case 'Large Van':\n ev = 0;\n break;\n default:\n ev = 0;\n }\n return ev.toFixed(2);\n}", "function convertToMeters(number, metric) {\n let inMeters = 0;\n switch (metric) {\n case 'km': inMeters = number * 1000; break;\n case 'm': inMeters = number * 1; break;\n case 'cm': inMeters = number * 0.01; break;\n case 'mm': inMeters = number * 0.001; break;\n case 'mi': inMeters = number * 1609.34; break;\n case 'yrd': inMeters = number * 0.9144; break;\n case 'ft': inMeters = number * 0.3048; break;\n case 'in': inMeters = number * 0.0254; break;\n }\n return inMeters;\n }", "function getUnitColumn (measure, oEntityType) {\n var properties = oEntityType.property;\n for (var i = 0, len = properties.length; i < len; i++) {\n if (properties[i].name == measure) {\n if (properties[i].hasOwnProperty(\"sap:unit\")) {\n return properties[i][\"sap:unit\"];\n }\n break;\n }\n }\n return null;\n }", "function kilometerToMeter(km) {\n\n // initializing the variable value as '0'\n var meter = 0;\n // error texts\n var errorTxt = \"Sorry, Kilometer cannot be Negative, Try Again.\";\n var errorTxtForZero = \"Sorry, Please add Value more than Zero / '0', Try Again.\";\n\n if (km < 0) { //validation - if the unit input is Negative \n return errorTxt;\n } else if (km == 0) { //validation - if the unit input is Zero / '0'\n return errorTxtForZero;\n } else {\n meter = km * 1000; // 1 Kilometer = 1000 Meter\n return meter;\n }\n}", "get unitSpeed() { return this._unitSpeed; }", "get unitSpeed() { return this._unitSpeed; }", "get unitSpeed() { return this._unitSpeed; }", "static fromNumerical(numerical: numerical): AbstractNumericalUnit {\n const string_of_number = Number(numerical).toString();\n if (string_of_number === \"0\") {\n return new AbstractNumericalUnit(0, 0, null);\n }\n const index_of_decimal = [...string_of_number].findIndex((element) => element === \".\");\n const number_character_array = [...string_of_number.replace(\".\", \"\")];\n const length = number_character_array.length;\n const decimal_offset = (index_of_decimal === -1) ? length : index_of_decimal;\n\n let last_unit = null;\n for (let i = length - 1; i >= 0; i--) {\n const power = decimal_offset - i - 1;\n const value = Number(number_character_array[i]);\n if (value === 0) {\n continue;\n }\n last_unit = new AbstractNumericalUnit(power, value, last_unit);\n }\n // $FlowFixMe\n return last_unit;\n }", "setUnits() {\n this.units = unitSystem.getUnits();\n }", "getTopUnit(){return this.__topUnit}", "function parseMeasure2(m) {\n var s = utils.isString(m) ? m : '';\n var match = /(sq|)([a-z]+)(2|)$/i.exec(s); // units rxp\n var o = {};\n if (utils.isNumber(m)) {\n o.value = m;\n } else if (s === '') {\n o.value = NaN;\n } else if (match) {\n o.units = UNITS_LOOKUP[match[2].toLowerCase()];\n o.areal = !!(match[1] || match[3]);\n o.value = Number(s.substring(0, s.length - match[0].length));\n if (!o.units && !isNaN(o.value)) {\n // throw error if string contains a number followed by unrecognized units string\n stop('Unknown units: ' + match[0]);\n }\n } else {\n o.value = Number(s);\n }\n return o;\n }", "function kilometerToMeter(kiloMeter){\n return kiloMeter * 1000;\n}", "get unitAccelerationMagnitude() { return this._unitAccelerationMagnitude; }", "get unitAccelerationMagnitude() { return this._unitAccelerationMagnitude; }", "get unitAccelerationMagnitude() { return this._unitAccelerationMagnitude; }", "getMeters(inches) {\n return inches === 'unknown' ? '---' : `${Math.round((parseInt(inches) * .0254) * 100) / 100}<i>m</i>`;\n }", "function convertUnit(from, to, value) {\n const transform = CONVERSION_TABLE[from][to];\n\n return transform(value);\n}", "function calculateCost(mile, units) {\n mile = parseFloat(mile);\n let cost;\n switch (units) {\n case 'Car/ Light Van':\n cost = (mile * 0.12) * 52;\n break;\n case 'Medium Van':\n cost = (mile * 0.18) * 52;\n break;\n case 'Large Van':\n cost = (mile * 0.22) * 52;\n break;\n default:\n cost = (mile * 0.12) * 52;\n }\n return cost.toFixed(2);\n}", "function kilometerToMeter(meter){\n var kilometer = meter*1000;\n return kilometer;\n}", "function ConvertKmToMile(km){\n\n return km * 0.621371;\n}", "function getNextUnit(unit) {\n switch (unit) {\n case \"year\":\n return;\n case \"month\":\n return \"year\";\n case \"week\":\n return \"month\";\n case \"day\":\n return \"month\"; // not a mistake\n case \"hour\":\n return \"day\";\n case \"minute\":\n return \"hour\";\n case \"second\":\n return \"minute\";\n case \"millisecond\":\n return \"second\";\n }\n}", "static get unitsPerInch() {\n var rv = {};\n\n rv['pt']=72.0;\n rv['px']=96.0;\n rv['em']=6.0;\n return rv;\n }", "function mtof(m) {\n return Math.pow(2, (m - 69) / 12) * 440;\n}", "function getMetertFromMile(mile) {\nreturn mile * 1609.34;\n}", "function kilometerToMeter(km) {\n var meter;\n if (km <= 0) {\n var msg = 'Input Error! Please enter a valid number (greater than 0).';\n return msg;\n } else {\n meter = km * 1000;\n return meter;\n }\n}", "function algebraUnit(num) {\n return [{ part: [], mult: num }];\n}", "function meters(km) {\n\treturn km * 1000;\n}", "function kilometerToMeter(kilo){\n\n if(kilo<0 ){\n return \"invalid input\";\n }\n \n else{\n var meter = kilo*1000; // 1 kilometer = 1000 meter\n \n return meter;\n }\n}", "function metersToInches(meterNum){\n return `${meterNum*39.3701} in.`;\n}", "convertUnits(input, output, units) {\n var indexOfInput = 0;\n var indexOfOutput = 0;\n var UNITS = units.getUnits();\n var STEP = units.getStep();\n\n for (var i = 0; i < UNITS.length; i++) {\n if (UNITS[i] === input.unit) {\n indexOfInput = i;\n }\n if (UNITS[i] === output.unit) {\n indexOfOutput = i;\n }\n }\n\n var diff = indexOfOutput - indexOfInput;\n\n if (diff === 0) {\n return input.value;\n } else {\n var coef = 10**(diff * STEP);\n var newvalue = input.value * coef;\n return newvalue;\n }\n }", "function kilometerToMeter(kilo) {\n var meter = kilo * 1000;\n return meter;\n}", "function unitConversion(unit) {\n\t\tvar hexconv = unit.toString(16);\n\t\treturn hexconv.length == 1 ? '0' + hexconv : hexconv;\n\t\t}", "function memToMB (mem) {\n var regex = /([0-9]*)([a-zA-Z]{1,2})/g;\n var found = regex.exec(mem);\n\n if (mem == null || found == null) {\n return 0;\n }\n\n switch (found[2]) {\n case 'b':\n return Math.round((found[1] / 1024) / 1024)\n break;\n case 'kb':\n return Math.round(found[1] / 1024)\n break;\n case 'mb':\n return Math.round(found[1])\n break;\n case 'gb':\n return Math.round(found[1] * 1024)\n break;\n case 'tb':\n return Math.round((found[1] * 1024) * 1024)\n break;\n default:\n console.log(\"[Error] Could not detect memory unit\")\n return 0\n }\n}", "function kilometerToMeter(km) {\n let numToMeter = km * 1000;\n if (km < 0) {\n console.log(\"Error Input!\");\n }\n else {\n return numToMeter;\n }\n\n}", "function getL(name,un_name) //get capcitor value in F, (name, name-unit)\n{\n\tvar x=getVar(name);\n\tvar unit=getVtext(un_name);\n\tif(\"nH\"==unit) return x/=1e9;\n\tif(\"uH\"==unit) return x/=1e6;\n\tif(\"mH\"==unit) return x/=1e3;\n\treturn x;\n}", "function getDistance(unit) {\n if (unit === undefined) unit = \"meters\";\n\n if (unit === \"miles\") return util.math.metersToMiles(getProperty(\"distance\"));\n else if (unit === \"feet\") return util.math.metersToFeet(getProperty(\"distance\"));\n else if (unit === \"kilometers\") return util.math.metersToKilometers(getProperty(\"distance\"));\n else if (unit === \"meters\") return getProperty(\"distance\");\n else {\n console.error(\"Unit must be miles, feet, kilometers, or meters. Given: \" + unit);\n return getProperty(\"distance\");\n }\n }", "function parseUnit(val, output) {\n output = output || {};\n if (!type_5.isDefined(val)) {\n output.unit = undefined;\n output.value = undefined;\n }\n else if (type_5.isNumber(val)) {\n output.unit = undefined;\n output.value = val;\n }\n else {\n var match = resources_2.measureExpression.exec(val);\n var startString = match[1];\n var unitTypeString = match[2];\n output.unit = unitTypeString || undefined;\n output.value = startString ? parseFloat(startString) : undefined;\n }\n return output;\n }", "static get UnitSystem() {\n return enums.UnitSystem;\n }", "function CSIRO_phiM(MC, U) {\n if(MC<12) {\n return Math.exp(-0.108*MC);\n } else if((MC>12) && (U<=10)) {\n return (0.684 - 0.0342*MC);\n } else {\n return (0.547 - 0.0228*MC);\n }\n}", "calculeazaMediaMiu(m, s) {\n\t\t\treturn ( Math.log(m) - (1/2) * Math.log((s / Math.pow(m, 2)) + 1) );\n\t\t}" ]
[ "0.70042497", "0.68661445", "0.68420166", "0.6795911", "0.6646663", "0.66201526", "0.6605138", "0.6602586", "0.6594072", "0.6594072", "0.6594072", "0.6594072", "0.6594072", "0.6594072", "0.6594072", "0.6594072", "0.6594072", "0.6594072", "0.6593717", "0.65248364", "0.65179926", "0.6481319", "0.6464521", "0.6446638", "0.6400559", "0.63985634", "0.63667417", "0.63667417", "0.6339334", "0.6339334", "0.63289213", "0.62909085", "0.62860715", "0.62756", "0.62091863", "0.6207489", "0.6192088", "0.6187781", "0.61806226", "0.6174163", "0.6170874", "0.61680657", "0.614894", "0.6124455", "0.611831", "0.611831", "0.6111286", "0.6111286", "0.61106753", "0.610511", "0.6085228", "0.60570824", "0.60442466", "0.60331976", "0.59952116", "0.59952116", "0.5952215", "0.59447587", "0.5936126", "0.59300804", "0.592936", "0.59280014", "0.59207934", "0.5914759", "0.58886725", "0.58886725", "0.58886725", "0.5872783", "0.5863761", "0.585547", "0.5854313", "0.58441204", "0.58079463", "0.58079463", "0.58079463", "0.5806845", "0.57956225", "0.5791814", "0.5790231", "0.5771844", "0.57674456", "0.5755742", "0.5755017", "0.57481", "0.5747532", "0.5746369", "0.57326967", "0.5726172", "0.57257456", "0.57169586", "0.57112116", "0.5703627", "0.56965667", "0.5696178", "0.5695992", "0.5692773", "0.56926924", "0.5685439", "0.5682559", "0.5665621" ]
0.78354245
0
Return true if an alternate unit is available for unit number m. Argument: m Unit number Return: true if an alternate unit is available; false otherwise
function alternateUnitAvailable(m) { if (m >= Units.alternateStart && m < Units.alternateStart + Units.alternate.length) { return true } else { return false } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function unit(m)\n {\n if (alternateUnitAvailable(m) &&\n my.settings.unit == my.UNIT.ALTERNATE) {\n return Units.alternate[m - Units.alternateStart]\n } else {\n return Units.main[m - 1]\n }\n }", "metricTypeMatching (unitType, unitTypeTo) {\n switch (unitType) {\n case 'kg':\n if (unitTypeTo !== 'g' && unitTypeTo !== 'kg') return false\n break;\n case 'g':\n if (unitTypeTo !== 'g' && unitTypeTo !== 'kg') return false\n break;\n case 'l':\n if (unitTypeTo !== 'ml' && unitTypeTo !== 'l') return false\n break;\n case 'ml':\n if (unitTypeTo !== 'ml' && unitTypeTo !== 'l') return false\n break;\n case 'db':\n if (unitTypeTo !== 'db') return false\n break;\n default:\n return false\n }\n return true\n }", "function isUseUnitLt(useUnit, sgUnit) {\n if (sgUnit == \"year\" && (useUnit == \"month\" || useUnit == \"day\" || useUnit == \"hm\")) {\n return true;\n } else if (sgUnit == \"month\" && (useUnit == \"day\" || useUnit == \"hm\")) {\n return true;\n } else if (sgUnit == \"day\" && (useUnit == \"hm\")) {\n return true\n }\n return false;\n }", "function unit() {\n var errors = document.querySelector(\"#errors\");\n var unitNum = document.querySelector(\"#unit\");\n var num = unitNum.value.trim();\n var patt = /^[0-9]{1,4}$/g;\n if(!patt.test(num)) {\n errorMessage(\"<p>Please enter a valid unit number</p>\");\n return false; \n } \n else {\n return true;\n }\n}", "function isUnitModel(model) {\n return model && model.type === 'unit';\n}", "verify(m, mm) {\n const a = m.elements, aa = mm.elements, d = [], sa = [];\n let flag = true, i;\n for (i = 0; i < a.length; i++) {\n d[i] = Math.abs(a[i] - aa[i]);\n sa.push(\"a[\" + i + \"]=\" + a[i] + \" aa[\" + i + \"]=\" + aa[i] + \" d[i]=\" + d[i]);\n if (Math.abs(d[i]) > 0.01) {\n flag = false;\n for (i = 0; i < sa.length; i++) {\n console.error(\"error: \" + sa[i]);\n }\n break;\n }\n }\n return flag;\n }", "function isUnitSupported(unit) {\n try {\n new Intl.NumberFormat(undefined, {\n style: 'unit',\n unit,\n });\n }\n catch (e) {\n return false;\n }\n return true;\n }", "function isUnitModel(model) {\n return model && model.type === 'unit';\n }", "isActive(){\n return this._units.some(unit => unit.isActive());\n }", "hasVillager(){\n let villagerFound = false;\n for(let unit of this.units){\n if(unit.getType() === \"Villager\"){\n villagerFound = true;\n }\n }\n\n return villagerFound;\n }", "function isInSelection(unit, adminUnitSelected) {\n if (!adminUnitSelected || !unit) { return false; }\n return unit.get(adminUnitSelected.admin) === adminUnitSelected.name;\n }", "function isUnitModel(model) {\n return (model === null || model === void 0 ? void 0 : model.type) === 'unit';\n }", "function toggleUnit()\n {\n var newUnit\n var confirmMessage\n\n if (my.settings.unit == my.UNIT.MAIN) {\n newUnit = my.UNIT.ALTERNATE\n confirmMessage = Units.alternateConfirmMessage\n } else {\n newUnit = my.UNIT.MAIN\n confirmMessage = Units.mainConfirmMessage\n }\n\n if (!confirm(confirmMessage)) {\n return false\n }\n\n localStorage.unit = newUnit\n loadSettings()\n updateUnitFromURL()\n return false\n }", "function check_current_height_weight_unit(height_unit, weight_unit){\r\n\t\tif(height_unit == \"cm\"){\r\n\t\t\tcm_flag = 1;\r\n\t\t\th_flag = 2;\r\n\t\t}else{\r\n\t\t\tft_inch_flag = 1;\r\n\t\t\th_flag = 1;\r\n\t\t}\r\n\t\t\r\n\t\tif(weight_unit == \"kg\"){\r\n\t\t\tkg_flag = 1;\r\n\t\t}else{\r\n\t\t\tlbs_flag = 1;\r\n\t\t}\r\n\t}", "function checkLettre(m) {\n for (let b = 0; b < m.length; b++) {\n if (lettre == m[b]) {\n return true;\n }\n }\n}", "function specLikeMFL() {\n return ((specLateral[LCL_MM_FOOD] >= 1) &&\n\t (specDiagonal[LCL_MM_HOME] >= 1) &&\n\t (specTotal[LCL_CLEAR] >= 2) &&\n\t (specTotal[LCL_ML1] + specTotal[LCL_ML3] >= 1));\n}", "function unitHref(m, n)\n {\n if (typeof m == 'undefined') {\n return ''\n } else if (typeof n == 'undefined') {\n return '#' + m\n } else {\n return '#' + m + '.' + n\n }\n }", "get isUseFileUnitsSupported() {}", "function hasMND(data){\r\n if (data[0].type === 'MND' || data[data.length - 1].type === 'MND'){\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n }", "function mtMtCheck(tin) {\n if (tin.length !== 9) {\n // No tests for UTR\n var chars = tin.toUpperCase().split(''); // Fill with zeros if smaller than proper\n\n while (chars.length < 8) {\n chars.unshift(0);\n } // Validate format according to last character\n\n\n switch (tin[7]) {\n case 'A':\n case 'P':\n if (parseInt(chars[6], 10) === 0) {\n return false;\n }\n\n break;\n\n default:\n {\n var first_part = parseInt(chars.join('').slice(0, 5), 10);\n\n if (first_part > 32000) {\n return false;\n }\n\n var second_part = parseInt(chars.join('').slice(5, 7), 10);\n\n if (first_part === second_part) {\n return false;\n }\n }\n }\n }\n\n return true;\n}", "assignUnits(state, cell, digit) {\n for (const unit of S.unitList[cell]) {\n let places = unit.map(u => state[u].includes(digit) ? u : false).filter(m => m !== false);\n if (places.length === 0) {\n this.logMessage(\"Contradiction: no place for \" + digit + \" in \" + S.unitName(unit), state);\n return false;\n }\n if (places.length === 1) {\n if (state[places[0]].length > 1) {\n this.logMessage(S.unitName(unit) + \" has only one place for \" + digit + \" at \" + places[0]);\n }\n if (!this.assign(state, places[0], digit)) {\n return false;\n }\n }\n }\n return true;\n }", "function determineUnit(minUnit, min, max, maxTicks) {\n\t\tvar units = Object.keys(interval);\n\t\tvar unit;\n\t\tvar numUnits = units.length;\n\n\t\tfor (var i = units.indexOf(minUnit); i < numUnits; i++) {\n\t\t\tunit = units[i];\n\t\t\tvar unitDetails = interval[unit];\n\t\t\tvar steps = (unitDetails.steps && unitDetails.steps[unitDetails.steps.length - 1]) || unitDetails.maxStep;\n\t\t\tif (steps === undefined || Math.ceil((max - min) / (steps * unitDetails.size)) <= maxTicks) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\treturn unit;\n\t}", "function swieta(d, m)\n{\n if( d==1 && m==0 || d==6 && m==0 || d==ruchome[0] && m==ruchome[1] || d==1 && m==4 || d==3 && m==4 || d==ruchome[2] && m==ruchome[3] || d==15 && m==7 || d==1 && m==10 || d==11 && m==10 || d==25 && m==11 || d==26 && m==11 )\n {\n return true;\n }\n else \n {\n return false;\n }\n}", "function is_medicare(MN) {\n var medicareNumber;\n var pattern;\n var length;\n var matches;\n var base;\n var checkDigit;\n var total;\n var multipliers;\n var isValid;\n\n pattern = /^(\\d{8})(\\d)/;\n medicareNumber = MN.toString().replace(/ /g, '');\n length = 11;\n\n if (medicareNumber.length === length) {\n matches = pattern.exec(medicareNumber);\n if (matches) {\n base = matches[1];\n checkDigit = matches[2];\n total = 0;\n multipliers = [1, 3, 7, 9, 1, 3, 7, 9];\n\n for (var i = 0; i < multipliers.length; i++) {\n total += base[i] * multipliers[i];\n }\n\n isValid = (total % 10) === Number(checkDigit);\n } else {\n isValid = false;\n }\n } else {\n isValid = false;\n }\n\n return isValid;\n}", "usdcPathExists(fromMint, toMint) {\n const fromMarket = this.tokenList\n .getList()\n .filter((t) => t.address === fromMint.toString())\n .filter((t) => { var _a; return ((_a = t.extensions) === null || _a === void 0 ? void 0 : _a.serumV3Usdc) !== undefined; })[0];\n const toMarket = this.tokenList\n .getList()\n .filter((t) => t.address === toMint.toString())\n .filter((t) => { var _a; return ((_a = t.extensions) === null || _a === void 0 ? void 0 : _a.serumV3Usdc) !== undefined; })[0];\n return fromMarket !== undefined && toMarket !== undefined;\n }", "function mtMtCheck(tin) {\n if (tin.length !== 9) {\n // No tests for UTR\n var chars = tin.toUpperCase().split(''); // Fill with zeros if smaller than proper\n while(chars.length < 8)chars.unshift(0);\n // Validate format according to last character\n switch(tin[7]){\n case 'A':\n case 'P':\n if (parseInt(chars[6], 10) === 0) return false;\n break;\n default:\n var first_part = parseInt(chars.join('').slice(0, 5), 10);\n if (first_part > 32000) return false;\n var second_part = parseInt(chars.join('').slice(5, 7), 10);\n if (first_part === second_part) return false;\n }\n }\n return true;\n}", "function containsTimeUnit(fullTimeUnit, timeUnit) {\n var index = fullTimeUnit.indexOf(timeUnit);\n\n if (index < 0) {\n return false;\n } // exclude milliseconds\n\n\n if (index > 0 && timeUnit === 'seconds' && fullTimeUnit.charAt(index - 1) === 'i') {\n return false;\n } // exclude dayofyear\n\n\n if (fullTimeUnit.length > index + 3 && timeUnit === 'day' && fullTimeUnit.charAt(index + 3) === 'o') {\n return false;\n }\n\n if (index > 0 && timeUnit === 'year' && fullTimeUnit.charAt(index - 1) === 'f') {\n return false;\n }\n\n return true;\n }", "function checkHitTest(p, m) {\n\tvar i=0, wlen= planComponents.walls.length, flen= planComponents.fornitures.length, toRet=0;\n\t\n\tfor (i=flen-1;i>=0;i--) {\n\t\tif (planComponents.fornitures[i].hitTest(p, m)) {\n\t\t\ttoRet=1;\n\t\t\tbreak;\n\t\t}\n\t}\n\t\n\tif (toRet) {\n\t\treturn 1;\n\t}\n\t\n\tfor (i=wlen-1;i>=0;i--) {\n\t\tif (planComponents.walls[i].hitTest(p, m)) {\n\t\t\ttoRet= 1;\n\t\t\tbreak ;\n\t\t}\n\t}\n\t\n\treturn toRet;\n}", "function isBase(unitList) {\n return unitList.length === 1\n && Math.abs(unitList[0].power - 1.0) < 1e-15\n && Object.keys(unitList[0].unit.dimension).length === 1\n && unitList[0].unit.dimension[Object.keys(unitList[0].unit.dimension)[0]] === 1;\n}", "function GetInternalUnit()\n{\n\treturn m_internalUnit;\n}", "function validateIfDoubleNumberBetween(str, from, to, vali){\n var myArray = str.match(/^([0-9.]*) *(nM|ng.mL)?$/i);\n\n if(myArray != null) {\n\treturn checkNumberBetween(myArray[1],from,to,vali);\n } else{ \n//\t\talert(vali + \" - \" + doublerr);\n\treturn false;\n }\n}", "function checkIfSeparateM0scanExists(m0scanFile, fileList) {\n let rule = m0scanFile.replace('_m0scan.nii', '').replace('.gz', '')\n let m0scanFile_nii = m0scanFile.replace('.nii.gz', '.nii')\n let m0scanFile_niigz = m0scanFile\n\n let onTheList = false\n for (let key2 in fileList) {\n if (key2) {\n const filePath = fileList[key2].relativePath\n if (\n matchRule_m0scan(filePath, rule + '_dir-*') ||\n filePath === m0scanFile_nii ||\n filePath === m0scanFile_niigz\n ) {\n onTheList = true\n }\n }\n }\n return onTheList\n}", "units() {\n return this.growRight('#Unit').match('#Unit$')\n }", "function isCompound(unitList) {\n if (unitList.length === 0) {\n return false;\n }\n return unitList.length > 1 || Math.abs(unitList[0].power - 1.0) > 1e-15;\n}", "function checkRange(x, n, m) {\n if (x >= n && x <= m) { return x; }\n else { return !x; }\n }", "function fullMana() {\n let t = document.getElementById(\"grimoireBarText\");\n\n // Format of magic: \"33/36 (+0.03/s)\"\n let mana = t.innerText.split(\" \")[0].split(\"/\");\n\n // we're either at max magic or it's been 30 minutes\n return (mana[0] == mana[1]) || itsAboutTimeToCastASpell;\n }", "unitReady() {\n\t\tif (this.ready === 0) {\n\t\t\tconsole.log(`[RECHARGE] Squad ${this.squadIndex} from army '${this.army}' is recharging`);\n\t\t}\n\t\t// Count ready units and compare to active units\n\t\tthis.ready++;\n\t\tif (this.ready >= this.getActiveUnits().length) {\n\t\t\tthis.ready = 0;\n\t\t\tconsole.log(`[RECHARGE] Squad ${this.squadIndex} from army '${this.army}' is ready`);\n\t\t\tthis.emit('attack', this);\n\t\t}\n\t\t// TODO@dvs:! You can not guarantee which unit called the method. Not sure if 2 timeouts of a single unit called the squads.unitReady\n\t\t// Not possible as units are only recharging after the attack, therefore a single unit can't do this twice.\n\t}", "function unitsolved(unit) {\n\t\tvar udigits = map(unit, function(s) { return values[s];});\n\t\tudigits.sort();\n\t\treturn udigits.join('') == digits;\n\t}", "function unit (value) {\n\t return low.number(value) &&\n\t value >= 0.0 && value <= 1.0\n\t}", "function findUnit(x) {\r\n for (y = 0; y < units.length; y++) {\r\n if (units[y][1] === x) {\r\n return units[y][0];\r\n }\r\n };\r\n return null;\r\n}", "isFriendly (unit) { return this.controller.isFriendly(unit.controller )}", "function validateTotalMeasurement() {\n\ttry {\n\t\tvar _total_measure_invoice \t\t= parseFloat($('.DSP_total_measure').text().replace(/,/g, ''));\n\t\t_total_measure_invoice \t\t= !isNaN(_total_measure_invoice) ? _total_measure_invoice : 0;\n\t\tvar _total_measure_carton \t\t= parseFloat($('.DSP_total_measure_carton').text().replace(/,/g, ''));\n\t\t_total_measure_carton \t\t= !isNaN(_total_measure_carton) ? _total_measure_carton : 0;\n\t\t//\n\t\tvar is_flag = true;\n\t\tif (_total_measure_invoice != _total_measure_carton) {\n\t\t\tis_flag = false;\n\t\t}\n\t\treturn is_flag;\n\t} catch(e) {\n console.log('validateTotalCartonInvoice' + e.message)\n }\n}", "function containsWood(item){\n // 1. Seach the materials of the item\n // 2. If materials contains \"wood\" \n if(item.materials.indexOf('wood') !== -1){\n return true;\n } else {\n return false;\n }\n \n // 2a. return true\n \n\n // 2b. if the materials doesn't contain wood\n \n}", "function __isDouble($str, $isMinusable) {\r\n if ($isMinusable==true) {\r\n if (_reg_spe.test($str) || $str*1==0) {\r\n return true;\r\n }\r\n if (_reg_double.test($str)) { \r\n return true;\r\n }\r\n }else {\r\n if ($str.substr(0,1)==\"-\") {\r\n return false;\r\n }\r\n\r\n if ($str*1==0) {\r\n return true;\r\n }\r\n if (_reg_spe_no_minus.test($str)) {\r\n return true;\r\n }\r\n\r\n if (_reg_double_no_minus.test($str)) {\r\n return true;\r\n }\r\n }\r\n\r\n return false;\r\n}", "hasRule(measure) {\n for (let i = 0, len = this.rules.length; i < len; i++) {\n if (this.rules[i].measure === pluralize(measure)) {\n return true\n }\n }\n\n return false\n }", "function m(t, n, r) {\n return t.units[n][r];\n }", "function esMayor05(){\n if (obtenerAleatorio()> 0.5) {\n return true;\n }else {\n return false;\n }\n}", "set isUseFileUnitsSupported(value) {}", "function checkNumerator() {\n var medMin = 10;\n\n // List of medications\n var medList = patient.medications();\n\n // Filters\n var medActive = filter_activeMeds(medList);\n\n return isMatch(medActive) && ( medMin <= medActive.length );\n\n }", "function IsCongruent(a,b,m)\n{\n\treturn IsDivisible(a-b,m)\n}", "function checkChampIsMid(champion) {\n var mids = ['Ahri', 'Lux', 'LeBlanc', 'Anivia', 'Brand', 'Twisted Fate', \n 'Oriana', 'Kassadin', 'Annie', 'Azir', 'Viktor', 'Syndra', \n 'Ekko', 'Malzahar', 'Diana', 'Katarina', 'Talon', 'Morgana',\n 'Xerath', 'Veigar', 'Ezreal', \"Vel'Koz\", 'Ziggs', 'Cassiopeia',\n 'Karthus', 'Zilean', 'Zyra', 'Varus', \"Kog'Maw\", 'Karma'];\n if(mids.indexOf(champion) != -1) {\n return true;\n }\n return false;\n}", "function modIsUEM(mod){\n\treturn (module.cors[mod].types.indexOf('UEM') >= 0);\n}", "check_b() {\n\t\tfor (let i=0; i<this.n; i++) {\n\t\t\tif (this.basis[i] >= this.m) continue;\n\t\t\tif ((this.b_numerator[i] % this.b_denominator[i]) != 0) return false;\n\t\t}\n\t\treturn true;\n\t}", "function nextSubunit()\n {\n var m = my.current.unitNo\n var n = my.current.subunitNo\n\n if (!currentSubunitIsTheLastSubunit()) {\n if (n == my.current.subunitTitles.length) {\n // If the user is at unit M.L where L is the last\n // subunit of unit M, then go to unit (M + 1).1.\n m++\n n = 1\n } else {\n // If the user is at unit M.N, then go to unit M.(N + 1).\n n++\n }\n }\n\n window.location.href = unitHref(m, n)\n }", "function calculateUnitValue(i) {\n\tif (getUnit(i) === \"in\") return 1;\n\telse if (getUnit(i) === \"cm\") return .3937;\n\telse return 0;\n}", "mobLookup(mob) {\r\n if (this.mobsInfo.filter(mobInfo => mobInfo.name == mob).length > 0) {\r\n return true;\r\n };\r\n }", "function getNextUnit(unit) {\n switch (unit) {\n case \"year\":\n return;\n case \"month\":\n return \"year\";\n case \"week\":\n return \"month\";\n case \"day\":\n return \"month\"; // not a mistake\n case \"hour\":\n return \"day\";\n case \"minute\":\n return \"hour\";\n case \"second\":\n return \"minute\";\n case \"millisecond\":\n return \"second\";\n }\n}", "function isValidCSSUnit(color) {\n\t return !!matchers.CSS_UNIT.exec(color);\n\t}", "function isValidCSSUnit(color) {\n\t return !!matchers.CSS_UNIT.exec(color);\n\t}", "function nearly(n, m) {\n const delta = 5;\n return Math.abs(n - m) < delta;\n}", "function isValidCSSUnit(color) {\n\t return !!matchers.CSS_UNIT.exec(color);\n\t}", "function kilometerToMeter(kmUnit) {\n \n var meter = kmUnit * 1000;\n\n if (kmUnit > 0) {\n return meter;\n }\n else {\n return \"Length cannot be Negative\";\n }\n}", "function formatUnit(unit) {\r\n\t\r\n\tvar isInt = parseInt(unit);\r\n\r\n\treturn isInt ? isInt : 0;\r\n}", "function handleUnit(unit) {\n switch(unit) {\n case \"MT\":\n return \"Minutes\";\n case \"HT\":\n return \"Hours\";\n case \"D\":\n return \"Days\";\n case \"M\":\n return \" Months\";\n default:\n return \"\";\n }\n}", "function currentSubunitIsTheFirstSubunit()\n {\n return my.current.unitNo == 1 && my.current.subunitNo == 1\n }", "checkUnits(){\n let logger = this.namespace.container.logger;\n\n let leftSideUnit = this.unitsParsed;\n if (typeof leftSideUnit === 'undefined') {\n logger.warn(`No units set for \"${this.index}\"`);\n }\n for (const scope in this.assignments) {\n let rightSideExpr = this.assignments[scope];\n if (typeof rightSideExpr.num === 'undefined') { // skip numbers\n let rightSideUnit = rightSideExpr.calcUnit(this);\n if (typeof rightSideUnit === 'undefined') {\n logger.warn(`Cannot calculate right side units in \"${this.index}\" for scope \"${scope}\".`);\n } else if (leftSideUnit && !leftSideUnit.equal(rightSideUnit, true)) {\n let leftUnitString = leftSideUnit.toString();\n let rightUnitString = rightSideUnit.simplify().toString();\n logger.warn(`Units inconsistency in \"${this.index}\" for scope \"${scope}\". Left: \"${leftUnitString}\". Right: \"${rightUnitString}\"`);\n }\n }\n }\n }", "function sumMul(n, m) {\r\n for (var sum = 0, i = n; i < m; i += n)\r\n sum += i\r\n return sum > 0 ? sum : 'INVALID'\r\n}", "function toggleMeasurement() {\n let currentUnit = document.querySelector('#unit-wrapper').getAttribute('data-measure');\n if(currentUnit == 'imperial') {\n // Metric\n measureUpdate('metric');\n document.querySelector('#unit-wrapper').setAttribute('data-measure', 'metric');\n writeCookie('canitube_Settings_Unit Measure', 'metric', 10000000);\n } else {\n // Imperial\n measureUpdate('imperial');\n document.querySelector('#unit-wrapper').setAttribute('data-measure', 'imperial');\n writeCookie('canitube_Settings_Unit Measure', 'imperial', 10000000);\n }\n\n}", "function checkFuel(){\r\n if (fuel > 0){\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n}", "function containsTimeUnit(fullTimeUnit, timeUnit) {\n var index = fullTimeUnit.indexOf(timeUnit);\n return index > -1 &&\n (timeUnit !== TimeUnit.SECONDS ||\n index === 0 ||\n fullTimeUnit.charAt(index - 1) !== 'i' // exclude milliseconds\n );\n}", "function canReachWDMNorth()\n\t{\n\t\tif (hasFoundEntrance(68) || (hasFoundEntrance(77) && items.hammer) || \n\t\t(items.mirror && (hasFoundEntrance(69) || hasFoundEntrance(70) || hasFoundEntrance(71) || hasFoundEntrance(72) || hasFoundEntrance(73) || hasFoundEntrance(75) || hasFoundEntrance(76) || hasFoundEntrance(127) || hasFoundEntrance(131) || hasFoundEntrance(132) || hasFoundEntrance(133) || hasFoundEntrance(136))) || (items.flute && items.mirror)\n\t\t) return true;\n\t\tif (items.mirror && items.hookshot && (hasFoundEntrance(77) || hasFoundEntrance(78) || hasFoundEntrance(79) || hasFoundEntrance(80) || hasFoundEntrance(81) || hasFoundEntrance(82) || hasFoundEntrance(83) || hasFoundEntrance(84))) return true;\n\t\tif (items.mirror && items.hammer && (hasFoundEntrance(128) || hasFoundEntrance(130))) return true;\n\t\t\n\t\treturn false;\n\t}", "function currentSubunitIsTheLastSubunit()\n {\n return my.current.unitNo == Units.main.length &&\n my.current.subunitNo == my.current.subunitTitles.length\n }", "pass(space) {\r\n if(space.occupied === this.color){\r\n return false;\r\n } else if(space.terrain === 3){\r\n console.log('Cannot enter mountains')\r\n return false;\r\n } else if(this.mounted === true && space.terrain === 2){\r\n console.log('Mounted units cannot enter rough terrain');\r\n return false;\r\n }\r\n else {\r\n return true;\r\n }\r\n }", "function n(n) {\n return null != _renderers_support_lengthUtils_js__WEBPACK_IMPORTED_MODULE_0__[\"meterIn\"][n];\n }", "function isValidCSSUnit(color) {\n return !!matchers.CSS_UNIT.exec(color);\n}", "function isValidCSSUnit(color) {\n return !!matchers.CSS_UNIT.exec(color);\n}", "function isValidCSSUnit(color) {\n return !!matchers.CSS_UNIT.exec(color);\n}", "function isValidCSSUnit(color) {\n return !!matchers.CSS_UNIT.exec(color);\n}", "function isValidCSSUnit(color) {\n return !!matchers.CSS_UNIT.exec(color);\n}", "function isValidCSSUnit(color) {\n return !!matchers.CSS_UNIT.exec(color);\n}", "function isValidCSSUnit(color) {\n return !!matchers.CSS_UNIT.exec(color);\n}", "function isValidCSSUnit(color) {\n return !!matchers.CSS_UNIT.exec(color);\n}", "function isValidCSSUnit(color) {\n return !!matchers.CSS_UNIT.exec(color);\n}", "function isValidCSSUnit(color) {\n return !!matchers.CSS_UNIT.exec(color);\n}", "function isValidCSSUnit(color) {\n return !!matchers.CSS_UNIT.exec(color);\n}", "function isValidCSSUnit(color) {\n return !!matchers.CSS_UNIT.exec(color);\n}", "function isValidCSSUnit(color) {\n return !!matchers.CSS_UNIT.exec(color);\n}", "function isValidCSSUnit(color) {\n return !!matchers.CSS_UNIT.exec(color);\n}", "function isValidCSSUnit(color) {\n return !!matchers.CSS_UNIT.exec(color);\n}", "function isValidCSSUnit(color) {\n return !!matchers.CSS_UNIT.exec(color);\n}", "function isValidCSSUnit(color) {\n return !!matchers.CSS_UNIT.exec(color);\n}", "function isValidCSSUnit(color) {\n return !!matchers.CSS_UNIT.exec(color);\n}", "function isValidCSSUnit(color) {\n return !!matchers.CSS_UNIT.exec(color);\n}", "function isValidCSSUnit(color) {\n return !!matchers.CSS_UNIT.exec(color);\n}", "function isValidCSSUnit(color) {\n return !!matchers.CSS_UNIT.exec(color);\n}", "function isValidCSSUnit(color) {\n return !!matchers.CSS_UNIT.exec(color);\n}", "function isValidCSSUnit(color) {\n return !!matchers.CSS_UNIT.exec(color);\n}", "function isValidCSSUnit(color) {\n return !!matchers.CSS_UNIT.exec(color);\n}", "function isValidCSSUnit(color) {\n return !!matchers.CSS_UNIT.exec(color);\n}", "function isValidCSSUnit(color) {\n return !!matchers.CSS_UNIT.exec(color);\n}" ]
[ "0.7132564", "0.5845576", "0.5764157", "0.5596584", "0.5589817", "0.55570203", "0.5511924", "0.54607326", "0.5388938", "0.53454024", "0.5287075", "0.5208508", "0.519486", "0.51917964", "0.5117975", "0.50865567", "0.50762963", "0.5061085", "0.5053876", "0.50512236", "0.5026597", "0.4898522", "0.48809773", "0.48480073", "0.48469317", "0.48431376", "0.48269847", "0.48121962", "0.48066226", "0.47816533", "0.47407234", "0.47225326", "0.47207826", "0.46892923", "0.46865818", "0.4684202", "0.4683489", "0.46702987", "0.46684977", "0.4661055", "0.46582574", "0.46483934", "0.46413305", "0.4639052", "0.46370438", "0.4628345", "0.4625897", "0.46237314", "0.4622338", "0.46101218", "0.4606986", "0.46056956", "0.45976838", "0.45952612", "0.4593157", "0.45830673", "0.45825028", "0.45700637", "0.45700637", "0.45690528", "0.45676038", "0.45669925", "0.45667642", "0.45651144", "0.456506", "0.45609945", "0.45577216", "0.45511568", "0.45392588", "0.45285323", "0.4526987", "0.45259944", "0.45243105", "0.45203802", "0.4515468", "0.4515468", "0.4515468", "0.4515468", "0.4515468", "0.4515468", "0.4515468", "0.4515468", "0.4515468", "0.4515468", "0.4515468", "0.4515468", "0.4515468", "0.4515468", "0.4515468", "0.4515468", "0.4515468", "0.4515468", "0.4515468", "0.4515468", "0.4515468", "0.4515468", "0.4515468", "0.4515468", "0.4515468", "0.4515468" ]
0.8651971
0
Display the unit links
function displayUnitLinks() { // Delete all existing unit links var linksDiv = my.html.unitLinks Util.removeChildren(linksDiv) // Create new unit links for (var i = 0; i < Units.main.length; i++) { var label = 'སློབ་མཚན། ' + (i + 1) var selected = (i + 1 == my.current.unitNo) var href = unitHref(i + 1) var divElement = boxedLink(label, selected, href) divElement.id = 'unit' + (i + 1) divElement.title = unit(i + 1).title linksDiv.appendChild(divElement) } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function displaySubunitLinks()\n {\n // Delete all existing subunit links\n var linksDiv = my.html.subunitLinks\n while (linksDiv.firstChild &&\n linksDiv.firstChild.className != 'stretch') {\n\n linksDiv.removeChild(linksDiv.firstChild)\n }\n\n // Create new subunit links for the unit m\n var numberOfSubunits = my.current.subunitTitles.length\n for (var i = numberOfSubunits - 1; i >= 0; i--) {\n // Insert whitespaces between div elements, otherwise they\n // would not be justified\n var whitespace = document.createTextNode('\\n')\n linksDiv.insertBefore(whitespace, linksDiv.firstChild)\n\n var label = my.current.subunitTitles[i]\n var selected = (i + 1 == my.current.subunitNo)\n var href = unitHref(my.current.unitNo, i + 1)\n\n var subunitDiv = boxedLink(label, selected, href)\n subunitDiv.id = 'subunit' + (i + 1)\n subunitDiv.style.width = (95 / numberOfSubunits) + '%'\n\n linksDiv.insertBefore(subunitDiv, linksDiv.firstChild)\n }\n }", "function displayAlternateUnitLinks()\n {\n // If alternate unit is not available for the current unit,\n // hide the alternate links element\n if (!alternateUnitAvailable(my.current.unitNo)) {\n alternateUnitLinks.style.visibility = 'hidden'\n return\n }\n\n // Delete all existing alternate unit links\n Util.removeChildren(alternateUnitLinks)\n\n // Create div elements for the main unit and alternate unit\n var mainUnitElement =\n boxedLink(Units.mainLabel,\n my.settings.unit == my.UNIT.MAIN,\n '#', toggleUnit)\n\n var alternateUnitElement =\n boxedLink(Units.alternateLabel,\n my.settings.unit == my.UNIT.ALTERNATE,\n '#', toggleUnit)\n\n alternateUnitLinks.appendChild(mainUnitElement)\n alternateUnitLinks.appendChild(alternateUnitElement)\n alternateUnitLinks.style.visibility = 'visible'\n }", "function renderUnit(unit) {\n return crel('li',\n crel('span', {'class':'naam'}, unit.naam), \n crel('span', {'class':'afkorting'}, unit.afkorting),\n crel('span', {'class':'wikilink'},\n crel ('a', {'href':unit.wikilink},unit.wikilink)),\n crel('span', {'class':'wow'}, unit.wieofwat),\n crel('span', {'class':'foto'}, \n crel ('img', {'src': unit.foto})),\n )\n }", "show() {\n for (let node of this.nodes) {\n node.show();\n node.showLinks();\n }\n }", "function displayUnitTitle() {\n\n // Parts of the unit title\n var unitNo = 'སློབ་མཚན། ' + my.current.unitNo +\n '.' + my.current.subunitNo\n var space = '\\u00a0\\u00a0'\n var title = '[' + my.current.unit.title + ']'\n\n Util.setChildren(my.html.unitTitle, unitNo, space, title)\n }", "function updateNavigationLinks()\n {\n if (currentSubunitIsTheFirstSubunit()) {\n my.html.previousLink.style.visibility = 'hidden'\n my.html.nextLink.style.visibility = 'visible'\n } else if (currentSubunitIsTheLastSubunit()) {\n my.html.previousLink.style.visibility = 'visible'\n my.html.nextLink.style.visibility = 'hidden'\n } else {\n my.html.previousLink.style.visibility = 'visible'\n my.html.nextLink.style.visibility = 'visible'\n }\n }", "function unit() {\n // Add more tests here.\n return linkUnit();\n}", "function unitHref(m, n)\n {\n if (typeof m == 'undefined') {\n return ''\n } else if (typeof n == 'undefined') {\n return '#' + m\n } else {\n return '#' + m + '.' + n\n }\n }", "function showUnits() {\n console.log(\"showUnits()\");\n units.forEach(unit => {\n /*\n // add unit names to page\n var unitName = document.createElement(\"h1\");\n unitName.innerText = unit.fields.name;\n document.body.appendChild(unitName);\n\n // add unit location to page\n unitLocation = document.createElement(\"p\");\n unitLocation.innerText = unit.fields.location;\n document.body.appendChild(unitLocation);\n\n // add image to page\n var unitImage = document.createElement(\"img\");\n unitImage.src = unit.fields.image[0].url;\n document.body.appendChild(unitImage); */\n\n // creating a new div container, where our unit info will go\n var unitContainer = document.createElement(\"div\");\n unitContainer.classList.add(\"unit-container\");\n document.querySelector(\".container\").append(unitContainer);\n\n // add unit names to unit container\n var unitName = document.createElement(\"h2\");\n unitName.classList.add(\"unit-name\");\n unitName.innerText = unit.fields.name;\n unitContainer.append(unitName);\n\n // add location to unit container\n var unitLocation = document.createElement(\"h3\");\n unitLocation.classList.add(\"unit-location\");\n unitLocation.innerText = unit.fields.location;\n unitLocation.style.color = \"#5F5C4F\";\n unitContainer.append(unitLocation);\n\n // add description to container\n var unitDescription = document.createElement(\"p\");\n unitDescription.classList.add(\"unit-description\");\n unitDescription.innerText = unit.fields.description;\n unitContainer.append(unitDescription);\n\n // add image to container\n var unitImage = document.createElement(\"img\");\n unitImage.classList.add(\"unit-image\");\n unitImage.src = unit.fields.image[0].url;\n unitContainer.append(unitImage);\n\n // add event listener\n // when user clicks on unit container\n // image and description will appear or disappear\n unitContainer.addEventListener(\"click\", function() {\n unitDescription.classList.toggle(\"active\");\n unitImage.classList.toggle(\"active\");\n });\n\n // add to each container as a class\n var unitCh = unit.fields.chapter;\n console.log(unitCh);\n unitContainer.classList.add(unitCh);\n\n // filter by chapter 2\n var filterCh2 = document.querySelector(\".ch2\");\n filterCh2.addEventListener(\"click\", function(){\n if(unitContainer.classList.contains(\"chapter2\")){\n unitContainer.style.background = \"#D7D2B5\";\n }\n else{\n unitContainer.style.background = \"#9f9b86\";\n }\n })\n\n var filterCh3 = document.querySelector(\".ch3\");\n filterCh3.addEventListener(\"click\", function(){\n if(unitContainer.classList.contains(\"chapter3\")){\n unitContainer.style.background = \"#D7D2B5\";\n }\n else{\n unitContainer.style.background = \"#9f9b86\";\n }\n })\n\n var filterCh4 = document.querySelector(\".ch4\");\n filterCh4.addEventListener(\"click\", function(){\n if(unitContainer.classList.contains(\"chapter4\")){\n unitContainer.style.background = \"#D7D2B5\";\n }\n else{\n unitContainer.style.background = \"#9f9b86\";\n }\n })\n\n var filterCh5 = document.querySelector(\".ch5\");\n filterCh5.addEventListener(\"click\", function(){\n if(unitContainer.classList.contains(\"chapter5\")){\n unitContainer.style.background = \"#D7D2B5\";\n }\n else{\n unitContainer.style.background = \"#9f9b86\";\n }\n })\n\n var filterCh6 = document.querySelector(\".ch6\");\n filterCh6.addEventListener(\"click\", function(){\n if(unitContainer.classList.contains(\"chapter6\")){\n unitContainer.style.background = \"#D7D2B5\";\n }\n else{\n unitContainer.style.background = \"#9f9b86\";\n }\n })\n\n var filterCh9 = document.querySelector(\".ch9\");\n filterCh9.addEventListener(\"click\", function(){\n if(unitContainer.classList.contains(\"chapter9\")){\n unitContainer.style.background = \"#D7D2B5\";\n }\n else{\n unitContainer.style.background = \"#9f9b86\";\n }\n })\n\n var filterCh13 = document.querySelector(\".ch13\");\n filterCh13.addEventListener(\"click\", function(){\n if(unitContainer.classList.contains(\"chapter13\")){\n unitContainer.style.background = \"#D7D2B5\";\n }\n else{\n unitContainer.style.background = \"#9f9b86\";\n }\n })\n\n var filterCh14 = document.querySelector(\".ch14\");\n filterCh14.addEventListener(\"click\", function(){\n if(unitContainer.classList.contains(\"chapter14\")){\n unitContainer.style.background = \"#D7D2B5\";\n }\n else{\n unitContainer.style.background = \"#9f9b86\";\n }\n })\n\n var filterCh17 = document.querySelector(\".ch17\");\n filterCh17.addEventListener(\"click\", function(){\n if(unitContainer.classList.contains(\"chapter17\")){\n unitContainer.style.background = \"#D7D2B5\";\n }\n else{\n unitContainer.style.background = \"#9f9b86\";\n }\n })\n\n var reset = document.querySelector(\".reset\");\n reset.addEventListener(\"click\", function(){\n unitContainer.style.background = \"#9f9b86\";\n })\n });\n}", "function linkDisplay (numLinks,urlList) {\r\n let i = 0;\r\n console.log(urlList);\r\n while( i < numLinks ) {\r\n let link = 'link:'+(i+1);\r\n let url = urlList[i];\r\n let linkLocation = document.getElementById(link);\r\n linkLocation.innerHTML = url;\r\n linkLocation.setAttribute('href',url);\r\n linkLocation.setAttribute('target','_blank');\r\n i++;\r\n }\r\n}", "function setup_metacpan_links() {\n $('a[href^=\"/dist/overview/\"]').each(\n function() {\n var module = this.href.match('/dist/overview/(.*)$')[1].replace('-', '::', 'g');\n console.log(\"module = \" + module);\n $(this).after('&nbsp;' + '<a href=\"http://metacpan.org/module/' + module + '\">' + metacpan_img + '</a>');\n });\n}", "function ShowLinks(linkId) { console.log(\"sellwood_px: ShowLinks called; this function is not defined in px.\"); }", "function displayGuide() {\n my.html.guide.innerHTML = my.current.unit.guide\n }", "mostrarTarefas() {\n printPlanejamentoAtual(this.getPlanejamentoAtual());\n printListaTarefa(this.listaQuadros());\n }", "function atLinks() {\n linklist = [\"239MTG\", \"affinityforartifacts\", \"alliesmtg\", \"AllStandards\", \"Alphabetter\", \"Amonkhet\", \"architectMTG\", \"ArclightPhoenixMTG\", \"aristocratsMTG\", \"BadMTGCombos\", \"basementboardgames\", \"BaSE_MtG\", \"BudgetBrews\", \"budgetdecks\", \"BulkMagic\", \"cardsphere\", \"casualmtg\", \"CatsPlayingMTG\", \"CircuitContest\", \"cocomtg\", \"CompetitiveEDH\", \"custommagic\", \"DeckbuildingPrompts\", \"edh\", \"EDHug\", \"EggsMTG\", \"ElvesMTG\", \"enchantress\", \"EsperMagic\", \"findmycard\", \"fishmtg\", \"FlickerMTG\", \"freemagic\", \"goblinsMTG\", \"HamiltonMTG\", \"HardenedScales\", \"humansmtg\", \"infect\", \"johnnys\", \"kikichord\", \"lanternmtg\", \"lavaspike\", \"locketstorm\", \"lrcast\", \"magicarena\", \"Magicdeckbuilding\", \"MagicDuels\", \"magicTCG\", \"magicTCG101\", \"MakingMagic\", \"marchesatheblackrose\", \"marduMTG\", \"MentalMentalMagic\", \"millMTG\", \"ModernLoam\", \"modernmagic\", \"ModernRecMTG\", \"modernspikes\", \"ModernZombies\", \"monobluemagic\", \"mtg\", \"MTGAngels\", \"mtgbattlebox\", \"mtgbracket\", \"mtgbrawl\", \"mtgbudgetmodern\", \"mtgcardfetcher\", \"mtgcube\", \"MTGDredge\", \"mtgfinalfrontier\", \"mtgfinance\", \"mtgfrontier\", \"mtglegacy\", \"MTGManalessDredge\", \"MTGMaverick\", \"mtgmel\", \"mtgrules\", \"mtgspirits\", \"mtgtreefolk\", \"mtgvorthos\", \"neobrand\", \"nicfitmtg\", \"oathbreaker_mtg\", \"oldschoolmtg\", \"pauper\", \"PauperArena\", \"PauperEDH\", \"peasantcube\", \"PennyDreadfulMTG\", \"PioneerMTG\", \"planeshiftmtg\", \"ponzamtg\", \"RatsMTG\", \"RealLifeMTG\", \"RecklessBrewery\", \"rpg_brasil\", \"scapeshift\", \"shittyjudgequestions\", \"sistersmtg\", \"skredred\", \"Sligh\", \"spikes\", \"stoneblade\", \"StrangeBrewEDH\", \"SuperUltraBudgetEDH\", \"therandomclub\", \"Thoptersword\", \"threecardblind\", \"TinyLeaders\", \"TronMTG\", \"UBFaeries\", \"uwcontrol\", \"xmage\", \"reddit.com/message\", \"reddit.com/user/MTGCardFetcher\"]\n\n for (j = 0; j < linklist.length; j++) {\n if (location.href.toLowerCase().includes(linklist[j].toLowerCase()))\n return true;\n }\n return false;\n}", "function currentSubunit()\n {\n var m = my.current.unitNo\n var n = my.current.subunitNo\n\n window.location.href = unitHref(m, n)\n }", "function display() {\n\treturn {\n\t\tdisplayStores: function() {\n\t\t\tfor (var i = 0; i < stores.length; i++) {\n\t\t\t\t$('<a class=\"storeLink\"></a>').appendTo('#mainDiv').append($('<img>').attr('src', stores[i].src))\n\t\t\t}\n\n\t\t\t$('.storeLink').click(function() {\n\t\t\t\tnewPage();\n\t\t\t\t\tfor (var i = 0; i < products.length; i++) {\n\t\t\t\t\t\t$('#mainDiv').append($('<a id=\"productLink\"></a>')\n\t\t\t\t\t\t.append($('<img>').attr('src', products[i].src))).append(products[i].name + '\\n' + products[i].price + '\\n' + products[i].size, $('<input type=\"checkbox\">').attr('id',i))\n\t\t\t\t\t}\n\n\t\t\t\t$('#mainDiv').append(\n\t\t\t\t buttons()\n\t\t\t\t)\n\t\t\t});\n\t\t},\n\n\t\tdisplayMen: function() {\n\t\t\tnewPage();\n\t\t\tfor (var i = 0; i < products.length; i++) {\n\t\t\t\tif (products[i].cat === 'men') {\n\t\t\t\t\tconsole.log(i)\n\t\t\t\t\t$('#mainDiv').append($('<a id=\"productLink\"></a>')\n\t\t\t\t\t.append($('<img>').attr('src', products[i].src))).append(products[i].name + '\\n' + products[i].price + '\\n' +products[i].size)\n\t\t\t\t\t.append($('<input type=\"checkbox\">').attr('id', i))\n\t\t\t\t\t.append(buttons());\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\tdisplayWomen: function() {\n\t\t\tnewPage();\n\t\t\tfor (var i = 0; i < products.length; i++) {\n\t\t\t\tif (products[i].cat === 'women') {\n\t\t\t\t\t$('#mainDiv').append($('<a id=\"productLink\"></a>')\n\t\t\t\t\t.append($('<img>').attr('src', products[i].src))).append(products[i].name + '\\n' + products[i].price + '\\n' +products[i].size)\n\t\t\t\t\t.append($('<input type=\"checkbox\">').attr('id', i))\n\t\t\t\t\t.append(buttons());\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\tdisplayKids: function() {\n\t\t\tnewPage();\n\t\t\tfor (var i = 0; i < products.length; i++) {\n\t\t\t\tif (products[i].cat === 'kids') {\n\t\t\t\t\t$('#mainDiv').append($('<a id=\"productLink\"></a>')\n\t\t\t\t\t.append($('<img>').attr('src', products[i].src))).append(products[i].name + '\\n' + products[i].price + '\\n' +products[i].size)\n\t\t\t\t\t.append($('<input type=\"checkbox\">').attr('id', i))\n\t\t\t\t\t.append(buttons());\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}", "function showLinks (delay) {\n // Show links\n\n // This is kind of redundant, but as long as the link arrows have not been\n // moved to user control layer, keep calling the modeSwitchWalkClick()\n // to bring arrows to the top layer. Once loaded, move svLinkArrowsLoaded to true.\n if (!status.svLinkArrowsLoaded) {\n var numPath = $divViewControlLayer.find(\"path\").length;\n if (numPath === 0) {\n makeLinksClickable();\n } else {\n status.svLinkArrowsLoaded = true;\n }\n }\n\n if (status.hideNonavailablePanoLinks &&\n status.availablePanoIds) {\n $.each($('path'), function (i, v) {\n if ($(v).attr('pano')) {\n var panoId = $(v).attr('pano');\n var idx = status.availablePanoIds.indexOf(panoId);\n\n if (idx === -1) {\n $(v).prev().prev().remove();\n $(v).prev().remove();\n $(v).remove();\n } else {\n //if (properties.browser === 'chrome') {\n // Somehow chrome does not allow me to select path\n // and fadeOut. Instead, I'm just manipulating path's style\n // and making it hidden.\n $(v).prev().prev().css('visibility', 'visible');\n $(v).prev().css('visibility', 'visible');\n $(v).css('visibility', 'visible');\n }\n }\n });\n } else {\n if (properties.browser === 'chrome') {\n // Somehow chrome does not allow me to select path\n // and fadeOut. Instead, I'm just manipulating path's style\n // and making it hidden.\n $('path').css('visibility', 'visible');\n } else {\n if (!delay) {\n delay = 0;\n }\n // $('path').show();\n $('path').css('visibility', 'visible');\n }\n }\n }", "function displayLinks(anchors, url){\n\t//none found\n\tif(anchors.length == 0){\n\t\t$('#results').innerHTML = \"Sorry. No links were found on this page. Are you sure you typed the correct url?\"\n\t}\n\telse{\n\t\t$('#results').innerHTML = `<h2>Results for ${url}</h2>`;\n\t}\n\n\t//go through anchors array, adding one by one to DOM.\n\tfor(let i in anchors){\n\t\t$('#results').append(`${anchors[i]}<br/>`);\n\t\tformatUrl(url);\n\t}\n\n\treturn;\n}", "function quickLinks(){\n\t\tvar menu = find(\"//td[@class='menu']\", XPFirst);\n\t\tfor (var j = 0; j < 2; j++) for (var i = 0; i < menu.childNodes.length; i++) if (menu.childNodes[i].nodeName == 'BR') removeElement(menu.childNodes[i]);\n\t\tmenu.innerHTML += '<hr/>';\n\t\tmenu.innerHTML += '<a href=\"login.php\">' + T('LOGIN') + '</a>';\n\t\tmenu.innerHTML += '<a href=\"allianz.php\">' + T('ALIANZA') + '</a>';\n\t\tmenu.innerHTML += '<a href=\"a2b.php\">' + T('ENV_TROPAS') + '</a>';\n\t\tmenu.innerHTML += '<a href=\"warsim.php\">' + T('SIM') + '</a>';\n\t\tmenu.innerHTML += '<hr/>';\n\t\tmenu.innerHTML += '<a href=\"http://trcomp.sourceforge.net/?lang=' + idioma + '\" target=\"_blank\">' + T('COMP') + '</a>';\n//\t\tmenu.innerHTML += '<a href=\"http://travmap.shishnet.org/?lang=' + idioma + '\" target=\"_blank\">' + T('MAPA') + '</a>';\n//\t\tmenu.innerHTML += '<a href=\"http://www.denibol.com/~victor/travian_calc/\" target=\"_blank\">' + T('CALC') + '</a>';\n\t\tmenu.innerHTML += '<a href=\"http://www.denibol.com/proyectos/travian_beyond/\" target=\"_blank\">Travian Beyond</a>';\n\t}", "function showUSGSLinks(evt){\n\t//check to see if there is already an existing linksDiv so that it is not build additional linksDiv. Unlikely to occur since the usgsLinks div is being destroyed on mouseleave.\n\tif (!dojo.byId('usgsLinks')){\n\t\t//create linksDiv\n\t\tvar linksDiv = dojo.doc.createElement(\"div\");\n\t\tlinksDiv.id = 'usgsLinks';\n\t\t//LINKS BOX HEADER TITLE HERE\n\t\tlinksDiv.innerHTML = '<div class=\"usgsLinksHeader\"><b>USGS Links</b></div>';\n\t\t//USGS LINKS GO HERE\n\t\tlinksDiv.innerHTML += '<p>';\n\t\tlinksDiv.innerHTML += '<a style=\"color:white\" target=\"_blank\" href=\"http://www.usgs.gov/\">USGS Home</a><br />';\n\t\tlinksDiv.innerHTML += '<a style=\"color:white\" target=\"_blank\" href=\"http://www.usgs.gov/ask/\">Contact USGS</a><br />';\n\t\tlinksDiv.innerHTML += '<a style=\"color:white\" target=\"_blank\" href=\"http://search.usgs.gov/\">Search USGS</a><br />';\n\t\tlinksDiv.innerHTML += '<a style=\"color:white\" target=\"_blank\" href=\"http://www.usgs.gov/laws/accessibility.html\">Accessibility</a><br />';\n\t\tlinksDiv.innerHTML += '<a style=\"color:white\" target=\"_blank\" href=\"http://www.usgs.gov/foia/\">FOIA</a><br />';\n\t\tlinksDiv.innerHTML += '<a style=\"color:white\" target=\"_blank\" href=\"http://www.usgs.gov/laws/privacy.html\">Privacy</a><br />';\n\t\tlinksDiv.innerHTML += '<a style=\"color:white\" target=\"_blank\" href=\"http://www.usgs.gov/laws/policies_notices.html\">Policies and Notices</a></p>';\n\t\t\n\t\t//place the new div at the click point minus 5px so the mouse cursor is within the div\n\t\tlinksDiv.style.top = evt.clientY-5 + 'px';\n\t\tlinksDiv.style.left = evt.clientX-5 + 'px';\n\t\t\n\t\t//add the div to the document\n\t\tdojo.byId('map').appendChild(linksDiv);\n\t\t//on mouse leave, call the removeLinks function\n\t\tdojo.connect(dojo.byId(\"usgsLinks\"), \"onmouseleave\", removeLinks);\n\n\t}\n}", "function displayDocuManager() {\n\n\t// clear\n\t$(\".controlContentBlock[id=compare-manage] > ol\").empty();\n\n\t// show each corpus\n\tfor (let corpusName in _dataset) {\n\t\tif (typeof _dataset[corpusName] !== 'object') continue;\n\t\tlet manageItem = \"<li name=\\\"\" + corpusName + \"\\\">\" + corpusName + \"</li>\";\n\t\tlet className = (_dataset[corpusName].isShow) ?\"glyphicon-eye-open\" :\"glyphicon-eye-close\";\n\t\tlet hideBtn = \"<span class=\\\"glyphicon \" + className + \"\\\" name=\\\"\" + corpusName + \"\\\" onclick=\\\"hideOrShowCorpus(this, '\"+corpusName+\"')\\\"></span>\";\n\t\tlet deleteBtn = \"<span class=\\\"glyphicon glyphicon-trash\\\" name=\\\"\" + corpusName + \"\\\" onclick=\\\"deleteCorpus('\" + corpusName + \"')\\\"></span>\";\n\t\t$(\".controlContentBlock[id=compare-manage] > ol\").append(manageItem + hideBtn + deleteBtn);\n\t}\n}", "function eLink(db,nm) {\n\tdbs = new Array(\"http://us.battle.net/wow/en/search?f=wowitem&q=\",\"http://www.wowhead.com/?search=\");\n\tdbTs = new Array(\"Armory\",\"Wowhead\");\n\tdbHs = new Array(\"&real; \",\"&omega; \");\n\tel = '<a href=\"'+ dbs[db]+nm + '\" target=\"_blank\" title=\"'+ dbTs[db] +'\">'+ dbHs[db] + '</a>';\n\treturn el;\n}", "populateUnitMenus() {\n\t\tlet category = this.m_catMenu.value;\n\t\tthis.m_unitAMenu.innerHTML = \"\";\n\t\tCONFIG[category].forEach(function(item) {\n\t\t\tGUI.m_unitAMenu.innerHTML += \"<option value=\\\"\" + item[0] + \"\\\">\" + item[1] + \"</option>\";\n\t\t});\n\t\t\n\t\tthis.m_unitBMenu.innerHTML = \"\";\n\t\tCONFIG[category].forEach(function(item) {\n\t\t\tGUI.m_unitBMenu.innerHTML += \"<option value=\\\"\" + item[0] + \"\\\">\" + item[1] + \"</option>\";\n\t\t});\n\t}", "function displayLinks() {\n $('[data-type=gallery] .image').each(function(index, item) {\n const link = $('a', item.parentNode);\n if (!link.get(0)) return;\n\n item = $(item);\n item.addClass('clickable');\n item.data('href', link.attr('href'));\n item.on('click', goto_article);\n });\n\n function goto_article(event) {\n let el = event.currentTarget;\n window.location = $(el).data('href');\n }\n}", "function displayLinks() {\n var x = document.links;\n var links = \"\";\n var i;\n for (i = 0; i < x.length; i++) {\n links = links + x[i].href + \"<br>\";\n }\n document.getElementById(\"links\").innerHTML = links;\n}", "printLinks() {\n this.links.forEach((link) => console.log(link));\n }", "function displayGenresList() {\n const genresValues = Object.values(genresTypes)\n const genresKeys = Object.keys(genresTypes)\n let htmlContent = ``\n for (let i = 0; i < genresValues.length; i++) {\n htmlContent += `<a class=\"nav-item nav-link border\" href=\"#\" data-genresid=\"${genresKeys[i]}\">${genresValues[i]}</a>`\n }\n genresList.innerHTML = htmlContent\n }", "generateLink() {\n return `\n <a href='https://en.wikipedia.org/wiki/${encodeURI(this.options[0])}' property='rdf:seeAlso'>\n ${this.options[0]}\n </a>&nbsp;\n `;\n }", "function setupLinks() {\n\tfor(let i = 0; i < 11; i++) {\n\t\tif(i == 10) { \n\t\t\tlinks[i] = createA('/resilience-repository/about.html', proj_names[i]);\n\t\t}\n\t\telse {\n\t\t\tlinks[i] = createA('/resilience-repository/projects/proj'+i+'.html', proj_names[i]);\n\t\t}\n\t}\n}", "function display(data) {\n var pages = data.query.pages\n var link = \"https://en.wikipedia.org/?curid=\";\n for(object in pages) {\n var id = pages[object].pageid\n\n $(\".results\").append(`<a href=\"${link+id}\"><div class=\"item\"><h6>${pages[object].title}</h6><p class=\"extract\">${pages[object].extract}</p></div></a>`);\n\n }\n}", "function initialDisplay() {\n \tcountLinks();\n \tgetDropDowns();\n \tgetList(\"id\");\n }", "function openLinks() {\n\tdocument.getElementById('link_box').style.display = 'block';\n\tdocument.getElementById('upArrow').style.display = 'block';\n\tdocument.getElementById('downArrow').style.display = 'none';\n}", "function openlink(upperCase){\n clickAnchor(upperCase,getItem(\"link\"));\n}", "function displayLinks (startIndex, numLinks) {\n\n for (let index = 0; index < linksToDisplay.length; index += 1) {\n if ((index >= startIndex) && (index < startIndex + numLinks)) {\n linksToDisplay[index].style.display = \"\";\n } else {\n linksToDisplay[index].style.display = \"none\";\n }\n }\n\n}", "display(){\n this.htmlBuilder.build();\n this.displayCityName();\n this.displayTodayWeather();\n this.displayWeekWeather();\n this.displayTimeSlots();\n }", "function displayGenre() {\n let htmlContent = ''\n htmlContent += `<div class=\"list-group\" id=\"list-tab\" role=\"tablist\">`\n Object.keys(genre).forEach(index => {\n htmlContent += `\n <a class=\"list-group-item list-group-item-action\" id=\"list-genre-list\" data-toggle=\"list\"\n href=\"#list-genre\" role=\"tab\" aria-controls=\"genre\" data-index=\"${index}\">${genre[index]}</a>\n `\n })\n htmlContent += `</div>`\n genrePanel.innerHTML = htmlContent\n }", "function showLink(value){\n\t\t\tif(value == 'ok'){\n\t\t\t\tif(KCI.util.Config.getHybrid() == true){\n\t\t\t\t\tif(KCI.app.getApplication().getController('Hybrid').cordovaCheck() == true){\n\t\t\t\t\t\t//hybrid childbrowser function\n\t\t\t\t\t\tKCI.app.getApplication().getController('Hybrid').doShowLink(button.getUrl());\n\t\t\t\t\t\t\n\t\t\t\t\t\t//Google Analytics Tracking\n\t\t\t\t\t\tKCI.app.getApplication().getController('Hybrid').doTrackEvent('Link','View',button.getText());\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\tKCI.app.getApplication().getController('Main').doShowExternal(button.getUrl());\n\t\t\t\t\t\n\t\t\t\t\t//Google Analytics Tracking\n\t\t\t\t\tKCI.app.getApplication().getController('Main').doTrackEvent('Link','View',button.getText());\n\t\t\t\t}\t\t\t\t\n\t\t\t}\n\t\t}", "function unitListVisible() {\n setVisible(!visible);\n }", "function showUnitTestDetails(num, html_url, sparql_url)\n{\n var rdfaExtractorUrl = getRdfaExtractorUrl();\n var n3ExtractorUrl = \"http://www.w3.org/2007/08/pyRdfa/extract?format=n3&uri=\";\n\n document.getElementById('unit-test-details-' + num).innerHTML =\n \"Retreiving information...\";\n sendRequest('test-details?id=' + num +\n '&xhtml=' + html_url +\n '&sparql=' + sparql_url +\n '&rdfa-extractor=' + escape(rdfaExtractorUrl) +\n '&n3-extractor=' + escape(n3ExtractorUrl),\n displayUnitTestDetailsResult, num)\n}", "function makeLinksClickable () {\n // Bring the layer with arrows forward.\n var $links = getLinkLayer();\n $divViewControlLayer.append($links);\n\n if (properties.browser === 'mozilla') {\n // A bug in Firefox? The canvas in the div element with the largest z-index.\n $divViewControlLayer.append($canvas);\n } else if (properties.browser === 'msie') {\n $divViewControlLayer.insertBefore($divLabelDrawingLayer);\n }\n }", "function displayReferent(unit) {\n if (unit.referent == null) {\n return;\n }\n unitSentDiv = document.getElementById('sentDiv'+unit.id);\n \n refImg = document.createElement('img');\n refImg.setAttribute('class', 'ref' + unit.id);\n refImg.setAttribute('src', 'gif/ref_arrow.gif');\n refImg.setAttribute('style', 'vertical-align: middle; height: 1em; width: 2em; margin-left: 2em; display: inline;');\n refImg.setAttribute('title', 'press to remove reference');\n refImg.setAttribute('onclick', 'removeReference('+unit.id+'); toggleAddReferent(null);');\n \n refDiv = document.createElement('span');\n refDiv.setAttribute('class', 'refUnit '+active_display_class+' ref'+unit.id);\n refDiv.setAttribute('id', 'refDiv'+unit.id);\n refDiv.setAttribute('title', 'CONTEXT: '+ unit.referent.parent.toString());\n\n refDiv.innerHTML = unit.referent.toString();\n \n unitSentDiv.appendChild(refImg);\n unitSentDiv.appendChild(refDiv);\n\n $('#refDiv'+unit.id).click(function() {\n edit(unit.referent);\n jump(unit.referent.id);\n });\n\n}", "function addUnitToTable(unit) {\n\n rows.push({\n title : \"<a href='#view=unit&amp;id=\" + unit.id + \"'>\" + unit.name + \"</a>\",\n exportTitle : safe_export_replace(unit.name),\n css : 'unit main',\n unit : unit,\n type : UNIT\n });\n\n rows.push({\n title : t(\"Activities Average\"),\n exportTitle : t(\"Activities Average\"),\n css : 'unit average',\n unit : unit,\n type : UNIT_AVERAGE\n });\n\n rows.push({\n title : t(\"Activities Coverage\"),\n exportTitle : t(\"Activities Coverage\"),\n css : 'unit coverage',\n unit : unit,\n type : UNIT_COVERAGE\n });\n\n // Actividades de la unidad\n var activities = unit.activities;\n for ( var i in activities) {\n\n var activity = activities[i];\n\n rows.push({\n title : \"<a class='partial' href='#view=activity&amp;id=\" + activity.id + \"'>\" + activity.name\n + \"</a>\",\n exportTitle : safe_export_replace(activity.name) + \" (\" + safe_export_replace(activity.code) + \")\",\n activity : activity,\n css : \"activity \" + getActivityType(activity.code),\n type : ACTIVITY\n });\n }\n\n }", "function showLinks() {\n var imageEl = document.getElementById('image');\n var voiceEl = document.getElementById('voice');\n for (var i = 0; i < visibleLinks.length; ++i) {\n if(RegExp('jpg|jpeg|png|gif').test(visibleLinks[i])){\n imageEl.dataset.url = visibleLinks[i];\n imageEl.style.display = null;\n } else if(RegExp('wav|mp3').test(visibleLinks[i])) {\n voiceEl.dataset.url = visibleLinks[i];\n voiceEl.style.display = null;\n }\n }\n}", "function mostrarLinks(inicio, fin){\n\tvar s = '';\n\tfor(var i=inicio; i<=fin && link[i]!==undefined; i++){\n\t\tif(i==posActual) s+= '\\n<<--actual-->>\\n';//'<actual>\\n\\t';\n\t\ts += i + ':\\t' +\n\t\t\t(link[i] && typeof(link[i])=='object' ? link[i][0]+' ; '+link[i][1] : link[i]) +\n\t\t\t'\\n\\t' + imagen[i] + '\\n';\n\t\tif(i==posActual) s+= '<<--actual-->>\\n\\n';//'</actual>\\n';\n\t}\n\treturn s;\n}", "function displayLinks(id) {\n var linkslist = document.getElementById(id);\n while (linkslist.firstChild) {\n linkslist.removeChild(linkslist.firstChild);\n }\n player.links.forEach(function(elem, index){\n var listItem = document.createElement('li');\n var listArrow = document.createElement('li');\n var img = document.createElement('img');\n listArrow.className = 'game-links-list-arrow';\n img.src='icons/arrow.svg';\n listArrow.appendChild(img);\n listItem.appendChild(elem);\n if (index > 0){\n linkslist.appendChild(listArrow);\n }\n linkslist.appendChild(listItem);\n })\n}", "function makeAllLink(){\n if(isTVShow)\n var allButtons=makeaLink(IMG1337x,URLTv1337x,itemName,\"1337x\");\n else\n var allButtons=makeaLink(IMG1337x,URL1337x,itemName,\"1337x\");\n allButtons+=\"|\";\n allButtons+=makeaLink(IMGPirateBay, URLPirateBay,itemName,\"TPB\");\n allButtons+=\"|\";\n allButtons+=makeaLink(IMGTorrentz2,URLTorrentz2,itemName, \"Torrentz2\");\n return allButtons;\n }", "function showLinks(){\n\t$body.classList.remove('mcl-hide-links');\n\thidenLinks = false;\n}", "function eLink(db,nm) {\ndbs = new Array(\"http://us.battle.net/wow/en/search?q=\",\"http://www.wowhead.com/?search=\",\"http://db.mmo-champion.com/search/all/\",\"http://www.wowdb.com/search?search=\");\ndbTs = new Array(\"Armory\",\"Wowhead\",\"DB MMO-Champion\",\"WoWDB\");\ndbHs = new Array(\"&real; \",\"&omega; \",\"&delta; \",\"&piv; \");\nel = '<a href=\"'+ dbs[db]+nm + '\" target=\"_blank\" title=\"'+ dbTs[db] +'\">'+ dbHs[db] + '</a>';\nreturn el;\n}", "link() {\n\t\t// Call super link to link members of Top Level (Identified)\n\t\tsuper.link();\n\t\t\n this._members = this._sbolDocument.lookupURIs(this._members);\n }", "function display() {\n // Update the display of the target rate text boxes, if needed.\n for (var i = 0; i < build_targets.length; i++) {\n build_targets[i].getRate()\n }\n var totals = globalTotals\n\n window.location.hash = \"#\" + formatSettings()\n\n if (currentTab == \"graph_tab\") {\n renderGraph(totals, spec.ignore)\n }\n recipeTable.displaySolution(totals)\n if (showDebug) {\n renderDebug()\n }\n\n timesDisplayed = timesDisplayed.add(one)\n var dc = document.getElementById(\"display_count\")\n dc.textContent = timesDisplayed.toDecimal()\n}", "renderStat(stat) {\n return (\n <li key={stat.name} className=\"user-info__stat\">\n <Link to={stat.url}>\n <p className=\"user-info__stat-value\">\n {stat.value}\n </p>\n <p className=\"user-info__stat-name\">\n {stat.name}\n </p>\n </Link> \n </li> \n );\n }", "function showRoomURL(adminId) {\n var roomHashURL = '#' + adminId;\n var roomQueryStringURL = '?cam=' + adminId;\n const base_url = location.origin + '/demos/'\n\n var html = '<h2>Endereço único da sua sala: ';\n html += '<a href=\"' + roomQueryStringURL + '\" target=\"_blank\">' + roomQueryStringURL.replace(`?cam=`, ``) + '</a></h2>';\n\n // html += 'Hash URL: <a href=\"' + roomHashURL + '\" target=\"_blank\">' + roomHashURL + '</a>';\n // html += '<br>';\n html += '<input class=\"input is-expanded\" value=\"' + base_url + roomQueryStringURL + '\" type=\"text\"> <br>';\n\n var roomURLsDiv = document.getElementById('room-urls');\n roomURLsDiv.innerHTML = html;\n\n roomURLsDiv.style.display = 'block';\n}", "function linkHeadings() {\n \n var headings = getHeadings();\n \n headings.forEach(function (heading) {\n heading.element.innerHTML = '<a href=\"#' + heading.id + '\">' +\n heading.element.innerHTML + \"</a>\";\n });\n }", "render() {\n const { classes, renderings } = this.props;\n\n return (\n <React.Fragment>\n <Typography variant=\"h3\" className={classes.h3}>Other download options</Typography>\n <List>\n {renderings.map(rendering => (\n <RenderingDownloadLink rendering={rendering} key={rendering.id} />\n ))}\n </List>\n </React.Fragment>\n );\n }", "function drawLinks() {\r\n\r\n\t\t// Helper function for generating a single link (or a span tag if it's\r\n\t\t// the current page)\r\n\t\tvar appendItem = function(page_id, appendopts) {\r\n\t\t\tpage_id = page_id < 0 ? 0 : (page_id < np ? page_id : np); // Normalize\r\n\t\t\t// page\r\n\t\t\t// id to\r\n\t\t\t// sane\r\n\t\t\t// value\r\n\t\t\tappendopts = jQuery.extend({\r\n\t\t\t\ttext : page_id,\r\n\t\t\t\tclasses : \"\"\r\n\t\t\t}, appendopts || {});\r\n\r\n\t\t\tvar lnk;\r\n\r\n\t\t\tif (page_id == 0) {\r\n\t\t\t\tpage_id = 1; // 이전페이지가 0으로가는걸 막음. 위에서 페이지를 바꾸지 않은건 버튼을 생성하기\r\n\t\t\t\t// 위해.\r\n\t\t\t} else if (page_id == np + 1) {\r\n\t\t\t\tpage_id = np; // 다음페이지가 마지막을 초과하지 않게\r\n\t\t\t}\r\n\t\t\tif (page_id == current_page) {\r\n\t\t\t\tlnk = jQuery(\"<span class='current'>\" + (appendopts.text)\r\n\t\t\t\t\t\t+ \"</span>\"); // 현재페이지는 클릭없음\r\n\t\t\t} else {\r\n\t\t\t\tlnk = jQuery(\"<a>\" + (appendopts.text) + \"</a>\").attr(\r\n\t\t\t\t\t\t'onClick',\r\n\t\t\t\t\t\t'javascript:' + opts.user_function + '(' + page_id\r\n\t\t\t\t\t\t\t\t+ ');').attr('id', opts.obj_id + '_' + page_id);\r\n\t\t\t}\r\n\r\n\t\t\tif (appendopts.classes) {\r\n\t\t\t\tlnk.addClass(appendopts.classes);\r\n\t\t\t}\r\n\t\t\tpanel.append(lnk);\r\n\t\t};\r\n\r\n\t\tpanel.empty(); // 이전정보 비우고\r\n\t\tvar interval = getInterval(); // 시작과 끝지정\r\n\t\tvar np = numPages(); // 전체페이지개수\r\n\r\n\t\t// Generate \"First\"-Link\r\n\t\tif (opts.first_text && (opts.first_show_always)) {\r\n\t\t\tappendItem(1, {\r\n\t\t\t\ttext : opts.first_text,\r\n\t\t\t\tclasses : \"prev\"\r\n\t\t\t}); // 처음으로\r\n\t\t}\r\n\r\n\t\t// Generate \"Previous\"-Link\r\n\t\tif (opts.prev_text && (current_page > 0 || opts.prev_show_always)) {\r\n\t\t\tappendItem(current_page - 1, {\r\n\t\t\t\ttext : opts.prev_text,\r\n\t\t\t\tclasses : \"prev\"\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\t// Generate interval links\r\n\t\tfor ( var i = interval[0]; i <= interval[1]; i++) {\r\n\t\t\tappendItem(i);\r\n\t\t}\r\n\r\n\t\t// Generate \"Next\"-Link\r\n\t\tif (opts.next_text && (current_page < np - 1 || opts.next_show_always)) {\r\n\t\t\tappendItem(current_page + 1, {\r\n\t\t\t\ttext : opts.next_text,\r\n\t\t\t\tclasses : \"next\"\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\t// Generate \"last\"-Link\r\n\t\tif (opts.last_text && (opts.last_show_always)) {\r\n\t\t\tappendItem(np, {\r\n\t\t\t\ttext : opts.last_text,\r\n\t\t\t\tclasses : \"next\"\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t}", "function buildingLinks(){\r\n\t\t// Localiza la barra de enlaces superiores\r\n\t\tvar barra = find(\"//div[@id='ltop5']\", XPFirst);\r\n\r\n\t\t// Asocia el mapa del mercado con la imagen especifica creada\r\n\t\tbarra.innerHTML += '<img usemap=\"#mercado\" class=\"fl2\" src=\"data:image/gif;base64,' + imagenes[\"mercado\"] + '\" border=\"0\" title=\"' + T('MERCADO') + '\">';\r\n\r\n\t\t// Asocia el mapa de los edificios militares con la imagen creada a tal efecto\r\n\t\tbarra.innerHTML += '<img usemap=\"#militar\" class=\"fl2\" src=\"data:image/gif;base64,' + imagenes[\"militar\"] + '\" border=\"0\" title=\"' + T('CUARTEL') + '\">';\r\n\r\n\t\t// Mapa para el mercado\r\n\t\tbarra.innerHTML += '<map name=\"mercado\"><area shape=\"rect\" coords=\"0,0,70,50\" href=\"build.php?gid=17\" title=\"' + T('ENVIAR') + '\"><area shape=\"rect\" coords=\"0,50,35,100\" href=\"build.php?gid=17&t=1\" title=\"' + T('COMPRAR') + '\"><area shape=\"rect\" coords=\"35,50,70,100\" href=\"build.php?gid=17&t=2\" title=\"' + T('VENDER') + '\"></map>';\r\n\r\n\t\t// Mapa para los edificios militares\r\n\t\tbarra.innerHTML += '<map name=\"militar\"><area shape=\"rect\" coords=\"0,0,35,50\" href=\"build.php?gid=16\" title=\"' + T('PUNTO') + '\"><area shape=\"rect\" coords=\"35,0,70,50\" href=\"build.php?gid=19\" title=\"' + T('CUARTEL') + '\"><area shape=\"rect\" coords=\"0,50,35,100\" href=\"build.php?gid=20\" title=\"' + T('CORRAL') + '\"><area shape=\"rect\" coords=\"35,50,70,100\" href=\"build.php?gid=21\" title=\"' + T('TALLER') + '\"></map>';\r\n\r\n\t\t// Desplaza el menu del Plus a la izquierda para hacer hueco a las nuevas imagenes\r\n\t\tvar a = find(\"//a[contains(@href, 'plus.php')]\", XPFirst);\r\n\t\ta.style.marginLeft = '0px';\r\n\t\ta.style.position = 'absolute';\r\n\t\ta.style.left = '-250px';\r\n\t}", "function showAllTours(){\r\n\tresetTourParameters();\r\n var json = JSON.parse(getAllTours());\r\n var tourArray = json.tour;\r\n var htmlResult = \"\";\r\n htmlResult +=\"<div>\";\r\n for(var i in tourArray){\r\n var tour = tourArray[i];\r\n htmlResult += \"<a data-role=button data-theme='b' href=javascript:showTour('\" + tour.name + \"'); >\" + tour.name + \"</a>\";\r\n } \r\n htmlResult +=\"</div>\";\r\n updateHTML(\"maincontent\", htmlResult);\r\n}", "function displayRecipe(recipe){\n console.log(recipe);\n // creates a link to recipe found in recipeList\n recipeLink = createA(recipeList[recipe], 'recipe', '_blank');\n // recipeLink.center('horizontal');\n div.child(recipeLink);\n}", "function displayShows() {\n var results = arguments;\n\n //Iterates through arguments by 2 as two consecutive elements in the array\n //belong to one show (first is show information, second is cast information)\n for (var i = 0; i < results.length; i+=2) {\n var show = results[i][0];\n var cast = results[i+1][0];\n\n var castText = '';\n\n //Iterates through cast\n for (var j = 0; j < cast.length; j++) {\n castText += (cast[j].person.name + '; ');\n }\n\n var table = $('table');\n table.append('<tr>' +\n '<td>' + show.name + '</td>' +\n '<td><a href=\"' + show.url + '\">'+ show.url +'</a></td>' +\n '<td>' + show.summary + '</td>' +\n '<td>' + castText + '</td>' +\n '<td>' + randomizeShowClip(show.name) + '</td>' +\n '</tr>'\n );\n }\n}", "function formatLinks() {\n\t$('#allLink').attr( \"href\",\"javascript:loadSearchDetailsByGroup('grp')\");\n\t$('#abtLink').attr( \"href\",\"javascript:loadSearchDetailsByGroup('\"+category[0]+\"')\");\n\t$('#invLink').attr( \"href\",\"javascript:loadSearchDetailsByGroup('\"+category[1]+\"')\");\n\t$('#mediaLink').attr( \"href\",\"javascript:loadSearchDetailsByGroup('\"+category[2]+\"')\");\n\t$('#bankLink').attr( \"href\",\"javascript:loadSearchDetailsByGroup('\"+category[3]+\"')\");\n\t$('#susLink').attr( \"href\",\"javascript:loadSearchDetailsByGroup('\"+category[4]+\"')\");\n\t$('#careerLink').attr( \"href\",\"javascript:loadSearchDetailsByGroup('\"+category[5]+\"')\");\n}", "function showLinkLabel(e) {\n var label = e.subject.findObject(\"LABEL\");\n if (label !== null) label.visible = (e.subject.fromNode.data.figure === \"Diamond\");\n }", "setupSubLinks() {\n for (let subLink in this.subLinks) {\n this.subLinks[subLink].addEventListener(\"click\", (e) => {\n let linkID = e.target.id;\n if (linkID === \"\") {\n linkID = e.target.parentNode.id;\n }\n let subViewToShow = linkID.slice(0, -5);\n this.showSubView(subViewToShow);\n });\n }\n }", "function updateUnitFromURL()\n {\n // Default lesson is Unit 1.1\n var unitNo = 1\n var subunitNo = 1\n\n // Parse the fragment identifier in the URL and determine the\n // unit\n if (window.location.hash.length > 0) {\n var fragmentID = window.location.hash.slice(1)\n var tokens = fragmentID.split('.')\n unitNo = parseInt(tokens[0])\n if (tokens.length > 1)\n subunitNo = parseInt(tokens[1])\n }\n\n // Default to unit 1 if unit number could not be parsed\n // correctly from the URL\n if (isNaN(unitNo)) {\n unitNo = 1\n }\n\n // Default to subunit 1 if unit number could not be parsed\n // correctly from the URL\n if (isNaN(subunitNo)) {\n subunitNo = 1\n }\n\n setSubunit(unitNo, subunitNo)\n\n displayUnitLinks()\n displaySubunitLinks()\n displayAlternateUnitLinks()\n updateNavigationLinks()\n updateProgressTooltip()\n\n displayUnitTitle()\n displayGuide()\n\n resetSubunit()\n }", "function showRoomURL(roomid) {\n var roomHashURL = '#' + roomid;\n var roomQueryStringURL = '?roomid=' + roomid;\n var html = '';\n html += 'Hash URL: <a href=\"' + roomHashURL + '\" target=\"_blank\">' + roomHashURL + '</a>';\n html += '<br>';\n html += 'QueryString URL: <a href=\"' + roomQueryStringURL + '\" target=\"_blank\">' + roomQueryStringURL + '</a>';\n var roomURLsDiv = document.getElementById('room-urls');\n roomURLsDiv.innerHTML = html;\n roomURLsDiv.style.display = 'block';\n}", "function showLinks(visibleLinks) {\n console.log('popup:showLinks');\n var linksTable = document.getElementById('links');\n while (linksTable.children.length > 1) {\n linksTable.removeChild(linksTable.children[linksTable.children.length - 1])\n }\n for (var i = 0; i < visibleLinks.length; ++i) {\n var row = document.createElement('tr');\n var col0 = document.createElement('td');\n var col1 = document.createElement('td');\n col1.innerText = visibleLinks[i];\n col1.style.whiteSpace = 'nowrap';\n row.appendChild(col1);\n linksTable.appendChild(row);\n }\n}", "function quickLinks(){\r\n\t\tvar menu = find(\"//td[@class='menu']\", XPFirst);\r\n\t\tfor (var j = 0; j < 2; j++) for (var i = 0; i < menu.childNodes.length; i++) if (menu.childNodes[i].nodeName == 'BR') removeElement(menu.childNodes[i]);\r\n\t\tvar links = [\t0,\r\n\t\t\t\t[T('ENV_TROPAS'), \"a2b.php\"],\r\n\t\t\t\t[\"联盟概况\", \"allianz.php\"],\r\n\t\t\t\t[T('ALIANZA_ATTACK'), \"allianz.php?s=3\"],\r\n\t\t\t\t[T('SIM'), \"warsim.php\"],\r\n\t\t\t\t[\"行宫\", \"build.php?gid=25\"],\r\n\t\t\t\t[\"皇宫\", \"build.php?gid=26\"],\r\n\t\t\t\t[\"英雄园\", \"build.php?gid=37\"],\r\n//\t\t\t\t[\"市镇厅\", \"build.php?gid=24\"],\r\n\t\t\t\t[\"中心大楼\", \"build.php?gid=15\"],\r\n//\t\t\t\t[T('COMP'), \"http://trcomp.sourceforge.net/?lang=\" + idioma, \"_blank\"],\r\n//\t\t\t\t[T('CALC'), \"http://www.denibol.com/~victor/travian_calc/\", \"_blank\"],\r\n\t\t\t\t0,\r\n\t\t\t\t[T('DUNIUMAP'), \"http://tra.duniu.com/map/\", \"_blank\"],\r\n\t\t\t\t[T('MAPA'), \"http://travmap.shishnet.org/?lang=zh\", \"_blank\"],\r\n\t\t\t\t[T('LOGIN'), \"login.php\"],\r\n//\t\t\t\t[T('CHECKNEW'), \"http://userscripts.org/users/51651/scripts\", \"_blank\"],\r\n//\t\t\t\t['TB-CN &#37197;&#32622;', \"spieler.php?s=2\"],\r\n//\t\t\t\t['Travian Beyond', \"http://www.denibol.com/proyectos/travian_beyond/\", \"_blank\"]\r\n\t\t];\r\n\r\n\t\tfor(var i = 0; i < links.length; i++){\r\n\t\t\tif(links[i]){\r\n\t\t\t\tvar a = elem(\"A\", links[i][0]);\r\n\t\t\t\ta.href = links[i][1];\r\n\t\t\t\tif(links[i][2]) a.setAttribute('target', links[i][2]);\r\n\t\t\t\tmenu.appendChild(a);\r\n\t\t\t}else menu.appendChild(document.createElement('HR'));\r\n\t\t}\r\n\r\n\t\tGM_registerMenuCommand('Travian Beyond > '+T('CHECKNEW'), function(){ GM_openInTab(\"http://userscripts.org/users/51651/scripts\")});\r\n\t}", "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 }", "function initializePage() {\n\tDescartesScenes = new Array();\n\n\tvar navigationPanel = $(\"#\" + NavigationPanelName);\n\n\tfor(var unitIndex in DescartesUnits) {\n\t\tvar currentUnit = DescartesUnits[unitIndex];\n\t\tvar currentUnitIndexFile = currentUnit.Files[0];\n\t\tvar unitLink = createButton (DescartesScenes.length, unitIndex, currentUnit.Name);\n\n\t\tfor(var sceneIndex in currentUnit.Files) {\n\t\t\tDescartesScenes[DescartesScenes.length] = currentUnit.Files[sceneIndex];\n\t\t}\n\t\tnavigationPanel.append(unitLink);\n\t}\n\n\tContentFrameWidth = ContentFrameWidth == -1 ? \"100%\" : ContentFrameWidth;\n\t$(\"#\" + ContentFrameName).attr(\"width\", ContentFrameWidth);\n\n\tsetScene(0);\n}", "display() {\n\t\t\t\tthis.nurbsPlane.display();\n\t\t}", "link() {\n\t\t// Call super link to link members of Top Level (Identified)\n\t\tsuper.link();\n\n this._modules = this._sbolDocument.lookupURIs(this._modules);\n this._functionalComponents = this._sbolDocument.lookupURIs(this._functionalComponents);\n this._interactions = this._sbolDocument.lookupURIs(this._interactions);\n this._models = this._sbolDocument.lookupURIs(this._models);\n }", "function buildingLinks(){\n\t\t// Localiza la barra de enlaces superiores\n\t\tvar barra = find(\"//div[@class='div2']\",XPFirst);\n\n\t\t// Mapa para el mercado\n\t\tbarra.innerHTML = '<map name=\"mercado\"><area shape=\"rect\" coords=\"0,0,70,50\" href=\"build.php?gid=17\" title=\"' + T('ENVIAR') + '\"><area shape=\"rect\" coords=\"0,50,35,100\" href=\"build.php?gid=17&t=1\" title=\"' + T('COMPRAR') + '\"><area shape=\"rect\" coords=\"35,50,70,100\" href=\"build.php?gid=17&t=2\" title=\"' + T('VENDER') + '\"></map>' + barra.innerHTML;\n\n\t\t// Mapa para los edificios militares\n\t\tbarra.innerHTML = '<map name=\"militar\"><area shape=\"rect\" coords=\"0,0,35,50\" href=\"build.php?gid=16\" title=\"' + T('PUNTO') + '\"><area shape=\"rect\" coords=\"35,0,70,50\" href=\"build.php?gid=19\" title=\"' + T('CUARTEL') + '\"><area shape=\"rect\" coords=\"0,50,35,100\" href=\"build.php?gid=20\" title=\"' + T('CORRAL') + '\"><area shape=\"rect\" coords=\"35,50,70,100\" href=\"build.php?gid=21\" title=\"' + T('TALLER') + '\"></map>' + barra.innerHTML;\n\n\t\t// Asocia el mapa del mercado con la imagen especifica creada\n\t\tbarra.innerHTML += '<img usemap=\"#mercado\" class=\"fl2\" src=\"data:image/gif;base64,' + imagenes[\"mercado\"] + '\" border=\"0\" title=\"' + T('MERCADO') + '\">';\n\n\t\t// Asocia el mapa de los edificios militares con la imagen creada a tal efecto\n\t\tbarra.innerHTML += '<img usemap=\"#militar\" class=\"fl2\" src=\"data:image/gif;base64,' + imagenes[\"militar\"] + '\" border=\"0\" title=\"' + T('CUARTEL') + '\">';\n\n\t\t// Desplaza la barra superior ligeramente a la derecha para no tapar la hora del juego\n\t\tbarra.style.left = '173px';\n\n\t\t// Desplaza el menu del Plus a la izquierda para hacer hueco a las nuevas imagenes\n\t\tfind(\"//div[@class='plus']\", XPFirst).style.left = '50px';\n\t}", "function updateUsersLink ( ) {\n var t = nicks.length.toString() + \" user\";\n if (nicks.length != 1) t += \"s\";\n $(\"#usersLink\").text(t);\n}", "function goToUnitPage() {\n history.push(\"/selectunit\");\n }", "function displayTurkeys(turkeys) {\n $('ul').empty();\n turkeys.forEach(function(turkey) {\n $('ul').append(\"<li>Frame \" + turkey + \"</li>\");\n });\n }", "function displayToPage(url) {\n spanEl.innerHTML = `<a id=\"link\" href=\"${url}\" target=\"_blank\" class=\"generated-url-link\">${url}</a>`;\n // Get the anchor link after is generated\n let generatedLink = document.getElementById('link');\n // Style the link with random colors\n generatedLink.style.color = pickRandomColors(arrOfColors);\n}", "function do_links( link_snap, get_char, header ) {\r\n var link_letter_order = []\r\n\r\n\r\n for( var i = 0; i< link_snap.snapshotLength; i++ ) {\r\n var link = link_snap.snapshotItem(i)\r\n\r\n var char = get_char(link)\r\n\r\n if( ! char ) continue\r\n\r\n // if the char is different from the last char...\r\n if( link_letter_order.length == 0 || char != link_letter_order[link_letter_order.length-1] ) {\r\n link_letter_order.push( char )\r\n\r\n var s = $e('div')\r\n s.style.background = '#aaa'\r\n s.style.borderTop = 'solid #777 1px'\r\n\r\n s.style.padding = '3px'\r\n s.style.marginTop = '20px'\r\n s.style.marginBottom = '-7px'\r\n\r\n s.innerHTML = \" &middot; \"\r\n\r\n var a = mk_link(char)\r\n a.name = char\r\n\r\n var top = mk_link('^top')\r\n top.target = '_self'\r\n\r\n\r\n s.appendChild( a )\r\n s.appendChild( $t(' ') )\r\n s.appendChild( top )\r\n\r\n var br = $e('br')\r\n\r\n link.parentNode.insertBefore(br,link)\r\n link.parentNode.insertBefore(s,br)\r\n \r\n /* link.parentNode.insertBefore($e('hr'),s) */\r\n }\r\n }\r\n\r\n for( var j=0; j<link_letter_order.length; j++ ) {\r\n var char = link_letter_order[j]\r\n header.innerHTML += \" <a href='#\" + char + \"' target='_self' style='color:#999'>\" + char + \"</a>\"\r\n }\r\n}", "function showNavigator() {\n console.log('>> Wunderlist Navigator shortcut clicked');\n $(Config.LIST_SWITCHER).show();\n $(Config.LIST_INPUT).focus();\n var lists = [];\n $(Config.LIST_LINKS).each(function (index, element) {\n var list = {};\n var $this = $(this);\n list.href = $this.attr('href');\n list.title = $this.find('.title').text();\n lists.push(list);\n });\n allLists = lists;\n populateLists(lists);\n }", "displayWikiDetails() {\n $('#modalBody').html(\n `${this.cleanExtract}<br><a href=https://${this.wikiUrl} target=\"_blank\">Full Wikipedia Article</a>`\n );\n }", "link() {\n\t\t// Call super link to link members of Top Level (Identified)\n\t\tsuper.link();\n\t\t\n this._built = this._sbolDocument.lookupURI(this._built);\t\t\n }", "display() {\n this.supplies.forEach(supply => supply.display());\n }", "function printlink() {\n\t\t\t\tvar linkElem = $('#inspo');\n\t\t\t\tlinkElem.html(links[randomlink].text);\n\t\t\t}", "authors() {\n const authors = this.state.notice.AUTR;\n if (!authors || !Array.isArray(authors) || !authors.length) {\n return <div />;\n }\n const links = authors\n .map(a => a.trim())\n .map(a => (\n <a href={`/search/list?auteur=[\"${a}\"]`} key={a}>\n {a}\n </a>\n ))\n .reduce((p, c) => [p, \" ; \", c]);\n return <React.Fragment>{links}</React.Fragment>;\n }", "function displayRegionalTours(regionalTours, DOMElements) {\n for (let i = 0; i < regionalTours.length; i++) {\n const tour = regionalTours[i];\n const html = `\n <a href=\"doc.html?id=${tour.id}\">\n <div class=\"top_item_image\"><img src=\"${tour.image}\" alt=\"\"></div>\n <div class=\"top_item_content\">\n <div class=\"top_item_title\">${tour.name}</div>\n <div class=\"top_item_price\">${tour.price.toLocaleString()} đ</div>\n </div>\n </a>\n `;\n // update the DOM elements with the prepared HTLM text\n DOMElements[i].innerHTML = html;\n }\n }", "function showRoomURL(roomid) {\n var roomHashURL = '#' + roomid;\n var roomQueryStringURL = '?roomid=' + roomid;\n var html = '<h2>Unique URL for your room:</h2><br>';\n html += 'Hash URL: <a href=\"' + roomHashURL + '\" target=\"_blank\">' + roomHashURL + '</a>';\n html += '<br>';\n html += 'QueryString URL: <a href=\"' + roomQueryStringURL + '\" target=\"_blank\">' + roomQueryStringURL + '</a>';\n var roomURLsDiv = document.getElementById('room-urls');\n roomURLsDiv.innerHTML = html;\n roomURLsDiv.style.display = 'block';\n}", "get liAndLinkHTML(){\n return `<li><a href=\"#\" data-id=\"${this.id}\">${this.name}</a></li>`\n }", "function printLinks(links){\n var container = document.getElementById(links[0]);\n var index = 0;\n container.innerText = \">\\xa0\";\n setTimeout(printChar, typeSpeed, container, links[0], index, links, 0);\n \n}", "function renderText(data) {\n let ul = document.createElement(\"ul\");\n nav.appendChild(ul);\n for (let key in data){\n let li = document.createElement(\"li\");\n li.textContent = big(key);\n li.addEventListener('click', function (e) {\n window.location.hash = small(e.target.textContent);\n\n getBreedImg();\n getSubBreed();\n });\n ul.appendChild(li);\n }\n }", "function UpdateLinks(Cont) {\n var ObjContainer = (Cont != undefined) ? Cont : MainMenu;\n // Do some init here.\n $(ObjContainer).children(\"ul\").find(\"li\").click(function (event) {\n var elem = $(this).children('a');\n if ($(MainContainer).find(\".menu\").filter(\":visible\").length > 1) {\n //console.log($(\".menu\").filter(\":visible\").length);\n return;\n }\n // Check if it has a child so we know if we execute the link or the child.\n event.preventDefault();\n event.stopPropagation();\n\n if (elem.data().smoothscroll) {\n if (!elem.data('onepage-section') && window.smoothScrollGetAnchors) {\n window.smoothScrollGetAnchors();\n }\n Visible = false;\n Self.Show(Visible);\n elem.trigger('click.onepage');\n return;\n }\n\n if (elem.parent().has(\"ul\").length) {\n Self.GoToSubmenu(\"\", elem);\n event.preventDefault();\n event.stopPropagation();\n } else {\n if (elem.length > 0 && elem.attr('href')) {\n window.location = elem.attr('href');\n }\n $(MenuButton).children(\"span.caption\").children(\"p.xtd_menu_ellipsis\").html(elem.children(\"p\").html());\n if (Visible) {\n Self.Show(Visible = !Visible);\n }\n }\n }\n ).on('touchstart', function () {\n $(this).addClass('clicked');\n }).on('touchend', function () {\n $(this).removeClass('clicked');\n }).on('touchmove', function () {\n $(this).removeClass('clicked');\n });\n }", "function displaySongInfo() {\n songs.forEach(function(song) {\n $(\"#songs\").append(`<p>${song}</p>`);\n });\n images.forEach(function(image) {\n $(\"#images\").append(`<img src=\"${image}\">`);\n });\n artists.forEach(function(artist) {\n $(\"#artists\").append(`<p>${artist}</p>`);\n });\n lengths.forEach(function(length) {\n $(\"#lengths\").append(`<p>${length}</p>`);\n });\n links.forEach(function(link) {\n $(\"#links\").append(`<a href=${link}>Youtube Link</a>`);\n });\n}", "function nextSubunit()\n {\n var m = my.current.unitNo\n var n = my.current.subunitNo\n\n if (!currentSubunitIsTheLastSubunit()) {\n if (n == my.current.subunitTitles.length) {\n // If the user is at unit M.L where L is the last\n // subunit of unit M, then go to unit (M + 1).1.\n m++\n n = 1\n } else {\n // If the user is at unit M.N, then go to unit M.(N + 1).\n n++\n }\n }\n\n window.location.href = unitHref(m, n)\n }", "function renderMealResults(mealDetails) {\n $('#mealResults').html(\n `<a href=\"${mealDetails.strYoutube}\">\n <img src=\"${mealDetails.strMealThumb}\" alt=\"meal\" />\n <div class=\"card-content\">\n <h2>${mealDetails.strMeal}</h2>\n <p>${mealDetails.strInstructions}</p>\n </div>\n </a>`\n );\n}", "function showResults(json) {\n document.getElementById('results').innerHTML = `<a href=${json.html_url}>${\n json.html_url\n }</a>`;\n}", "function ampaeDisplayDataTop(val) {\n var r = '<a href=\"'+val.link+'\">'+val.value+'</a>';\n return r + '\\n';\n}", "function appendToLinks() {\n let snapTextElements = document.evaluate(\"//a[contains(translate(@href, 'HTTP', 'http'), 'http') and contains(@href, 'assetstore.unity')]\",\n document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);\n for (let i = snapTextElements.snapshotLength - 1; i >= 0; i--) {\n let elmLink = snapTextElements.snapshotItem(i);\n let latest = $(elmLink).attr('href').split('/').pop().trim();\n let data_id = Number.isInteger(latest) ? latest : latest.split('-').pop().trim();\n $(elmLink).wrap(`<span class=\"unitystore-holder\" data-id=\"${data_id}\"></span>`);\n $(elmLink).addClass('unitystore-link');\n }\n }", "function showOverview() {\n var links = [];\n $.each(noteSelf.paragraphs, function(index, paragraph) {\n if (paragraph.paragraphClient.getDependencies != undefined) {\n var dependencies = paragraph.paragraphClient.getDependencies();\n $.each(dependencies.inputTables, function(index, inputTable) {\n links.push({ source: inputTable, target: dependencies.name });\n });\n $.each(dependencies.outputTables, function(index, outputTable) {\n links.push({ source: dependencies.name, target: outputTable });\n });\n }\n });\n\n utils.showModalPopup('Overview', utils.generateDirectedGraph(links), $());\n }", "function showUrl(short, full){ \n shortenUrl.style.display = 'block'\n let originalAddress = document.querySelector('#address')\n let shortenAdresss = document.querySelector('#short')\n\n originalAddress.innerHTML = `${full}`\n shortenAdresss.innerHTML = `${short}`\n}", "function _openOnAllDisplays() {\n\t\tchrome.system.display.getInfo(function(displayInfo) {\n\t\t\tif (displayInfo.length === 1) {\n\t\t\t\t_open(null);\n\t\t\t} else {\n\t\t\t\tfor (let i = 0; i < displayInfo.length; i++) {\n\t\t\t\t\t_open(displayInfo[i]);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}", "function showURL(data) {\n if (data.success) {\n cardLinkElem.innerHTML = `<a class=\"twitter-url\" href=${data.cardURL} target=\"_blank\">${data.cardURL}</a>`;\n twitterLink(data.cardURL);\n } else {\n cardLinkElem.innerHTML = 'ERROR: ' + data.error;\n }\n}", "function NameAndLinks(props) {\n\t//console.log(props)\n return (\n \t<div >\n\t\t<h4 style={{position:\"absolute\",top:\"15px\",left:\"15px\",color:\"#38a7ba\",margin:0}}>{props.projectName}</h4>\n\t\t<div style={stylesForLinks}>\n\t\t <a style={{display:\"flex\",marginBottom:\"10px\"}} href={props.liveLink} target=\"blank\">\n\t\t <MdWebAsset style={{marginRight:\"10px\",height:\"1.5em\",width:\"1.5em\"}}/>Live page \n\n\t\t </a>\n\t\t <a style={{display:\"flex\",marginLeft:\"20px\"}} href={props.gitLink} target=\"blank\">\n\t\t <FaGithub style={{marginRight:\"10px\",height:\"1.5em\",width:\"1.5em\"}}/>Code \n\n\t\t </a>\n\n\t\t</div>\n\n\n </div>\n );\n}" ]
[ "0.7937359", "0.7711603", "0.64367145", "0.6167931", "0.614548", "0.61015666", "0.60523754", "0.5939187", "0.5838429", "0.5720863", "0.56588864", "0.55833983", "0.55783045", "0.5575401", "0.55705994", "0.5568032", "0.55376863", "0.55354947", "0.5526451", "0.5490971", "0.54887956", "0.54759604", "0.54733926", "0.5454163", "0.545412", "0.5452656", "0.544991", "0.5424047", "0.541289", "0.53985363", "0.53885454", "0.5382257", "0.5378309", "0.5355137", "0.5333044", "0.5329308", "0.5298835", "0.52968675", "0.529508", "0.5287017", "0.5284078", "0.52641785", "0.5259511", "0.5257078", "0.525658", "0.52484614", "0.52388096", "0.5193721", "0.51906586", "0.5189183", "0.5187812", "0.5182512", "0.51795024", "0.51615524", "0.51526266", "0.51493955", "0.5145247", "0.51394546", "0.5136904", "0.5131623", "0.5114768", "0.5109867", "0.5108365", "0.5105903", "0.51042295", "0.51023334", "0.51011807", "0.51008254", "0.5098815", "0.5090553", "0.5083052", "0.50773597", "0.50740963", "0.5073167", "0.5072866", "0.5069732", "0.5069605", "0.5067288", "0.5065626", "0.50619614", "0.50586855", "0.5055883", "0.5053733", "0.50428575", "0.50361437", "0.50329113", "0.50314325", "0.5030639", "0.502388", "0.50223213", "0.5020361", "0.50133014", "0.50086063", "0.50078803", "0.5006844", "0.50061315", "0.5002384", "0.50001895", "0.4993667", "0.49918824" ]
0.89430076
0
Create an HTML div element containing a label if the div element is specified as selected, and/or a hyperlink if the div element is specified as not selected. Arguments: label Label to be displayed inside the div element selected Whether the div element should be marked selected href Fragment identifier for the link to be created clickHandler Function to be invoked when the link is clicked Return: HTML div element with the label and/or link
function boxedLink(label, selected, href, clickHandler) { var divElement = document.createElement('div') if (selected) { var spanElement = document.createElement('span') Util.addChildren(spanElement, label) divElement.appendChild(spanElement) divElement.className = 'selected' } else { var anchorElement = document.createElement('a') anchorElement.href = href Util.addChildren(anchorElement, label) if (typeof clickHandler != 'undefined') { anchorElement.onclick = clickHandler } divElement.appendChild(anchorElement) } return divElement }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function formAnchorHtml(href, label) {\r\n\treturn \"<div class='linkContainer'>\" + label + \": <a href='\" + href + \"' target='_blank'>\" + href + \"</a></div>\";\r\n}", "function createLink(label,link){\n var newLink=$(\"<a>\", {\n title: label,\n href: link,\n class: \"toolbox_button\"\n }).append( label );\n return newLink;\n }", "function createBookNewsArea(){\n var myDiv = document.getElementById('arqsiWidgetBookNews_div'); \n\n var a = document.createElement(\"a\");\n var myNewsLabel = document.createTextNode(\"Novidades\");\n a.href = '#';\n a.onclick = afterNewsSelected;\n a.appendChild(myNewsLabel);\n myDiv.appendChild(a);\n\n}", "_onLabelClick(e) {\n if (this.disabled) return;\n if (e.target.nodeName === \"A\") {\n // If click on link within label, navigate\n return;\n }\n\n this.model = !this.model;\n this._emit(\"model-change\", {\n value: this.model,\n });\n // prevent click checkbox within <a></a> triggering navigation\n e.preventDefault();\n }", "function handleLinkClick(event) {\n\t\tvar linkLabel = event.currentTarget.id;\n\t\tvar url;\n\t\tswitch(linkLabel) {\n\t\t\tcase 'pivotal' :\n\t\t\t\turl = \"http://www.gopivotal.com/\";\n\t\t\t\twindow.open(url, '_blank');\n\t\t\t\tbreak;\n\t\t\tcase 'support' :\n\t\t\t\turl = \"https://support.gopivotal.com/hc/en-us\";\n\t\t\t\twindow.open(url, '_blank');\n\t\t\t\tbreak;\n\t\t\tcase 'feedback' :\n\t\t\t\turl = \"http://www.gopivotal.com/contact\";\n\t\t\t\twindow.open(url, '_blank');\n\t\t\t\tbreak;\n\t\t\tcase 'help' :\n\t\t\t\turl = \"../../static/docs/gpdb_only/index.html\";\n\t\t\t\twindow.open(url, '_blank');\n\t\t\t\tbreak;\n\t\t\tcase 'logout' :\n\t\t\t\tlogoutClick();\n\t\t\t\tbreak;\n\t\t}\n\t}", "function Label_CreateHTMLObject(theObject)\n{\n\t//create the label/link\n\tvar theHTML = document.createElement(\"div\");\n\t//simple add\n\ttheHTML = Basic_SetParent(theHTML, theObject);\n\t//set ourselves as directly the child container\n\ttheObject.HTMLParent = theHTML;\n\t//set its Basic Properties\n\tBasic_SetBasicProperties(theHTML, theObject);\n\t//never disable these\n\ttheHTML.disabled = false;\n\t//Updates the Cursor\n\tLabel_UpdateCursor(theHTML, theObject);\n\t//Update word break\n\tLabel_CheckMultiline(theHTML, theObject);\n\t//Update Caption\n\tBasic_UpdateCaption(theHTML, theObject);\n\t//Update Label Overflow\n\tLabel_UpdateOverFlow(theHTML, theObject);\n\t//update focus only\n\tLabel_UpdateOnFocusOnly(theHTML, theObject);\n\t//Update ShortCut\n\tLabel_UpdateShortCut(theHTML, theObject);\n\t//add a special post to correct the font\n\t__SIMULATOR.Interpreter.AddPostDisplayCmd(theObject.DataObject.Id, __INTERPRETER_CMD_RESET_FONT);\n\t//not TreeGrid Cell? nor a ultragrid\n\tif (!theObject.TreeGridCell && !theObject.UltraGrid)\n\t{\n\t\t//add events\n\t\tBrowser_AddEvent(theHTML, __BROWSER_EVENT_MOUSEDOWN, Browser_CancelBubbleAndMenu);\n\t\tBrowser_AddEvent(theHTML, __BROWSER_EVENT_CLICK, Label_MouseDown);\n\t\tBrowser_AddEvent(theHTML, __BROWSER_EVENT_DOUBLECLICK, Label_MouseDown);\n\t\tBrowser_AddEvent(theHTML, __BROWSER_EVENT_MOUSERIGHT, Label_MouseDown);\n\t\tBrowser_AddEvent(theHTML, __BROWSER_EVENT_SELECTSTART, Label_MouseDown);\n\t\tBrowser_AddEvent(theHTML, __BROWSER_EVENT_SCROLL, Simulator_OnScroll);\n\t\t//touch enabled?\n\t\tif (__BROWSER_IS_TOUCH_ENABLED)\n\t\t{\n\t\t\t//add double click listener\n\t\t\tBrowser_AddEvent(theHTML, __BROWSER_EVENT_MOUSEDOWN, Label_TouchDoubleClick);\n\t\t}\n\t\t//install the dragging listener\n\t\tDragging_InstallListener(theObject, theHTML);\n\t}\n\t//add states listener\n\tBasic_SetStatesListener(theHTML);\n\t//mouseover event is always processed\n\tBrowser_AddEvent(theHTML, __BROWSER_EVENT_MOUSEOVER, Label_MouseOver);\n\ttheHTML.State_OnFocus = Label_OnFocus;\n\ttheHTML.UpdateProperties = Label_UpdateProperties;\n\ttheHTML.GetDesignerName = Label_GetDesignerName;\n\t//return the newly created object\n\treturn theHTML;\n}", "function makeLink(parentElementLabel, childElementLabel) {\n\n return new joint.dia.Link({\n source: { id: parentElementLabel },\n target: { id: childElementLabel },\n attrs: { '.marker-target': { d: 'M 4 0 L 0 2 L 4 4 z' } },\n smooth: false\n });\n}", "function Item(label, handler, cssClass){\n this.label = label || \"\";\n this.elem = $(\"<li/>\").html(label);\n this.cssClass = cssClass;\n if(typeof cssClass !== 'undefined'){\n this.elem.addClass(cssClass);\n }\n\n if(typeof handler === 'function'){\n this.elem.click(handler);\n } else if(typeof handler === 'string') {\n this.elem.html(\"<a href=\" + handler + \" target='_blank'>\" + label + \"</a>\");\n }\n }", "function newPage(id,text){\n return $(\"<a id='\" + id + \"' href='#'>\" + text + \"</a>\").click(navigate);\n}//END newPage function", "function generateOnClick(onClickNewPage, onClickRoute) {\n if (onClickNewPage) {\n // Then we link to new page\n return () => window.location.href = onClickRoute;\n } else {\n // Link to div section\n return () => document.getElementById(onClickRoute).scrollIntoView();\n }\n}", "function makeLink(target, content) {\n // a local let\n\n let elemA = document.createElement(\"a\");\n\n // use the param \"target \" to go into the href\n elemA.href = target;\n //and the param \"content\" for what goes inside the tag\n elemA.innerText = content;\n\n // add an target Attribute for fun \n elemA.setAttribute(\"target\", \"_blank\");\n\n // a local divMain aswell \n let divMain = document.getElementsByTagName(\"div\");\n divMain[0].appendChild(elemA);\n}", "function Label(){\n this.createLabel =function(text,id){\n this.item=document.createElement('p');\n this.item.setAttribute(\"id\",id);\n var textLabel = document.createTextNode(text); \n this.item.appendChild(textLabel);\n \n },\n\n this.setText = function(text){\n this.item.innerHTML=text;\n\n }\n this.addtoDocument =function(){\n document.body.appendChild(this.item);\n }\n this.addtodiv=function(id){\n document.getElementById(id).appendChild(this.item);\n }\n}", "function anchorClicked(e) {\n e.preventDefault();\n const selectedBookEl = document.getElementById('selectedBook');\n if (!selectedBookEl) return;\n\n const self = this;\n const cell = self.parentElement;\n const row = cell.parentElement;\n const data = row.querySelectorAll('td');\n\n // Generate HTML details of selected book\n let bookData = `<ul class=\"book-details\">`;\n for (const field of data) {\n // console.log(field); // each <td>\n // https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement\n bookData += `<li><b>${field.dataset.value}</b>: ${field.innerText}</li>`;\n }\n bookData += `</ul>`;\n\n selectedBookEl.innerHTML = bookData; // render\n}", "function createMenuItem(label, link, subMenu) {\n\t\treturn $('<li>').append(\n\t\t\t$('<a>', {\n\t\t\t\ttext: label,\n\t\t\t\thref: link\n\t\t\t}),\n\t\t\t(typeof subMenu === 'undefined') ? null : subMenu\n\t\t);\n\t}", "function handleClick(el,e) {\n\tloadURL(el.attributes.target,el.text);\n}", "function createLabel(htmlFor, text){\n\tconst label = document.createElement(\"label\");\n\tlabel.htmlFor = htmlFor;\n\tconst b = document.createElement(\"b\");\n\tb.textContent = text;\n\tlabel.appendChild(b);\n\treturn label;\n}", "_onLabelClick(ev) {\n const $target = $(ev.currentTarget);\n this.trigger('revisionSelected', [0, $target.data('revision')]);\n }", "function goLabel(labelId) {\n return labelHome(labelId);\n}", "function addLinkToDiv(parentId, func, title, text, addBr)\n{\n var parentNode = $(parentId);\n if (parentNode)\n {\n if (!addBr)\n {\n if ($$(\"#\" + parentId + \" a\").length > 0) \n addTextToDiv(parentId, \" | \");\n }\n\n var link = document.createElement(\"a\");\n link.href = \"javascript:void(0)\";\n link.addEventListener(\"click\", func, true);\n link.setAttribute(\"title\", title);\n var linkContent = document.createTextNode(text);\n link.appendChild(linkContent);\n if (addBr)\n parentNode.insertBefore(document.createElement(\"br\"), null);\n parentNode.insertBefore(link, null);\n\n }\n else\n {\n throw(\"Attempt to add link to non-existant div $('\" + parentId + \"')\");\n }\n}", "function createContextMenuItem(label,onclick,divider) {\n\n\tif (onclick == \"\")\n\t\tvar menuHTML = '<div class=\"contextMenuDivInactive\" class=\"contextMenuInactive\">'+label+'</div>';\n\telse\n\t\tvar menuHTML = '<div class=\"contextMenuDiv\" onclick=\"'+onclick+'\" onmouseover=\"this.className=\\'contextMenuDivMouseOver\\';\" onmouseout=\"this.className=\\'contextMenuDiv\\';\">'+label+'</div>';\n\n\t// Add horizontal divider\n\tif (divider == 1) {\n\t\tmenuHTML += '<div class=\"contextMenuDivider\"></div>';\n\t\tglobalContextHeight = parseInt(globalContextHeight) + 12;\n\t}\n\n\t// Set height of the menu\n\tglobalContextHeight = parseInt(globalContextHeight) + 29;\n\t\t\n\treturn menuHTML;\n}", "function createLabel(label, id) {\n var elm_label = document.createElement('label');\n elm_label.className = '.label';\n elm_label.setAttribute('for', id);\n elm_label.innerHTML = label;\n return elm_label\n}", "clickLabel() {\n $(this.rootElement)\n .$('label')\n .click();\n }", "clickLabel() {\n $(this.rootElement)\n .$('label')\n .click();\n }", "function addOverlayDiv(label, selection) {\r\n\t\t\tcurrentZIndex++;\r\n\t\t\t// Div that will permanently shown but invisible\r\n\t\t\tvar div = document.createElement('div');\r\n\t\t\t// Div that contain border, title, etc only shown first time and upon hover\r\n\t\t\tvar anotherDiv = document.createElement('div');\r\n\t\t\tdiv = addStyle(div, selection, currentZIndex);\r\n\t\t\tanotherDiv = addStyle(anotherDiv, selection, currentZIndex, true);\r\n\t\t\t$(anotherDiv).append(label);\r\n\t\t\t$('body').append(div);\r\n\t\t\t$('body').append(anotherDiv);\r\n\t\t\tif (o.autoHide)\r\n\t\t\t\thideIt($(anotherDiv), o.timeoutDelay);\r\n\t\t\t$(div).hover(function() {\r\n\t\t\t\tif (!$(anotherDiv).is(\":visible\")) {\r\n\t\t\t\t\tshowIt($(anotherDiv), o.timeoutDelay);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}", "editLabel(id, event) {\n event.preventDefault();\n if (event.target.label.value !== \"\") {\n const link = this.props.node.ports.bottom.links[id];\n link.addLabel(event.target.label.value);\n this.props.node.display = false;\n this.props.node.selectedLinkId = null;\n this.props.node.app.forceUpdate();\n }\n }", "function showLinkLabel(e) {\n var label = e.subject.findObject('LABEL');\n if (label !== null) {\n label.visible = (e.subject.fromNode.data.category === 'Conditional');\n }\n }", "function build_link_base (label,url) {\n var ext_link = $('<a></a>');\n ext_link.html(label);\n if (url) {\n ext_link.attr('href', url);\n }\n return ext_link;\n}", "function selected2link() {\n if (!toolbar.data(\"sourceOpened\")) {\n var selectedTag = getSelectedNode(); // the selected node\n var thisHrefLink = \"http://\"; // default the input value of the link-form-field\n\n // display the link-form-field\n linkAreaSwitch(true);\n\n if (selectedTag) {\n\n var thisTagName = selectedTag.prop('tagName').toLowerCase();\n\n // if tag name of the selected node is \"a\" and the selected node have \"href\" attribute\n if (thisTagName == \"a\" && selectedTag.is('[href]')) {\n thisHrefLink = selectedTag.attr('href');\n\n selectedTag.attr(setdatalink, \"\");\n }\n // if it don't have \"a\" tag name\n else\n replaceSelection(\"a\", setdatalink, \"\");\n\n }\n else\n linkinput.val(thisHrefLink).focus();\n\n // the method of displaying-hiding to link-types\n linktypeselect.click(function (e) {\n if ($(e.target).hasClass(vars.css + \"_linktypetext\") || $(e.target).hasClass(vars.css + \"_linktypearrow\"))\n linktypeSwitch(true);\n });\n\n // the method of selecting to link-types\n linktypes.find(\"a\").click(function () {\n var thisLinkType = $(this).attr(vars.css + \"-linktype\");\n\n linktypes.data(\"linktype\", thisLinkType)\n\n linktypeview.find(\".\" + vars.css + \"_linktypetext\").html(linktypes.find('a:eq(' + linktypes.data(\"linktype\") + ')').text());\n\n linkInputSet(thisHrefLink);\n\n linktypeSwitch();\n });\n\n linkInputSet(thisHrefLink);\n\n // the method of link-input\n linkinput\n // auto focus\n .focus()\n // update to value\n .val(thisHrefLink)\n // the event of key to enter in link-input\n .bind(\"keypress keyup\", function (e) {\n if (e.keyCode == 13) {\n linkRecord(jQTE.find(\"[\" + setdatalink + \"]\"));\n return false;\n }\n });\n\n // the event of click link-button\n linkbutton.click(function () {\n linkRecord(jQTE.find(\"[\" + setdatalink + \"]\"));\n });\n }\n else\n // hide the link-form-field\n linkAreaSwitch(false);\n }", "_setLabel(label, labelTextContainer, dropDownLabelContainer) {\n const potentialHTMLTemplate = label ? document.getElementById(label) : null;\n\n if (potentialHTMLTemplate !== null && potentialHTMLTemplate.tagName.toLowerCase() === 'template') {\n // label is the id of an HTML template\n const templateContent = document.importNode(potentialHTMLTemplate.content, true);\n\n labelTextContainer.appendChild(templateContent);\n\n if (dropDownLabelContainer) {\n const templateContent = document.importNode(potentialHTMLTemplate.content, true);\n\n dropDownLabelContainer.appendChild(templateContent);\n }\n }\n else {\n // label is string\n if (label === '') {\n label = '&nbsp;';\n }\n\n labelTextContainer.innerHTML = label;\n\n if (dropDownLabelContainer) {\n dropDownLabelContainer.innerHTML = label;\n }\n }\n }", "function toggleLabelSelection(event) {\n var labelFor = event.target.htmlFor;\n var labelInput = document.getElementById(labelFor);\n if (!labelInput.checked) {\n selectedTags.push(labelFor);\n } else {\n selectedTags = selectedTags.filter(tag => tag !== labelFor);\n }\n showRecipes(); //this gives template for recipe selection\n}", "function renderBookmark(id, url, text) {\n return $('<li>').attr('id', id).append(\n $('<button>').addClass('delete').html('&times;')\n ).append(\n $('<span>').append(\n $('<button>').addClass('checkbox').html('&#x2713;')\n ).append(\n $('<span>').addClass('text').text(text)\n )\n )\n .addClass(url ? 'url=' + url : '');\n }", "function buildBookmarkElement(bookmark) {\n var labelElement = document.createElement(\"label\");\n labelElement.setAttribute(\"class\", \"bookmarkContainer\");\n\n var inputElement = document.createElement(\"input\");\n inputElement.setAttribute(\"type\", \"radio\");\n inputElement.setAttribute(\"name\", \"bookmark\");\n inputElement.setAttribute(\"id\", bookmark.name);\n inputElement.setAttribute(\"onclick\", \"onBookmarkClicked(this);\");\n labelElement.appendChild(inputElement);\n\n var spanElement = document.createElement(\"span\");\n spanElement.setAttribute(\"class\", \"bookmarkCheckmark\");\n labelElement.appendChild(spanElement);\n\n var secondSpanElement = document.createElement(\"span\");\n secondSpanElement.setAttribute(\"class\", \"radioTitle\");\n var radioTitleElement = document.createTextNode(bookmark.displayName);\n secondSpanElement.appendChild(radioTitleElement);\n labelElement.appendChild(secondSpanElement);\n\n return labelElement;\n}", "async clickLabel() {\n await $(this.rootElement)\n .$('label')\n .click();\n }", "function onClick(link){\n \n}", "function addLink(linkObj) { \r\n var myDiv = document.getElementById(\"list\"); \r\n // creating checkbox element \r\n var checkbox = document.createElement('input'); \r\n checkbox.type = \"checkbox\"; \r\n checkbox.name = \"name\"; \r\n checkbox.value = \"value\"; \r\n checkbox.id = count_links; \r\n // creating label for checkbox \r\n var label = document.createElement('label'); \r\n // assigning attributes for the created label tag \r\n label.htmlFor = \"id\"; \r\n\t// appending the created text to the created label tag \r\n\tvar lb = linkObj.lnk + \" -> \" + linkObj.desc;\r\n label.appendChild(document.createTextNode(lb)); \r\n //appending the checkbox and label to div \r\n myDiv.appendChild(checkbox); \r\n myDiv.appendChild(label); \r\n document.getElementById('list').innerHTML += \"<br>\";\r\n\tcount_links = count_links + 1;\r\n\tdocument.getElementById('links').innerHTML = '';\r\n\tdocument.getElementById('links_desc').innerHTML = '';\r\n\tcreateJASON(summary,codeURL,instrURL,libsURLs);\r\n}", "url(href=null, text=null, classes=null, id=null) {\n let $l = $(`<a></a>`);\n if (href) {\n $l.attr(\"href\", href);\n } else {\n $l.attr(\"href\", \"javascript:void(0)\");\n }\n if (text) {\n $l.text(text);\n } else if (href) {\n $l.text(href);\n } else {\n $l.val(\"undefined\");\n }\n if (Util.IsArray(classes)) {\n for (let c of classes) {\n $l.addClass(c);\n }\n } else if (classes) {\n $l.addClass(classes);\n }\n if (id) {\n $l.attr(\"id\", id);\n }\n return $l;\n }", "function _labelClick(e) {\r\n\tif( !e && event ) e = event;\r\n\tvar menuItem = Utils.getObjForId(this);\t// this.view ;\r\n\tif( !menuItem || !menuItem.isSelectable() || !menuItem.isEnabled() ) return;\r\n\r\n\r\n\tif( menuItem.fSelectListener )\r\n\t menuItem.fSelectListener.onItemSelect(menuItem, menuItem.fSelectListener);\r\n\tvar action = menuItem.fActionHandler;\r\n\tvar actionID = menuItem.fActionID;\r\n\tif( action && action.doAction ) {\r\n\t action.doAction(menuItem, actionID);\r\n\t}\r\n\tif( e.preventDefault )\r\n\t e.preventDefault();\r\n\treturn false;\r\n }", "function generate_external_link (label,id_class,ext_class) {\n var classes = external_link_class+\" \"+id_class;\n if (ext_class) {\n classes += ' egb_link';\n }\n var ext_link = build_link_base(label);\n ext_link.addClass(classes);\n return ext_link[0].outerHTML;\n}", "function createOptionLabel(Text,URL){\n if ( URL && !isAllWhite(URL) )\n return ( Text + \" (\" + URL + \")\" );\n else\n return Text ;\n}", "function createEdge(edge_label) {\n\t\tsaveFAState();\n\t\tvar edge = executeAddEdge(g, first, selected, edge_label);\n\t\t$(edge._label.element).click(labelClickHandler);\n\t\t// This new edge does need its edge label click handler to be set individually.\n\t\tupdateAlphabet();\n\t\tcheckEdge(edge);\n\t}", "function createLink(url,text){\r\n\treturn \"<a href=\\\"\"+url+\"\\\"\"+Target+\">\"+text+\"</a>\";\r\n}", "function linkOnClick(e) {\r\n\tvar obj = targetElement(e);\r\n\tif (isNS6) {\r\n\t\tobj = obj.parentNode;\r\n\t}\r\n\tvar id = obj.id;\r\n\tvar idarray = new Array();\r\n\tidarray = id.split(\"_\");\r\n\tcallFunction(idarray);\r\n}", "function mkOption(option,callback){\n var link = $(\"<a style='cursor: pointer'>\"+option+'</a>');\n var opt = $(\"<li></li>\").append(link);\n link[0].onclick = _.partial(callback, option);\n return opt;\n }", "function createLink(el) {\n if (el.tagName.toLowerCase() === 'A') return;\n\n const url = $('h2 a', el.parentNode).first().attr('href');\n $(el.parentNode).append(`<a href=\"${url}\" class=\"${el.className}\">`);\n\n // Remove linked Children\n $('a', el).each((index, item) => {\n const text = $(item).html();\n $(item).after(text);\n item.remove();\n });\n\n // Create Link Element\n let link = $('a.content', el.parentNode);\n link.html($(el).html());\n $(el).remove();\n }", "function makeLabelsClickable() {\n let labels = document.querySelectorAll('.form-inline label');\n labels.forEach((label) => {\n let node = label.previousSibling;\n\n if (node !== null && node.matches('[type=\"checkbox\"]')) {\n if (node.getAttribute('id') === null) {\n node.setAttribute('id', node.value);\n label.setAttribute('for', node.value);\n }\n }\n });\n }", "function createMarkerClickHandler(marker, text, link) {\n return function() {\n marker.openInfoWindowHtml(\n '<b>' + text.tx_centro + '</b>' +\n '<p>Codigo: '+text.co_centro+'</p>'+ \n '<p>Municipio: '+text.tx_municipio+'</p>'+\n '<p>Parroquia: '+text.tx_parroquia+'</p>'+\n '<p>Cant. Mesas: '+text.cn_mesa+'</p>'+\n '<p>Cant. Votantes: '+text.nu_cant_votante+'</p>'+\n '<p>Cant. Patrulleros: '+text.cant_patrullero+'</p>'+\n '<p>Cant. Contactados: '+text.cant_contactado+'</p>'+\n '<p>Cant. PSUV: '+text.cant_psuv+'</p>'\n \n );\n return false;\n };\n}", "async function linkUserToCustomLabel(UserID, labelName) { // eslint-disable-line no-unused-vars\n\tconst ourLabels = await postback.listAllLabels(); // get all labels we have\n\tconst theOneLabel = await ourLabels.data.find(x => x.name === labelName); // find the one label with the name same (we need the id)\n\n\tif (theOneLabel) { // if we already have that label, all we have to do is associate the user to the id\n\t\treturn postback.associatesLabelToUser(UserID, theOneLabel.id);\n\t}\n\t// no theOneLabel exists so we have to create it\n\tconst newLabel = await postback.createNewLabel(labelName);\n\tif (!newLabel.error) { // no errors, so we can add the user to the label\n\t\treturn postback.associatesLabelToUser(UserID, newLabel.id);\n\t}\n\treturn newLabel;\n}", "function addControlLink ( text, url, linkClass ) {\n\n if ( ! linkContainer ) {\n \n console.error( 'domui.addControlLink() error: link container not created.');\n\n return;\n\n }\n\n if ( ! text || ! url ) {\n\n console.error( 'domui.addControlLink() error: no text or link supplied.');\n\n return;\n\n }\n\n var link = document.createElement( 'a' );\n\n link.innerHTML = text;\n\n link.href = url;\n\n link.className = linkClass || '';\n\n linkContainer.appendChild( link );\n\n return link;\n\n }", "function new_check_link (e, url) {\r\n var a = document.createElement('a');\r\n a.title = url || e.href;\r\n a.href= 'javascript:;';\r\n a.style.fontWeight = \"bold\";\r\n a.style.fontSize = \"small\";\r\n a.style.textDecoration = \"none\";\r\n a.appendChild(document.createTextNode('[C]'));\r\n a.addEventListener(\"click\", click, true);\r\n e.parentNode.insertBefore(a, e.nextSibling);\r\n}", "function TagMenu_initializeUI(newLinkStr) {\r\n var tagNames = new Array()\r\n var tagValues = new Array();\r\n \r\n var dom = dw.getDocumentDOM();\r\n\r\n // get the current selection\r\n var selNode, offsets;\r\n selNode = this.getSelectedTag();\r\n if (selNode) { //if selection is inside a tag, select the entire tag\r\n offsets = dw.nodeToOffsets(selNode);\r\n dw.setSelection(offsets[0],offsets[1]);\r\n }\r\n \r\n if (this.tagList.length == 1 && this.tagList[0] == \"A\") {\r\n\r\n // if no tag selection, ensure the selection is linkable\r\n if (!selNode) {\r\n selStr = dwscripts.trim(dwscripts.fixUpSelection(dom,false,true));\r\n if (selStr && !stringCanBeLink(selStr)) {\r\n offsets = dom.getSelection();\r\n dw.setSelection(offsets[1],offsets[1]); //move the insertion point after the selection\r\n selStr = \"\";\r\n }\r\n }\r\n\r\n // add a new link or a selection as the first item in the list\r\n if (selNode || !selStr) { //if sel is link, or no valid selection\r\n\r\n newLinkStr = (newLinkStr != null) ? newLinkStr : \"New Link\";\r\n\r\n //add generic new link item to menu\r\n tagNames.push(dwscripts.sprintf(MM.LABEL_CreateNewLink,newLinkStr));\r\n\t\t \r\n newLinkStr = dwscripts.entityNameDecode(newLinkStr);\r\n\t tagValues.push(\"createAtSelection+\"+newLinkStr);\r\n\r\n } else { //else selection could be converted to link, so add it\r\n var displayString = dwscripts.trim(selStr);\r\n displayString = displayString.replace(/\\s+/,\" \"); //replace all newlines and whitespace with a single space\r\n displayString = dwscripts.entityNameDecode(displayString);\r\n tagNames.push(MM.LABEL_SelectionLink+' \"' + displayString + '\"');\r\n tagValues.push(\"createAtSelection+\"+selStr);\r\n\r\n }\r\n }\r\n\r\n // add all other tags to menu\r\n var nodes = this.getTagElements();\r\n for (var i=0; i < nodes.length; i++) {\r\n\r\n tagNames.push(this.getNiceName(nodes[i], i));\r\n tagValues.push(nodes[i]);\r\n\r\n }\r\n \r\n // set the list control\r\n this.listControl = new ListControl(this.paramName); \r\n this.listControl.setAll(tagNames, tagValues);\r\n\r\n // if link currently selected, pick it in the list\r\n if (selNode) {\r\n this.pickValue(selNode);\r\n }\r\n}", "function createLabelElement(label) {\r\n var labelElement = document.createElement('span');\r\n\r\n $(labelElement).addClass('image-viewer-label');\r\n $(labelElement).html(label.text);\r\n $(labelElement).css({\r\n top: label.top + 'px',\r\n left: label.left + 'px'\r\n });\r\n\r\n $(presenter.$view).append(labelElement);\r\n\r\n return labelElement;\r\n }", "function addLabelBoxClickHandler(){\r\n \r\n var box = $('iframe#canvas_frame', parent.document).contents().find('div.zw').find('div.nL.J-J5-Ji');\r\n if(box.is('*')) \r\n GM_log ('Label boxes found');\r\n else \r\n GM_log('Label boxes not found');\r\n \r\n box.click(function(event){clickLabel($(this).next().children().attr(\"title\"));});\r\n \r\n }", "function createDiv(className, htmltext, attrib ='') {\n var tag = document.createElement('div');\n tag.setAttribute('class', className);\n if (htmltext != '') {\n tag.innerHTML = htmltext;\n }\n if (attrib != '') {\n tag.setAttribute('onclick', attrib);\n }\n return tag;\n}", "function LinkWidget(text,value) {\n\tClickWidget.apply(this,[A({href:'javascript:undefined'},text),value]);\n}", "function makeLinkRet(target, content) {\n // a local let\n\n let elemA = document.createElement(\"a\");\n\n // use the param \"target \" to go into the href\n elemA.href = target;\n //and the param \"content\" for what goes inside the tag\n elemA.innerText = content;\n\n // add an target Attribute for fun \n elemA.setAttribute(\"target\", \"_blank\");\n\n\n\n return elemA;\n}", "function createLiElementAndFillWithText (inText) {\n\n if(inText !== '' && inText !== undefined){\n\n var liEl = window.document.createElement('li');\n liEl.id = inText.toLowerCase() + '-li';\n liEl.className = 'suggestion';\n\n liEl.innerHTML = '<a href=\"#\" class=\"suggestion-link\" id=\"' + inText.toLowerCase() + '\">' + inText + '</a>';\n\n // add event on clisk to the a element\n var aElem = liEl.getElementsByTagName('a')[0];\n aElem.addEventListener(\"click\", insertSelectedSuggestionInTheInputElement, false);\n\n return liEl;\n }else{\n\n return false;\n }\n }", "function create_html_button(htmls_id , opt_id , on_click_fn){\n\n htmls_id = document.getElementById(htmls_id);\n tmp_div = document.createElement('button');\n tmp_div.setAttribute(\"type\", \"button\");\n tmp_div.setAttribute(\"id\", opt_id);\n tmp_div.setAttribute(\"name\", opt_id);\n tmp_div.setAttribute(\"class\", opt_id);\n tmp_div.setAttribute(\"onClick\", on_click_fn);\n\n //tmp_div.innerHTML = text;\n htmls_id.appendChild(tmp_div);\n}", "function newDiagramLink(text, href) {\n const element = document.createElement('a');\n element.className = 'diagram';\n element.textContent = text;\n element.href = href;\n return element;\n}", "function labelElement(id){\n\n var ul = document.createElement('UL');\n var ulIdName = 'labelUl'+String(id);\n ul.setAttribute('id',ulIdName);\n ul.setAttribute('class','labelElement');\n\n var li1 = document.createElement('LI');\n var li2 = document.createElement('LI');\n var li3 = document.createElement('LI');\n\n var textNode1 = document.createTextNode('up');\n li1.appendChild(textNode1);\n li1.setAttribute('class',id);\n\n var textNode2 = document.createTextNode('down');\n li2.appendChild(textNode2);\n li2.setAttribute('class',id);\n\n var textNode3 = document.createTextNode('remove');\n li3.appendChild(textNode3);\n li3.setAttribute('class',id);\n li3.setAttribute('onClick','deleteElm('+id+')');\n\n document.getElementById('dynamicForm').appendChild(ul);\n\n document.getElementById(ulIdName).appendChild(li1);\n document.getElementById(ulIdName).appendChild(li2);\n document.getElementById(ulIdName).appendChild(li3);\n}", "function createLink(name, text) {\n let className = `link-${name}`;\n \n const link = document.createElement('div');\n link.classList.add(className);\n link.textContent = text;\n link.addEventListener('click', () => {\n console.log(`clicked link: ${name}`);\n let el;\n if(name === \"About-Me\") {\n el = document.querySelector('.about-me-container');\n } else if(name === \"Projects\") {\n el = document.querySelector('.projects-container');\n } else if(name === 'Contact') {\n el = document.querySelector('.contact-container');\n }\n\n if(el != undefined) {\n el.scrollIntoView({behavior: \"smooth\"});\n }\n });\n \n return link;\n }", "function onClickEventHandler(event){\n \n var target = event.target;\n if(target && target.getAttribute(\"cricket\", \"1\")) {\n \n var url = target.getAttribute(\"value\");\n if(url) {\n loadLink(event, url, false);\n }\n }\n}", "_setLabel(label, labelElement, item, labelSet) {\n const potentialHTMLTemplate = document.getElementById(label);\n\n if (potentialHTMLTemplate !== null && potentialHTMLTemplate.tagName.toLowerCase() === 'template') {\n // label is the id of an HTML template\n const templateContent = document.importNode(potentialHTMLTemplate.content, true);\n\n if (item instanceof JQX.MenuItem) {\n labelElement.appendChild(templateContent);\n\n if (labelSet) {\n item.setAttribute('template-applied', '');\n item.templateApplied = true;\n }\n }\n else if (JQX.ListMenu && this instanceof JQX.ListMenu) {\n const regex = new RegExp(/{{title=\"(.*)\"}}/);\n\n for (let i = 0; i < templateContent.childNodes.length; i++) {\n if (regex.test(templateContent.childNodes[i].innerHTML)) {\n item.titleLabel = regex.exec(templateContent.childNodes[i].innerHTML)[1];\n templateContent.childNodes[i].innerHTML = templateContent.childNodes[i].innerHTML.replace(regex, '');\n }\n else if (regex.test(templateContent.childNodes[i].textContent)) {\n item.titleLabel = regex.exec(templateContent.childNodes[i].textContent)[1];\n templateContent.childNodes[i].textContent = templateContent.childNodes[i].textContent.replace(regex, '');\n }\n }\n\n if (item.titleLabel === undefined) {\n item.titleLabel = templateContent.textContent;\n }\n\n labelElement.appendChild(templateContent);\n }\n else {\n labelElement.innerHTML = label;\n item.titleLabel = label;\n }\n }\n else {\n labelElement.innerHTML = label;\n\n if (item instanceof JQX.MenuItemsGroup) {\n item.titleLabel = label;\n }\n }\n }", "@method createNavigationLinkHTML(contents, path) {\n if (typeof contents != \"string\") {\n // Retrieve the HTML for the element.\n var tempDiv = I3.ui.create(\"div\");\n tempDiv.appendChild(contents);\n contents = tempDiv.innerHTML;\n }\n var eventParams = I3.browser.isIE() ? \"\" : \"event\";\n return '<a href=\"#' + path +\n '\" onclick=\"return I3.ui.onNavigationClick(' + eventParams +\n ');\">' + contents + '</a>';\n }", "function constructUrl(element) {\n\tvar text = element.childNodes[1].value;\n\tvar url = element.childNodes[3].value;\n\tif (text == \"\" || url == \"\") {\n\t\treturn;\n\t}\n\tvar result = document.createElement(\"p\");\n\tresult.setAttribute(\"name\", url);\n\tif (element.childNodes[5].checked) {\n\t\tresult.setAttribute(\"name\", url + \"_blank\");\n\t}\n\tresult.setAttribute(\"class\", \"replaceToA\");\n\tresult.setAttribute(\"onclick\", \"editorFunction(this)\");\n\tresult.innerHTML = text;\n\telement.parentNode.replaceChild(result, element);\n\t$('#new-a').removeClass(\"active\");\n}", "function insertSelectTasksByTag(divId)\n{\n if (prefs.getPref(\"SHOW_SELECT_NO_TAG_LINK\"))\n addLinkToDiv(divId, selectTasksWithNoTag, \"Select All Tasks With No Tag\", \"No Tag\");\n if (prefs.getPref(\"SHOW_SELECT_TAG_LINK\"))\n addLinkToDiv(divId, promptSelectTasksWithTag, \"Select All Tasks With Tag...\", \"Tag...\");\n if (prefs.getPref(\"SHOW_SELECT_TAG_CONTAINING_LINK\"))\n addLinkToDiv(divId, promptSelectTasksWithTagMatching, \"Select All Tasks With Tag Containing...\", \"Tag Containing...\");\n}", "function setLibraryHTML(libraryUrlPattern, isbn, title, linktext, color) {\r\n\tvar splLinkyDiv = document.getElementById('splLinkyLibraryHTML');\r\n\tif (splLinkyDiv == null) { return; }\r\n\r\n\tvar link = document.createElement('a');\r\n\tlink.setAttribute('title', title );\r\n\tlink.setAttribute('href', libraryUrlPattern+isbn);\r\n\tlink.setAttribute('target', \"_blank\");\r\n\tlink.style.color = color;\r\n\r\n\tvar label = document.createTextNode( linktext );\r\n\tlink.appendChild(label);\r\n\r\n\t//append to existing content\r\n\tsplLinkyDiv.appendChild(link);\r\n\tsplLinkyDiv.appendChild(document.createElement('br'));\r\n}", "function insertSelectLinks(divId)\n{\n if(!$(\"selectTasksDiv\"))\n {\n var selectTasksDivId = \"selectTasksDiv\";\n addDivTo(divId, selectTasksDivId);\n addTextToDiv(selectTasksDivId, \"Select:\", \"padding-right: 5px; font-weight: bold;\");\n // Comment out the following lines to change which links appear.\n insertSelectAllOrNoneTaskLinks(selectTasksDivId);\n insertSelectTasksByDueDate(selectTasksDivId);\n insertSelectTasksByPriority(selectTasksDivId);\n insertSelectTasksByTag(selectTasksDivId);\n }\n}", "function showSelected()\r\n{\r\n //gameitems [question, ]\r\n //$('#gameselectable').empty();\r\n for(var i=0; i<gameitems.length; i++)\r\n\t{\r\n\t\tvar txt = gameitems[i][0].text;//$.parseHTML(quests[i].text);//[object Text]\r\n //var lnk = '<a href=\"'+gameitems[i][0].question_id+'\">[ <i class=\"icon-eye\">SEE</i> ]</a> ';//view link\r\n //cant add link to selectable <li>\r\n\t\t$('#gameselectable').append('<li class=\"ui-widget-content\" data-id=\"'+gameitems[i][0].question_id+'\">'+txt+'</li>');\r\n\t}\r\n\t\r\n\tclose_accordion_section();\r\n\t$('#accordion-4').addClass('active');\r\n\t// Open up the hidden content panel\r\n\t$('.accordion #accordion-4').slideDown(300).addClass('open');\r\n}", "link(options = {}) {\n if (!options || (options && !options.href) || !this.isValid()) {\n return;\n }\n\n if (window.getSelection && !window.getSelection().toString()) {\n console.warn(\"no text selected..\");\n return null;\n }\n const unwrapAtags = (linkElements) => {\n linkElements.forEach(link => {\n Array.from(link.querySelectorAll(\"a\")).forEach(aTag => aTag.unwrap());\n const closestATag = link.parentElement ? link.parentElement.__closest(\"a\") : null;\n if (closestATag) {\n var a = Object(_utilis_splitHTML__WEBPACK_IMPORTED_MODULE_2__[\"splitHTML\"])(link, closestATag, {\n tag: \"a\"\n });\n if (a) {\n a.center.unwrap();\n }\n // closestATag.unwrap();\n }\n });\n }\n const setTargetToTag = (linkElements, renderedLink, _target) => {\n linkElements.forEach(aTag => {\n aTag.href = renderedLink;\n if (_target) {\n aTag.setAttribute(\"target\", _target);\n }\n });\n }\n const setProtocol = (_protocol, newURL) => {\n _protocol = _protocol.replace(/:/g, \"\");\n _protocol = _protocol.replace(/\\/\\//g, \"\");\n _protocol += \":\";\n if (_protocol.includes(\"http\")) {\n _protocol += \"//\";\n } else {\n }\n newURL.push(_protocol);\n return _protocol;\n }\n\n\n const { href = \"\", protocol = \"\", target = \"\" } = options;\n\n const linkElements = Object(_services_range_service__WEBPACK_IMPORTED_MODULE_0__[\"wrapRangeWithElement\"])(\"a\");\n let newURL = [];\n const Atag = Object(_services_link_service__WEBPACK_IMPORTED_MODULE_9__[\"createTempLinkElement\"])(href);\n let _href = Object(_services_link_service__WEBPACK_IMPORTED_MODULE_9__[\"resetURL\"])(href.trim());\n\n let _protocol = protocol.trim() || Atag.protocol;\n let _target = null;\n const testTarget = _services_link_service__WEBPACK_IMPORTED_MODULE_9__[\"TARGETS\"][target.trim().toLowerCase()];\n if (testTarget) {\n _target = testTarget;\n }\n if (_protocol.trim()) {\n _protocol = setProtocol(_protocol, newURL);\n }\n if (_href) {\n newURL.push(_href);\n }\n const renderedLink = newURL.join(\"\");\n unwrapAtags(linkElements);\n setTargetToTag(linkElements, renderedLink, _target);\n const { firstFlag, lastFlag } = Object(_services_range_service__WEBPACK_IMPORTED_MODULE_0__[\"setSelectionFlags\"])(linkElements[0], linkElements[linkElements.length - 1]); //Set Flag at last\n Object(_services_range_service__WEBPACK_IMPORTED_MODULE_0__[\"setSelectionBetweenTwoNodes\"])(firstFlag, lastFlag);\n linkElements.forEach(aTag=>{\n Object(_services_textEditor_service__WEBPACK_IMPORTED_MODULE_4__[\"normalizeElement\"])(aTag.parentElement);// merge siblings and parents with child as possible.. \n })\n }", "click(e){\r\n if ( this.url ){\r\n bbn.fn.link(this.url);\r\n }\r\n else{\r\n this.$emit('click', e);\r\n }\r\n }", "selectLabel(label, selectText) {\n // already selected? do nothing\n if (label === this._.selectedLabel) return;\n this.unselectSelectedLabel(); // unselect previous selected label\n label.minimized = false;\n this._.selectedLabel = label;\n if (this._.mode === MODES.EDITION) this.refreshAllDeleteRegionIcons();\n this.renderForAWhile();\n this.forceUpdate(() => {\n this.refreshLabelPosition(label);\n const mode = this._.mode;\n if (mode === MODES.EDITION) {\n setTimeout(() => {\n const id = getLabelFocusId(label.id, this._.componentId);\n const elem = document.getElementById(id);\n elem.focus();\n if (mode === MODES.EDITION && selectText) {\n if (typeof elem.select === 'function') elem.select();\n else if (typeof elem.setSelectionRange === 'function') {\n elem.setSelectionRange(0, elem.value.length);\n }\n }\n }, 0);\n }\n });\n }", "function handleLabelSelectClick(evt,labelNameSelected,selectId,opposingSelectId){\n\n\t\t\t\t//holding control or shift to highlight many labels?\n\t\t\t\tif(evt.ctrlKey || evt.shiftKey){\n\t\t\t\t\t//do nothing, let user se3lect multiple items to move as group\n\t\t\t\t}else{\n\t\t\t\t\t\n\t\t\t\t\t//a non-ctrl non-shift click will clear all hightlighted/selected label names\n\t\t\t\t\t// (won't move groups of labels)\n\t\t\t\t\tunselectAllLabelNames(opposingSelectId,undefined);//undefined since don't want to keep any selected lable name in opposing list\n\t\t\t\t\tunselectAllLabelNames(selectId,labelNameSelected);\n\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//load the label info into ui \n\t\t\t\tvar label = getSelectedLabel(selectId);\n\t\t\t\t\n\t\t\t\tif(label !== undefined){\n\t\t\t\t\trestoreLabelState(label);\n\t\t\t\t}\t\n\t\t\t}", "function buildLink(callback){\n var floatingPanel = document.createElement('a');\n var panelStyle = 'display:none; position:fixed;z-index:9999999;top:10px;width:200px;left:50%;margin-left:-100px;font-family:Helvetica;color:#ffffff;background-color:#F37A1F; text-decoration:none; text-align:center; box-shadow:0px 2px 10px #999999; border-radius:4px; ';\n floatingPanel.setAttribute('href', url());\n floatingPanel.setAttribute('style', panelStyle);\n floatingPanel.setAttribute('id', 'clickPanel');\n floatingPanel.setAttribute('target','_blank');\n var linkHeader = document.createElement('h3');\n linkHeader.setAttribute('style','line-height:40px; text-decoration:none; font-size:18px;');\n var linkText = document.createTextNode('Track Shipments');\n floatingPanel.appendChild(linkHeader);\n linkHeader.appendChild(linkText);\n document.body.appendChild(floatingPanel);\n callback();\n}", "function handleLabel ($node) {\n // `<option>` tags have a `label` attribute in HTML5.\n if (!$node.label || $node.tagName === \"OPTION\") return\n\n const $label = html.element(\"label\", { for: $node })\n const $span = html.element(\"span\", $node.label)\n html.replace($node, $label)\n html.append($label, $span, $node)\n delete $node.label\n}", "function createRenameLinkElement(itemDiv) {\n\t\tvar element = createElement(\"span\");\n\t\telement.innerHTML = \"<b><i>&#171;</i></b>\";\n\n\t\tvar curtagurl = getElementsByName(itemDiv,'a')[0].href;\t\n\t\t\n\t\t// Check if url is ending with escape(\"system:unfiled) == system%3Aunfiled \n\t\tif(curtagurl.indexOf(escape(\"system:unfiled\")) != -1) return null;\n\n\t\tvar tagUserName = curtagurl.split(\"http://del.icio.us/\")[1];\n\t\ttagUserName = tagUserName.split('/')[0];\n\t\tif(tagUserName != loggedUserName) return null;\n\n\t\telement.setAttribute(\"title\",\"rename tag\");\n\t\telement.onclick = function (event) {\n\t\t\tvar tagurl = getElementsByName(itemDiv,'a')[0].href;\n\t\t\tvar oldtag = getElementsByName(itemDiv,'a')[0].innerHTML;\n\t\t\tvar newtag = prompt(\"Enter the new tag: \");\n\t\t\tif(newtag == null) return;\n\t\t\tcurrentURL = window.location.href;\n\t\t\t\n\t\t\t// tagurl is of the form: http://del.icio.us/username/tagname\n\t\t\tvar username = tagurl.split(\"http://del.icio.us/\")[1];\n\t\t\tusername = username.split('/')[0];\n\n\t\t\t// If the you are in some other page then do not add link.\n\n\t\t\t// Change the tagname\n\t\t\tchangeTag(username,oldtag,newtag);\n\t\t}\t\n\t\t// Define CSS rules for rename link element.\n\t\telement.setAttribute(\"style\",renameStyleRule);\n\t\treturn element;\n\t}", "function gLnk(target, description, linkData, targetF) { \n fullLink = \"\" \n if (targetF == null) {\n targetF = targetFrame;\n }\n if (target==0) { \n return new Item(description, \"'\"+linkData+\"' target=\\\"\" + targetF + \"\\\"\");\n } \n else if (target==1) {\n return new Item(description, \"'http://\"+linkData+\"' target=_blank\");\n }\n return new Item(description, \"'http://\"+linkData+\"' target=\\\"\" + targetF + \"\\\"\");\n}", "function buildCategoriesHTML(selectedCategory){\n\tvar allCategories = Object.keys(MULTIVERSEOBJECT);\n\tvar categoryHTML = '';\n\tfor (var i = 0; i < allCategories.length; i++) {\n\t\tif (allCategories[i] == selectedCategory) {\n\t\t\tcategoryHTML += '<div class=\"categoryselected\" id=\"' + allCategories[i] +'\" onclick =\"categoryOnClick()\"> '+ allCategories[i] +' </div>';\n\t\t} \n\t\telse {\n\t\t\tcategoryHTML += '<div class=\"categoryunselected\" id=\"' + allCategories[i] +'\" onclick =\"categoryOnClick()\"> '+ allCategories[i] +' </div>';\n\t\t}\n\t}\n\tdocument.querySelector('.categories').innerHTML = categoryHTML;\n\n\t//Logic for Category single selection\n\tvar categoryDivs = document.querySelectorAll('.categories div');\n\tfor (var i = 0; i < categoryDivs.length; i++) {\n\t\tcategoryDivs[i].onclick = function(){\n\t\t\tbuildCategoriesHTML(this.id);\n\t\t}\n\t}\n\tALLSEARCHENGINESINCATEGORY = MULTIVERSEOBJECT[selectedCategory];\n\tSELECTEDCATEGORY = selectedCategory;\n\tSELECTEDSEARCHENGINES = [ALLSEARCHENGINESINCATEGORY.names[0]]; // Again defaultng on the first tab;\n\tbuildTabsHTML(selectedCategory, SELECTEDSEARCHENGINES);\t\n}", "function getLink(url, term, label) {\n formattedTerm = term.split(' ').join('+');\n return \"<a target=\\\"_blank\\\" href=\\\"\" + url + formattedTerm + \"\\\" title=\\\"View results on \" + label + \"\\\"\\\">\" + term + \"</a>\";\n}", "function createAnchorTag(text, href, download) {\n var link = document.createElement('a');\n link.textContent = text;\n if (href) {\n link.href = href;\n }\n if (download) {\n link.download = download;\n var lowerCaseName = download.toLowerCase();\n var isLikelyInline = ['.png', '.jpg', '.jpeg', '.gif', '.bmp', '.webp', '.pdf'].some(function (substr) {\n return lowerCaseName.length > substr.length &&\n lowerCaseName.indexOf(substr) == lowerCaseName.length - substr.length;\n });\n if (isLikelyInline) {\n link.onclick = downloadFile.bind(null, href, download);\n }\n }\n else if (href && href.charAt(0) != '#') {\n link.target = '_blank';\n }\n return link;\n}", "function onAnchorClick(event) {\n chrome.tabs.create({\n selected: true,\n url: event.srcElement.href\n });\n return false;\n}", "function onAnchorClick(event) {\n chrome.tabs.create({\n selected: true,\n url: event.srcElement.href\n });\n return false;\n}", "function selectClickOnLinkClick (e) {\n selectMenuItem('click-on-link-menu', 'click');\n e.preventDefault();\n}", "function createHyperlink (textLink, textString) {\n let hyperlink = document.createElement(\"a\");\n hyperlink.className = \"nav-link\";\n hyperlink.innerText = textString;\n hyperlink.href = textLink;\n return hyperlink;\n}", "function convert_hyperlink_default(object)\n{\n var element = document.createElement(\"a\");\n element.setAttribute(\"class\", \"pair \" + object.kind);\n element.setAttribute(\"href\", object.y.text);\n element.innerHTML = object.x.text;\n\n return element;\n}", "function InsertAnchorLink() {\r\n var selectedField = RTE.Canvas.currentEditableRegion();\r\n var anchorTags = selectedField.getElementsByTagName(\"ins\");\r\n var anchorList = \"\";\r\n //This loop creates an Array that we pass into the dialog window\r\n for (i = 0; i < anchorTags.length; i++) {\r\n if (anchorTags[i].id && (anchorTags[i].id.length > 0))\r\n anchorList = anchorList + anchorTags[i].id + \",\";\r\n }\r\n anchorList = anchorList.substring(0, anchorList.length - 1);\r\n var options = SP.UI.$create_DialogOptions();\r\n var selectedText = getSelectedText();\r\n\r\n options.title = \"Please select an anchor\";\r\n options.width = 400;\r\n options.height = 200;\r\n options.y = getTop(200);\r\n\r\n options.args =\r\n {\r\n selectedText: selectedText,\r\n anchorList: anchorList\r\n };\r\n options.url = \"/_layouts/BeenJammin.SharePoint.CustomRibbonActions/AnchorLinkDialog.aspx\";\r\n options.dialogReturnValueCallback = Function.createDelegate(null, AnchorLinkCloseCallback);\r\n SP.UI.ModalDialog.showModalDialog(options);\r\n\r\n}", "function addLink() {\n var body_element, selection, pagelink, copytext, newdiv;\n body_element = document.getElementsByTagName('body')[0];\n selection = window.getSelection();\n pagelink = \" Read more at: <a href='\" + document.location.href + \"'>\" + document.location.href + \"</a>\";\n copytext = selection + pagelink;\n newdiv = document.createElement('div');\n newdiv.style.position = 'absolute';\n newdiv.style.left = '-99999px';\n body_element.appendChild(newdiv);\n newdiv.innerHTML = copytext;\n selection.selectAllChildren(newdiv);\n window.setTimeout(function () {\n body_element.removeChild(newdiv);\n }, 0);\n }", "function create_option({input_id, text, label_id}) {\n\n let row = document.createElement(\"div\");\n row.className = \"row\";\n\n // Create a checkbox <input> and add it before the <label> element.\n if (input_id) {\n let cb = document.createElement(\"input\");\n cb.type = \"checkbox\";\n cb.id = input_id;\n cb.className = \"cb\";\n row.appendChild(cb);\n }\n\n // The <label> element comes after the <input> so that a checked <input>\n // can easily affect the appearance of its corresponding <label>.\n let label = document.createElement(\"label\");\n if (label_id) {\n label.id = label_id;\n }\n label.className = \"opt\";\n label.innerText = text;\n input_id && label.setAttribute(\"for\", input_id);\n row.appendChild(label);\n\n return row;\n\n}", "function create_link(table_id, day) {\n return $(\"<a/>\", {\n href: \"#\",\n class: \"list-group-item\"})\n .click(\n {\n table_id: table_id,\n day: day\n },\n function(e) {\n view(\"view_map_highlight_table\", e.data);\n e.preventDefault();\n })\n .html('<span class=\"glyphicon glyphicon-map-marker\" aria-hidden=\"true\"></span>' +\n get_day_string(day) +\n '<span class=\"glyphicon glyphicon-menu-right pull-right\"></span>');\n }", "function addTagLabel(name) {\n let tagList = document.getElementById(\"tag-line\");\n let newTag = document.createElement(\"span\");\n let newText = document.createElement(\"span\");\n let newRemove = document.createElement(\"a\");\n let newIcon = document.createElement(\"i\");\n let input = document.getElementById(\"tag-add\");\n\n input.value = \"\";\n\n newTag.className = \"tag-label tag\";\n newTag.id = name;\n\n let aElement = document.createElement('a');\n aElement.innerText = name;\n newText.appendChild(aElement);\n\n newIcon.className = \"remove glyphicon glyphicon-remove-sign glyphicon-white\";\n\n newRemove.onclick = function() {\n tagList.removeChild(newTag);\n toAddTagList.delete(name.toLowerCase());\n removeTagFromItem(name);\n };\n newText.onclick = function() {\n window.location.href = '/tags/display/' + encodeURIComponent(name.toLowerCase());\n };\n newRemove.appendChild(newIcon);\n newTag.appendChild(newText);\n newTag.appendChild(newRemove);\n\n if(!toAddTagList.has(name)) {\n toAddTagList.add(name);\n tagList.appendChild(newTag);\n }\n}", "function makeLink(url, text) {\n const selection = document.getSelection();\n document.execCommand('createLink', true, url);\n selection.anchorNode.parentElement.target = '_blank';\n selection.anchorNode.parentElement.innerHTML = text;\n showPostPreview();\n}", "function clickHandler(id, name, attribute) {\n let elem = document.getElementById(id);\n let div = document.createElement('div');\n div.id = id;\n div.class = \"pop-up window\";\n elem.appendChild(div);\n\n\n let form = document.createElement('form');\n div.appendChild(form);\n\n let button = document.createElement('button');\n button.setAttribute('type', 'ok');\n button.innerText = 'Close';\n\n //If was clicked at 'title' field, handler shows that book's information.\n if (attribute === 'title') {\n form.innerText =\n `This book has ${name.pageCount} pages.\\nYou read this book at ${name.read}`\n }\n\n //If was clicked at 'author' field, handler shows that author's information.\n if (attribute === 'author') {\n form.innerText =\n `Author name is ${name.firstName}. \\n Author surname is ${name.lastName}.\\n He was born at ${name.getFormattedBirthDate()}`;\n }\n\n form.appendChild(button);\n button.onclick = () => {\n elem.removeChild(div);\n }\n}", "function autoLink(str, elem) {\n var exp =\n /(^|\\s|[^\\u0020-\\u007f])(https?:\\/\\/[\\x21-\\x27\\x2a-\\x7f]+)|((\\#[^\\x00-\\x2f\\x3a-\\x40\\x5b-\\x5e\\x60\\x7b-\\x7f]+)|(@[a-zA-Z\\d_]+))/g;\n var lastIndex = 0;\n var m;\n while (m = exp.exec(str)) {\n var text = str.substr(lastIndex, m.index - lastIndex);\n //console.log(text);\n appendText(elem, text);\n var prefix = m[1] || \"\";\n var url;\n var target;\n if (m[4]) { // Hash tag\n text = m[4];\n url = \"/search?q=\" + encodeURIComponent(text) + \"&hl=\" + lang;\n target = \"_self\";\n } else if (m[5]) { // User name\n text = m[5];\n url = \"https://twitter.com/\" + text.replace(/^@/, \"\");\n target = \"_blank\";\n } else if (m[2]) { // URL\n text = m[2];\n url = text;\n target = \"_blank\";\n }\n //console.log(prefix, text, url, target);\n appendText(elem, prefix);\n elem.append(createElementTree([\"a\", {href: url, target: target}, text]));\n lastIndex = m.index + m[0].length;\n }\n var text = str.substr(lastIndex);\n //console.log(text);\n appendText(elem, text);\n}", "function appendNewElement(tap, strings, DivConfiguration) {\n \n var tapID = strings.id + tap.ID;\n var tapIDStatus = tapID + \"Status\"\n var LabelText = strings.initalLabel ; \n if (tap.State == strings.state) LabelText = strings.altLabel ;\nvar label = createElement(\"label\",{\"class\":strings.class}, tap.Name),\n div = createElement(\"div\",{\"class\":\"status_\"+tap.State, \"id\":tapIDStatus}),\n button = createElement(\"button\",{\"type\":\"submit\",\"id\":\"button-\"+tapID},LabelText),\n newListItem = createElement(\"div\",{\"id\":tapID, \"class\":strings.div_class},[label,div,button]);\n \n DivConfiguration.appendChild(newListItem);\n var taptapName = '#button-'+tapID; \n $(taptapName).click(function(){\n var textContent = $(taptapName).text() ; \n if (textContent == strings.altLabel)\n socket.emit(strings.emitAlt, tap.ID); \n else socket.emit(strings.emitBase, tap.ID);\n });\n \n }", "_labelContainerHandler(currentElement, event, eventType) {\n const that = this,\n click = eventType === 'up' && that._downTarget === currentElement;\n\n if (eventType === 'down') {\n that._downTarget = currentElement;\n\n if (that.selectionMode === 'click' && currentElement !== that._addNewTab) {\n if (JQX.Utilities.Core.isMobile && currentElement.tab.group === null) {\n const scrollDirection = that.$.tabStrip[that._orientationSettings.scrollDirection];\n\n setTimeout(function () {\n if (scrollDirection === that.$.tabStrip[that._orientationSettings.scrollDirection]) {\n const rippleInProgress = that._ripple(event, currentElement);\n\n if (rippleInProgress && that._openDropDown && that._openDropDown.contains(currentElement)) {\n that._openDropDown.rippleInProgress = true;\n }\n }\n }, 100);\n }\n else {\n const rippleInProgress = that._ripple(event, currentElement);\n\n if (rippleInProgress && that._openDropDown && that._openDropDown.contains(currentElement)) {\n that._openDropDown.rippleInProgress = true;\n }\n }\n }\n }\n\n if (currentElement === that._addNewTab) {\n that._addNewTabHandler(currentElement, eventType, click);\n return;\n }\n\n const index = currentElement.tab.index,\n currentElementStatic = !(that._reordering && that._reorderedIndex !== undefined);\n\n if (click && index === that.selectedIndex) {\n that._closeGroupDropDown();\n\n if (currentElementStatic && currentElement.tab.group === null) {\n that._toggleCollapsedState();\n }\n }\n\n if (!that._swiping && (currentElementStatic && that.selectionMode === 'click' && click ||\n !that._reordering && (that.selectionMode === eventType || that.selectionMode === 'mouseenter' && eventType === 'mouseover'))) {\n that._select(index, true);\n }\n\n if (!that._reordering && !that._swiping && (that.selectionMode === 'click' || that.selectionMode === 'dblclick')) {\n if (eventType === 'mouseover' && !currentElement.hasAttribute('selected')) {\n currentElement.setAttribute('hover', '');\n }\n else if (eventType === 'mouseout') {\n currentElement.removeAttribute('hover');\n }\n }\n\n if (that.reorder && eventType === 'down' && currentElement.tab.group === null && that._reorderItems.length > 1) {\n that._getTabCoordinates();\n that._reordering = true;\n that.setAttribute('dragged', '');\n\n if (currentElement.hasAttribute('hover')) {\n that._draggedHoveredTab = currentElement;\n }\n\n if (that._groups.length === 0) {\n that._draggedIndex = currentElement.tab.index;\n }\n else {\n that._draggedIndex = Array.from(that.$.tabStrip.children).indexOf(currentElement);\n }\n }\n }", "function mgnlDialogLinkOpenBrowser(controlName,repository,extension,addcontext){\r\n var control = document.getElementById(controlName);\r\n var pathSelected = control.value;\r\n pathSelected = pathSelected.replace(\".html\",\"\");\r\n\r\n var pathOpen=\"\"; //without selection: open path of editing page\r\n var pathElem=document.getElementById(\"mgnlPath\");\r\n if (pathElem) pathOpen=pathElem.value;\r\n \r\n mgnlDebug(\"link: selectedPath: \" + pathSelected, \"dialog\");\r\n mgnlDebug(\"link: pathOpen: \" + pathOpen, \"dialog\"); \r\n\r\n var callBackCommand = new MgnlDialogLinkBrowserCallBackCommand(control, extension);\r\n mgnlOpenTreeBrowser(pathSelected,pathOpen,repository,null,null,callBackCommand)\r\n}", "handleClick(event) {\n const { location, isSelectable, onClick } = this.props;\n\n if (!isSelectable || event.target.closest('.c-finder-tree-leaf__btn--toggle-selection')) {\n return;\n }\n\n onClick(location);\n }", "function addFotkiTab() {\n sourceTabbar = document.getElementById(\"source-tabbar\");\n fotkiDiv = document.createElement('div');\n fotkiDiv.id = 'tab-conduit-fotki';\n fotkiDiv.addEventListener(\n 'click', \n function(evt) { \n folderListDiv = document.getElementById('fotki-folder-list');\n folderListDiv.style.display = 'block';\n },\n true\n );\n fotkiDiv.innerHTML = \"<a class=\\\"command-show-source-conduit-fotki left bar button\\\"><b>Fotki</b><s></s></a>\";\n sourceTabbar.appendChild(fotkiDiv);\n}", "function _handleTagClick(e) {\n var labelTags = status.targetLabel.getProperty('tagIds');\n\n // Use position of cursor to determine whether the click came from the mouse or from a keyboard shortcut.\n var wasClickedByMouse = e.hasOwnProperty(\"originalEvent\") &&\n e.originalEvent.clientX !== 0\n && e.originalEvent.clientY !== 0;\n\n $(\"body\").unbind('click').on('click', 'button', function(e) {\n if (e.target.name === 'tag') {\n // Get the tag_id from the clicked tag's class name (e.g., \"tag-id-9\").\n var currTagId = parseInt($(e.target).attr('class').split(\" \").filter(c => c.search(/tag-id-\\d+/) > -1)[0].match(/\\d+/)[0], 10);\n var tag = self.labelTags.filter(tag => tag.tag_id === currTagId)[0];\n\n // Adds or removes tag from the label's current list of tags.\n if (!labelTags.includes(tag.tag_id)) {\n // Deals with 'no alternate route' and 'alternate route present' being mutually exclusive.\n var alternateRoutePresentId = self.labelTags.filter(tag => tag.tag === 'alternate route present')[0].tag_id;\n var noAlternateRouteId = self.labelTags.filter(tag => tag.tag === 'no alternate route')[0].tag_id;\n // Automatically deselect one of the tags above if the other one is selected.\n if (currTagId === alternateRoutePresentId) {\n labelTags = _autoRemoveAlternateTagAndUpdateUI(noAlternateRouteId, labelTags);\n } else if (currTagId === noAlternateRouteId) {\n labelTags = _autoRemoveAlternateTagAndUpdateUI(alternateRoutePresentId, labelTags);\n }\n\n // Deals with 'street has a sidewalk' and 'street has no sidewalks' being mutually exclusive.\n var streetHasOneSidewalkId = self.labelTags.filter(tag => tag.tag === 'street has a sidewalk')[0].tag_id;\n var streetHasNoSidewalksId = self.labelTags.filter(tag => tag.tag === 'street has no sidewalks')[0].tag_id;\n // Automatically deselect one of the tags above if the other one is selected.\n if (currTagId === streetHasOneSidewalkId) {\n labelTags = _autoRemoveAlternateTagAndUpdateUI(streetHasNoSidewalksId, labelTags);\n } else if (currTagId === streetHasNoSidewalksId) {\n labelTags = _autoRemoveAlternateTagAndUpdateUI(streetHasOneSidewalkId, labelTags);\n }\n\n // Log the tag click.\n labelTags.push(tag.tag_id);\n if (wasClickedByMouse) {\n svl.tracker.push('ContextMenu_TagAdded', { tagId: tag.tag_id, tagName: tag.tag });\n } else {\n svl.tracker.push('KeyboardShortcut_TagAdded', { tagId: tag.tag_id, tagName: tag.tag });\n }\n } else {\n var index = labelTags.indexOf(tag.tag_id);\n labelTags.splice(index, 1);\n if (wasClickedByMouse) {\n svl.tracker.push('ContextMenu_TagRemoved', { tagId: tag.tag_id, tagName: tag.tag });\n } else {\n svl.tracker.push('KeyboardShortcut_TagRemoved', { tagId: tag.tag_id, tagName: tag.tag });\n }\n }\n _toggleTagColor(labelTags, tag.tag_id, e.target);\n status.targetLabel.setProperty('tagIds', labelTags);\n e.target.blur();\n $tagHolder.trigger('tagIds-updated'); // For events that depend on up-to-date tagIds.\n }\n });\n }", "function showLinkLabel(e) {\n var label = e.subject.findObject(\"LABEL\");\n if (label !== null) label.visible = (e.subject.fromNode.data.figure === \"Diamond\");\n }", "_render({icon, label, href}) {\n return html`\n ${this._renderStyle()}\n <style>\n\n </style>\n <a class=\"mdc-tab mdc-tab--with-icon-and-text\" href=\"${href || '#'}\">\n ${icon ? html`<i class=\"material-icons mdc-tab__icon\" aria-hidden=\"true\">${icon}</i>` : ''}\n <span class=\"mdc-tab__icon-text\">${label}</span>\n </a>`;\n }" ]
[ "0.6615223", "0.60973525", "0.5916459", "0.58006585", "0.55518717", "0.5511999", "0.5477806", "0.5327929", "0.5247053", "0.52089906", "0.5196766", "0.51823187", "0.51765573", "0.51503855", "0.5128251", "0.5105734", "0.5094164", "0.5088068", "0.5087811", "0.5085603", "0.50777036", "0.50602454", "0.50602454", "0.50507367", "0.5049001", "0.50489277", "0.5037331", "0.5020067", "0.499498", "0.49791932", "0.4961872", "0.49493903", "0.49466154", "0.4944123", "0.4932932", "0.4931675", "0.4928692", "0.49249977", "0.49201214", "0.49127457", "0.49060357", "0.4903015", "0.49001995", "0.4894427", "0.48925766", "0.48882014", "0.48867977", "0.48791564", "0.48666745", "0.48616225", "0.4860292", "0.48534212", "0.4850719", "0.48453653", "0.4834358", "0.48222908", "0.4821492", "0.48159677", "0.48057404", "0.4802463", "0.48004815", "0.4799439", "0.4794542", "0.47858706", "0.4783213", "0.47829807", "0.4778395", "0.4776227", "0.47732788", "0.4772203", "0.4771717", "0.4762509", "0.47591397", "0.47505614", "0.4748709", "0.47420484", "0.47386172", "0.4729972", "0.47224122", "0.47218361", "0.47218361", "0.4716545", "0.47130412", "0.47129557", "0.47120833", "0.47108728", "0.47089842", "0.4705357", "0.4699898", "0.4699654", "0.46977112", "0.46951273", "0.46950886", "0.46947804", "0.46917158", "0.4685108", "0.46828386", "0.46781638", "0.4670295", "0.46632588" ]
0.7782364
0
Return fragment identifier to be used in URL for the specified unit and subunit. Arguments: m Unit number (number) n Subunit number (number) Return value: Fragment identifier to be used in URL (string)
function unitHref(m, n) { if (typeof m == 'undefined') { return '' } else if (typeof n == 'undefined') { return '#' + m } else { return '#' + m + '.' + n } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_fragment( url ) {\n return url.replace( re_fragment, '$2' );\n }", "function updateUnitFromURL()\n {\n // Default lesson is Unit 1.1\n var unitNo = 1\n var subunitNo = 1\n\n // Parse the fragment identifier in the URL and determine the\n // unit\n if (window.location.hash.length > 0) {\n var fragmentID = window.location.hash.slice(1)\n var tokens = fragmentID.split('.')\n unitNo = parseInt(tokens[0])\n if (tokens.length > 1)\n subunitNo = parseInt(tokens[1])\n }\n\n // Default to unit 1 if unit number could not be parsed\n // correctly from the URL\n if (isNaN(unitNo)) {\n unitNo = 1\n }\n\n // Default to subunit 1 if unit number could not be parsed\n // correctly from the URL\n if (isNaN(subunitNo)) {\n subunitNo = 1\n }\n\n setSubunit(unitNo, subunitNo)\n\n displayUnitLinks()\n displaySubunitLinks()\n displayAlternateUnitLinks()\n updateNavigationLinks()\n updateProgressTooltip()\n\n displayUnitTitle()\n displayGuide()\n\n resetSubunit()\n }", "function get_fragment( url ) {\n url = url || loc.href;\n return url.replace( /^[^#]*#?(.*)$/, '$1' );\n }", "function get_fragment( url ) {\nurl = url || location.href;\nreturn '#' + url.replace( /^[^#]*#?(.*)$/, '$1' );\n}", "function generateConcreteFragmentID() {\n\t return __webpack_require__(221)(_nextFragmentID++) + SUFFIX;\n\t}", "function get_fragment( url ) {\n url = url || location.href;\n return '#' + url.replace( /^[^#]*#?(.*)$/, '$1' );\n }", "function get_fragment( url ) {\n url = url || location.href;\n return '#' + url.replace( /^[^#]*#?(.*)$/, '$1' );\n }", "function get_fragment( url ) {\n url = url || location.href;\n return '#' + url.replace( /^[^#]*#?(.*)$/, '$1' );\n }", "function get_fragment(url) {\n url = url || location.href;\n return '#' + url.replace(/^[^#]*#?(.*)$/, '$1');\n }", "function get_fragment(url) {\n url = url || location.href;\n return '#' + url.replace(/^[^#]*#?(.*)$/, '$1');\n }", "function getFragment(url) {\n url = url || location.href;\n if (Router.nativeHistory && supportNativeHistory) {\n url = new S.Uri(url);\n var query = url.getQuery().toString();\n return url.getPath().substr(Router.urlRoot.length) + (query ? ('?' + query) : '');\n } else {\n return getHash(url);\n }\n }", "function unit(m)\n {\n if (alternateUnitAvailable(m) &&\n my.settings.unit == my.UNIT.ALTERNATE) {\n return Units.alternate[m - Units.alternateStart]\n } else {\n return Units.main[m - 1]\n }\n }", "get_fragment_id() {\n return this.fragment_id\n }", "function setSubunit(m, n)\n {\n my.current.unitNo = m\n my.current.subunitNo = n\n\n my.current.unit = unit(m)\n\n my.current.subunitTitles.length = 0\n for (var subunitTitle in my.current.unit.subunits) {\n my.current.subunitTitles.push(subunitTitle)\n }\n\n var subunitTitle = my.current.subunitTitles[n - 1]\n my.current.subunitText = my.current.unit.subunits[subunitTitle]\n }", "function currentSubunit()\n {\n var m = my.current.unitNo\n var n = my.current.subunitNo\n\n window.location.href = unitHref(m, n)\n }", "get_fragment() {\n return this.fc.get_fragment_by_id(this.get_fragment_id());\n }", "function getSlideNumberFromUrlFragment() {\n var fragment = window.location.hash || ''\n\n currentSlideNumber = (parseInt(fragment.substr(1)) - 1) || 0\n}", "function getSlideNumberFromUrlFragment() {\n var fragment = window.location.hash || ''\n\n currentSlideNumber = (parseInt(fragment.substr(1)) - 1) || 0\n}", "getFragment(fragment) {\n if (fragment === null) {\n if (this._usePushState || !this._wantsHashChange) {\n fragment = this.getPath();\n } else {\n fragment = this.getHash();\n }\n } else {\n fragment = this.getHash();\n }\n return fragment.replace(routeStripper, '');\n }", "onFragment(id) {\n const resourceAnnotation = this.resourceAnnotation(id);\n if (!resourceAnnotation) return undefined;\n // IIIF v2\n const on = resourceAnnotation.getProperty('on');\n // IIIF v3\n const target = resourceAnnotation.getProperty('target');\n const fragmentMatch = (on || target).match(/xywh=(.*)$/);\n if (!fragmentMatch) return undefined;\n return fragmentMatch[1].split(',').map(str => parseInt(str, 10));\n }", "function nextSubunit()\n {\n var m = my.current.unitNo\n var n = my.current.subunitNo\n\n if (!currentSubunitIsTheLastSubunit()) {\n if (n == my.current.subunitTitles.length) {\n // If the user is at unit M.L where L is the last\n // subunit of unit M, then go to unit (M + 1).1.\n m++\n n = 1\n } else {\n // If the user is at unit M.N, then go to unit M.(N + 1).\n n++\n }\n }\n\n window.location.href = unitHref(m, n)\n }", "getFragment() {\n return this.clearSlashes(decodeURI(window.location.pathname + window.location.search)).replace(/\\?(.*)$/, '');\n }", "loadUrl(fragment) {\n fragment = this.fragment = this.location.pathname\n this.onLoadUrl && this.onLoadUrl(fragment, this.location.search)\n }", "function get_sm_name(page_url){\r\n\t//GM_log(page_url);\r\n\r\n\tvar site_start = page_url.indexOf('&s=');\r\n\tif (site_start==-1){\r\n\t\tsite_start = page_url.indexOf('&S=');\r\n\t}\r\n\tvar site_end = page_url.indexOf('&r',site_start);\r\n\tvar site_url= page_url.substring(site_start+3,site_end);\r\n\r\n\t//GM_log(site_start +\"|\"+site_end +\"|\"+site_url);\t\r\n\treturn site_url;\r\n}", "function getLinkId(url) {\n\n var id = url.slice(url.lastIndexOf('/') + 1, url.length);\n //console.log(\"ID= \" + id);\n return id;\n\n}//get link id", "function getGroupID(URL) {\n var start_pos = URL.indexOf('=') + 1;\n var end_pos = URL.indexOf('&study_group_uuid', start_pos);\n var studyGroupID = URL.substring(start_pos, end_pos);\n console.log(studyGroupID);\n return studyGroupID;\n}", "resource(fullUrl){\n //Pega o caminho da URL ou seja a string que vem após a porta e antes das querys\n //protocolo://domínio:porta/RECURSO/.../RECURSO?query_string#fragmento\n let parsedUrl = url.parse(fullUrl).pathname\n return parsedUrl\n }", "getUrlSection(segment) {\n\n if (segment != 0 && segment != 1) {\n return;\n }\n\n // default page is the first one in the list\n let default_page = \"\";\n\n if (this.appPages.length > 0) {\n default_page = this.appPages[0][\"name\"];\n }\n\n let curr_url = decodeURI(window.location.href);\n\n // has page defined\n if (curr_url.split(\"#\").length > 1) {\n return curr_url.split(\"#\")[segment];\n } else {\n window.location.href = encodeURI(window.location.href + \"#\" + default_page);\n return default_page;\n }\n }", "function getStep() {\n\tlet url = new URL(window.location.href);\n\tlet hash = url.hash.substring(1);\n\tif (hash === '0' || hash === '1' || hash === '2' || hash === '3') {\n\t\treturn parseInt(hash, 10);\n\t} else {\n\t\treturn '0';\n\t}\n}", "function getPhotoSetID() {\n\t\t\tvar photoset = WIN.location.hash.substring(1);\n\t\t\tswitch (photoset) {\t\t\t\t\t\t\t \t\t// convert string to flikr photoset id\n\t\t\tcase \"decks\":\n\t\t\t\tphotoset = \"72157626337904479\"\n\t\t\t\tbreak;\n\t\t\tcase \"bathrooms\":\n\t\t\t\tphotoset = \"72157629682777453\"\n\t\t\t\tbreak;\n\t\t\tcase \"kitchens\":\n\t\t\t\tphotoset = \"72157629318222372\"\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tphotoset = \"72157626337904479\" \n\t\t\t\tbreak;\n\t\t\t}\n\t\t\treturn photoset;\n\t\t}", "function get_subsection_url(html) {\r\n var friendId = null;\r\n var page_nums = [1]; //Start with one page of results\r\n //Look for anything like this:\r\n //http://friends.myspace.com/index.cfm?fuseaction=user.viewfriends&friendId=30920517&p=5\r\n var results = html.match(/index.cfm\\?fuseaction=user\\.viewfriends&friendId=(\\d+)/);\r\n if (results && results[1]) {\r\n friendId = results[1];\r\n }\r\n else {\r\n if (mydebug) alert('Could not find friendId');\r\n }\r\n results = html.match(/index.cfm\\?fuseaction=user\\.viewfriends&friendId=\\d+&p=\\d+\"/g);\r\n if (results) {\r\n for (i=0;i<results.length;i++) {\r\n //Get our friendId if we dont yet have it.\r\n var page_num = results[i].match(/(\\d+)\"$/);\r\n if (page_num) {\r\n page_nums.push(page_num[1]);\r\n }\r\n }\r\n }\r\n else {\r\n //Case where there is not enough friends for paging (like 11)\r\n return 'http://www.myspace.com/index.cfm?fuseaction=user.viewfriends&friendId=' + friendId;\r\n }\r\n\r\n var random_page = Math.floor(Math.random() * array_max(page_nums)) + 1;\r\n var ret = 'http://www.myspace.com/index.cfm?fuseaction=user.viewfriends&friendId=' + friendId + '&p=' + random_page;\r\n return ret;\r\n}", "function parseUrl() {\r\n var hash = window.location.hash.substr(1),\r\n rez = hash.split(\"-\"),\r\n index = rez.length > 1 && /^\\+?\\d+$/.test(rez[rez.length - 1]) ? parseInt(rez.pop(-1), 10) || 1 : 1,\r\n gallery = rez.join(\"-\");\r\n\r\n return {\r\n hash: hash,\r\n /* Index is starting from 1 */\r\n index: index < 1 ? 1 : index,\r\n gallery: gallery\r\n };\r\n }", "function parseUrl() {\r\n var hash = window.location.hash.substr(1),\r\n rez = hash.split(\"-\"),\r\n index = rez.length > 1 && /^\\+?\\d+$/.test(rez[rez.length - 1]) ? parseInt(rez.pop(-1), 10) || 1 : 1,\r\n gallery = rez.join(\"-\");\r\n\r\n return {\r\n hash: hash,\r\n /* Index is starting from 1 */\r\n index: index < 1 ? 1 : index,\r\n gallery: gallery\r\n };\r\n }", "function getPokemonId(url){\n\treturn url.slice(33, url.length-1);\n}", "function getIndexVonMitarbeiter() {\n var query = window.location.href\n console.log(query)\n var vars = query.split(\"/\");\n\n return vars[4]\n\n}", "function getQueryVariableShortened(url){\n\n return url.split(\"/\")[3];\n}", "function parseUrl() {\n var hash = window.location.hash.substr(1),\n rez = hash.split(\"-\"),\n index = rez.length > 1 && /^\\+?\\d+$/.test(rez[rez.length - 1]) ? parseInt(rez.pop(-1), 10) || 1 : 1,\n gallery = rez.join(\"-\");\n\n return {\n hash: hash,\n /* Index is starting from 1 */\n index: index < 1 ? 1 : index,\n gallery: gallery\n };\n }", "function parseUrl() {\n var hash = window.location.hash.substr(1),\n rez = hash.split(\"-\"),\n index = rez.length > 1 && /^\\+?\\d+$/.test(rez[rez.length - 1]) ? parseInt(rez.pop(-1), 10) || 1 : 1,\n gallery = rez.join(\"-\");\n\n return {\n hash: hash,\n /* Index is starting from 1 */\n index: index < 1 ? 1 : index,\n gallery: gallery\n };\n }", "function parseUrl() {\n var hash = window.location.hash.substr(1),\n rez = hash.split(\"-\"),\n index = rez.length > 1 && /^\\+?\\d+$/.test(rez[rez.length - 1]) ? parseInt(rez.pop(-1), 10) || 1 : 1,\n gallery = rez.join(\"-\");\n\n return {\n hash: hash,\n /* Index is starting from 1 */\n index: index < 1 ? 1 : index,\n gallery: gallery\n };\n }", "function changeUrlFragment(targetGroup) {\n document.location.hash = \"#\" + targetGroup + \"_tab\";\n }", "function parseUrl() {\n var hash = window.location.hash.substr(1),\n rez = hash.split(\"-\"),\n index = rez.length > 1 && /^\\+?\\d+$/.test(rez[rez.length - 1]) ? parseInt(rez.pop(-1), 10) || 1 : 1,\n gallery = rez.join(\"-\");\n\n return {\n hash: hash,\n /* Index is starting from 1 */\n index: index < 1 ? 1 : index,\n gallery: gallery\n };\n }", "function extractIdFromUrl( url ) {\n if ( !url ) {\n return;\n }\n\n var matches = url.match( rWebUrl );\n return matches ? matches[0].substr(10) : \"\";\n }", "getBaseUrl() {\r\n let $encodeURI = encodeURI;\r\n let fragment = decodeURI(this.fragment);\r\n if (fragment === '') {\r\n let nonEmptyRoute = this.router.routes.find(route => {\r\n return route.name === this.config.name &&\r\n route.route !== '';\r\n });\r\n if (nonEmptyRoute) {\r\n fragment = nonEmptyRoute.route;\r\n }\r\n }\r\n if (!this.params) {\r\n return $encodeURI(fragment);\r\n }\r\n let wildcardName = this.getWildCardName();\r\n let path = this.params[wildcardName] || '';\r\n if (!path) {\r\n return $encodeURI(fragment);\r\n }\r\n return $encodeURI(fragment.substr(0, fragment.lastIndexOf(path)));\r\n }", "function parseUrl() {\r\n var hash = window.location.hash.substr( 1 );\r\n var rez = hash.split( '-' );\r\n var index = rez.length > 1 && /^\\+?\\d+$/.test( rez[ rez.length - 1 ] ) ? parseInt( rez.pop( -1 ), 10 ) || 1 : 1;\r\n var gallery = rez.join( '-' );\r\n\r\n\t\t// Index is starting from 1\r\n\t\tif ( index < 1 ) {\r\n\t\t\tindex = 1;\r\n\t\t}\r\n\r\n return {\r\n hash : hash,\r\n index : index,\r\n gallery : gallery\r\n };\r\n }", "function parseUrl() {\n var hash = window.location.hash.substr( 1 );\n var rez = hash.split( '-' );\n var index = rez.length > 1 && /^\\+?\\d+$/.test( rez[ rez.length - 1 ] ) ? parseInt( rez.pop( -1 ), 10 ) || 1 : 1;\n var gallery = rez.join( '-' );\n\n // Index is starting from 1\n if ( index < 1 ) {\n index = 1;\n }\n\n return {\n hash : hash,\n index : index,\n gallery : gallery\n };\n }", "static setUnitMetric(unit) {\n if (unit === 'm' || unit === 'metres') {\n return `&units=metric`;\n }\n return ``;\n }", "function previousSubunit()\n {\n var m = my.current.unitNo\n var n = my.current.subunitNo\n\n if (!currentSubunitIsTheFirstSubunit()) {\n if (n == 1) {\n // If the user is at unit M.1, go to unit (M - 1).L\n // where L is the last subunit of the previous unit.\n previousUnit = unit(m - 1)\n var previousSubunitTitles = []\n for (var subunitTitle in previousUnit.subunits) {\n previousSubunitTitles.push(subunitTitle)\n }\n\n m--\n n = previousSubunitTitles.length\n } else {\n // If the user is at unit M.N, go to unit M.(N - 1)\n n--\n }\n }\n\n window.location.href = unitHref(m, n)\n }", "function getBuildingID() {\n\n //get mapName from URL file (buildingID=\"X-X-X\".svg)\n var URL = window.location.href;\n var mapName = URL.substring(\n URL.lastIndexOf(\"buildingID=\") +11, \n URL.lastIndexOf(\".svg\")\n );\n \n \n var notMain = URL.includes(\"buildingID=\");\n if (!notMain){\n mapName = \"mainMap\";\n }\n \n return mapName;\n \n }", "function findMaterialIndex(material) {\n let str = material.match(/((###)(\\s+)(\\d+))/);\n if (str) {\n // console.log(str[4])\n return str[4];\n }\n}", "function getUTUBEID(url) {\n\tid_start = url.indexOf('/v') + 3;\n\turl = url.slice(id_start);\n\tid_end = url.indexOf('&');\n\tif (id_end == -1) {\n\t\t// no query paramters\n\t} else {\n\t\turl = url.slice(0, id_end);\n\t}\n\treturn url;\n}", "function getUTUBEID(url) {\n\tid_start = url.indexOf('/v') + 3;\n\turl = url.slice(id_start);\n\tid_end = url.indexOf('&');\n\tif (id_end == -1) {\n\t\t// no query paramters\n\t} else {\n\t\turl = url.slice(0, id_end);\n\t}\n\treturn url;\n}", "function displaySubunitLinks()\n {\n // Delete all existing subunit links\n var linksDiv = my.html.subunitLinks\n while (linksDiv.firstChild &&\n linksDiv.firstChild.className != 'stretch') {\n\n linksDiv.removeChild(linksDiv.firstChild)\n }\n\n // Create new subunit links for the unit m\n var numberOfSubunits = my.current.subunitTitles.length\n for (var i = numberOfSubunits - 1; i >= 0; i--) {\n // Insert whitespaces between div elements, otherwise they\n // would not be justified\n var whitespace = document.createTextNode('\\n')\n linksDiv.insertBefore(whitespace, linksDiv.firstChild)\n\n var label = my.current.subunitTitles[i]\n var selected = (i + 1 == my.current.subunitNo)\n var href = unitHref(my.current.unitNo, i + 1)\n\n var subunitDiv = boxedLink(label, selected, href)\n subunitDiv.id = 'subunit' + (i + 1)\n subunitDiv.style.width = (95 / numberOfSubunits) + '%'\n\n linksDiv.insertBefore(subunitDiv, linksDiv.firstChild)\n }\n }", "function getPageRoute(pageId) {\n return pageId.split('-')[2];\n}", "function seite_parameter() {return window.location.href.substr(window.location.href.indexOf(fragezeichen)+1);}", "function parseUrl() {\n var hash = window.location.hash.substr( 1 );\n var rez = hash.split( '-' );\n var index = rez.length > 1 && /^\\+?\\d+$/.test( rez[ rez.length - 1 ] ) ? parseInt( rez.pop( -1 ), 10 ) || 1 : 1;\n var gallery = rez.join( '-' );\n\n\t\t// Index is starting from 1\n\t\tif ( index < 1 ) {\n\t\t\tindex = 1;\n\t\t}\n\n return {\n hash : hash,\n index : index,\n gallery : gallery\n };\n }", "function parseUrl() {\n var hash = window.location.hash.substr( 1 );\n var rez = hash.split( '-' );\n var index = rez.length > 1 && /^\\+?\\d+$/.test( rez[ rez.length - 1 ] ) ? parseInt( rez.pop( -1 ), 10 ) || 1 : 1;\n var gallery = rez.join( '-' );\n\n\t\t// Index is starting from 1\n\t\tif ( index < 1 ) {\n\t\t\tindex = 1;\n\t\t}\n\n return {\n hash : hash,\n index : index,\n gallery : gallery\n };\n }", "function parseUrl() {\n var hash = window.location.hash.substr( 1 );\n var rez = hash.split( '-' );\n var index = rez.length > 1 && /^\\+?\\d+$/.test( rez[ rez.length - 1 ] ) ? parseInt( rez.pop( -1 ), 10 ) || 1 : 1;\n var gallery = rez.join( '-' );\n\n\t\t// Index is starting from 1\n\t\tif ( index < 1 ) {\n\t\t\tindex = 1;\n\t\t}\n\n return {\n hash : hash,\n index : index,\n gallery : gallery\n };\n }", "function parseUrl() {\n var hash = window.location.hash.substr( 1 );\n var rez = hash.split( '-' );\n var index = rez.length > 1 && /^\\+?\\d+$/.test( rez[ rez.length - 1 ] ) ? parseInt( rez.pop( -1 ), 10 ) || 1 : 1;\n var gallery = rez.join( '-' );\n\n\t\t// Index is starting from 1\n\t\tif ( index < 1 ) {\n\t\t\tindex = 1;\n\t\t}\n\n return {\n hash : hash,\n index : index,\n gallery : gallery\n };\n }", "function getItemNum (url) {\n return url.substr (url.lastIndexOf('/')+1, url.length-1);\n}", "function getHeroID(){\n const urlparams = new URLSearchParams(window.location.search);\n return urlparams.get('id');\n }", "function getId() {\n var url = window.location.pathname.split('/')\n\n return url[url.length - 3]\n}", "matchFragment(frag, start = 0, end = frag.childCount) {\n let cur = this;\n for (let i = start; cur && i < end; i++)\n cur = cur.matchType(frag.child(i).type);\n return cur;\n }", "multiUnitParams(props = this.props) {\n return `?unit_ids=${this.unit_ids(props)}${this.getDateParams(props)}`\n }", "function extractQuerystring(url) {\r\n var queryStart = url.indexOf('?');\r\n if (!queryStart) {\r\n return '';\r\n }\r\n var fragmentStart = url.indexOf('#', queryStart);\r\n return url.substring(queryStart, fragmentStart > 0 ? fragmentStart : undefined);\r\n}", "function getHashNum() {\r\n var hash = window.location.hash.split('/');\r\n if (hash.length > 1) {\r\n return parseInt(hash[2]) - 1;\r\n } else {\r\n return '';\r\n }\r\n }", "getVideoID(){\n return location.href.split('/').pop().replace('#','');\n }", "function parseURLParentID(number) {\n let queryString = decodeURIComponent(window.location.search);\n let queries = queryString.split(\"?\");\n let searchQueries = queries[number];\n return searchQueries;\n}", "function getConcreteFragmentHash(fragment) {\n\t var instanceHash = fragment.__instanceHash__;\n\t if (instanceHash == null) {\n\t instanceHash = (_nextFragmentID++).toString();\n\t fragment.__instanceHash__ = instanceHash;\n\t }\n\t return instanceHash;\n\t}", "function getConcreteFragmentHash(fragment) {\n\t var instanceHash = fragment.__instanceHash__;\n\t if (instanceHash == null) {\n\t instanceHash = (_nextFragmentID++).toString();\n\t fragment.__instanceHash__ = instanceHash;\n\t }\n\t return instanceHash;\n\t}", "function getIDfromURL() {\n var url = window.location.href;\n var endofurl = url.split('=');\n var cur_uid = endofurl[endofurl.length-1];\n return cur_uid;\n}", "function idFromUrl(url) {\n var last3 = url.slice(-3);\n if (last3[0] === \"/\") return url.slice(-2)\n if (last3[1] === \"/\") return url.slice(-1);\n return last3;\n }", "function GetMaxStorageUnitNumber(nStudyID)\n{\n\tvar hidMaxStorageUnitNumber = document.getElementById('hidMaxStorageUnitNumber');\n\tvar oSpan = document.getElementById('oSpan');\n\n\tfor (var i=0;i<aMaxStorageUnits.length;i++)\n\t{\n\t\tif (aMaxStorageUnits[i][0] == nStudyID)\n\t\t{\n\t\t\toSpan.innerHTML = ' Max. Unit Number: ' + aMaxStorageUnits[i][1];\n\t\t\thidMaxStorageUnitNumber.value = aMaxStorageUnits[i][1];\n\t\t\tbreak;\n\t\t}\n\t}\n}", "function extractQuerystring(url) {\n var queryStart = url.indexOf('?');\n if (!queryStart) {\n return '';\n }\n var fragmentStart = url.indexOf('#', queryStart);\n return url.substring(queryStart, fragmentStart > 0 ? fragmentStart : undefined);\n}", "function extractQuerystring(url) {\n var queryStart = url.indexOf('?');\n if (!queryStart) {\n return '';\n }\n var fragmentStart = url.indexOf('#', queryStart);\n return url.substring(queryStart, fragmentStart > 0 ? fragmentStart : undefined);\n}", "function extractQuerystring(url) {\n var queryStart = url.indexOf('?');\n if (!queryStart) {\n return '';\n }\n var fragmentStart = url.indexOf('#', queryStart);\n return url.substring(queryStart, fragmentStart > 0 ? fragmentStart : undefined);\n}", "function extractQuerystring(url) {\n var queryStart = url.indexOf('?');\n if (!queryStart) {\n return '';\n }\n var fragmentStart = url.indexOf('#', queryStart);\n return url.substring(queryStart, fragmentStart > 0 ? fragmentStart : undefined);\n}", "function extractQuerystring(url) {\n var queryStart = url.indexOf('?');\n if (!queryStart) {\n return '';\n }\n var fragmentStart = url.indexOf('#', queryStart);\n return url.substring(queryStart, fragmentStart > 0 ? fragmentStart : undefined);\n}", "function getID(string) {\n\n /* Variables */\n var id = 0;\n var page = 1;\n var res = string.split(\"/\");\n\n /* Retrieve studio ID. */\n res.forEach(function(element) {\n if(/^\\d+$/.test(element)) {\n id = element;\n }\n });\n\n /* Check for invalid URL. */\n if (id == 0) {\n linkError();\n return;\n }\n return id;\n}", "getTagFromLocation() {\n let a = location.hash.slice(1).split('/')\n return a[a.length-2];\n }", "function getSectionAndSubsectionFromURL () {\n let sectionId = (document.location.hash || '').split('#').pop();\n let subSectionElement = document.querySelector('section #' + sectionId);\n\n if (subSectionElement) {\n // locate section\n let subSectionId = sectionId;\n let sectionElement = subSectionElement;\n while (sectionElement && sectionElement.className.indexOf('container-info-topic') < 0) {\n sectionElement = sectionElement.parentNode;\n }\n\n return {\n sectionId: sectionElement.id,\n subSectionId\n };\n } else {\n return {\n sectionId: sectionId,\n subSectionId: null\n };\n }\n}", "getSectionId(subsection) {\n let lastCount = this.sections.length;\n if (lastCount == undefined)\n lastCount = 0;\n let id = \"sec\" + lastCount;\n // Now have last count of sections ( if not )\n if (subsection) {\n id += \"_\";\n // Get subsection count;\n let lastsubcount = 0;\n let lastsection = this.sections[this.sections.length - 1];\n if (lastsection) {\n if (lastsection.children)\n lastsubcount = lastsection.children.length;\n }\n // append subsection count\n id += lastsubcount;\n }\n }", "function page_uri() {\n\treturn window.location.href.split('#')[0];\n}", "fragment(editor, at) {\n var range = Editor.range(editor, at);\n var fragment = Node.fragment(editor, range);\n return fragment;\n }", "fragment(editor, at) {\n var range = Editor.range(editor, at);\n var fragment = Node.fragment(editor, range);\n return fragment;\n }", "function getHash() {\n\t\tvar routeHash = window.location.hash;\n\t\treturn routeHash.substring(1); }", "function MakeId3(idprefix, m, n) {\n return idprefix + m + \"_\" + n;\n}", "function set_url(fragment) {\n var baseurl = window.location.protocol+\"//\"+window.location.host+window.location.pathname\n var url = baseurl + fragment;\n $('span#cur_url').html(\"<a href='\"+url+\"'>\"+url+\"</a>\"); \n}", "getTagFromLocation() {\n let a = location.hash.slice(1).split('/')\n return a[a.length-1];\n }", "function extractQuerystring(url) {\r\n const queryStart = url.indexOf('?');\r\n if (!queryStart) {\r\n return '';\r\n }\r\n const fragmentStart = url.indexOf('#', queryStart);\r\n return url.substring(queryStart, fragmentStart > 0 ? fragmentStart : undefined);\r\n}", "function url() {\n var u = a + b + c + d\n return u\n }", "function ml(){function a(a){a=a.slice(1).split(\"&\");for(var b=0;b<a.length;b++){var d=a[b].split(\"=\");c[decodeURIComponent(d[0])]=decodeURIComponent(d[1])}}var b=g.location||{},c={},d=b.hash;d&&a(d);(b=b.search)&&a(b);return c}", "function getIdFromUrl(urlData,id){\n\t// let arr = ulr.split(\"-\");\n\tlet arr2 = ulr.indexOf(id);\n\tlet arr3 = ulr.substr(arr2, id.length);\n\treturn arr3;\n}", "function get_dropdown_id(page) {\n b = document.assign.drop.value;\n a = page + b;\n document.location.href = a;\n}", "function getUrlId() {\n return getURLSearch().replace('id=', '');\n}", "getProjectID() {\n\n console.log(\"TCL: getProjectID -> this.props.locationData\", this.props.locationData)\n\n const {projectID} = this.props.locationData.match.params;\n \n const requestID = projectID.substr(projectID.indexOf('GSD')+3,projectID.length);\n\n return requestID\n }", "function parse_imageId() {\n\t// URL is like http://emptysquare.net/photography/lower-east-side/#5/\n\t// fragment from http://benalman.com/code/projects/jquery-bbq/examples/fragment-basic/\n\tvar fragment = $.param.fragment();\n\tif (fragment.length) {\n\t\t// URL's image index is 1-based, our internal index is 0-based\n\t\timageId = parseInt(fragment.replace(/\\//g, '')) - 1;\n\t\tif (imageId < 0 || isNaN(imageId)) imageId = 0;\n\t} else {\n\t\timageId = 0;\n\t}\n}", "function getSetID(url) {\n return /\\d{6,}/g.exec(url)[0];\n }", "function extractIdFromUrl( url ) {\n if ( !url ) {\n return;\n }\n\n var matches = urlRegex.exec( url );\n\n // Return id, which comes after first equals sign\n return matches ? matches[1] : \"\";\n }", "function jq_param_sub( is_fragment, get_func, url, params, merge_mode ) {\n var result,\n qs,\n matches,\n url_params,\n hash;\n \n if ( params !== undefined ) {\n // Build URL by merging params into url string.\n \n // matches[1] = url part that precedes params, not including trailing ?/#\n // matches[2] = params, not including leading ?/#\n // matches[3] = if in 'querystring' mode, hash including leading #, otherwise ''\n matches = url.match( is_fragment ? re_fragment : /^([^#?]*)\\??([^#]*)(#?.*)/ );\n \n // Get the hash if in 'querystring' mode, and it exists.\n hash = matches[3] || '';\n \n if ( merge_mode === 2 && is_string( params ) ) {\n // If merge_mode is 2 and params is a string, merge the fragment / query\n // string into the URL wholesale, without converting it into an object.\n qs = params.replace( is_fragment ? re_params_fragment : re_params_querystring, '' );\n \n } else {\n // Convert relevant params in url to object.\n url_params = jq_deparam( matches[2] );\n \n params = is_string( params )\n \n // Convert passed params string into object.\n ? jq_deparam[ is_fragment ? str_fragment : str_querystring ]( params )\n \n // Passed params object.\n : params;\n \n qs = merge_mode === 2 ? params // passed params replace url params\n : merge_mode === 1 ? $.extend( {}, params, url_params ) // url params override passed params\n : $.extend( {}, url_params, params ); // passed params override url params\n \n // Convert params object into a sorted params string.\n qs = jq_param_sorted( qs );\n \n // Unescape characters specified via $.param.noEscape. Since only hash-\n // history users have requested this feature, it's only enabled for\n // fragment-related params strings.\n if ( is_fragment ) {\n qs = qs.replace( re_no_escape, decode );\n }\n }\n \n // Build URL from the base url, querystring and hash. In 'querystring'\n // mode, ? is only added if a query string exists. In 'fragment' mode, #\n // is always added.\n result = matches[1] + ( is_fragment ? fragment_prefix : qs || !matches[1] ? '?' : '' ) + qs + hash;\n \n } else {\n // If URL was passed in, parse params from URL string, otherwise parse\n // params from window.location.href.\n result = get_func( url !== undefined ? url : location.href );\n }\n \n return result;\n }", "function extractIdFromUri( url ) {\n if ( !url ) {\n return;\n }\n\n var matches = urlRegex.exec( url );\n\n // Return id, which comes after first equals sign\n return matches ? matches[1] : \"\";\n }" ]
[ "0.59477466", "0.593649", "0.5595272", "0.5579261", "0.5552435", "0.5512202", "0.5512202", "0.5512202", "0.5494468", "0.5494468", "0.5205885", "0.51779586", "0.51635396", "0.511326", "0.5038234", "0.49963725", "0.49533242", "0.49533242", "0.4853974", "0.48509097", "0.48320642", "0.48295593", "0.4820523", "0.4772506", "0.46751952", "0.4662405", "0.46560073", "0.46526718", "0.46282628", "0.46000108", "0.45928195", "0.4581701", "0.4581701", "0.45510906", "0.45419207", "0.45336694", "0.45336562", "0.45336562", "0.45336562", "0.45224577", "0.45109925", "0.45032597", "0.4501288", "0.44927278", "0.44786677", "0.44718572", "0.446512", "0.44650453", "0.4463554", "0.4451172", "0.4451172", "0.44502693", "0.44495603", "0.44484112", "0.44382206", "0.44382206", "0.44382206", "0.44382206", "0.44171202", "0.44151998", "0.43946132", "0.43886244", "0.43847916", "0.43820897", "0.4380416", "0.4375747", "0.4371356", "0.43682808", "0.43682808", "0.43668607", "0.43605113", "0.43403175", "0.43271393", "0.43271393", "0.43271393", "0.43271393", "0.43271393", "0.43248734", "0.43233052", "0.43224257", "0.43203008", "0.4310904", "0.43051118", "0.43051118", "0.42971045", "0.42919743", "0.42902634", "0.42864653", "0.42773896", "0.4267629", "0.42639142", "0.4260098", "0.42579556", "0.42569995", "0.42526495", "0.42481205", "0.42332977", "0.422864", "0.42279443", "0.42068964" ]
0.6636278
0
Process the current URL and perform appropriate tasks. This function is called automatically when the fragment identifier in the current URL changes.
function processURLChange() { switch(window.location.hash) { case '#restart': currentSubunit() break case '#previous': previousSubunit() break case '#next': nextSubunit() break default: updateUnitFromURL() } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "processURL() {\n\t\t\tlet urlParams = {};\n\t\t\t// Get URL params - split em up - loop over them - fill urlParams object\n\t\t\twindow.location.search\n\t\t\t\t.replace('?', '')\n\t\t\t\t.split('&')\n\t\t\t\t.forEach(chunks => {\n\t\t\t\t\tlet kv = chunks.split('=');\n\t\t\t\t\turlParams[kv[0]] = kv[1];\n\t\t\t\t});\n\t\t\t// If a command URL is present.\n\t\t\tif (urlParams.hasOwnProperty('note')) {\n\t\t\t\tmethods.add('note', urlParams);\n\t\t\t\t// Clear the state.\n\t\t\t\twindow.history.pushState({}, document.title, '/');\n\t\t\t}\n\t\t}", "function do_fragment_change() {\n var fragment = window.location.hash;\n set_url(fragment);\n\n if (fragment.match(/^#t=/)) {\n do_time_change(fragment);\n }\n else if (fragment.match(/^#!/)) {\n do_transcript_change(fragment);\n }\n}", "function checkURL() {\n\t\tvar url = window.location.href;\n\t\t\n\t\tif(url != lastQuery) {\n\t\t\tvar parsedURL = parseURL(url);\n\t\t\t\n\t\t\tvar routeAndParams = findMatchingRoute(parsedURL);\n\t\t\t\n\t\t\tif(routeAndParams !== false) {\n\t\t\t\ttry {\n\t\t\t\t\tvar route = routeAndParams[0];\n\t\t\t\t\tvar params = routeAndParams[1];\n\t\t\t\t\t\n\t\t\t\t\troute[2].call(route[3], params);\n\t\t\t\t} catch(e) {\n\t\t\t\t\tif(e.message != \"StopProcessingHandlerException\") {\n\t\t\t\t\t\tthrow e;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tlastQuery = url;\n\t\t}\n\t}", "function _urlChangedCallback() {\n if (_oldHref == location.href) {\n return;\n }\n _oldHref = location.href\n var parsedUrl = {href: location.href};\n if (urlParser) {\n parsedUrl = urlParser.parse(location.href);\n }\n //var newLocation = parse(location.href);\n var changes = {};\n for (var entry in parsedUrl) {\n if (parsedUrl[entry] != _oldParsedUrl[entry]) {\n\n\n changes[entry] = {\n \"old\": _oldParsedUrl[entry],\n \"new\": parsedUrl[entry]\n }\n\n\n }\n }\n for (var entry in changes) {\n var callbackName = \"on\" + entry + \"changed\";\n if (_export[callbackName] && (_export[callbackName] instanceof Function)) {\n _export[callbackName].call(null, changes);\n }\n }\n _oldParsedUrl = parsedUrl;\n\n }", "function _urlChangedCallback() {\n if (_oldHref == location.href) {\n return;\n }\n _oldHref = location.href\n var parsedUrl = {href: location.href};\n if (urlParser) {\n parsedUrl = urlParser.parse(location.href);\n }\n //var newLocation = parse(location.href);\n var changes = {};\n for (var entry in parsedUrl) {\n if (parsedUrl[entry] != _oldParsedUrl[entry]) {\n\n\n changes[entry] = {\n \"old\": _oldParsedUrl[entry],\n \"new\": parsedUrl[entry]\n }\n\n\n }\n }\n for (var entry in changes) {\n var callbackName = \"on\" + entry + \"changed\";\n if (_export[callbackName] && (_export[callbackName] instanceof Function)) {\n _export[callbackName].call(null, changes);\n }\n }\n _oldParsedUrl = parsedUrl;\n\n }", "function runWhenURLMet(){\n url = location.hash.slice(1).split(\"?\")[0];\n data = location.hash.slice(1).split(\"?\");\n \n setActive(url);\n\n if (url === \"home\"){\n list(\"products\", \"homeul\",true);\n }\n if (url === \"login\" || url === \"\"){\n document.getElementById(\"menu\").style.display = \"none\";\n document.getElementById(\"returnBtn\").style.display = \"none\";\n }\n if (url !== \"login\" && url !== \"\"){\n document.getElementById(\"menu\").style.display = \"flex\";\n document.getElementById(\"returnBtn\").style.display = \"block\";\n }\n if (url === \"detail\"){\n details(data[1]);\n }\n}", "parseUrl () {\r\n this.currentIndex = this.getParameter(\"index\");\r\n this.currentFolder = this.findSubnavFolderByIndex(this.currentIndex);\r\n\r\n const page = this.getParameter(\"page\");\r\n\r\n if (this.currentFolder) {\r\n const target = document.querySelector(`#${page}`);\r\n\r\n this.toggleActivePages(target);\r\n this.toggleActiveSubnav(this.currentIndex);\r\n } else {\r\n const target = document.querySelector(\"#flight-ops-home\");\r\n\r\n this.toggleActivePages(target);\r\n this.toggleActiveSubnav(0);\r\n }\r\n }", "function processUrlParameters() {\n\tvar params = window.location.hash.substring(1).split('&');\n\tfor (i in params) {\n\t\tvar pair = params[i].split('=');\n\t\tvar handler = parameterMap[pair[0]];\n\t\tif (handler) {\n\t\t\thandler(pair[1]);\n\t\t}\n\t}\n}", "function updateUrlFragment() {\n window.history.replaceState(null, '', '#' + (currentSlideNumber + 1))\n}", "function updateUrlFragment() {\n window.history.replaceState(null, '', '#' + (currentSlideNumber + 1))\n}", "function poll() {\n var hash = get_fragment(),\n history_hash = history_get( last_hash );\n \n if ( hash !== last_hash ) {\n history_set( last_hash = hash, history_hash );\n \n $(window).trigger( str_hashchange );\n \n } else if ( history_hash !== last_hash ) {\n location.href = location.href.replace( /#.*/, '' ) + history_hash;\n }\n \n timeout_id = setTimeout( poll, $.fn[ str_hashchange ].delay );\n }", "function poll() {\n var hash = get_fragment(),\n history_hash = history_get( last_hash );\n \n if ( hash !== last_hash ) {\n history_set( last_hash = hash, history_hash );\n \n $(window).trigger( str_hashchange );\n \n } else if ( history_hash !== last_hash ) {\n location.href = location.href.replace( /#.*/, '' ) + history_hash;\n }\n \n timeout_id = setTimeout( poll, $.fn[ str_hashchange ].delay );\n }", "function poll() {\n var hash = get_fragment(),\n history_hash = history_get( last_hash );\n \n if ( hash !== last_hash ) {\n history_set( last_hash = hash, history_hash );\n \n $(window).trigger( str_hashchange );\n \n } else if ( history_hash !== last_hash ) {\n location.href = location.href.replace( /#.*/, '' ) + history_hash;\n }\n \n timeout_id = setTimeout( poll, $.fn[ str_hashchange ].delay );\n }", "function poll() {\n var hash = get_fragment(),\n history_hash = history_get(last_hash);\n\n if (hash !== last_hash) {\n history_set(last_hash = hash, history_hash);\n\n $(window).trigger(str_hashchange);\n\n } else if (history_hash !== last_hash) {\n location.href = location.href.replace(/#.*/, '') + history_hash;\n }\n\n timeout_id = setTimeout(poll, $.fn[str_hashchange].delay);\n }", "function poll() {\n var hash = get_fragment(),\n history_hash = history_get(last_hash);\n\n if (hash !== last_hash) {\n history_set(last_hash = hash, history_hash);\n\n $(window).trigger(str_hashchange);\n\n } else if (history_hash !== last_hash) {\n location.href = location.href.replace(/#.*/, '') + history_hash;\n }\n\n timeout_id = setTimeout(poll, $.fn[str_hashchange].delay);\n }", "function parseCurrentUrlParams () {\n\t\tme.urlParams = me.paramsToObject(window.location.search.substr(1));\n\t}", "function hashChange() {\n var hash = window.location.hash.slice(1);\n var ind = dayMap.indexOf(hash);\n console.log(hash, ind)\n if(hash && ind)\n detailPage(ind);\n else\n homePage();\n }", "function updatePageUrl() {\n // here we have updated the globals so we will take the url data from the history object\n // unless its the list view where we use the default dates\n // (if we were coming from the updated url ones the setPageUrl method would trigger instead of this one)\n if (scheduled.currentView == 'list') {\n scheduled.listDateStart = scheduled.defaultlistDateStart;\n scheduled.listDateEnd = scheduled.defaultlistDateEnd;\n }\n\n var urlParams = createUrl();\n var url = window.location.origin + window.location.pathname + urlParams;\n History.pushState(null, null, url);\n }", "function locationHashChanged() {\n var hash = location.hash.slice(1);\n router.handleURL(hash);\n}", "function updateURLFragment(path) {\n window.location.hash = path;\n }", "function poll() {\n var hash = get_fragment(),\n history_hash = history_get( last_hash );\n \n if ( hash !== last_hash ) {\n history_set( last_hash = hash, history_hash );\n \n $(window).trigger( str_hashchange );\n \n } else if ( history_hash !== last_hash ) {\n location.href = location.href.replace( /#.*/, '' ) + history_hash;\n }\n \n timeout_id = window.setTimeout( poll, $.fn[ str_hashchange ].delay );\n}", "function processHashInstruction() {\n switch (window.location.hash) {\n case '#nocache':\n deleteAllCaches();\n Common.customAlert('Deleted all Caches');\n break;\n\n case '#unregister':\n unregisterServiceWorkers();\n Common.customAlert('Unregistered Service Workers');\n break;\n\n case '#deletestorage':\n localStorage.clear();\n Common.customAlert('Deleted Storage');\n break;\n }\n}", "function dealWithHash () {\n\tif (!_ignoreHashChangeOnce) {\n\t\tvar hash = window.location.hash.substr(1);\n\t\tconsole.log('Hash changed to: '+hash);\n\t\tif (hash != '') {\n\t\t\tsetupAndSendAjaxRequest(hash);\n\t\t}else{\n\t\t\tsetupAndSendAjaxRequest('pages/home.html');\n\t\t}\n\t}\n\t_ignoreHashChangeOnce = false;\n}", "function onHashChange() {\n\t\tupdateActiveTab();\n\t\tupdateActiveSection();\n\t}", "function handleNewHash() {\n var location = window.location.hash.replace(/^#\\/?|\\/$/g, '').split('/');\n}", "checkUrl(/* e */) {\n if (this.location.pathname === this.fragment) {\n return false\n }\n\n this.loadUrl()\n }", "loadUrl(fragment) {\n fragment = this.fragment = this.location.pathname\n this.onLoadUrl && this.onLoadUrl(fragment, this.location.search)\n }", "handleCurrentRoute()\n\t{\n\t\tconst newQuery = this.props.match.params.query;\n\n\t\tif(this.props.query !== newQuery)\n\t\t{\n\t\t\tthis.props.performSearch(newQuery);\n\t\t}\n\t}", "function onPopAndStart(){\n var l = location.href;\n //http://localhost/.../hash\n var pageName = l.substring(l.lastIndexOf(\"/\")+1);\n // if no pageName set pageName to false\n pageName = pageName || false;\n switchToSection(pageName);\n }", "function hashChangeHandler(){\n if(!isScrolling && !options.lockAnchors){\n var value = window.location.hash.replace('#', '').split('/');\n var section = decodeURIComponent(value[0]);\n var slide = decodeURIComponent(value[1]);\n\n //when moving to a slide in the first section for the first time (first time to add an anchor to the URL)\n var isFirstSlideMove = (typeof lastScrolledDestiny === 'undefined');\n var isFirstScrollMove = (typeof lastScrolledDestiny === 'undefined' && typeof slide === 'undefined' && !slideMoving);\n\n\n if(section.length){\n /*in order to call scrollpage() only once for each destination at a time\n It is called twice for each scroll otherwise, as in case of using anchorlinks `hashChange`\n event is fired on every scroll too.*/\n if ((section && section !== lastScrolledDestiny) && !isFirstSlideMove || isFirstScrollMove || (!slideMoving && lastScrolledSlide != slide )) {\n scrollPageAndSlide(section, slide);\n }\n }\n }\n }", "_update() {\n window.location.pathname = this._current().url;\n }", "start() {\n if (this._started) return;\n\n this.started = true;\n this._onHashChange({newURL: global.location.hash});\n }", "function process_page() {\r\n\tconst loadPage = function(page) {\r\n\t\tconst main = $('#mdl-layout__content');\r\n\t\tmain.html(page);\r\n\t\tprocess_accordions(main);\r\n\t\tprocess_links(main);\r\n\t\tprocess_code_lines();\r\n\t\tcomponentHandler.upgradeDom();\r\n\t\t$(\".app-loading\").fadeOut();\r\n\t}\r\n\t\r\n\tswitch (window.location.hash) {\r\n\t\tcase '':\r\n\t\tcase '#apis':\r\n\t\t\t$(\"#apis\").addClass(\"is-active\");\r\n\t\t\t$(\"#guides\").removeClass(\"is-active\");\r\n\t\t\tloadPage(compileTemplate('apis'));\r\n\t\t\tbreak;\r\n\t\tcase '#guides':\r\n\t\t\t$(\"#apis\").removeClass(\"is-active\");\r\n\t\t\t$(\"#guides\").addClass(\"is-active\");\r\n\t\t\tloadPage(compileTemplate('guides'));\r\n\t\t\tbreak;\r\n\t\tdefault:\t\r\n\t\t\tconst hash = unescape(window.location.hash.substring(1));\r\n\t\t\tconst item = MEMBERS.find(it => it.signature == hash);\r\n\t\t\tif (item) {\r\n\t\t\t\tloadPage(compileTemplate('default', item));\r\n\t\t\t} else {\r\n\t\t\t\tconst guide = GUIDES[hash];\r\n\t\t\t\tif (guide) {\r\n\t\t\t\t\tif (!guide.processed) {\r\n\t\t\t\t\t\tguide.content = process_comment(undefined, guide.content);\r\n\t\t\t\t\t\tguide.processed = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tloadPage(Handlebars.compile(guide.content)());\r\n\t\t\t\t} else {\r\n\t\t\t\t\tloadPage(compileTemplate('error'));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t}\r\n}", "function hashChangeHandler(){\n if(!isScrolling && !options.lockAnchors){\n var value = window.location.hash.replace('#', '').split('/');\n var sectionAnchor = decodeURIComponent(value[0]);\n var slideAnchor = decodeURIComponent(value[1]);\n\n //when moving to a slide in the first section for the first time (first time to add an anchor to the URL)\n var isFirstSlideMove = (typeof lastScrolledDestiny === 'undefined');\n var isFirstScrollMove = (typeof lastScrolledDestiny === 'undefined' && typeof slideAnchor === 'undefined' && !slideMoving);\n\n\n if(sectionAnchor.length){\n /*in order to call scrollpage() only once for each destination at a time\n It is called twice for each scroll otherwise, as in case of using anchorlinks `hashChange`\n event is fired on every scroll too.*/\n if ((sectionAnchor && sectionAnchor !== lastScrolledDestiny) && !isFirstSlideMove || isFirstScrollMove || (!slideMoving && lastScrolledSlide != slideAnchor )) {\n scrollPageAndSlide(sectionAnchor, slideAnchor);\n }\n }\n }\n }", "function hashChangeHandler(){\n if(!isScrolling && !options.lockAnchors){\n var value = window.location.hash.replace('#', '').split('/');\n var sectionAnchor = decodeURIComponent(value[0]);\n var slideAnchor = decodeURIComponent(value[1]);\n\n //when moving to a slide in the first section for the first time (first time to add an anchor to the URL)\n var isFirstSlideMove = (typeof lastScrolledDestiny === 'undefined');\n var isFirstScrollMove = (typeof lastScrolledDestiny === 'undefined' && typeof slideAnchor === 'undefined' && !slideMoving);\n\n\n if(sectionAnchor.length){\n /*in order to call scrollpage() only once for each destination at a time\n It is called twice for each scroll otherwise, as in case of using anchorlinks `hashChange`\n event is fired on every scroll too.*/\n if ((sectionAnchor && sectionAnchor !== lastScrolledDestiny) && !isFirstSlideMove || isFirstScrollMove || (!slideMoving && lastScrolledSlide != slideAnchor )) {\n scrollPageAndSlide(sectionAnchor, slideAnchor);\n }\n }\n }\n }", "function respondToState(){\n\t\t_oldUrl = _currentUrl;\n\t\tif(_useAPI) _currentUrl = cleanUrl(window.location.pathname || \"\");\n\t\telse _currentUrl = cleanUrl(window.location.hash || \"\");\n\t\t//Remove slash in beginning\n\t\tif(_currentUrl == \"/\") _currentUrl = \"\";\n\t\telse if(_currentUrl.indexOf(\"/\") == 0) _currentUrl = _currentUrl.substr(1);\n\t\t//Add slash in end\n\t\tif(_currentUrl.substr(_currentUrl.length-1) != \"/\") _currentUrl = _currentUrl+\"/\";\n\t\tif(_allowCookies || _firstTime) track(); //Track first page. After that only when cookies have been accepted.\n\t\tsetCanonical();\n\t\treadParameters();\n\t\tif(!_firstTime && _oldUrl == _currentUrl){\n\t\t\t//console.log(\"Same url firing statechange\", _oldUrl);\n\t\t\twindow.dispatchEvent(GLBCustomEvent(\"subPageChange\", 0));\n\t\t\treturn;\n\t\t}\n\t\t_firstTime = false;\n\t\tsetTitle();\n\t\t//Pages listening can animIn/Out\n\t\twindow.dispatchEvent(GLBCustomEvent(\"pageChange\", 0));\n\t}", "function _parseAndProcess(event) {\n var splitUrl = event.url.split('?');\n var params = (splitUrl[1]) ? splitUrl[1] : event.url.split('#')[1];\n var paramsSplited = params.split('&');\n var paramsArr = [];\n\n paramsSplited.forEach(function (param) {\n var splited = param.split('=');\n paramsArr[splited[0]] = splited[1];\n });\n\n if (typeof paramsArr['access_token'] !== 'undefined') {\n FB.options({version: 'v2.7', app_id: APP_ID});\n FB.setAccessToken(paramsArr['access_token']);\n s({authResponse: paramsArr['access_token'], status: \"connected\"});\n } else {\n f(paramsArr);\n }\n\n webview.removeEventListener('loadcommit', _loadcommit);\n }", "function listen () {\n\t\tif (interval !== 0) {\n\t\t\t// clear the interval if it's already set\n\t\t\tclearInterval(interval);\n\t\t}\n\n\t\t// start listening for a change in the url\n\t\tinterval = setInterval(function () {\n\t\t\tvar current = window.location.pathname;\n\n\t\t\t// if our store of the current url does not \n\t\t\t// equal the url of the browser, something has changed\n\t\t\tif (location !== current) {\t\t\t\t\t\n\t\t\t\t// update the location\n\t\t\t\tlocation = current;\n\n\t\t\t\t// dispatch route change\n\t\t\t\tdispatch();\n\t\t\t}\n\t\t}, 50);\n\t}", "function hashChangeHandler(){\n var value = window.location.hash.replace('#', '').split('/');\n var sectionAnchor = value[0];\n\n if(sectionAnchor.length){\n /*in order to call scrollpage() only once for each destination at a time\n It is called twice for each scroll otherwise, as in case of using anchorlinks `hashChange`\n event is fired on every scroll too.*/\n if (sectionAnchor && sectionAnchor !== lastScrolledDestiny) {\n var section;\n\n if(isNaN(sectionAnchor)){\n section = $('[data-anchor=\"'+sectionAnchor+'\"]');\n }else{\n section = $('.pp-section').eq( (sectionAnchor -1) );\n }\n scrollPage(section);\n }\n }\n }", "function hashChangeHandler() {\n if (!isScrolling && !options.lockAnchors) {\n var anchors = getAnchorsURL();\n var sectionAnchor = anchors.section;\n var slideAnchor = anchors.slide; //when moving to a slide in the first section for the first time (first time to add an anchor to the URL)\n\n var isFirstSlideMove = typeof lastScrolledDestiny === 'undefined';\n var isFirstScrollMove = typeof lastScrolledDestiny === 'undefined' && typeof slideAnchor === 'undefined' && !slideMoving;\n\n if (sectionAnchor && sectionAnchor.length) {\n /*in order to call scrollpage() only once for each destination at a time\r\n It is called twice for each scroll otherwise, as in case of using anchorlinks `hashChange`\r\n event is fired on every scroll too.*/\n if (sectionAnchor && sectionAnchor !== lastScrolledDestiny && !isFirstSlideMove || isFirstScrollMove || !slideMoving && lastScrolledSlide != slideAnchor) {\n scrollPageAndSlide(sectionAnchor, slideAnchor);\n }\n }\n }\n } //gets the URL anchors (section and slide)", "function hashChangeHandler() {\n if (!isScrolling && !options.lockAnchors) {\n var anchors = getAnchorsURL();\n var sectionAnchor = anchors.section;\n var slideAnchor = anchors.slide;\n\n //when moving to a slide in the first section for the first time (first time to add an anchor to the URL)\n var isFirstSlideMove = (typeof lastScrolledDestiny === 'undefined');\n var isFirstScrollMove = (typeof lastScrolledDestiny === 'undefined' && typeof slideAnchor === 'undefined' && !slideMoving);\n\n if (sectionAnchor.length) {\n /*in order to call scrollpage() only once for each destination at a time\n It is called twice for each scroll otherwise, as in case of using anchorlinks `hashChange`\n event is fired on every scroll too.*/\n if ((sectionAnchor && sectionAnchor !== lastScrolledDestiny) && !isFirstSlideMove ||\n isFirstScrollMove ||\n (!slideMoving && lastScrolledSlide != slideAnchor)) {\n\n scrollPageAndSlide(sectionAnchor, slideAnchor);\n }\n }\n }\n }", "function hashChangeHandler(){\r\n if(!isScrolling && !options.lockAnchors){\r\n var value = window.location.hash.replace('#', '').split('/');\r\n var sectionAnchor = decodeURIComponent(value[0]);\r\n var slideAnchor = decodeURIComponent(value[1]);\r\n\r\n //when moving to a slide in the first section for the first time (first time to add an anchor to the URL)\r\n var isFirstSlideMove = (typeof lastScrolledDestiny === 'undefined');\r\n var isFirstScrollMove = (typeof lastScrolledDestiny === 'undefined' && typeof slideAnchor === 'undefined' && !slideMoving);\r\n\r\n\r\n if(sectionAnchor.length){\r\n /*in order to call scrollpage() only once for each destination at a time\r\n It is called twice for each scroll otherwise, as in case of using anchorlinks `hashChange`\r\n event is fired on every scroll too.*/\r\n if ((sectionAnchor && sectionAnchor !== lastScrolledDestiny) && !isFirstSlideMove || isFirstScrollMove || (!slideMoving && lastScrolledSlide != slideAnchor )) {\r\n scrollPageAndSlide(sectionAnchor, slideAnchor);\r\n }\r\n }\r\n }\r\n }", "function hashChangeHandler(){\r\n if(!isScrolling && !options.lockAnchors){\r\n var value = window.location.hash.replace('#', '').split('/');\r\n var sectionAnchor = decodeURIComponent(value[0]);\r\n var slideAnchor = decodeURIComponent(value[1]);\r\n\r\n //when moving to a slide in the first section for the first time (first time to add an anchor to the URL)\r\n var isFirstSlideMove = (typeof lastScrolledDestiny === 'undefined');\r\n var isFirstScrollMove = (typeof lastScrolledDestiny === 'undefined' && typeof slideAnchor === 'undefined' && !slideMoving);\r\n\r\n\r\n if(sectionAnchor.length){\r\n /*in order to call scrollpage() only once for each destination at a time\r\n It is called twice for each scroll otherwise, as in case of using anchorlinks `hashChange`\r\n event is fired on every scroll too.*/\r\n if ((sectionAnchor && sectionAnchor !== lastScrolledDestiny) && !isFirstSlideMove || isFirstScrollMove || (!slideMoving && lastScrolledSlide != slideAnchor )) {\r\n scrollPageAndSlide(sectionAnchor, slideAnchor);\r\n }\r\n }\r\n }\r\n }", "parseHistory(event, doPushState = true) {\n if (event.detail.needAddBase && this.baseUrl.length) {\n let evPath = event.detail.path;\n if (evPath[0] === \"/\")\n evPath = evPath.substring(1);\n evPath = this.baseUrl + evPath;\n event.detail.path = evPath;\n }\n if (event.detail.path.indexOf(this.baseUrl) == -1 && doPushState !== false)\n return false;\n let path = event.detail.path.replace(this.baseUrl, \"\");\n if (path[0] !== \"/\")\n path = \"/\" + path;\n this.fullUrl = path;\n let detailObj = { path: path };\n if (doPushState)\n history.pushState(detailObj, '', event.detail.path);\n var routeArray = path.split('?');\n var routeInfo = {\n fullPath: routeArray[0],\n route: routeArray[0].split('/'),\n query: {}\n };\n if (routeArray[1]) {\n var routeQuery = routeArray[1].split('&');\n routeQuery.forEach((param) => {\n let keyValue = param.split('=');\n routeInfo.query[keyValue[0]] = keyValue[1];\n });\n }\n var fromPath;\n if (this.currentRoute)\n fromPath = this.currentRoute;\n else\n fromPath = null;\n if (this.transition !== null) {\n this.transitionOut();\n }\n setTimeout(function () {\n this.beforeEachRoute(this.beforeEach, routeInfo, fromPath).then(function () {\n this.currentRoute = routeInfo;\n this.compareRoutes();\n if (this.afterEach)\n this.afterEach(routeInfo, fromPath);\n if (this.transition !== null) {\n this.transitionIn();\n }\n }.bind(this));\n }.bind(this), this.transitionDuration.leavingDuration + 10);\n }", "function updateState(){\r\n // If we already have hash on URL it won't trigger hash change\r\n // So I force a hash change\r\n if ( firstLoad && hash || isReload){\r\n window.location.hash = '#';\r\n } \r\n\r\n window.location.hash = '#' + presentSlideNumber;\r\n updateCurrentSlide();\r\n }", "function handlePageLoad() {\n // Add a listener to be triggered when we scroll through the pages\n window.addEventListener('hashchange', function() {\n debug('Hash change detected: ' + location.hash + ' State: ' + document.readyState);\n processUserList();\n }, false);\n\n queryUserId();\n queryReviveSkill();\n }", "function urlHandler(data) {\r\n // Called from either setUrlHandler or using window.location on load, so normalise the path\r\n var path = data.path || data;\r\n\r\n\r\n var request_ids = getParameterByName(path, 'request_ids');\r\n var latest_request_id = request_ids.split(',')[0];\r\n\r\n if (latest_request_id) {\r\n // Probably a challenge request. Play against sender\r\n getRequestInfo(latest_request_id, function(request) {\r\n \tplayAgainstSomeone(request.from.id);\r\n \tdeleteRequest(latest_request_id);\r\n });\r\n}\r\n}", "componentWillUpdate() {\n this.url = splitUrl(window.location.pathname)[0];\n console.log(\"URL \" + this.url);\n }", "hashChange(event) {\n\t\t// This support the abort a cicle\n\t\tif (this.engineIsRunning === true) {\n\t\t\tthis.engineIsRunning = false;\n\t\t\treturn;\n\t\t}\n\t\tthis.currentUrl = event ? event.newURL : window.location.href;\n\t\tthis.previousUrl = event ? event.oldURL : window.location.href;\n\t\t// Save the old routes if user abort and need restore it\n\t\tthis.oldRoutesBkp = this.cloneRoutes({source: this.oldRoutes});\n\t\t// Save a copy of currentRoutes as oldRoutes\n\t\tthis.oldRoutes = this.cloneRoutes({source: this.currentRoutes});\n\t\t// Clean current routes\n\t\tthis.currentRoutes = getEmptyRouteObjetc();\n\t\tthis.engine();\n\t}", "function updateURL () {\n var parms = QueryParams.map(input => {\n var parm = input.queryStringParm;\n return parm + \"=\" + encodeURIComponent(input.location.val());\n });\n var s = parms.join(\"&\");\n window.history.pushState(null, null, location.origin+location.pathname+\"?\"+s);\n }", "function hashChangeHandler(){\n if(!isScrolling && !options.lockAnchors){\n var anchors = getAnchorsURL();\n var sectionAnchor = anchors.section;\n var slideAnchor = anchors.slide;\n\n //when moving to a slide in the first section for the first time (first time to add an anchor to the URL)\n var isFirstSlideMove = (typeof lastScrolledDestiny === 'undefined');\n var isFirstScrollMove = (typeof lastScrolledDestiny === 'undefined' && typeof slideAnchor === 'undefined' && !slideMoving);\n\n if(sectionAnchor && sectionAnchor.length){\n /*in order to call scrollpage() only once for each destination at a time\n It is called twice for each scroll otherwise, as in case of using anchorlinks `hashChange`\n event is fired on every scroll too.*/\n if ((sectionAnchor && sectionAnchor !== lastScrolledDestiny) && !isFirstSlideMove\n || isFirstScrollMove\n || (!slideMoving && lastScrolledSlide != slideAnchor )){\n\n scrollPageAndSlide(sectionAnchor, slideAnchor);\n }\n }\n }\n }", "function hashChangeHandler(){\n if(!isScrolling && !options.lockAnchors){\n var anchors = getAnchorsURL();\n var sectionAnchor = anchors.section;\n var slideAnchor = anchors.slide;\n\n //when moving to a slide in the first section for the first time (first time to add an anchor to the URL)\n var isFirstSlideMove = (typeof lastScrolledDestiny === 'undefined');\n var isFirstScrollMove = (typeof lastScrolledDestiny === 'undefined' && typeof slideAnchor === 'undefined' && !slideMoving);\n\n if(sectionAnchor && sectionAnchor.length){\n /*in order to call scrollpage() only once for each destination at a time\n It is called twice for each scroll otherwise, as in case of using anchorlinks `hashChange`\n event is fired on every scroll too.*/\n if ((sectionAnchor && sectionAnchor !== lastScrolledDestiny) && !isFirstSlideMove\n || isFirstScrollMove\n || (!slideMoving && lastScrolledSlide != slideAnchor )){\n\n scrollPageAndSlide(sectionAnchor, slideAnchor);\n }\n }\n }\n }", "function hashChangeHandler(){\n if(!isScrolling && !options.lockAnchors){\n var anchors = getAnchorsURL();\n var sectionAnchor = anchors.section;\n var slideAnchor = anchors.slide;\n\n //when moving to a slide in the first section for the first time (first time to add an anchor to the URL)\n var isFirstSlideMove = (typeof lastScrolledDestiny === 'undefined');\n var isFirstScrollMove = (typeof lastScrolledDestiny === 'undefined' && typeof slideAnchor === 'undefined' && !slideMoving);\n\n if(sectionAnchor && sectionAnchor.length){\n /*in order to call scrollpage() only once for each destination at a time\n It is called twice for each scroll otherwise, as in case of using anchorlinks `hashChange`\n event is fired on every scroll too.*/\n if ((sectionAnchor && sectionAnchor !== lastScrolledDestiny) && !isFirstSlideMove\n || isFirstScrollMove\n || (!slideMoving && lastScrolledSlide != slideAnchor )){\n\n scrollPageAndSlide(sectionAnchor, slideAnchor);\n }\n }\n }\n }", "setURL() {\n log(':: setURL() :: - Adding Hash on user input');\n\n var hash = moment(this.date.timeStamp).format('YYYY-MM-DD') + '/' + this.feed[this.selectedTimeIndex].id;\n\n if (this.feedType == 'live') {\n var pathName = window.location.pathname;\n var lastChar = pathName.substr(pathName.length - 1);\n var slash = lastChar == '/' ? '' : '/';\n\n pathName += slash; // add a trailing slash if there isn't one\n\n // surfcams/knights/paid +\n window.location = pathName + 'replays/#/' + hash;\n } else {\n window.location.hash = '/' + hash; // add id to hash, allows link sharing\n }\n }", "function dispatchRouteChange() {\n // remove hash\n var href = location.hash.substr(1, location.hash.length - 1);\n\n routerState$.patch({\n route: href === '' ? '/' : href.split('?')[0],\n params: getUrlParams(href)\n });\n }", "function onHashChange(firstLoad) {\n var path = window.location.pathname\n\n var page = pageIndex[path]\n // Only reflow the main content if necessary\n if (!page) {\n return\n }\n showToc(page.tocId)\n setSelectedAnchor()\n if (firstLoad) {\n return\n }\n\n // Send GA page view\n if (window.ga) {\n window.ga('send', 'pageview', window.location.pathname);\n }\n\n loadPageContent(page, 2).then(function (pageContent) {\n /* \n * Search filter disabled, uncomment to enable\n */\n // setSearchFilter(page)\n // Don't compare iframes\n if (main.innerHTML.trim().replace(/\\<iframe.*\\<\\/iframe\\>/g, '') !== pageContent.trim().replace(/\\<iframe.*\\<\\/iframe\\>/g, '')) {\n main.innerHTML = pageContent\n document.title = page.title\n documentTitle.innerText = page.documentInfo[0] // document title\n documentSubtitle.innerText = page.documentInfo[1] // document subtitle\n if (indexDiv) {\n indexDiv.classList.remove('index')\n }\n }\n scrollAnchorIntoView()\n\n // Hide menu if sub link clicked or clicking on search results \n if (window.location.hash.replace('#', '').length > 0 || navigation.classList.contains('hidden')) {\n window.dispatchEvent(new Event('link-click'))\n }\n highlightBody()\n })\n }", "function getSlideNumberFromUrlFragment() {\n var fragment = window.location.hash || ''\n\n currentSlideNumber = (parseInt(fragment.substr(1)) - 1) || 0\n}", "function getSlideNumberFromUrlFragment() {\n var fragment = window.location.hash || ''\n\n currentSlideNumber = (parseInt(fragment.substr(1)) - 1) || 0\n}", "function onHashChange() {\n // set location fragmention as uri-decoded text (from href, as hash may be decoded)\n location.fragmention = decodeURIComponent((location.href.match(/#(#|%23)(.+)/) || [0,0,''])[2].replace(/\\+/g, ' '));\n\n\n // conditionally remove stashed element fragmention attribute\n if (element) {\n element.removeAttribute('fragmention');\n\n // DEPRECATED: trigger style in IE8\n if (element.runtimeStyle) {\n element.runtimeStyle.windows = element.runtimeStyle.windows;\n }\n }\n\n // if fragmention exists\n if (location.fragmention) {\n // get element containing text (or return document)\n element = getElementByText(document, location.fragmention);\n\n // if element found\n if (element !== document) {\n // scroll to element\n element.scrollIntoView();\n\n // set fragmention attribute\n element.setAttribute('fragmention', '');\n element.setAttribute('tabindex', '-1');\n element.focus();\n\n // DEPRECATED: trigger style in IE8\n if (element.runtimeStyle) {\n element.runtimeStyle.windows = element.runtimeStyle.windows;\n }\n }\n // otherwise clear stashed element\n else {\n element = null;\n }\n }\n }", "function UpdateCurrentUrl(activeInfo) {\n chrome.tabs.get(activeInfo.tabId, function(tab){\n if (chrome.runtime.lastError) {\n setTimeout(function(){UpdateCurrentUrl(activeInfo) }, 500); // arbitrary delay\n return;\n }\n Utils.currentUrl = tab.url;\n });\n}", "function updateUrl() {\n urlRouter.updateUrl(urlRouter.buildExploreUrlFromPrefs());\n }", "function hashChangeHandler(){\r\n if(!isScrolling && !options.lockAnchors){\r\n var anchors = getAnchorsURL();\r\n var sectionAnchor = anchors.section;\r\n var slideAnchor = anchors.slide;\r\n\r\n //when moving to a slide in the first section for the first time (first time to add an anchor to the URL)\r\n var isFirstSlideMove = (typeof lastScrolledDestiny === 'undefined');\r\n var isFirstScrollMove = (typeof lastScrolledDestiny === 'undefined' && typeof slideAnchor === 'undefined' && !slideMoving);\r\n\r\n if(sectionAnchor.length){\r\n /*in order to call scrollpage() only once for each destination at a time\r\n It is called twice for each scroll otherwise, as in case of using anchorlinks `hashChange`\r\n event is fired on every scroll too.*/\r\n if ((sectionAnchor && sectionAnchor !== lastScrolledDestiny) && !isFirstSlideMove\r\n || isFirstScrollMove\r\n || (!slideMoving && lastScrolledSlide != slideAnchor )){\r\n\r\n scrollPageAndSlide(sectionAnchor, slideAnchor);\r\n }\r\n }\r\n }\r\n }", "function hashChangeHandler(){\r\n if(!isScrolling && !options.lockAnchors){\r\n var anchors = getAnchorsURL();\r\n var sectionAnchor = anchors.section;\r\n var slideAnchor = anchors.slide;\r\n\r\n //when moving to a slide in the first section for the first time (first time to add an anchor to the URL)\r\n var isFirstSlideMove = (typeof lastScrolledDestiny === 'undefined');\r\n var isFirstScrollMove = (typeof lastScrolledDestiny === 'undefined' && typeof slideAnchor === 'undefined' && !slideMoving);\r\n\r\n if(sectionAnchor && sectionAnchor.length){\r\n /*in order to call scrollpage() only once for each destination at a time\r\n It is called twice for each scroll otherwise, as in case of using anchorlinks `hashChange`\r\n event is fired on every scroll too.*/\r\n if ((sectionAnchor && sectionAnchor !== lastScrolledDestiny) && !isFirstSlideMove\r\n || isFirstScrollMove\r\n || (!slideMoving && lastScrolledSlide != slideAnchor )){\r\n\r\n scrollPageAndSlide(sectionAnchor, slideAnchor);\r\n }\r\n }\r\n }\r\n }", "function hashChangeHandler(){\r\n if(!isScrolling && !options.lockAnchors){\r\n var anchors = getAnchorsURL();\r\n var sectionAnchor = anchors.section;\r\n var slideAnchor = anchors.slide;\r\n\r\n //when moving to a slide in the first section for the first time (first time to add an anchor to the URL)\r\n var isFirstSlideMove = (typeof lastScrolledDestiny === 'undefined');\r\n var isFirstScrollMove = (typeof lastScrolledDestiny === 'undefined' && typeof slideAnchor === 'undefined' && !slideMoving);\r\n\r\n if(sectionAnchor && sectionAnchor.length){\r\n /*in order to call scrollpage() only once for each destination at a time\r\n It is called twice for each scroll otherwise, as in case of using anchorlinks `hashChange`\r\n event is fired on every scroll too.*/\r\n if ((sectionAnchor && sectionAnchor !== lastScrolledDestiny) && !isFirstSlideMove\r\n || isFirstScrollMove\r\n || (!slideMoving && lastScrolledSlide != slideAnchor )){\r\n\r\n scrollPageAndSlide(sectionAnchor, slideAnchor);\r\n }\r\n }\r\n }\r\n }", "function doNavigate() {\n if (!hashIsEmpty()) {\n var parsedHash = this.parse(window.location.hash);\n this.navigate.apply(this, parsedHash);\n } else {\n this.navigate(_defaultRoute);\n }\n }", "function urlCleanup() {\n if (typeof (history.pushState) != \"undefined\") {\n var obj = {\n Title: document.title,\n Url: window.parent.location.pathname\n };\n history.pushState(obj, obj.Title, obj.Url);\n } else {\n window.parent.location = window.parent.location.pathname;\n }\n}", "function hashHandler(){\n this.oldHash = window.location.hash;\n this.Check;\n\n var that = this;\n var detect = function(){\n if(that.oldHash!=window.location.hash){\n that.oldHash = window.location.hash;\n processWord(window.location.href)\n }\n };\n this.Check = setInterval(function(){ detect() }, 100);\n}", "function set_url(fragment) {\n var baseurl = window.location.protocol+\"//\"+window.location.host+window.location.pathname\n var url = baseurl + fragment;\n $('span#cur_url').html(\"<a href='\"+url+\"'>\"+url+\"</a>\"); \n}", "parseHash() {\n if (window.location.hash.indexOf('#') === -1) {\n this.push('/');\n }\n let hash = window.location.hash.replace('#', '');\n var routeArray = hash.split('?');\n var routeInfo;\n var routeInfo = {\n fullPath: routeArray[0],\n route: routeArray[0].split('/'),\n query: {}\n };\n if (routeArray[1]) {\n var routeQuery = routeArray[1].split('&');\n routeQuery.forEach((param) => {\n let keyValue = param.split('=');\n routeInfo.query[keyValue[0]] = keyValue[1];\n });\n }\n var fromPath;\n if (this.currentRoute)\n fromPath = this.currentRoute;\n else\n fromPath = null;\n if (this.transition !== null) {\n this.transitionOut();\n }\n setTimeout(function () {\n this.beforeEachRoute(this.beforeEach, routeInfo, fromPath).then(function (r) {\n this.currentRoute = routeInfo;\n this.compareRoutes();\n if (this.afterEach)\n this.afterEach(routeInfo, fromPath);\n if (this.transition !== null) {\n this.transitionIn();\n }\n }.bind(this));\n }.bind(this), this.transitionDuration.leavingDuration + 10);\n }", "function handleHashChange() {\n if (location.hash.endsWith(LOG_GROUPS_PAGE_URL_SUFFIX)) {\n browser.runtime\n .sendMessage({\n type: GET_LOGS_FILTERS_MSG_TYPE\n })\n .then(response => renderFilteringButtons(response.data))\n .catch(onError);\n }\n}", "parseURL() {\n var currentURL = window.location.href;\n\n var match = currentURL.match(/id=([^&]+)/);\n\n var self = this;\n if (match) {\n // Switch to share mode: le mec a partagé son event\n this.appState = this.appStates.sharing;\n\n // Store the ID in the state\n this.eventID = match[1];\n var cookie = this.getCookie(`${SETTINGS.cookieNameFirstPart}${this.eventID}`);\n\n if (cookie && cookie.user) {\n this.currentUser = cookie.user.name;\n this.pinsCreated = cookie.user.pinsCreated;\n }\n } else {\n // If no ID is passed in the URL then we are in create mode\n // we show the create button: the idea is not to create an entry in the database \n // each time a dude visits the app but only after he is sure he wants to create a wigot\n this.appState = this.appStates.wigotCreation;\n }\n }", "function pageNavigationHandler() {\n AttachLinkBehavior();\n\n $(window).bind('hashchange', CheckHashParam)\n .trigger('hashchange');\n }", "getCurrentRoute () {\n return location.href.split('#')[1];\n }", "function onWindowHashChange(event) {\n\n readURL();\n\n }", "function onNavigate (tabId, url, isInPlace, isMainFrame, frameProcessId, frameRoutingId) {\r\n if (isMainFrame) {\r\n onPageURLChange(tabId, url)\r\n }\r\n}", "function checkURL(hash)\n{\n if(!hash) hash = window.location.hash;\t//if no parameter is provided, use the hash value from the current address\n if(hash != lasturl)\t// if the hash value has changed\n {\n lasturl = hash;\t//update the current hash\n loadPage(hash);\t// and load the new page\n }\n}", "function runAddressChangeCallback() {\n var address = go.formatURL(location.hash);\n // If address is not current address and isn't held, then run action\n if (address != go.wait && address != _currentAddress) {\n go.run(\n new ActionEvent({ url: address })\n );\n }\n }", "function onHashChange(event) {\n \n app.router.router(location.hash.slice(1));\n }", "handleRefresh() {\n window.location = window.location.pathname;\n }", "function pagesOnload(){\n var start_hash=location.hash;\n if(!start_hash){ /* the url has no hash . run the callback function of the first page */\n var callback = $(\".fullPage\").eq(0).attr(\"inView\");\n strTofunc(callback);\n\t\t return false;\n }\n /* if the url has hash , locate to the page */\n locateToHash(start_hash);\n }", "changed()\n {\n if (window.location.hash !== this.lastHash)\n {\n this.lastHash = window.location.hash;\n return true;\n }\n else\n {\n return false;\n }\n }", "function updateFilterWithCurrentHash() {\n var hash = window.location.hash;\n if (hash) {\n var tag = hash.substr(1);\n setFilterTag(tag);\n } else {\n clearFilterTag();\n }\n window.scrollTo(0, 0);\n}", "function processURLParameters() {\r\n originalURL = decodeURIComponent(window.location.href);\r\n var params = {};\r\n // look for the params\r\n if (originalURL.indexOf(\"#\") != -1) {\r\n var qString = originalURL.split('#')[1];\r\n var args = qString.split(',');\r\n originalURL = originalURL.split('#')[0];\r\n ac.loadCategoryItem(args[0], args[1]);\r\n return;\r\n \t} else if (originalURL.indexOf(\"?\") != -1) {\r\n var qString = originalURL.split('?')[1];\r\n // get rid of any bookmarking stuff\r\n if (qString.indexOf(\"#\") != -1) {\r\n qString = qString.split('#')[0];\r\n originalURL = originalURL.split('#')[0];\r\n window.location.href = originalURL;\r\n }\r\n ps = qString.split('&');\r\n // now go through and create the params map as an object literal\r\n for (var i in ps) {\r\n var t = ps[i].split('=');\r\n params[t[0]] = t[1];\r\n }\r\n // first check for the item in product \r\n if (typeof params.itemId != 'undefined' && typeof params.pid != 'undefined') {\r\n ac.loadCategoryItem(params.pid, params.itemId);\r\n \t// next if there is a catid definition then do it\r\n } else if (typeof params.catid != 'undefined') {\r\n ac.showCategory(params.catid);\r\n }\r\n } else {\r\n // nothing is selected\r\n ac.showFirstCategory();\r\n }\r\n }", "listenForHashChanges() {\n //get url on page load.\n finsembleWindow.updateOptions({ url: window.top.location.href }, () => {\n });\n var self = this;\n //There's no pushState event in the browser. This is a monkey patched solution that allows us to catch hash changes. onhashchange doesn't fire when a site is loaded with a hash (e.g., salesforce).\n (function (history) {\n var pushState = history.pushState;\n history.pushState = function (state) {\n if (typeof history.onpushstate === \"function\") {\n history.onpushstate({ state: state });\n }\n pushState.apply(history, arguments);\n finsembleWindow.updateOptions({ url: window.top.location.href }, () => {\n });\n return;\n };\n var replaceState = history.replaceState;\n history.replaceState = function (state) {\n if (typeof history.onreplacestate === \"function\") {\n history.onreplacestate({ state: state });\n }\n replaceState.apply(history, arguments);\n finsembleWindow.updateOptions({ url: window.top.location.toString() });\n // DH 3/6/2019 - This should be handled by the WindowStorageManager.\n storageClient_1.default.save({ topic: constants_1.WORKSPACE.CACHE_STORAGE_TOPIC, key: self.windowHash, value: finsembleWindow.windowOptions });\n return;\n };\n })(window.history);\n window.addEventListener(\"hashchange\", () => {\n finsembleWindow.updateOptions({ url: window.top.location.toString() }, () => {\n });\n });\n }", "function hashChanged() {\n var url = \"#\" + (document.location.hash.slice(1) || \"\");\n history.push(url);\n trigger(\"GET\", url);\n }", "function checkURL(hash)\n{\n if(!hash) hash=window.location.hash;\t//if no parameter is provided, use the hash value from the current address\n if(hash != lasturl)\t// if the hash value has changed\n {\n lasturl=hash;\t//update the current hash\n loadPage(hash);\t// and load the new page\n }\n}", "function activeTabChanged(activeInfo) {\n if (activeInfo) {\n var tabId = activeInfo.tabId;\n if (tabId) {\n getCurrentTabUrl();\n }\n }\n}", "function $listen() {\n var listener = mx.route.mode === \"hash\" ? \"onhashchange\" : \"onpopstate\";\n window[listener] = function() {\n var url = mx.route.mode === \"hash\" ?\n window.location[mx.route.mode].substr( 1 ):\n window.location[mx.route.mode];\n if( url !== currentUrl ) {\n var foundState = $findState( url );\n mx.route.go( foundState.state , foundState.parameters );\n }\n };\n window[listener]();\n }", "function _pollHash(){\r\n if (!_listenerWindow) {\r\n return;\r\n }\r\n var href = _listenerWindow.location.href, hash = \"\", indexOf = href.indexOf(\"#\");\r\n if (indexOf != -1) {\r\n hash = href.substring(indexOf);\r\n }\r\n if (hash && hash != _lastMsg) {\r\n _handleHash(hash);\r\n }\r\n }", "function _pollHash(){\n if (!_listenerWindow) {\n return;\n }\n var href = _listenerWindow.location.href, hash = \"\", indexOf = href.indexOf(\"#\");\n if (indexOf != -1) {\n hash = href.substring(indexOf);\n }\n if (hash && hash != _lastMsg) {\n _handleHash(hash);\n }\n }", "function readFromUrl() {\n let urlGoTo = false; // modify current page if \"page\" not in URL\n\n const urlParams = new URLSearchParams(location.search);\n\n if (urlParams.get(\"page\") != null) {\n current_view_value = parseInt(urlParams.get(\"page\")) - 1;\n } else {\n current_view_value = 0;\n urlGoTo = true;\n }\n\n // make sure that a negative number was not provided\n if (current_view_value < 0) {\n current_view_value = 0;\n }\n\n if (urlParams.get(\"view\") != null) {\n current_view =\n urlParams.get(\"view\").slice(0, 1).toUpperCase() +\n urlParams.get(\"view\").slice(1);\n\n modifier = calculateModifier(current_view)\n }\n\n if (urlGoTo == true) {\n calculateDefaultView();\n }\n}", "function processHtmlMessageEvent(evt) {\n location.hash = evt.data;\n checkForMessages();\n}", "function hashChangeHandler(){\n\n if(!isScrolling && !options.lockAnchors){\n var value = window.location.hash.replace('#', '').split('/');\n var section = decodeURIComponent(value[0]);\n var slide = decodeURIComponent(value[1]);\n\n //when moving to a slide in the first section for the first time (first time to add an anchor to the URL)\n var isFirstSlideMove = (typeof lastScrolledDestiny === 'undefined');\n var isFirstScrollMove = (typeof lastScrolledDestiny === 'undefined' && typeof slide === 'undefined' && !slideMoving);\n\n\n if(section.length){\n /*in order to call scrollpage() only once for each destination at a time\n It is called twice for each scroll otherwise, as in case of using anchorlinks `hashChange`\n event is fired on every scroll too.*/\n if ((section && section !== lastScrolledDestiny) && !isFirstSlideMove || isFirstScrollMove || (!slideMoving && lastScrolledSlide != slide )) {\n scrollPageAndSlide(section, slide);\n }\n }\n\n \n } \n\n /* nectar addition */ \n\n //make page history work when clicking faster than transition speed\n if($('#nectar_fullscreen_rows[data-animation-speed=\"medium\"]').length > 0)\n var $timeOutDur = ($('.last-before-footer').length == 0) ? 900 : 530;\n else if($('#nectar_fullscreen_rows[data-animation-speed=\"slow\"]').length > 0)\n var $timeOutDur = ($('.last-before-footer').length == 0) ? 1180 : 530;\n else\n var $timeOutDur = ($('.last-before-footer').length == 0) ? 710 : 530;\n\n if(HASHCHANGE == true) {\n \tclearInterval(HASHCHANGETIMEOUT);\n\n \tHASHCHANGETIMEOUT = setInterval(function(){ \n \t\tif(canScroll) {\n\t \t\thashChangeHandler();\n\t \t\t//reset\n\t \t\tclearInterval(HASHCHANGETIMEOUT);\n\t \t}\n \t},100);\n }\n\n HASHCHANGE = true;\n /* nectar addition */ \n }", "function onLocationChange() {\n\t\t\tvar path = $location.path();\n\t\t\tvar matchPage = function(section, page) {\n\t\t\t\t\n\t\t\t\tif (path === page.url) {\n\t\t\t\t\tself.selectSection(section);\n\t\t\t\t\tself.selectPage(section, page);\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t};\n\t\t\t\n\t\t\tfindSelectedPage(sections,matchPage);\n\n\t\t}", "function mainLoaded() {\n if (typeof(executeOnContentLoad) == \"function\") {\n if (contentLoadDestination && location.hash != contentLoadDestination) return;//wait til we are on the correct page\n var fn = executeOnContentLoad;\n executeOnContentLoad = null;\n contentLoadDestination = null;\n fn();\n }\n }", "function getCurrentUrl() {\r\n var url = window.location.href.toString();\r\n var url = url.replace(/#.*/gi, '');\r\n return url;\r\n}", "function hashChange(first) {\n\tif (isFullscreenSidebar() && flags.mobileSidebar) {\n\t\ttoggleSidebar()\n\t}\n\tvar fragment = getPath()\n\t// append # to the end of fragment links,\n\t// and it will be removed, so every time you clikc the link it will scroll\n\tif (fragment[2] == \"\") {\n\t\tsilentSetFragment(location.hash.slice(0,-1))\n\t}\n\tif (currentPath == fragment[0]) {\n\t\tscrollTo(fragment[1])\n\t} else {\n\t\tcurrentPath = fragment[0]\n\t\tnavigateTo(fragment[0], first, function() {\n\t\t\tscrollTo(fragment[1])\n\t\t}, fragment[1])\n\t}\n}", "function onContentFetched(responseText, textStatus) {\n if (textStatus === \"error\") {\n console.log(\"There was a problem loading the page.\");\n return;\n }\n\n var queryString = utilities.createQueryString(queryObject);\n if (shouldPushHistory) {\n history.pushState(\n {\n url: url,\n query: queryObject\n },\n null,\n url + queryString\n );\n }\n\n // Update Google analytics\n ga(\"set\", \"page\", url + queryString);\n ga(\"send\", \"pageview\");\n\n this._path = location.pathname;\n this._$content.velocity({ opacity: 1 }, this._fadeDuration, \"swing\");\n this._onReload();\n }", "function locationHashChanged() {\n if (location.hash === \"\") {\n closePage();\n }\n}", "__onHashChange() {\n var currentState = this._readState();\n\n if (\n qx.lang.Type.isString(currentState) &&\n currentState != this.getState()\n ) {\n this._onHistoryLoad(currentState);\n }\n }" ]
[ "0.6454162", "0.6398715", "0.61943847", "0.6142036", "0.61398184", "0.6094532", "0.6076581", "0.603019", "0.5881091", "0.5881091", "0.58692473", "0.58692473", "0.58692473", "0.58502096", "0.5821408", "0.5806132", "0.5700259", "0.56412446", "0.5632201", "0.5630265", "0.5624022", "0.5617764", "0.56093305", "0.56079865", "0.5576951", "0.55722314", "0.55647296", "0.55635333", "0.5539779", "0.55246913", "0.54964435", "0.5492363", "0.54754746", "0.5467887", "0.5467887", "0.5463136", "0.5460243", "0.54549974", "0.5454974", "0.5421727", "0.5394751", "0.53853744", "0.53853744", "0.5370914", "0.5363297", "0.5361809", "0.53606576", "0.53494483", "0.53485703", "0.5343351", "0.53229266", "0.53229266", "0.53229266", "0.5317462", "0.5316206", "0.53051865", "0.52904904", "0.52904904", "0.52863", "0.52789366", "0.52753645", "0.52743715", "0.5266242", "0.5266242", "0.5260584", "0.5259783", "0.52382004", "0.52299273", "0.52204967", "0.5209145", "0.5204385", "0.51994336", "0.5176404", "0.5173872", "0.51697505", "0.51499426", "0.5149128", "0.51457435", "0.5130366", "0.5125047", "0.51235396", "0.5121629", "0.5115389", "0.51070136", "0.5097547", "0.5093846", "0.50889075", "0.507053", "0.50655204", "0.50637877", "0.50591856", "0.5053255", "0.50402766", "0.5040193", "0.50246954", "0.50181526", "0.5015784", "0.5015598", "0.5011056", "0.5004404" ]
0.67682683
0
Go to current subunit.
function currentSubunit() { var m = my.current.unitNo var n = my.current.subunitNo window.location.href = unitHref(m, n) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function nextSubunit()\n {\n var m = my.current.unitNo\n var n = my.current.subunitNo\n\n if (!currentSubunitIsTheLastSubunit()) {\n if (n == my.current.subunitTitles.length) {\n // If the user is at unit M.L where L is the last\n // subunit of unit M, then go to unit (M + 1).1.\n m++\n n = 1\n } else {\n // If the user is at unit M.N, then go to unit M.(N + 1).\n n++\n }\n }\n\n window.location.href = unitHref(m, n)\n }", "function goToUnitPage() {\n history.push(\"/selectunit\");\n }", "function goToRoot() {\n goTo();\n }", "function previousSubunit()\n {\n var m = my.current.unitNo\n var n = my.current.subunitNo\n\n if (!currentSubunitIsTheFirstSubunit()) {\n if (n == 1) {\n // If the user is at unit M.1, go to unit (M - 1).L\n // where L is the last subunit of the previous unit.\n previousUnit = unit(m - 1)\n var previousSubunitTitles = []\n for (var subunitTitle in previousUnit.subunits) {\n previousSubunitTitles.push(subunitTitle)\n }\n\n m--\n n = previousSubunitTitles.length\n } else {\n // If the user is at unit M.N, go to unit M.(N - 1)\n n--\n }\n }\n\n window.location.href = unitHref(m, n)\n }", "gotoNextStep() {\n this.gotoStep(this.currentStep + 1);\n }", "static goTo() {\n // to implement on child\n }", "function goToStep(step){//because steps starts with zero\nthis._currentStep=step-2;if(typeof this._introItems!==\"undefined\"){nextStep.call(this);}}", "function nav(){\n var path = currentTest().path;\n window.location = path;\n }", "__nextStep() {\n this.openNextStep();\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 currentSubunitIsTheFirstSubunit()\n {\n return my.current.unitNo == 1 && my.current.subunitNo == 1\n }", "function goToSubworkflow(node) {\n var matchingTableRow = getTableRow(node);\n var subworkflowLink = $(matchingTableRow).find(\"a.subworkflow\");\n if (subworkflowLink.length > 0) {\n location.href = subworkflowLink.attr(\"href\");\n }\n }", "function _goToStep(step) {\n\t //because steps starts with zero\n\t this._currentStep = step - 2;\n\t if (typeof (this._introItems) !== 'undefined') {\n\t _nextStep.call(this);\n\t }\n\t }", "function goToPreviousStep() {\n\tpreviousSteps();\n\tupdateStepsText();\n\tconsole.log(\"hey\");\n}", "function _goToStep(step) {\n //because steps starts with zero\n this._currentStep = step - 2;\n if (typeof (this._introItems) !== 'undefined') {\n _nextStep.call(this);\n }\n }", "function _goToStep(step) {\n //because steps starts with zero\n this._currentStep = step - 2;\n if (typeof (this._introItems) !== 'undefined') {\n _nextStep.call(this);\n }\n }", "function _goToStep(step) {\n //because steps starts with zero\n this._currentStep = step - 2;\n if (typeof (this._introItems) !== 'undefined') {\n _nextStep.call(this);\n }\n }", "function _goToStep(step) {\n //because steps starts with zero\n this._currentStep = step - 2;\n if (typeof (this._introItems) !== 'undefined') {\n _nextStep.call(this);\n }\n }", "function _goToStep(step) {\n //because steps starts with zero\n this._currentStep = step - 2;\n if (typeof (this._introItems) !== 'undefined') {\n _nextStep.call(this);\n }\n }", "click() {\n let tour = get(this, 'tour');\n tour.start();\n }", "gotoParentContext(){\n let bot = this.botid;\n let parent = this.selectedContext.parent_context;\n //this.router.navigateToRoute(`manager/bot/${bot}/context/${parent}`);\n //this.router.navigateToRoute('bot-context','contextid':parent);\n this.router.navigateToRoute('bot-context', { 'contextid': parent }, // route parameters object\n { trigger: true, replace: true }); // options\n }", "function goToStepNumber(step){this._currentStepNumber=step;if(typeof this._introItems!==\"undefined\"){nextStep.call(this);}}", "goToSelected () {\n this.path = this.selectedPath;\n }", "function goToNextStep() {\n\tnextSteps();\n\tupdateStepsText();\n\tconsole.log(\"hi\");\n}", "function _goToStep(step) {\n //because steps starts with zero\n this._currentStep = step - 2;\n if(typeof (this._introItems) !== 'undefined') {\n _nextStep.call(this);\n }\n }", "gotoNextFrame() {\n this.scriptOwner.parentClip.gotoNextFrame();\n }", "function down(results){\n goToPage('step1f');\n}", "async gotoAddMenuPage(testController) {\n await testController.click('#add-menu-food-page');\n }", "levelUp() {\n\t\tthis.getActiveUnits().forEach(unit => {\n\t\t\tunit.levelUp();\n\t\t});\n\t}", "breakoutClicked () {\n this.SceneManager.switchToUsingTransaction('Breakout/Level1', Transition.named('ScrollFrom', { direction: 'bottom' }))\n }", "function goto ( id, duration ) {\n\t if('string'!== typeof id || steps.indexOf(id) < 0 ){\n\t return null;\n\t }\n\n\t activeStep = id;\n\ts\n\t debug(\"goto #\"+ activeStep);\n\t asqSocket.emitGoto({step: activeStep, duration: duration})\n\t return activeStep;\n\t }", "function stepInto() {\n\t\tInspector.Debugger.stepInto();\n\t}", "goto(target) {\r\n this._nextTarget = target;\r\n this.uiDispatcher.debug(`Goto : ${target}`);\r\n }", "function TPROJECT_PTC(id)\n{\n parent.workframe.location = fRoot+menuUrl+\"?type=testspec&level=tc&id=\"+id+args;\n}", "next() {\n const that = this;\n\n that.navigateTo(that.pageIndex + 1);\n }", "function gotoNext() {\n var currentIndex = findCurrentIndexInList();\n if (currentIndex == -1)\n return;\n var nextIndex = currentIndex + 1;\n // If next is == length then loop to zero\n if (nextIndex == exports.activeList.members.length) {\n nextIndex = 0;\n }\n var next = exports.activeList.members[nextIndex];\n gotoLine(next.filePath, next.line, next.col, exports.activeList);\n}", "function TPROJECT_PTS(id)\n{\n var pParams = tree_getPrintPreferences();\n parent.workframe.location = fRoot+menuUrl+\"?type=testspec&level=testsuite&id=\"+id+args+\"&\"+pParams;\n}", "async gotoMyVendorPage(testController) {\n await testController.click('#my-vendor-page');\n }", "function gotoNext() {\n\tif(typeof nextInventory !== 'undefined') {\n\t\tpreviousInventory = currentInventory;\n\t\tcurrentInventory = nextInventory;\n\t\tnextInventory = undefined;\n\t}\n}", "function performJumpTo(){\n\tvar jumpToId = jq(\"[name='jumpToId']\").val();\n\tvar jumpToName = jq(\"[name='jumpToName']\").val();\n\tif(jumpToId){\n\t\tif(jumpToId.toUpperCase() === \"TOP\"){\n\t\t\tjumpToTop();\n\t\t}\n\t\telse if(jumpToId.toUpperCase() === \"BOTTOM\"){\n\t\t\tjumpToBottom();\n\t\t}\n\t\telse{\n\t\t\tjumpToElementById(jumpToId);\n\t\t}\n\t}\n\telse if(jumpToName){\n\t\tjumpToElementByName(jumpToName);\n\t}\n\telse{\n\t\tjumpToTop();\n\t}\n}", "function goStep(step,id=1){\n switch(step)\n {\n case 1: window.location.assign(\"./defconceptos/\"+id);\n break;\n case 2: window.location.assign(\"./planteamiento/\"+id);\n break;\n case 3: window.location.assign(\"./ideas/\"+id);\n break;\n case 4: window.location.assign(\"./categorizacion\");\n break;\n case 5: window.location.assign(\"./metas\");\n break;\n case 6: window.location.assign(\"./estudio\");\n break;\n case 7: window.location.assign(\"./conclusion\");\n break;\n }\n\n\t\n}", "function next() {\n\t\t\tif (aTests.length) {\n\t\t\t\trunTest(aTests.shift());\n\t\t\t} else if (!iRunningTests) {\n\t\t\t\toTotal.element.classList.remove(\"hidden\");\n\t\t\t\toTotal.element.firstChild.classList.add(\"running\");\n\t\t\t\tsummary(Date.now() - iStart);\n\t\t\t\tsaveLastRun(mLastRun);\n\t\t\t\tif (oFirstFailedTest) {\n\t\t\t\t\tselect(oFirstFailedTest);\n\t\t\t\t}\n\t\t\t}\n\t\t}", "function goToTravelTodo() {\n console.log(\"TravelTODO\");\n //Apply code to continue to travels\n //Make connection with Jonas page\n}", "function goToSection(_sectionName,offest){\n var section = document.getElementById(_sectionName) ;\n gsap.to(window, {duration: 1 , scrollTo: {y: section.offsetTop-offest}});\n\n}", "switchTo(name) {\n //Checks if the given index is valid.\n if (name in this.children) {\n this.currentGameState = this.children[name];\n this.currentGameState.reset();\n }\n }", "async gotoMenuPage(testController) {\n await testController.click('#menu-page');\n }", "function TPLAN_PTS(id)\n{\n var pParams = tree_getPrintPreferences();\n parent.workframe.location = fRoot+menuUrl+\"?level=testsuite&id=\"+id+args+\"&\"+pParams;\n}", "goToHomePage() {\r\n Actions.jump('selectMethod');\r\n }", "function navigateTo() {\n testLog.logStart(\"Navigate to homepage\");\n cy.server()\n cy.route('GET', '/apps?**').as('getHomePage')\n\n // Open application\n cy.visit('http://localhost:5050')\n cy.wait('@getHomePage')\n testLog.logEnd();\n}", "goToFrame(frame) {\n // TODO\n }", "sendHome() {\n this.planManager.goHome();\n }", "function GotoProfile() {\n self.app.router.navigate('/my_Profile/', { reloadCurrent: true });\n}", "function jumpToStep(stepID) {\n\tif (currentStepInfo.type == \"result\" || (currentStepInfo.type == \"info\" && currentStepInfo.lastStep == \"true\")) {\n\t\tstartNewDecision(stepID);\n\t} else {\n\t\t// remove partially completed workflow from history\n\t\tif (currentDecision == 0) {\n\t\t\tcurrentDecision = undefined;\n\t\t} else {\n\t\t\tcurrentDecision--;\n\t\t}\n\t\tdecisionHistory = decisionHistory.splice(0,decisionHistory.length - 1);\n\t\tstoredResultTxt = storedResultTxt.splice(0,storedResultTxt.length - 1);\n\t\tstartNewDecision(stepID);\n\t}\n\t\n\t$dialog.dialog(\"close\");\n\tdocument.getElementById(\"mainHolder\").scrollIntoView();\n}", "jumpTo(step) {\n this.setState({\n stepNumber: step,\n xIsNext: (step % 2) === 0\n });\n }", "function goTo(folio, sequence) {\n // For some reason we have to wait before jumping.\n // @TODO: Why do we have to wait before jumping?\n setTimeout(function () {\n var url = (sequence) ? folio + '/' + sequence : folio;\n data.current_diva.gotoPageByAliasedNumber(folio.replace(/^0+/, ''));\n }, 1);\n }", "jumpTo(step) {\n // rerender the game to reflect these steps\n this.setState({\n stepNumber: step,\n xIsNext: (step % 2) === 0,\n });\n }", "function goToNext() {\n var nextId = getNextLocationIndex();\n if (nextId != null) {\n setCurrentLocation(nextId);\n }\n }", "exec() {\n this.event.preventDefault();\n let node = false;\n\n if (this.item.getDepth() > 1) {\n this.event.stopPropagation();\n this.parentNav.closeSubNav();\n node = this.getElement('parentItem');\n }\n else {\n this.masterNav.closeAllSubNavs();\n node = this.getElement('first', this.item.parentNode);\n }\n\n if (node) {\n node.focus();\n }\n }", "clickOverviewTab(){\n this.overviewTab.waitForExist();\n this.overviewTab.click();\n }", "goToFirstSlide() {\n\n this.goTo(0, -1);\n\n }", "function scrollToStory()\n {\n storyText.scrollIntoView();\n }", "function goToSection(section) {\n WinJS.log && WinJS.log(\"You are viewing the \" + section + \" section.\", \"sample\", \"status\");\n }", "function goto_next_form() {\n context.current++;\n if (context.current >= context.workflow.length) {\n return finish_survey(); //todo: verify that when going Back and clicking Next this doesn't break the flow\n }\n //Store the incremented value of 'current'\n Survana.Storage.Set('current', context.current, function () {\n //load the next form\n window.location.href = context.workflow[context.current];\n }, on_storage_error);\n }", "function goNext(){\n var childTgrp = tgrp_position - 1;\n dataTabsFrame.selectTab(\"page3-\" + childTgrp);\n}", "async function navigateToCommand() {\r\n const page = agent.parameters.page\r\n\r\n if (page === \"home\") {\r\n await navigateTo('/')\r\n } else if (page === \"cart\") {\r\n if (token === \"\" || typeof token === 'undefined') {\r\n addAgentMessage(\"Sorry I cannot perform that. Please login first!\")\r\n return;\r\n }\r\n await navigateTo('/cart')\r\n }\r\n\r\n addAgentMessage('Okay!')\r\n }", "function start_Theory(folder,Nargument){\r\n let pos=\"./Argument/\"\r\n pos=pos.concat(folder).concat(\"/Theory/\").concat(\"Theory\").concat(Nargument).concat(\".html\");\r\n window.location.href =pos\r\n}", "function setCurrentStep(newStep) {\n // for steps in the upload process\n if (newStep.name) {\n navigate(`?tab=${newStep.name}`)\n window.scrollTo(0, 0)\n }\n // for the upload data split view\n else {\n navigate(newStep)\n }\n }", "function resetSubunit()\n {\n my.current.state = my.STATE.READY\n my.current.errors = 0\n my.html.input.value = ''\n\n log('state', my.current.state.toUpperCase(),\n 'unit', my.current.unitNo + '.' + my.current.subunitNo,\n 'type', my.settings.unit)\n\n updatePracticePaneState()\n updatePracticePane()\n clearAdvice()\n clearResultTooltips()\n }", "static goToHome() {\n browser.refresh();\n new MenuBar().clickHome();\n }", "function processURLChange()\n {\n switch(window.location.hash) {\n\n case '#restart':\n currentSubunit()\n break\n\n case '#previous':\n previousSubunit()\n break\n\n case '#next':\n nextSubunit()\n break\n\n default:\n updateUnitFromURL()\n }\n }", "async testNavigateToOtherPages(index) {\n await this.homePage.navigateToHomePage()\n await this.homePage.navigateToGivenPage(index)\n }", "async gotoTodayTopPicksPage(testController) {\n await testController.click('#today-top-picks-page');\n }", "jumpTo(position = 0) {\n this.at = position;\n }", "goTo(){\n this.adminLink.click()\n this.cataloglink.click()\n until.waitUntilElement(this.category, configuration.timeMs , 'no encontre el elemento Category') \n }", "jumpTo(step) {\n this.setState({\n stepNumber: step,\n xIsNext: (step % 2) === 0\n });\n }", "function _goToStepNumber(step) {\n this._currentStepNumber = step;\n if (typeof (this._introItems) !== 'undefined') {\n _nextStep.call(this);\n }\n }", "openNextStep() {\n if (this.activeStep._nestedValidate() && this.activeStep.validate()) {\n this.activeStep.saveStep();\n // set the value to and from the the transition effect.\n this.__fromStep = this.activeStep;\n this.__toStep = this.nextStep;\n // toggle the step\n this.activeStep.toggleStep();\n this.removeActiveStep();\n if (this.nextStep !== null) this.nextStep.toggleStep();\n } else {\n this.activeStep.fireInvalidStep();\n }\n }", "clickFirstRaceTile(){\n this.firstRaceTile.waitForExist();\n this.firstRaceTile.click();\n }", "clickFirstRaceTile(){\n this.firstRaceTile.waitForExist();\n this.firstRaceTile.click();\n }", "function Step() {\n\n // Set the states of trees in the next time step\n SetNextStates();\n\n // Advance the model by swapping in each tree's next state for the current\n // state\n Advance();\n\n} // end function Step()", "function navigateTo(activeItem) {\n\n var text = $(activeItem).text();\n var path = $(activeItem).data(\"path\");\n var children = parseInt($(activeItem).data(\"children\"));\n\n if (children > 0) {\n\n path = path + \"\\\\\";\n $(idSearchBoxJQ).val(path);\n populateResults();\n }\n\n }", "function MM_jumpMenuGo(objId,targ,restore){ //v9.0\n var selObj = null; with (document) { \n if (getElementById) selObj = getElementById(objId);\n if (selObj) eval(targ+\".location='\"+selObj.options[selObj.selectedIndex].value+\"'\");\n if (restore) selObj.selectedIndex=0; }\n}", "async gotoAddVendorPage(testController) {\n await testController.click('#add-vendor-page');\n }", "function gotoVictoryVan(event) {\n\taddNavActionJS(\"initial victory van\", \"\");\n\tswitchTo('victoryVanStart');\n}", "function next() {\n\t\t\tif (aTests.length) {\n\t\t\t\treturn runTest(aTests.shift());\n\t\t\t} else if (!iRunningTests) {\n\t\t\t\toTotal.element.classList.remove(\"hidden\");\n\t\t\t\toTotal.element.firstChild.classList.add(\"running\");\n\t\t\t\tsummary(Date.now() - iStart);\n\t\t\t\tif (oFirstFailedTest) {\n\t\t\t\t\tselect(oFirstFailedTest);\n\t\t\t\t}\n\t\t\t}\n\t\t}", "chooseFromMenu(subject) {\n cy.contains(subject).click();\n }", "function go_mainpage(){\n\n object.getpage('mainpage.html');\n }", "function goTo(lala) {\n $state.go(lala);\n }", "goto (targetSceneName, options) {\n // check if loaderKit asigned to class are loaded, if yes get the scene, if no , goto loader scene and load all kit and scene\n this.nextScene = $Loader.getNextScene(targetSceneName); //|| $Loader.loadSceneKit(sceneName); //$Loader.needLoaderKit(sceneName);\n }", "function NextStory(again) {\n if (again === false) {\n var nextstory = SelectedStory;\n }\n var nextstory = SelectedStory;\n nextstory++;\n console.log(nextstory);\n //SelectedStory does not need a ++ because it is the hman number(starting at 1) and not the machine number(starting at 0)\n if (chapters[SelectedStory] != undefined && chapters[SelectedStory].level == 1) {\n ChapSelect(nextstory)\n console.log(\"selecting! \" + nextstory);\n } else {\n NextStory(true);\n }\n}", "function JumpToChapter(c,frame) {\n\tLoadSection(c * 100 + chapterStartSectionOffset);\n\t// PW: Note that chapterStartSectionOffset is defined above and may be overridden by config.js\n}", "jumpTo(step) {\n this.setState({\n stepNumber: step,\n xIsNext: (step % 2) ===0,\n clickedButton: step,\n });\n }", "function _navTo( n ) {\n\t\t// go to it\n\t\t$( \"#taxa > section\", _sandbox.context ).scrollTo( \"#\" + n.link.attr( \"id\" ), 100, { offset: -45 } );\n\t}", "jumpTo(step) {\r\n\r\n this.setState({\r\n\r\n stepNumber: step,\r\n\r\n xIsNext: (step % 2) === 0,\r\n\r\n });// end setState()\r\n\r\n }", "async gotoManageVendorPage(testController) {\n await testController.click('#manage-vendor-page');\n }", "goDown(data = {}){\n data.cameFrom = \"down\";\n this.launchSceneAt(\n this.activeScene.coordinate.x, \n this.activeScene.coordinate.y + 1,\n data\n );\n }", "function goToNextStep(){\n unhighlightArrow(currStepId, numberToString[currStepId]);\n currStepId+=1;\n replaceStep();\n highlightArrow(currStepId, numberToString[currStepId]); \n}", "function goToSection(index) {\n $timeout(function() {\n $('slick').slick('slickGoTo', index);\n });\n }", "function goToTab(tabName) {\n routingBase.goToMenuTab(tabName);\n }", "clickRunnerTab(){\n this.runnerTab.waitForExist();\n this.runnerTab.click();\n }" ]
[ "0.7053677", "0.6360854", "0.6329819", "0.60506517", "0.59753084", "0.5795796", "0.57329166", "0.570666", "0.5690685", "0.5668464", "0.5607941", "0.5563058", "0.55586433", "0.5523618", "0.55072564", "0.55072564", "0.55072564", "0.55072564", "0.55072564", "0.5503803", "0.5499513", "0.54933804", "0.54700446", "0.54545695", "0.5450763", "0.54216146", "0.5402049", "0.5392531", "0.5389773", "0.53402305", "0.5339407", "0.5331127", "0.53310275", "0.5321734", "0.53184783", "0.53137416", "0.5301554", "0.52992344", "0.52794546", "0.5269937", "0.5265488", "0.525688", "0.52563906", "0.5248583", "0.5236079", "0.52244204", "0.52102035", "0.5179318", "0.5166469", "0.51504564", "0.5150292", "0.5140691", "0.5137928", "0.51313907", "0.512806", "0.5119766", "0.5115761", "0.51083", "0.5101303", "0.51003313", "0.5100169", "0.50940865", "0.5092773", "0.5090098", "0.5088821", "0.5088123", "0.50880337", "0.50779593", "0.50702524", "0.5069394", "0.50679845", "0.5067555", "0.5064441", "0.50534093", "0.5046237", "0.50402826", "0.50339895", "0.5032128", "0.5032128", "0.50317055", "0.5029924", "0.5027209", "0.5026727", "0.5019071", "0.5009791", "0.5007654", "0.49931702", "0.49922413", "0.49863952", "0.49858534", "0.49833933", "0.49815604", "0.4972074", "0.497067", "0.49684566", "0.49650392", "0.49555242", "0.49552634", "0.49536693", "0.49467054" ]
0.75363404
0
Check if the current unit is the first subunit among all the subunits. Return: true if the current subunit is the first subunit; false otherwise
function currentSubunitIsTheFirstSubunit() { return my.current.unitNo == 1 && my.current.subunitNo == 1 }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function currentSubunitIsTheLastSubunit()\n {\n return my.current.unitNo == Units.main.length &&\n my.current.subunitNo == my.current.subunitTitles.length\n }", "function isFirstChild(subtree){\n var par = subtree.parent;\n if (par.children[0] === subtree) {\n return true;\n }\n}", "function nextSubunit()\n {\n var m = my.current.unitNo\n var n = my.current.subunitNo\n\n if (!currentSubunitIsTheLastSubunit()) {\n if (n == my.current.subunitTitles.length) {\n // If the user is at unit M.L where L is the last\n // subunit of unit M, then go to unit (M + 1).1.\n m++\n n = 1\n } else {\n // If the user is at unit M.N, then go to unit M.(N + 1).\n n++\n }\n }\n\n window.location.href = unitHref(m, n)\n }", "function is_prefix_of(sub, seq) {\n if(is_empty_list(sub)){\n return true;\n } else if(is_empty_list(seq)){\n return false;\n } else if(head(sub) === head(seq)){\n return is_prefix_of(tail(sub), tail(seq));\n } else {\n return false;\n }\n}", "get isFirstChild() {\t\t\n\t\tvar parent = this.__atom.parent;\n\t\tif (!parent) {\n\t\t\tthrow new Error('There is no parent atom');\n\t\t}\n\t\tvar firstChild = parent.children[0];\n\t\treturn firstChild === this.atom;\t\t\n\t}", "function previousSubunit()\n {\n var m = my.current.unitNo\n var n = my.current.subunitNo\n\n if (!currentSubunitIsTheFirstSubunit()) {\n if (n == 1) {\n // If the user is at unit M.1, go to unit (M - 1).L\n // where L is the last subunit of the previous unit.\n previousUnit = unit(m - 1)\n var previousSubunitTitles = []\n for (var subunitTitle in previousUnit.subunits) {\n previousSubunitTitles.push(subunitTitle)\n }\n\n m--\n n = previousSubunitTitles.length\n } else {\n // If the user is at unit M.N, go to unit M.(N - 1)\n n--\n }\n }\n\n window.location.href = unitHref(m, n)\n }", "function isBase(unitList) {\n return unitList.length === 1\n && Math.abs(unitList[0].power - 1.0) < 1e-15\n && Object.keys(unitList[0].unit.dimension).length === 1\n && unitList[0].unit.dimension[Object.keys(unitList[0].unit.dimension)[0]] === 1;\n}", "function isSuperset(superset, subset) {\n // empty sets do not apply to this question\n // I know, technically, any non-empty set contains the empty set. But\n // practicelly, that just muddies the waters here\n if (superset.size === 0 || subset.size === 0) {\n return false;\n }\n for (let el of subset) {\n if (!superset.has(el)) {\n return false;\n }\n }\n return true;\n}", "function getFirstCat(tower, catId) {\r\n\tvar ind = 0;\r\n\tvar upTo = getIndex(catId);\r\n\t\r\n\tfor (ind = 0; ind < upTo; ind++) {\r\n\t\tif (tower[ind] != EMPTY) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\treturn true;\r\n}", "isActive(){\n return this._units.some(unit => unit.isActive());\n }", "function is_subseq_at(sub, seq, start_pos){\n let cnt = 0;\n let flag = false;\n for(let i = start_pos; i < seq.length; i = i + 1){\n if(cnt === sub.length){\n break;\n } else if(sub[cnt] !== seq[i]){\n flag = true;\n break;\n } else {\n if(i+1<seq.length){cnt = cnt + 1;} else {}\n }\n }\n \n if(flag || cnt < sub.length-1){\n return false;\n } else {\n // display(cnt);\n return true;\n }\n}", "function areAllSubsetsEmpty()\n{\n if(isSubsetEmpty(1) && isSubsetEmpty(2))\n {\n Ext.Msg.alert('子集为空', '所有子集均为空。请选择子集。');//<SIAT_zh_CN original=\"Subsets are empty\">子集为空</SIAT_zh_CN>//<SIAT_zh_CN original=\"All subsets are empty. Please select subsets.\">所有子集均为空。请选择子集。</SIAT_zh_CN>\n \n return true;\n }\n}", "canAddSub() {\n return this.subaddable().length > 0;\n }", "function currentSubunit()\n {\n var m = my.current.unitNo\n var n = my.current.subunitNo\n\n window.location.href = unitHref(m, n)\n }", "isBase() {\n return isBase(this.unitList);\n }", "hasVillager(){\n let villagerFound = false;\n for(let unit of this.units){\n if(unit.getType() === \"Villager\"){\n villagerFound = true;\n }\n }\n\n return villagerFound;\n }", "isProperSuperset(subset) {\n return XSet.isProperSuperset(this, subset);\n }", "isSuperset(subset) {\n return XSet.isSuperset(this, subset);\n }", "isFull() {\n if (this.hasSupernova) {\n return true;\n }\n return this.sectors.every(row => {\n return row.every(sector => !sector.container.isEmpty())\n });\n }", "function isCompound(unitList) {\n if (unitList.length === 0) {\n return false;\n }\n return unitList.length > 1 || Math.abs(unitList[0].power - 1.0) > 1e-15;\n}", "isCompound() {\n return isCompound(this.unitList);\n }", "isIngredientUnique() {\n let ingredients = this.state.ingredients;\n\n for (\n let ingredientIndex = 0;\n ingredientIndex < ingredients.length;\n ingredientIndex++\n ) {\n // get ingredient's name\n let ingredientName = Object.keys(ingredients[ingredientIndex])[0];\n\n // split quantity and unit\n let unitWithQuantity =\n ingredients[ingredientIndex][ingredientName].split(\" \");\n\n // if ingredient's name and unit are already present, do not add such ingredient\n if (\n ingredientName === this.state.ingredientName &&\n unitWithQuantity[1] === this.state.ingredientUnit\n )\n return false;\n }\n return true;\n }", "function isSub(index1, index2) {\r\n\tvar result = false;\r\n\tvar i = index1;\r\n\t\r\n\twhile (i != -1 && nodes[i].parentID != 'root' && result == false) {\r\n\t\tif(nodes[i].parentID==nodes[index2].id) result = true;\r\n\t\ti = getItemIndex(nodes[i].parentID);\t\t\r\n\t}\r\n\r\n\treturn result;\r\n}", "function isInSelection(unit, adminUnitSelected) {\n if (!adminUnitSelected || !unit) { return false; }\n return unit.get(adminUnitSelected.admin) === adminUnitSelected.name;\n }", "get isFirst() {\n return this.index === 0;\n }", "function isSuperset(set, subset)\n{\n for(let elem of subset)\n {\n if(!set.has(elem)){ return false; }\n }\n return true;\n}", "function isSubsequenceRecursion(s, t) {\n // base case\n if (s === null || s.length === 0) return true;\n\n for (let i = 0; i < t.length; i++) {\n if (t.charAt(i) === s.charAt(0)) {\n return isSubsequenceRecursion(s.substr(1), t.substr(i+1))\n }\n }\n return false\n}", "function isSuperset(set, subset) {\n for (var elem of subset) {\n if (!set.has(elem)) {\n return false;\n }\n }\n return true;\n}", "hasNext() {\n if (this.first) return true;\n return (!this.curr || this.curr.next == null) ? false : true;\n }", "function isSelectionAtLeafStart(editorState) {\n var selection = editorState.getSelection();\n var anchorKey = selection.getAnchorKey();\n var blockTree = editorState.getBlockTree(anchorKey);\n var offset = selection.getStartOffset();\n\n var isAtStart = false;\n\n blockTree.some(function (leafSet) {\n if (offset === leafSet.get('start')) {\n isAtStart = true;\n return true;\n }\n\n if (offset < leafSet.get('end')) {\n return leafSet.get('leaves').some(function (leaf) {\n var leafStart = leaf.get('start');\n if (offset === leafStart) {\n isAtStart = true;\n return true;\n }\n\n return false;\n });\n }\n\n return false;\n });\n\n return isAtStart;\n}", "function isSelectionAtLeafStart(editorState) {\n var selection = editorState.getSelection();\n var anchorKey = selection.getAnchorKey();\n var blockTree = editorState.getBlockTree(anchorKey);\n var offset = selection.getStartOffset();\n\n var isAtStart = false;\n\n blockTree.some(function (leafSet) {\n if (offset === leafSet.get('start')) {\n isAtStart = true;\n return true;\n }\n\n if (offset < leafSet.get('end')) {\n return leafSet.get('leaves').some(function (leaf) {\n var leafStart = leaf.get('start');\n if (offset === leafStart) {\n isAtStart = true;\n return true;\n }\n\n return false;\n });\n }\n\n return false;\n });\n\n return isAtStart;\n}", "function isSelectionAtLeafStart(editorState) {\n var selection = editorState.getSelection();\n var anchorKey = selection.getAnchorKey();\n var blockTree = editorState.getBlockTree(anchorKey);\n var offset = selection.getStartOffset();\n\n var isAtStart = false;\n\n blockTree.some(function (leafSet) {\n if (offset === leafSet.get('start')) {\n isAtStart = true;\n return true;\n }\n\n if (offset < leafSet.get('end')) {\n return leafSet.get('leaves').some(function (leaf) {\n var leafStart = leaf.get('start');\n if (offset === leafStart) {\n isAtStart = true;\n return true;\n }\n\n return false;\n });\n }\n\n return false;\n });\n\n return isAtStart;\n}", "function isSelectionAtLeafStart(editorState) {\n var selection = editorState.getSelection();\n var anchorKey = selection.getAnchorKey();\n var blockTree = editorState.getBlockTree(anchorKey);\n var offset = selection.getStartOffset();\n\n var isAtStart = false;\n\n blockTree.some(function (leafSet) {\n if (offset === leafSet.get('start')) {\n isAtStart = true;\n return true;\n }\n\n if (offset < leafSet.get('end')) {\n return leafSet.get('leaves').some(function (leaf) {\n var leafStart = leaf.get('start');\n if (offset === leafStart) {\n isAtStart = true;\n return true;\n }\n\n return false;\n });\n }\n\n return false;\n });\n\n return isAtStart;\n}", "function isSelectionAtLeafStart(editorState) {\n var selection = editorState.getSelection();\n var anchorKey = selection.getAnchorKey();\n var blockTree = editorState.getBlockTree(anchorKey);\n var offset = selection.getStartOffset();\n\n var isAtStart = false;\n\n blockTree.some(function (leafSet) {\n if (offset === leafSet.get('start')) {\n isAtStart = true;\n return true;\n }\n\n if (offset < leafSet.get('end')) {\n return leafSet.get('leaves').some(function (leaf) {\n var leafStart = leaf.get('start');\n if (offset === leafStart) {\n isAtStart = true;\n return true;\n }\n\n return false;\n });\n }\n\n return false;\n });\n\n return isAtStart;\n}", "function isSelectionAtLeafStart(editorState) {\n var selection = editorState.getSelection();\n var anchorKey = selection.getAnchorKey();\n var blockTree = editorState.getBlockTree(anchorKey);\n var offset = selection.getStartOffset();\n\n var isAtStart = false;\n\n blockTree.some(function (leafSet) {\n if (offset === leafSet.get('start')) {\n isAtStart = true;\n return true;\n }\n\n if (offset < leafSet.get('end')) {\n return leafSet.get('leaves').some(function (leaf) {\n var leafStart = leaf.get('start');\n if (offset === leafStart) {\n isAtStart = true;\n return true;\n }\n\n return false;\n });\n }\n\n return false;\n });\n\n return isAtStart;\n}", "function isSelectionAtLeafStart(editorState) {\n var selection = editorState.getSelection();\n var anchorKey = selection.getAnchorKey();\n var blockTree = editorState.getBlockTree(anchorKey);\n var offset = selection.getStartOffset();\n\n var isAtStart = false;\n\n blockTree.some(function (leafSet) {\n if (offset === leafSet.get('start')) {\n isAtStart = true;\n return true;\n }\n\n if (offset < leafSet.get('end')) {\n return leafSet.get('leaves').some(function (leaf) {\n var leafStart = leaf.get('start');\n if (offset === leafStart) {\n isAtStart = true;\n return true;\n }\n\n return false;\n });\n }\n\n return false;\n });\n\n return isAtStart;\n}", "function isSelectionAtLeafStart(editorState) {\n var selection = editorState.getSelection();\n var anchorKey = selection.getAnchorKey();\n var blockTree = editorState.getBlockTree(anchorKey);\n var offset = selection.getStartOffset();\n\n var isAtStart = false;\n\n blockTree.some(function (leafSet) {\n if (offset === leafSet.get('start')) {\n isAtStart = true;\n return true;\n }\n\n if (offset < leafSet.get('end')) {\n return leafSet.get('leaves').some(function (leaf) {\n var leafStart = leaf.get('start');\n if (offset === leafStart) {\n isAtStart = true;\n return true;\n }\n\n return false;\n });\n }\n\n return false;\n });\n\n return isAtStart;\n}", "function isDirectValue(subcomponent) {\n let direct_values = [\n SubComponentType.STRING,\n SubComponentType.NAME,\n SubComponentType.NUMBER\n ];\n\n for(let direct_value of direct_values)\n if(subcomponent[0].isOf(direct_value))\n return true;\n\n return false;\n}", "function isSub(name) {\r\n try {\r\n if (name === null) {\r\n return false;\r\n }\r\n else if (name.indexOf(\"~Sub\") === 0) {\r\n return true;\r\n }\r\n else return false;\r\n }\r\n catch (err) {\r\n sendChanAll(\"Error in determining whether \"+name+\" is a sub, \"+err, tourserrchan);\r\n return false;\r\n }\r\n}", "function isElementInsideNav(el) {\n\t\tconst expandedLevel1El = rootEl.querySelector('[data-o-hierarchical-nav-level=\"1\"] > [aria-expanded=\"true\"]');\n\t\tlet expandedMegaDropdownEl;\n\t\tlet allLevel1Els;\n\n\t\tif (expandedLevel1El) {\n\t\t\texpandedMegaDropdownEl = getMegaDropdownEl(expandedLevel1El);\n\t\t\tif (expandedMegaDropdownEl && expandedMegaDropdownEl.contains(el)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\tallLevel1Els = rootEl.querySelectorAll('[data-o-hierarchical-nav-level=\"1\"] > li');\n\n\t\tfor (let c = 0, l = allLevel1Els.length; c < l; c++) {\n\t\t\tif (allLevel1Els[c].contains(el)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "function canSubtractRoot(min, sub) {\n\t var minIdentifyingCall = min.getIdentifyingArg();\n\t var subIdentifyingCall = sub.getIdentifyingArg();\n\t return min.getFieldName() === sub.getFieldName() && areEqual(minIdentifyingCall, subIdentifyingCall);\n\t}", "function canSubtractRoot(min, sub) {\n\t var minIdentifyingCall = min.getIdentifyingArg();\n\t var subIdentifyingCall = sub.getIdentifyingArg();\n\t return min.getFieldName() === sub.getFieldName() && areEqual(minIdentifyingCall, subIdentifyingCall);\n\t}", "isEmpty() {\n if (this.length < 1) {\n return true;\n }\n return false;\n }", "isEmpty() {\n if (this.length < 1) {\n return true;\n }\n return false;\n }", "get isInMiddle() {\n return !this.isFirst && !this.isLast;\n }", "doesMinotaurSeeTheseus(){\n\t\tlet minotaurLOS = this.getLineOfSight(this.props.G.minotaurPos);\n\t\tfor(let x = 0; x < minotaurLOS.length; x++){\n\t\t\tif(minotaurLOS[x] === this.props.G.theseusPos){\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}", "function isParent(first, second) {\n\tvar firstList = (first == '')?[]:first.split('.');\n\tvar secondList = second.split('.');\n\tsecondList.splice(firstList.length);\n\tconsole.log(firstList);\n\tconsole.log(secondList);\n\treturn (firstList.join('.') == secondList.join('.'));\n}", "isEmpty() {\n return this.size() < 1;\n }", "function isSuperSet(setD, subset) {\n let isSuperSetBool = true;\n for(let element of subset) {\n if (!setD.has(element)) {\n isSuperSetBool = false;\n break;\n }\n\n }\n return isSuperSetBool;\n\n}", "function startsWith (substr) {\n\treturn this.lastIndexOf(substr, 0) === 0\n}", "function isValidSubsequence(array, sequence) {\r\n let i = 0; // índice da sequencia\r\n // varro o array de entrada\r\n for (const a of array) {\r\n // se encontrei \r\n if (a === sequence[i]) {\r\n // avanço para procurar o próximo na sequencia\r\n i += 1;\r\n }\r\n // se avacei na sequencia até o fim\r\n if (i === sequence.length) {\r\n // todos os números foram encontrados\r\n return true;\r\n }\r\n }\r\n return false;\r\n}", "function isSingular(value) {\n return !!(value && hasOwnProperty(value, 'isVirtual')) || isRealElement(value);\n}", "get hasSubFolders()\n\t{\n\t\treturn true;\n\t}", "isStartingWith(value, sub) {\n return this.isString(value) && value.startsWith(sub);\n }", "first() {\n return this._first && this._first.value;\n }", "function isSingular(value) {\n return !!(value && hasOwnProperty(value, 'isVirtual')) || isRealElement(value);\n }", "function hasStat(curTgrp){\n var bFound = false;\n var measures = curTgrp.measures;\n if ((measures) && (measures.length > 0)) {\n var stats = measures[0];\n if ((stats)) {\n bFound = true;\n }\n }\n return bFound;\n}", "function isFirstInStatement(printStack /*: Array<Object>*/) /*: boolean*/ {\n\t var i = printStack.length - 1;\n\t var node = printStack[i];\n\t i--;\n\t var parent = printStack[i];\n\t while (i > 0) {\n\t if (t.isExpressionStatement(parent, { expression: node })) {\n\t return true;\n\t }\n\n\t if (t.isCallExpression(parent, { callee: node }) || t.isSequenceExpression(parent) && parent.expressions[0] === node || t.isMemberExpression(parent, { object: node }) || t.isConditional(parent, { test: node }) || t.isBinary(parent, { left: node }) || t.isAssignmentExpression(parent, { left: node })) {\n\t node = parent;\n\t i--;\n\t parent = printStack[i];\n\t } else {\n\t return false;\n\t }\n\t }\n\n\t return false;\n\t}", "hasKey(name) {\n if (name in this.values) {\n return true;\n }\n for (let i in this.subspacesById) {\n if (this.subspacesById[i].hasKey(name)) {\n return true;\n }\n }\n return false;\n }", "isFull() {\n if (this.front == 0 && this.rear == this.size - 1 || (this.rear + 1 == this.front)) {\n return true;\n }\n return false;\n }", "function subType (subType, genType) {\n\tsubType += '';\n\tgenType += '';\n\tif (subType === genType) return true;\n\tvar typePriority = ['double', 'float', 'int', 'uint'];\n\tvar subIdx = typePriority.indexOf(subType);\n\tvar genIdx = typePriority.indexOf(genType);\n\tif (subIdx >= 0 && genIdx >= 0 && subIdx >= genIdx) return true;\n\treturn false;\n}", "function findUnit(x) {\r\n for (y = 0; y < units.length; y++) {\r\n if (units[y][1] === x) {\r\n return units[y][0];\r\n }\r\n };\r\n return null;\r\n}", "function containsTimeUnit(fullTimeUnit, timeUnit) {\n var index = fullTimeUnit.indexOf(timeUnit);\n return index > -1 &&\n (timeUnit !== TimeUnit.SECONDS ||\n index === 0 ||\n fullTimeUnit.charAt(index - 1) !== 'i' // exclude milliseconds\n );\n}", "function determineMajorUnit(unit) {\n\t\tvar units = Object.keys(interval);\n\t\tvar unitIndex = units.indexOf(unit);\n\t\twhile (unitIndex < units.length) {\n\t\t\tvar majorUnit = units[++unitIndex];\n\t\t\t// exclude 'week' and 'quarter' units\n\t\t\tif (majorUnit !== 'week' && majorUnit !== 'quarter') {\n\t\t\t\treturn majorUnit;\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t}", "isEmpty() {\n if (this.top === null){\n return true;\n } else {\n return false;\n }\n }", "function containsTimeUnit(fullTimeUnit, timeUnit) {\n var index = fullTimeUnit.indexOf(timeUnit);\n\n if (index < 0) {\n return false;\n } // exclude milliseconds\n\n\n if (index > 0 && timeUnit === 'seconds' && fullTimeUnit.charAt(index - 1) === 'i') {\n return false;\n } // exclude dayofyear\n\n\n if (fullTimeUnit.length > index + 3 && timeUnit === 'day' && fullTimeUnit.charAt(index + 3) === 'o') {\n return false;\n }\n\n if (index > 0 && timeUnit === 'year' && fullTimeUnit.charAt(index - 1) === 'f') {\n return false;\n }\n\n return true;\n }", "isEmpty() {\n return this.length() < 1;\n }", "function subArea(a, b) {\n\tvar a_ = a.toString();\n\tvar b_ = b.toString();\n\tif (b == 0) { // 0 is the Root(All areas)\n\t\treturn true;\n\t} else if (b_.substring(1, 3) == \"00\") {\n\t\treturn a_[0] == b_[0];\n\t} else if (b_[2] == \"0\") {\n\t\treturn a_.substring(0, 2) == b_.substring(0, 2);\n\t} else {\n\t\treturn a_ == b_;\n\t}\n}", "_checkIfIsMainElement(currentElement) {\n\t\tlet found = false;\n\t\tif (currentElement && currentElement.className) {\n\t\t\tfor (const mainPowerElementConfig of PowerUi._powerElementsConfig.filter(s => s.isMain === true)) {\n\t\t\t\tif (currentElement.classList.contains(mainPowerElementConfig.name)) {\n\t\t\t\t\tfound = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn found;\n\t}", "isEmpty()\n {\n if(this.front===null)\n return true;\n else\n return false;\n }", "isEmpty() {\n return this.front == -1;\n }", "function checkFirst(array, sumGroup){\n dividedSorted = Lib.Pivot.divideArray(array, sumGroup);\n var firstElements = [];\n for(var i = 0; i < dividedSorted.length; i++){\n //firstElements - it is array of cells of Sums for each Person\n firstElements.push(dividedSorted[i][0]);\n dividedSorted[i].shift();\n }\n expect(Lib.Pivot.isSorted(firstElements, fn)).toBeTruthy();\n return dividedSorted;\n }", "function checkFirst(array, sumGroup){\n dividedSorted = Lib.Pivot.divideArray(array, sumGroup);\n var firstElements = [];\n for(var i = 0; i < dividedSorted.length; i++){\n //firstElements - it is array of cells of Sums for each Person\n firstElements.push(dividedSorted[i][0]);\n dividedSorted[i].shift();\n }\n expect(Lib.Pivot.isSorted(firstElements, fn)).toBeTruthy();\n return dividedSorted;\n }", "firstToken({token, counter}) {\n\t\tif (token.name === 'blank') {\n\t\t\tthis.listener.candidates = this.listener.candidates.filter(c=> c.name === 'empty');\n\t\t\tthis.listener.checking = 'middleTokens';\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "function isSingleSel(name) {\r\n\tvar all = $n(name);\r\n\tvar returnValue = true;\r\n\tvar flag = 0;\r\n\tfor (var i = 0; i < all.length; i++) {\r\n\t\tif(all[i].checked){\r\n\t\t flag++;\r\n\t\t}\r\n\t}\r\n\tif(flag==0 || flag>1){\r\n\t returnValue = false;\r\n\t}\r\n\treturn returnValue ;\r\n}", "isEmpty(){\n return (this.rear +1 === this.front);\n }", "function textoEmpiezaCon(texto, subtexto) {\n return texto.indexOf(subtexto) === 0;\n}", "function isRoot() {\n return this.source === this.value;\n}", "isSubset(superset) {\n return XSet.isSubset(this, superset);\n }", "function firstStart() {\n const local = '.';\n let files = [];\n try {\n files = fs.readdirSync(local);\n } catch (exception) {\n console.log(exception);\n }\n let stats = null;\n for (let i = 0; i < files.length; i++) {\n const str = files[i];\n stats = fs.statSync(files[i]);\n if (stats.isFile()) {\n // if prefsJson or historyJson is there then it is not first start\n if (str === prefsJson || str === historyJson) {\n return false;\n }\n }\n }\n\n return true;\n}", "function checkSelfIntersection(polygon) {\n if(polygon.CLASS_NAME==\"OpenLayers.Geometry.Polygon\") {\n // checking only outer ring\n var outer = polygon.components[0].components;\n var segments = [];\n for(var i=1;i<outer.length;i++) {\n var segment= new OpenLayers.Geometry.LineString([outer[i-1].clone(),outer[i].clone()]);\n segments.push(segment);\n }\n for(var j=0;j<segments.length;j++) {\n if(segmentIntersects(segments[j],segments)) {\n return true;\n }\n }\n }\n return false;\n}", "function isValidSubsequence1(array, sequence) {\n if (sequence.length > array.length) {\n return false;\n } else {\n for (let i = 0; i < sequence.length; i++) {\n if (array.indexOf(sequence[i]) === -1) {\n return false;\n }\n }\n return true;\n }\n}", "isEmpty(editor, element) {\n var {\n children\n } = element;\n var [first] = children;\n return children.length === 0 || children.length === 1 && Text.isText(first) && first.text === '' && !editor.isVoid(element);\n }", "isEmpty(editor, element) {\n var {\n children\n } = element;\n var [first] = children;\n return children.length === 0 || children.length === 1 && Text.isText(first) && first.text === '' && !editor.isVoid(element);\n }", "function first_in_statement(stack) {\n let node = stack.parent(-1);\n for (let i = 0, p; p = stack.parent(i); i++) {\n if (p instanceof AST_Statement && p.body === node)\n return true;\n if ((p instanceof AST_Sequence && p.expressions[0] === node) ||\n (p.TYPE === \"Call\" && p.expression === node) ||\n (p instanceof AST_PrefixedTemplateString && p.prefix === node) ||\n (p instanceof AST_Dot && p.expression === node) ||\n (p instanceof AST_Sub && p.expression === node) ||\n (p instanceof AST_Chain && p.expression === node) ||\n (p instanceof AST_Conditional && p.condition === node) ||\n (p instanceof AST_Binary && p.left === node) ||\n (p instanceof AST_UnaryPostfix && p.expression === node)\n ) {\n node = p;\n } else {\n return false;\n }\n }\n}", "unitReady() {\n\t\tif (this.ready === 0) {\n\t\t\tconsole.log(`[RECHARGE] Squad ${this.squadIndex} from army '${this.army}' is recharging`);\n\t\t}\n\t\t// Count ready units and compare to active units\n\t\tthis.ready++;\n\t\tif (this.ready >= this.getActiveUnits().length) {\n\t\t\tthis.ready = 0;\n\t\t\tconsole.log(`[RECHARGE] Squad ${this.squadIndex} from army '${this.army}' is ready`);\n\t\t\tthis.emit('attack', this);\n\t\t}\n\t\t// TODO@dvs:! You can not guarantee which unit called the method. Not sure if 2 timeouts of a single unit called the squads.unitReady\n\t\t// Not possible as units are only recharging after the attack, therefore a single unit can't do this twice.\n\t}", "function someRecursive(arr, cb) {\n if(arr.length === 0) return false;\n return cb(arr[0]) === true ? true : someRecursive(arr.slice(1), cb);\n}", "get isSimple() {\n const { _coords } = this\n const numCoords = _coords.length\n if (numCoords <= 6) return true\n\n for (let i = 0; i < numCoords; i += 2) {\n const ax = _coords[i]\n const ay = _coords[i + 1]\n const bx = _coords[(i + 2) % numCoords]\n const by = _coords[(i + 3) % numCoords]\n const endJ = i + numCoords - 2\n\n for (let j = i + 4; j < endJ; j += 2) {\n const cx = _coords[j % numCoords]\n const cy = _coords[(j + 1) % numCoords]\n const dx = _coords[(j + 2) % numCoords]\n const dy = _coords[(j + 3) % numCoords]\n\n if (this.areVectorsIntersecting(ax, ay, bx, by, cx, cy, dx, dy))\n return false\n }\n }\n\n return true\n }", "function firsttime() {\n\tfor(let i = 0; i < pos; i++) {\n\t\tif(current == origin[i]) {\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;\n}", "isSubsetFull (grid,origin, end) {\n if(end[0]>grid.length) {\n end[0]=grid.length;\n }\n if(end[1]>grid[0].length){\n end[1]=grid[0].length;\n }\n for(let i=origin[0]; i<end[0]; i++) {\n for(let j=origin[1]; j<end[1]; j++) {\n if(grid[i][j]===null){\n return false;\n }\n if(grid[i][j]!==true){\n if(!grid[i][j].isFull){\n return false;\n }\n }\n }\n }\n return true;\n }", "function isUnitModel(model) {\n return model && model.type === 'unit';\n}", "isEmpty() {\n return this.root === null;\n }", "function containsTimeUnit(fullTimeUnit, timeUnit) {\n var index = fullTimeUnit.indexOf(timeUnit);\n return index > -1 &&\n (timeUnit !== TimeUnit.SECONDS ||\n index === 0 ||\n fullTimeUnit.charAt(index - 1) !== 'i' // exclude milliseconds\n );\n }", "checkEmpty () {\n if (this.front === 0 && this.rear === 0) {\n return true\n }\n }", "function checkSubArrayBool(parentArray, childArray) {\n var bool = true;\n for (var element of childArray) {\n if (!parentArray.includes(element)) {\n bool = false;\n break;\n }\n }\n return bool;\n}", "function isSubstring(phrase, subphrase) {\n return phrase.includes(subphrase);\n}", "function isSliceContinous(shape, begin, size) {\n // Index of the first axis that has size > 1.\n var firstNonOneAxis = size.length;\n for (var i = 0; i < size.length; i++) {\n if (size[i] > 1) {\n firstNonOneAxis = i;\n break;\n }\n }\n for (var i = firstNonOneAxis + 1; i < size.length; i++) {\n if (begin[i] > 0 || size[i] !== shape[i]) {\n return false;\n }\n }\n return true;\n}", "function isSubsequence(st1,st2) {\n\n var i = 0;\n var j = 0;\n\n if (!str1) return true;\n\n while (j < str2.length) {\n if (str2[j] === str1[i]) {i++};\n if (i === str1.length) { return true};\n j++;\n }\n \n return false;\n }", "function containsTimeUnit(fullTimeUnit, timeUnit) {\n\t const index = fullTimeUnit.indexOf(timeUnit);\n\t return (index > -1 && (timeUnit !== TimeUnit.SECONDS || index === 0 || fullTimeUnit.charAt(index - 1) !== 'i') // exclude milliseconds\n\t );\n\t}", "function chkAtLstOneInGroupChkBx() {\n var atLeastOneIsChecked = false;\n $('input:checkbox').each(function () {\n if ($(this).is(':checked')) {\n atLeastOneIsChecked = true;\n // Stop .each from processing any more items\n return false;\n }\n });\n // Do something with atLeastOneIsChecked\n}" ]
[ "0.6750091", "0.59201705", "0.5856817", "0.56979275", "0.5572986", "0.5389489", "0.52738553", "0.5268939", "0.5255774", "0.5230735", "0.5198978", "0.5186373", "0.51727164", "0.51307213", "0.51191735", "0.51138365", "0.5085178", "0.5050002", "0.50461066", "0.5044285", "0.50414205", "0.49877152", "0.49611166", "0.49431747", "0.4937476", "0.49337822", "0.4932743", "0.4913778", "0.48472986", "0.4844908", "0.4844908", "0.4844908", "0.4844908", "0.4844908", "0.4844908", "0.4844908", "0.4844908", "0.4823694", "0.48217604", "0.48102587", "0.48007742", "0.48007742", "0.4788183", "0.4788183", "0.47611538", "0.4756255", "0.47031608", "0.46916673", "0.46865445", "0.46771017", "0.46726233", "0.46660864", "0.46411595", "0.46395493", "0.4632379", "0.46271685", "0.46098536", "0.46042308", "0.45853078", "0.4580094", "0.45789233", "0.45693484", "0.4561532", "0.45604393", "0.4557376", "0.45545128", "0.45501631", "0.45498702", "0.45444486", "0.45440498", "0.45400888", "0.4538557", "0.4538557", "0.45300508", "0.45296922", "0.45237142", "0.45226568", "0.45117137", "0.45116043", "0.45045862", "0.45016253", "0.4498126", "0.44946784", "0.44946784", "0.44943297", "0.4490389", "0.44872606", "0.44846183", "0.44817686", "0.44791743", "0.4478953", "0.4473062", "0.44701338", "0.44657204", "0.44651726", "0.44614884", "0.44602835", "0.44515404", "0.44511783", "0.44500655" ]
0.8978072
0
Check if the current subunit is the last subunit among all the subunits. Return: true if the current subunit is the last subunit; false otherwise
function currentSubunitIsTheLastSubunit() { return my.current.unitNo == Units.main.length && my.current.subunitNo == my.current.subunitTitles.length }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function currentSubunitIsTheFirstSubunit()\n {\n return my.current.unitNo == 1 && my.current.subunitNo == 1\n }", "function isLast(idx) {\n const parent = inArr[idx][1];\n for (let i = idx + 1; i < inArr.length; i++) {\n if (inArr[i][1] === parent) {\n return false;\n }\n }\n return true;\n }", "function isLastItem() {\n var curListItem = $(this).closest(\".listItem\");\n var totalItems = $(this).closest(\".list\").find(\".listItem\").length;\n var itemInd = $(curListItem).index(); // this starts at 1\n return totalItems === itemInd;\n}", "isLast(item) {\n return this.crumbs.indexOf(item) === this.crumbs.length - 1;\n }", "get isLast() {\n return this.index === this.length - 1;\n }", "isLastSubscriptInChain() {\n let depth = 0;\n for (let i = this.tokens.currentIndex() + 1; ; i++) {\n if (i >= this.tokens.tokens.length) {\n throw new Error(\"Reached the end of the code while finding the end of the access chain.\");\n }\n if (this.tokens.tokens[i].isOptionalChainStart) {\n depth++;\n } else if (this.tokens.tokens[i].isOptionalChainEnd) {\n depth--;\n }\n if (depth < 0) {\n return true;\n }\n\n // This subscript token is a later one in the same chain.\n if (depth === 0 && this.tokens.tokens[i].subscriptStartIndex != null) {\n return false;\n }\n }\n }", "isLastStep() {\n return this.wizardSteps.length > 0 && this.currentStepIndex === this.wizardSteps.length - 1;\n }", "decision () {\n\n // console.log('length: ', this.leves.length)\n if ((this.currentIndexLevel == this.leves.length - 1)) {\n return true\n }\n return false\n }", "function nextSubunit()\n {\n var m = my.current.unitNo\n var n = my.current.subunitNo\n\n if (!currentSubunitIsTheLastSubunit()) {\n if (n == my.current.subunitTitles.length) {\n // If the user is at unit M.L where L is the last\n // subunit of unit M, then go to unit (M + 1).1.\n m++\n n = 1\n } else {\n // If the user is at unit M.N, then go to unit M.(N + 1).\n n++\n }\n }\n\n window.location.href = unitHref(m, n)\n }", "function isLastItem(selected_id) {\r\n\tif (!$('#' + selected_id + '-node')[0].nextSibling\r\n\t\t\t&& !$('#' + selected_id + '-node')[0].previousSibling)\r\n\t\treturn true;\r\n\telse\r\n\t\treturn false;\r\n}", "get isEnd() {\n return !this.descendants.length;\n }", "isEnd() {\r\n return this.curr.next == null ? true : false;\r\n }", "lastMoviePlay()\n {\n return (this.currentMoviePlay == this.playsCoords.length - 1);\n }", "function endOfCombat() {\n\tvar eoc = false;\n\n\t_.each(combat.fleets,function(fleet) {\n\t\tconsole.log(fleet.name + \" \" + fleet.combat.loseCount + \" of \" + fleet.combat.unitCount + \"(\" + fleet.breakoff + \")\");\n\t\tif(fleet.combat.loseCount >= fleet.combat.unitCount) {\n\t\t\teoc = true;\n\t\t}\n\t});\n\n\treturn eoc;\n}", "function previousSubunit()\n {\n var m = my.current.unitNo\n var n = my.current.subunitNo\n\n if (!currentSubunitIsTheFirstSubunit()) {\n if (n == 1) {\n // If the user is at unit M.1, go to unit (M - 1).L\n // where L is the last subunit of the previous unit.\n previousUnit = unit(m - 1)\n var previousSubunitTitles = []\n for (var subunitTitle in previousUnit.subunits) {\n previousSubunitTitles.push(subunitTitle)\n }\n\n m--\n n = previousSubunitTitles.length\n } else {\n // If the user is at unit M.N, go to unit M.(N - 1)\n n--\n }\n }\n\n window.location.href = unitHref(m, n)\n }", "function nodeEndsWith(n, expectedLastToken, sourceFile) {\n var children = n.getChildren(sourceFile);\n if (children.length) {\n var last = ts.lastOrUndefined(children);\n if (last.kind === expectedLastToken) {\n return true;\n }\n else if (last.kind === 23 /* SemicolonToken */ && children.length !== 1) {\n return children[children.length - 2].kind === expectedLastToken;\n }\n }\n return false;\n }", "function lastRound(){\r\n\tif(nthRound === rounds){\r\n\t\treturn true;\r\n\t}\r\n\telse{\r\n\t\treturn false;\r\n\t}\r\n}", "removeLast() {\n\t\tif (this.head === null) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (this.head === this.tail) {\n\t\t\tthis.head = null;\n\t\t\tthis.tail = null;\n\t\t} else {\n\t\t\tthis.tail = this.tail.previous;\n\t\t\tthis.tail.next = null;\n\t\t}\n\n\t\tthis._size--;\n\n\t\treturn true;\n\t}", "canAddSub() {\n return this.subaddable().length > 0;\n }", "function isEnd() {\n\t\tlet flag = true;\n\t\tfor (let i = 0; i < pieceCount.length; i++) {\n\t\t\t//for each puzzle piece\n\t\t\tlet top = parseInt(pieceCount[i].style.top);\n\t\t\tlet left = parseInt(pieceCount[i].style.left);\n\t\t\tif (left != (i % 4 * PIECESIZE) || top != parseInt(i / 4) * PIECESIZE) {\n\t\t\t\t//checks if each piece matches its left and top position\n\t\t\t\tflag = false;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn flag;\n\t}", "isEnd() {\n return this.data.rounds.end(); \n }", "isEndingWith(value, sub) {\n return this.isString(value) && value.endsWith(sub);\n }", "function is_subseq_at(sub, seq, start_pos){\n let cnt = 0;\n let flag = false;\n for(let i = start_pos; i < seq.length; i = i + 1){\n if(cnt === sub.length){\n break;\n } else if(sub[cnt] !== seq[i]){\n flag = true;\n break;\n } else {\n if(i+1<seq.length){cnt = cnt + 1;} else {}\n }\n }\n \n if(flag || cnt < sub.length-1){\n return false;\n } else {\n // display(cnt);\n return true;\n }\n}", "_isMovingToSubmenu() {\n const submenuPoints = this._getSubmenuBounds();\n if (!submenuPoints) {\n return false;\n }\n let numMoving = 0;\n const currPoint = this._points[this._points.length - 1];\n // start from the second last point and calculate the slope between each point and the last\n // point.\n for (let i = this._points.length - 2; i >= 0; i--) {\n const previous = this._points[i];\n const slope = getSlope(currPoint, previous);\n if (isWithinSubmenu(submenuPoints, slope, getYIntercept(currPoint, slope))) {\n numMoving++;\n }\n }\n return numMoving >= Math.floor(NUM_POINTS / 2);\n }", "isBase() {\n return isBase(this.unitList);\n }", "isLastPage () {\n return this.lastItemIndex === 0\n ? true\n : this.computedPagination.page >= this.pagesNumber\n }", "function checkIfLastOperator() {\n var lastChar = screenContent.substr(screenContent.length - 1);\n var operator = [\"+\", \"-\", \"*\", \"/\", \".\"];\n for (i = 0; i < operator.length; i++) {\n if (operator[i] === lastChar) {\n return true;\n }\n }\n return false;\n }", "isFull() {\n if (this.front == 0 && this.rear == this.size - 1 || (this.rear + 1 == this.front)) {\n return true;\n }\n return false;\n }", "last() {\n return this._last && this._last.value;\n }", "isSelectionOnLastLine() {\n return this.getLineIndex(this.end) >= this.lineBreaks_.length - 1;\n }", "function confirmEnding(str, target) {\n let exist=str.lastIndexOf(target);\n if (exist!=-1){\n let slice = str.slice(exist);\n console.log(slice);\n if(slice==target){\n return true;\n }\n else{\n return false;\n }\n }\n else {\n return false;\n }\n }", "hasMore() {\n return this.length > this.#index + 1;\n }", "get _last() {\n return this === OverlayElement.__attachedInstances.pop();\n }", "function checkLastElement(e) {\n if (e == null)\n return false;\n var friendElement = e.next();\n if (typeof friendElement[0] !== 'undefined' && friendElement[0].tagName === 'SIDE-ACCORDION-ITEM') {\n return false;\n } else {\n return true;\n }\n }", "function last(grid) {\r\n begintime = new Date();\r\n grid.recordset.MoveLast();\r\n if (isEmptyRecordset(grid.recordset) || grid.recordset(\"ID\").value == \"-9999\")\r\n return false;\r\n endtime = new Date();\r\n\r\n return true;\r\n}", "isFull() {\n return (this.tail + 1) % this.capacty == this.head\n }", "function checkIfLastOperatorforMinus() {\n var lastChar = screenContent.substr(screenContent.length - 1);\n var operator = [\"+\", \"-\"];\n for (i = 0; i < operator.length; i++) {\n if (operator[i] === lastChar) {\n return true;\n }\n }\n return false;\n }", "function setIsFinal() {\r\n var nPiecesFound = 0;\r\n for (var i in that.finalPieces) {\r\n var finalPiece = that.finalPieces[i];\r\n for (var j in that.pieces) {\r\n var piece = that.pieces[j];\r\n if (finalPiece.equals(piece)) {\r\n nPiecesFound++;\r\n break;\r\n }\r\n }\r\n }\r\n that.isFinal = nPiecesFound == that.finalPieces.length;\r\n }", "get isInMiddle() {\n return !this.isFirst && !this.isLast;\n }", "function levelCompleted() {\n\tcompleted = true;\n\tfor (var i=0; i<NY; i++) {\n\t\tfor (var j=0; j<NX; j++) {\n\t\t\tif (values[i][j] != levels[currentLevel][i][j]) {\n\t\t\t\tcompleted = false;\n\t\t\t}\n\t\t}\n\t}\n\treturn completed;\n}", "isFull() {\n return (this.lastIndex === (this.capacity() - 1));\n }", "selectEnd() {\n\t\tvar last, items = this.getItemsArray();\n\t\tif (!_isEmpty(items) && (last = _arrLast(items))) {\n\t\t\treturn last.setActiveState(true);\n\t\t}\n\t}", "function is_finished(curr_song, num_songs) {\n\t\treturn curr_song >= num_songs ? true : false;\n\t}", "function isLastPage() {\n var viewLastIndex = curPageNumber * curPageLimit + curCount + 1;\n if(viewLastIndex >= totalCount) {\n return true;\n }\n return false;\n }", "checkValidLastTransaction(lastTransactionInSegment, lastTransactionToObtain) {\n if (lastTransactionToObtain.id === false || lastTransactionInSegment.id === false) {\n return 'noCheck';\n } else {\n let check = Transaction.prototype.transactionFromId(lastTransactionInSegment.id).checkEarlierLaterEqualThanId(lastTransactionToObtain.id);\n //if (check === 'equal' || check === 'later') {\n if (check === 'equal') {\n return true;\n } else {\n return false;\n }\n }\n }", "function checkEnd(){\n var flag = false;\n for (i=0;i<arr.length;i++){\n if (arr[i]%(level+1)===0){\n flag = true;\n }\n }\n return flag;\n}", "function endsWithBlankLine(block) {\n var curBlock = block;\n while (curBlock) {\n if (curBlock.lastLineBlank) {\n return true;\n }\n var t = curBlock.type;\n if (!curBlock.lastLineChecked && (t === 'list' || t === 'item')) {\n curBlock.lastLineChecked = true;\n curBlock = curBlock.lastChild;\n }\n else {\n curBlock.lastLineChecked = true;\n break;\n }\n }\n return false;\n}", "isFull() {\n return ((this.tail + 1) % this.size) === this.head;\n }", "get isEnd() {\n\t\treturn (this.state.sourcePosition >= this.state.sourceEnd);\n\t}", "function isLastMatchingPair() {\n return memoryGrid.querySelectorAll('.' + MATCH).length === 16;\n }", "end() {\n return this.index === this.questions.length;\n }", "endsAfter(path, another) {\n var i = path.length - 1;\n var as = path.slice(0, i);\n var bs = another.slice(0, i);\n var av = path[i];\n var bv = another[i];\n return Path.equals(as, bs) && av > bv;\n }", "endsAfter(path, another) {\n var i = path.length - 1;\n var as = path.slice(0, i);\n var bs = another.slice(0, i);\n var av = path[i];\n var bv = another[i];\n return Path.equals(as, bs) && av > bv;\n }", "isParagraphLastLine(element) {\n let paragraph = element.line.paragraph;\n let lastLineWidget = paragraph.childWidgets[paragraph.childWidgets.length - 1];\n let lastInline = lastLineWidget.children[lastLineWidget.children.length - 1];\n if (element === lastInline) {\n // tslint:disable-next-line:max-line-length \n return (lastInline instanceof FieldElementBox) || ((!(lastInline instanceof TextElementBox && lastInline.text === '\\v')));\n }\n return false;\n }", "finished() {\n return (this.root.length >= this.totalLength * this.scale);\n }", "_popElement(fullName, endSourceSpan) {\n for (let stackIndex = this._elementStack.length - 1; stackIndex >= 0; stackIndex--) {\n const el = this._elementStack[stackIndex];\n if (el.name == fullName) {\n // Record the parse span with the element that is being closed. Any elements that are\n // removed from the element stack at this point are closed implicitly, so they won't get\n // an end source span (as there is no explicit closing element).\n el.endSourceSpan = endSourceSpan;\n el.sourceSpan.end = endSourceSpan !== null ? endSourceSpan.end : el.sourceSpan.end;\n this._elementStack.splice(stackIndex, this._elementStack.length - stackIndex);\n return true;\n }\n if (!this.getTagDefinition(el.name).closedByParent) {\n return false;\n }\n }\n return false;\n }", "_popElement(fullName, endSourceSpan) {\n for (let stackIndex = this._elementStack.length - 1; stackIndex >= 0; stackIndex--) {\n const el = this._elementStack[stackIndex];\n if (el.name == fullName) {\n // Record the parse span with the element that is being closed. Any elements that are\n // removed from the element stack at this point are closed implicitly, so they won't get\n // an end source span (as there is no explicit closing element).\n el.endSourceSpan = endSourceSpan;\n el.sourceSpan.end = endSourceSpan !== null ? endSourceSpan.end : el.sourceSpan.end;\n this._elementStack.splice(stackIndex, this._elementStack.length - stackIndex);\n return true;\n }\n if (!this.getTagDefinition(el.name).closedByParent) {\n return false;\n }\n }\n return false;\n }", "function findLastChar(currString, currNode) {\n //console.log(\"lastChar currString\", currString);\n if (currString.length === 0) {\n return true;\n }\n for (let i = 0; i < currNode.nexts.length; i++) {\n if (currString.charAt(currString.length - 1) === currNode.nexts[i].string) {\n return findLastChar(currString.slice(0, -1), currNode.nexts[i]);\n }\n }\n return false;\n}", "_isComparisonEnd(value) {\n return isEnd(value, this.comparisonStart, this.comparisonEnd);\n }", "_isComparisonEnd(value) {\n return isEnd(value, this.comparisonStart, this.comparisonEnd);\n }", "hasLoop(){\n if (this.isEmpty() || this.head.next == null) {\n return false;\n }\n let rabbit = this.head.next;\n let tortoise = this.head;\n while (rabbit != tortoise){\n if (rabbit.next == null || tortoise.next == null){\n return false;\n }\n rabbit = rabbit.next.next;\n tortoise = tortoise.next;\n }\n return true;\n }", "function isValidSubsequence(array, sequence) {\r\n let i = 0; // índice da sequencia\r\n // varro o array de entrada\r\n for (const a of array) {\r\n // se encontrei \r\n if (a === sequence[i]) {\r\n // avanço para procurar o próximo na sequencia\r\n i += 1;\r\n }\r\n // se avacei na sequencia até o fim\r\n if (i === sequence.length) {\r\n // todos os números foram encontrados\r\n return true;\r\n }\r\n }\r\n return false;\r\n}", "function isLastCategory(path)\n{\n\tvar hasCard; // Initialize boolean\n\n\tfirebase.database().ref(path).once(\"value\", function(snapshot) // Reference snapshot\n\t{\t\n\t\thasCard = snapshot.hasChild(\"Card1\");\n\t});\n\treturn hasCard; // Return boolean value\n}", "isEnd(editor, point, at) {\n var end = Editor.end(editor, at);\n return Point.equals(point, end);\n }", "isEnd(editor, point, at) {\n var end = Editor.end(editor, at);\n return Point.equals(point, end);\n }", "function check_with_parents_last(el, css, value, comparison, animation_fill_mode) {\n\n var isVal = false;\n\n // Get CSS\n var cssValue = el.css(css);\n\n // If not none but and not have any transfrom.\n if (css == 'transfrom' && cssValue != 'none' && cssValue == 'matrix(1, 0, 0, 1, 0, 0)') {\n cssValue = 'none';\n }\n\n if (comparison == '==') {\n\n if (cssValue === value) {\n if (animation_fill_mode !== undefined) {\n el.css(\"animation-fill-mode\", animation_fill_mode);\n }\n return true;\n\n }\n\n } else {\n\n if (cssValue !== value) {\n if (animation_fill_mode !== undefined) {\n el.css(\"animation-fill-mode\", animation_fill_mode);\n }\n return true;\n\n }\n\n }\n\n if (animation_fill_mode !== undefined) {\n el.css(\"animation-fill-mode\", animation_fill_mode);\n }\n return isVal;\n\n }", "function CheckFile(lasts, last) {\n \n var arrays = lasts.split(',');\n var length = arrays.length;\n last = last.toLowerCase();\n var isOk = false;\n for (var i = 0; i < length; i++) {\n if (last === arrays[i]) {\n isOk = true;\n break;\n }\n }\n return isOk;\n}", "function contentMenuCheckLastSection(){\n\t\"use strict\";\n\t\n\tif($j('nav.content_menu').length){\n\t\n\t\tif($j('.content .in_content_menu').length){\n\t\t\tvar last_from_top = $j('.content .in_content_menu:last').offset().top + $j('.content .in_content_menu:last').height();\n\t\t\tvar first_from_top = $j('.content .in_content_menu:first').offset().top - content_menu_top - content_menu_top_add - 100; //60 is height of content menu\n\t\t\tif(last_from_top < $scroll){\n\t\t\t\t$j(\"nav.content_menu.fixed li\").removeClass('active');\n\t\t\t\t\n\t\t\t}\n\t\t\tif(first_from_top > $scroll){\n\t\t\t\t$j('nav.content_menu li:first, nav.content_menu ul.menu li:first').removeClass('active');\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\n\t}\n}", "function isSub(index1, index2) {\r\n\tvar result = false;\r\n\tvar i = index1;\r\n\t\r\n\twhile (i != -1 && nodes[i].parentID != 'root' && result == false) {\r\n\t\tif(nodes[i].parentID==nodes[index2].id) result = true;\r\n\t\ti = getItemIndex(nodes[i].parentID);\t\t\r\n\t}\r\n\r\n\treturn result;\r\n}", "EndAll()\n {\n\t let result = false;\n\n\t let current = this.Manager_Routine.GetAllocatedHead();\n\t let next\t= current;\n\n\t while (next != null)\n\t {\n\t\t current\t\t\t\t = next;\n\t\t let routineContainer = current.Element;\n\t\t next\t\t\t\t = current.GetNextLink();\n\n let r = routineContainer.Get();\n\n\t\t r.End(EndReasonType.Shutdown);\n\n\t\t //LogTransaction(NCsCoroutineCached::ToUpdate(ScheduleType), TransactionType::End, R);\n\n\t\t r.Reset();\n this.Manager_Routine.Deallocate(routineContainer);\n\n\t\t result = true;\n\t }\n return result;\n }", "function stop() {\n const reachedMax = depth >= maxDepth;\n if (!reachedMax) return false;\n const hasResult = result.length;\n if (hasResult) return true;\n const hasDeepResult = deepSuggestions.filter(arr => arr.length).length;\n return !!hasDeepResult;\n }", "anyDiff() {\n if (this.diff) return true;\n const anyFolderDiff = this.folders.some(folder => folder.anyDiff());\n if (anyFolderDiff) return true;\n return false;\n }", "isActive(){\n return this._units.some(unit => unit.isActive());\n }", "hasOnlyOneExit(){\n\n var sideOfParent = this.sideOfParent();\n\n return ((this.west ? 0 : 1) - (sideOfParent == 0 ? 1 : 0)) + \n ((this.north ? 0 : 1) - (sideOfParent == 1 ? 1 : 0)) +\n ((this.east ? 0 : 1) - (sideOfParent == 2 ? 1 : 0)) +\n ((this.south ? 0 : 1) - (sideOfParent == 3 ? 1 : 0)) == 1;\n }", "function confirmEnding(str, target) {\n //1. of corse .endsWith() method\n //str = str.endsWith(target);\n //return str\n\n //2. .slice() method\n //return str.slice(str.length - target.length) === target;\n\n //3. usual for loop\n let flag = false;\n //start comparing only if target is shorter, else - false\n //compare from the last char till the first of the target\n for ( let i = target.length-1, j = str.length-1; target.length < str.length && i >= 0; i--, j--){\n if (target[i] == str[j]) { \n flag = true;\n } else {\n flag = false\n break\n }\n }\n\n\n return flag;\n }", "endsMonth() {\n\t\treturn this._type == \"month\" || this._type == \"always\" || (this._type == \"day\" && this._end != null && this._end.day == Constants.MONTH_END_DAY[this._end.month-1]);\n\t}", "isComplete() {\n for (let i = 0; i < this.rounds.length; i++) {\n for (let j = 0; j < this.rounds[i].length; j++) {\n if (this.rounds[i][j] == \"\") {\n return false;\n }\n }\n }\n return true;\n }", "shouldAppendLast(variable) {\n return variable[this.PROPERTY.DATA_UPDATE_STRATEGY] === this.DATA_UPDATE_STRATEGY.APPEND;\n }", "isEmpty() {\n return (this.lastIndex === -1);\n }", "isFull() {\n if (this.hasSupernova) {\n return true;\n }\n return this.sectors.every(row => {\n return row.every(sector => !sector.container.isEmpty())\n });\n }", "function isPossible(){\n\tvar a = getTokens();\n\tvar lastToken = a[a.length-1];\n\tif(isNaN(lastToken))\n\t\treturn false;\n\telse{\n\t\tvar i;\n\t\tfor(i = 0;i<lastToken.length;i++){\n\t\t\tif(lastToken[i]=='.')\n\t\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}\n}", "function endsWith(ch)\n{\n return this.lastIndexOf(ch) == this.length - ch.length;\n}", "endGame() {\n\t\tfor (let i = 1; i < this.cell.length; i++) {\n\t\t\tif (this.x == this.cell[i].x && this.y == this.cell[i].y) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "function isBase(unitList) {\n return unitList.length === 1\n && Math.abs(unitList[0].power - 1.0) < 1e-15\n && Object.keys(unitList[0].unit.dimension).length === 1\n && unitList[0].unit.dimension[Object.keys(unitList[0].unit.dimension)[0]] === 1;\n}", "canDown() {\n if (!this.parent) {\n return false;\n }\n const props = this.parent.order ? this.parent.order : Object.keys(this.parent.properties);\n const index = props.indexOf(this.name);\n if (index >= 0) {\n return index < props.length - 1;\n }\n else {\n for (const p of props) {\n if (Array.isArray(p)) {\n if (p.indexOf(this.name) >= 0) {\n return p.indexOf(this.name) < p.length - 1;\n }\n }\n }\n }\n }", "function hasNext() {\n\n return (currentVideo < media.length - 1);\n }", "function isLoop() {\n var last = history[history.length - 1];\n for (var i = 0; i < history.length - 1; i++) {\n if (history[i] === last) {\n return true;\n }\n }\n return false;\n }", "isComplete() {\n if (!this.endTime) return false;\n if (this.now() > this.endTime) {\n return true;\n }\n else {\n return false;\n }\n \n }", "isSubsetFull (grid,origin, end) {\n if(end[0]>grid.length) {\n end[0]=grid.length;\n }\n if(end[1]>grid[0].length){\n end[1]=grid[0].length;\n }\n for(let i=origin[0]; i<end[0]; i++) {\n for(let j=origin[1]; j<end[1]; j++) {\n if(grid[i][j]===null){\n return false;\n }\n if(grid[i][j]!==true){\n if(!grid[i][j].isFull){\n return false;\n }\n }\n }\n }\n return true;\n }", "function isValidYet(s) {\n for(let i = 0; i < s.length / 2; i++) {\n if(s[i] !== s[s.length - 1 - i]) {\n return false;\n }\n }\n return true;\n}", "_popElement(fullName, endSourceSpan) {\n let unexpectedCloseTagDetected = false;\n for (let stackIndex = this._elementStack.length - 1; stackIndex >= 0; stackIndex--) {\n const el = this._elementStack[stackIndex];\n if (el.name === fullName) {\n // Record the parse span with the element that is being closed. Any elements that are\n // removed from the element stack at this point are closed implicitly, so they won't get\n // an end source span (as there is no explicit closing element).\n el.endSourceSpan = endSourceSpan;\n el.sourceSpan.end = endSourceSpan !== null ? endSourceSpan.end : el.sourceSpan.end;\n this._elementStack.splice(stackIndex, this._elementStack.length - stackIndex);\n return !unexpectedCloseTagDetected;\n }\n if (!this.getTagDefinition(el.name).closedByParent) {\n // Note that we encountered an unexpected close tag but continue processing the element\n // stack so we can assign an `endSourceSpan` if there is a corresponding start tag for this\n // end tag in the stack.\n unexpectedCloseTagDetected = true;\n }\n }\n return false;\n }", "getLastOfSubstring(substring) {\n let runner = this.root;\n for (let letter of substring) {\n if (runner.children.hasOwnProperty(letter)) {\n runner = runner.children[letter];\n }\n }\n // console.log(\"last node letter: \", runner.letter);\n return runner;\n }", "function isEnd(i, array){\n if ((array.length === i + 1) || (i > 0 && array[i]==' ' && array[i-1] !== 0)) return true;\n return false;\n}", "function confirmEnding(str, target) {\n\treturn str.lastIndexOf(target) === str.length - target.length;\n}", "function areAllSubsetsEmpty()\n{\n if(isSubsetEmpty(1) && isSubsetEmpty(2))\n {\n Ext.Msg.alert('子集为空', '所有子集均为空。请选择子集。');//<SIAT_zh_CN original=\"Subsets are empty\">子集为空</SIAT_zh_CN>//<SIAT_zh_CN original=\"All subsets are empty. Please select subsets.\">所有子集均为空。请选择子集。</SIAT_zh_CN>\n \n return true;\n }\n}", "function isValidSubsequence(array, sequence) {\n // Parameters are the array and sequence, where the sequence is the subsequence of the array.\n // The result will return true or false if the sequence is the subsequence of the array.\n // Example if let array = [1,2,3,4,5] and sequence = [1,3,4] the result would be true\n // However, result is false if sequence is [1,3,2]\n \n // Psuedocode\n // declare an empty array called subsequenceArr\n let subsequenceArr = []\n // loop through the main array\n for (let i = 0; i < array.length; i++){\n // loop through the sequence array\n for (let j = 0; j < sequence.length; j++){\n if ( subsequenceArr.join('') === sequence.join('') || (array[i] === sequence[j] && array[i] === sequence[j+1] )){\n break\n } else if ( array[i] === sequence[j]) {\n subsequenceArr.push(array[i])\n }\n }\n }\n // if element of main array matches element in sequence array, push element of main array to the subsequenceArr variable\n // Once the looping is done, compare the subsequenceArr to the sequence array\n // if they are equal, return true else false\n // other cases, if the sequence array length is longer than array then false\n // sequence has the same element across the array\n if (sequence.length > array.length) {\n return false\n } else if (array.slice(0, sequence.length).join('') === sequence.join('')){\n return true\n }else {\n return subsequenceArr.join('') === sequence.join('') ? true : false\n }\n }", "isEndGame() {\r\n return this.solvedCards.length == this.arrayCards.length;\r\n }", "function isParent(first, second) {\n\tvar firstList = (first == '')?[]:first.split('.');\n\tvar secondList = second.split('.');\n\tsecondList.splice(firstList.length);\n\tconsole.log(firstList);\n\tconsole.log(secondList);\n\treturn (firstList.join('.') == secondList.join('.'));\n}", "function end(str, target) {\n // \"Never give up and good luck will find you.\" -- Falcor\n\n var length = target.length;\n var isEqual = target === str.substr(-length);\n return isEqual;\n\n}", "function checkForEnd(element){ \n\tif((element.match(/\\{/) === null) && (element.match(/[(]/) === null)){\n\t\treturn true;\n\t}\n}" ]
[ "0.7374074", "0.6813333", "0.6345423", "0.634049", "0.62572867", "0.61544603", "0.60059303", "0.5926182", "0.58705175", "0.57863706", "0.5739082", "0.5722547", "0.56428087", "0.56001955", "0.5597021", "0.55936736", "0.5565375", "0.5556319", "0.5512312", "0.53971046", "0.53872925", "0.536717", "0.53639793", "0.53609425", "0.5330404", "0.5295771", "0.52895784", "0.5275687", "0.52747136", "0.5234391", "0.52118874", "0.52023655", "0.5183316", "0.5173776", "0.5173251", "0.5172465", "0.5167112", "0.51659906", "0.5152951", "0.5145053", "0.5141025", "0.5138603", "0.51381767", "0.5135133", "0.5134736", "0.5113428", "0.51063704", "0.5101891", "0.50980586", "0.5083726", "0.50750804", "0.5038325", "0.5038325", "0.5031041", "0.50116754", "0.5006584", "0.5006584", "0.49970242", "0.49969217", "0.49969217", "0.49830166", "0.4964519", "0.49623784", "0.49615347", "0.49615347", "0.49514332", "0.49499127", "0.49489596", "0.49364436", "0.49259278", "0.4916997", "0.49141467", "0.49140838", "0.4910707", "0.4909688", "0.490921", "0.49089557", "0.49055892", "0.49009332", "0.49009043", "0.4894399", "0.48893288", "0.48837125", "0.48709926", "0.48696434", "0.48650265", "0.48624858", "0.48619896", "0.48565477", "0.48553655", "0.48550898", "0.48549148", "0.48520264", "0.4849456", "0.4843337", "0.48391953", "0.48361883", "0.48309872", "0.48237157", "0.48230156" ]
0.8845541
0
Go to previous subunit. Do nothing if the user is already at the first subunit of the first unit.
function previousSubunit() { var m = my.current.unitNo var n = my.current.subunitNo if (!currentSubunitIsTheFirstSubunit()) { if (n == 1) { // If the user is at unit M.1, go to unit (M - 1).L // where L is the last subunit of the previous unit. previousUnit = unit(m - 1) var previousSubunitTitles = [] for (var subunitTitle in previousUnit.subunits) { previousSubunitTitles.push(subunitTitle) } m-- n = previousSubunitTitles.length } else { // If the user is at unit M.N, go to unit M.(N - 1) n-- } } window.location.href = unitHref(m, n) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function gotoPrevious() {\n\tif(typeof previousInventory !== 'undefined') {\n\t\tnextInventory = currentInventory;\n\t\tcurrentInventory = previousInventory;\n\t\tpreviousInventory = undefined;\n\t}\n}", "function nextSubunit()\n {\n var m = my.current.unitNo\n var n = my.current.subunitNo\n\n if (!currentSubunitIsTheLastSubunit()) {\n if (n == my.current.subunitTitles.length) {\n // If the user is at unit M.L where L is the last\n // subunit of unit M, then go to unit (M + 1).1.\n m++\n n = 1\n } else {\n // If the user is at unit M.N, then go to unit M.(N + 1).\n n++\n }\n }\n\n window.location.href = unitHref(m, n)\n }", "function goToPrevious() {\n var prevId = getPreviousLocationIndex();\n if (prevId != null) {\n setCurrentLocation(prevId);\n }\n }", "function goToPrevStep(){\n unhighlightArrow(currStepId, numberToString[currStepId]);\n currStepId-=1;\n replaceStep();\n highlightArrow(currStepId, numberToString[currStepId]); \n}", "__previousStep() {\n this.openPreviousStep();\n }", "navigateToPreviousStep() {\n if (this.state.currentStepIndex <= 0) {\n return;\n }\n this.setState(prevState => ({\n currentStepIndex: prevState.currentStepIndex - 1,\n }));\n }", "prevStep() {\n\n if (this.currStep > -1) {\n\n this.goTo(this.currSlide, this.currStep - 1);\n\n }\n\n }", "function goToPreviousStep() {\n\tpreviousSteps();\n\tupdateStepsText();\n\tconsole.log(\"hey\");\n}", "function goToPrevious() {\n goTo(_currentContext.previous);\n }", "traversePreviousQuestion() {\r\n this.curr = this.curr.prev;\r\n }", "previous(){\n let previous = this.currentId - 1;\n if(previous <= 1){\n previous = 1;\n }\n this.goto(previous);\n }", "function goToPreviousSlide() {\n if (getCurrentSubSlide() != -1 && getCurrentSubSlide() > 0) {\n goToSlide(getCurrentMainSlide(), getCurrentSubSlide() - 1);\n return true;\n }\n if (getCurrentMainSlide() > 0) {\n goToSlide(getCurrentMainSlide() - 1);\n return true;\n }\n}", "openPreviousStep() {\n this.activeStep.toggleStep();\n this.removeActiveStep();\n if (this.previousStep !== null) this.previousStep.toggleStep();\n }", "function previousPhase() {\n var index = phases.indexOf(currentPhase);\n if (index > 0) {\n setPhase(phases[index - 1]);\n }\n }", "runOneStepBackwards() {\n this.stateHistory.previousState()\n }", "function _previousStep() {\n if(this._currentStep == 0)\n return;\n\n _showElement.call(this, this._introItems[--this._currentStep].element);\n }", "function moveToPrev(Calvin){\n\t// console.log(\"MPrev: \" + currElement);\n\tif(currElement>1 && currElement<elementIdArray.length){\n\t\tcurrElement= currElement-2; //this needs to be -2\n\t\t\n\t\tletThereBeLight(currElement,Calvin);\n\t\tif(currElement <= 0){\n\t\t\tcurrElement =0;\n\t\t\tfirstIteration =0;\n\t\t}\n\t}\n\telse if(firstIteration == 0 || currElement <= 0){\n\t\tremoveDarkness();\n\t\talert(\"This is the start of our tour, you can't go back any farther!\");\n\t\tcurrElement =0;\n\t\tfirstIteration =0;\n\t}\n\telse if(currElement <= 1){\n\t\tcurrElement =0;\n\t\tfirstIteration =0;\n\t\tletThereBeLight(currElement,Calvin);\n\t\tconsole.log(\"currElement: \" + currElement);\n\t\talert(\"You're already at the first stop\");\n\t}\n}", "goToPreviousView() {\n const poppedData = this.previousItems.pop();\n this.breadCrumbs.pop();\n this.handleStructs(this.supportedKeys);\n this.setState({\n properties: poppedData,\n });\n }", "function prev() {\n\t\tvar prevStep = steps.prev();\n\t\tsetSteps(steps);\n\t\tsetCurrent(prevStep);\n\t}", "movePrevious() {\n const previousStep = this.steps[this.currentStep - 1];\n if (!previousStep) {\n // this.reset();\n return;\n }\n\n this.overlay.highlight(previousStep);\n this.currentStep -= 1;\n }", "goToPrev () {\n\t\t\tif (this.canGoToPrev) {\n\t\t\t\tthis.goTo(this.currentSlide - 1)\n\t\t\t}\n\t\t}", "function currentSubunitIsTheFirstSubunit()\n {\n return my.current.unitNo == 1 && my.current.subunitNo == 1\n }", "function backToLastFolderBeforeSearch() {\n var navItem = _.last(beforeSearchNavStack);\n\n navItem.back();\n navStack = beforeSearchNavStack;\n updatePaths();\n}", "function gotoPreviousSong() {\n if (songIndex === 0) {\n songIndex = songs.length - 1;\n } else {\n songIndex = songIndex - 1;\n }\n\n const isDiscPlayingNow = !disc.paused;\n loadSong(songs[songIndex]);\n resetProgress();\n if (isDiscPlayingNow) {\n playPauseMedia();\n }\n}", "previous() {\n this._previous();\n }", "prev() {\n const that = this;\n\n that.navigateTo(that.pageIndex - 1);\n }", "goToPrevious() {\n if (this.history.getPagesCount()) {\n this.transition = this.history.getCurrentPage().transition;\n if (!_.isEmpty(this.transition)) {\n this.transition += '-exit';\n }\n this.history.pop();\n this.isPageAddedToHistory = true;\n window.history.back();\n }\n }", "function _previousStep() {\n\t this._direction = 'backward';\n\n\t if (this._currentStep === 0) {\n\t return false;\n\t }\n\n\t var nextStep = this._introItems[--this._currentStep];\n\t if (typeof (this._introBeforeChangeCallback) !== 'undefined') {\n\t this._introBeforeChangeCallback.call(this, nextStep.element);\n\t }\n\n\t _showElement.call(this, nextStep);\n\t }", "selectPrevious() {\n const children = Array.from(this.children);\n if (!children || children.length === 0) {\n return;\n }\n const selectedItem = this.selectedItem;\n const prevIndex = children.indexOf(selectedItem);\n const nextIndex = prevIndex - 1 < 0 ? children.length - 1 : prevIndex - 1;\n this.selected = nextIndex;\n }", "function _previousStep() {\n this._direction = 'backward';\n\n if (this._currentStep === 0) {\n return false;\n }\n\n var nextStep = this._introItems[--this._currentStep];\n if (typeof (this._introBeforeChangeCallback) !== 'undefined') {\n this._introBeforeChangeCallback.call(this, nextStep.element);\n }\n\n _showElement.call(this, nextStep);\n }", "function _previousStep() {\n this._direction = 'backward';\n\n if (this._currentStep === 0) {\n return false;\n }\n\n var nextStep = this._introItems[--this._currentStep];\n if (typeof (this._introBeforeChangeCallback) !== 'undefined') {\n this._introBeforeChangeCallback.call(this, nextStep.element);\n }\n\n _showElement.call(this, nextStep);\n }", "function _previousStep() {\n this._direction = 'backward';\n\n if (this._currentStep === 0) {\n return false;\n }\n\n var nextStep = this._introItems[--this._currentStep];\n if (typeof (this._introBeforeChangeCallback) !== 'undefined') {\n this._introBeforeChangeCallback.call(this, nextStep.element);\n }\n\n _showElement.call(this, nextStep);\n }", "function _previousStep() {\n this._direction = 'backward';\n\n if (this._currentStep === 0) {\n return false;\n }\n\n var nextStep = this._introItems[--this._currentStep];\n if (typeof (this._introBeforeChangeCallback) !== 'undefined') {\n this._introBeforeChangeCallback.call(this, nextStep.element);\n }\n\n _showElement.call(this, nextStep);\n }", "function _previousStep() {\n this._direction = 'backward';\n\n if (this._currentStep === 0) {\n return false;\n }\n\n var nextStep = this._introItems[--this._currentStep];\n if (typeof (this._introBeforeChangeCallback) !== 'undefined') {\n this._introBeforeChangeCallback.call(this, nextStep.element);\n }\n\n _showElement.call(this, nextStep);\n }", "back() {\n // if we're on the first page of a step, return to the previous step.\n // otherwise, if we're still navigating within the same step, just update the page number.\n if (scope.currentStep().currentPageIndex == 0) {\n scope.currentStepIndex--;\n }\n\n else {\n scope.currentStep().currentPageIndex--;\n }\n }", "prevPatent() {\n if (this.state.selectedPatent && this.state.selectedPatent.index > 0) {\n if (this.state.selectedPatent.isFolder) {\n this.setState({selectedPatent: this.state.folder[this.state.selectedPatent.index - 1]})\n } else {\n this.setState({selectedPatent: this.state.patents[this.state.selectedPatent.index - 1]})\n }\n }\n }", "previousstep(step) {}", "function previousStep(){this._direction=\"backward\";if(this._currentStep===0){return false;}--this._currentStep;var nextStep=this._introItems[this._currentStep];var continueStep=true;if(typeof this._introBeforeChangeCallback!==\"undefined\"){continueStep=this._introBeforeChangeCallback.call(this,nextStep&&nextStep.element);}// if `onbeforechange` returned `false`, stop displaying the element\nif(continueStep===false){++this._currentStep;return false;}_showElement.call(this,nextStep);}", "previousStep(e) {\n if (this.state.step === 1) {\n this.props.dismiss(e);\n } else {\n let newStep = this.state.step - 1;\n console.log(newStep);\n this.setState({\n step: newStep,\n previousText: newStep === 1 ? 'Cancel' : 'Back',\n nextText: newStep === 3 ? 'Add' : 'Next',\n });\n\n }\n }", "function pag_goToPreviousVenue() {\n\n // If there is no previous venue, report an error\n if (pag_previousVenues.length == 0) {\n alert(\"There are no more venues to go back to!\");\n } else {\n pag_previousVenues.pop();\n pag_setStatus('Entering venue...');\n pag_xmlRpcClient.call(\"enterPreviousVenue\");\n }\n}", "previousSection() {\n const sections = this.sections;\n const shouldLoopNavigation = this.getLoopNavigationAttribute(this.activeRegion);\n if (\n this.modalIsOpen ||\n this.popupIsOpen ||\n !sections ||\n !sections.length ||\n (!shouldLoopNavigation && this.activeSectionIndex === 0)\n ) {\n return;\n }\n let newSection;\n if (this.activeSection && this.activeSectionIndex > 0) {\n newSection = sections[this.activeSectionIndex - 1];\n } else if (this.activeSection && this.activeSectionIndex === 0) {\n newSection = sections[sections.length - 1];\n } else {\n newSection = sections[0];\n }\n this.setActiveSection(newSection);\n this.setCurrentFocus();\n this.resetNavigation = true;\n }", "goToPreviousStep(preFinalize, postFinalize) {\n return this.navigation.goToStep(this, this.currentStepIndex - 1, preFinalize, postFinalize);\n }", "function clickPrev() {\n var currentEQ = checkCurrent();\n\n // 01.save prev step to local Storage\n if(currentEQ !== 0) {\n saveStorage(currentEQ-1);\n }\n\n // 02.check if end of quiz then back to previous\n var currentItem = localStorage.getItem('step'),\n quizID = quiz.eq(quiz.length-1).attr('id');\n\n if (currentItem == 'end') {\n localStorage.setItem('step',quizID);\n saveStorage(currentEQ);\n }\n checkProgress();\n}", "function currentSubunit()\n {\n var m = my.current.unitNo\n var n = my.current.subunitNo\n\n window.location.href = unitHref(m, n)\n }", "function previousSong() {\r\n if (index_no > 0) {\r\n index_no -= 1;\r\n loadTrack(index_no);\r\n playSong();\r\n } else {\r\n index_no = All_songs.length;\r\n loadTrack(index_no);\r\n playSong();\r\n }\r\n}", "function _previousStep() {\n if (this._currentStep === 0) {\n return false;\n }\n\n var nextStep = this._introItems[--this._currentStep];\n if (typeof (this._introBeforeChangeCallback) !== 'undefined') {\n this._introBeforeChangeCallback.call(this, nextStep.element);\n }\n\n _showElement.call(this, nextStep);\n }", "function moveBack() {\n if (currentPage == 1) return;\n loadTaskList(--currentPage);\n}", "previous() {\n this.selectedIndex = Math.max(this._selectedIndex - 1, 0);\n }", "function previousItem() {\n\t\tstopSlideshow();\n\t\tchangeItem(current - 1);\n\t}", "function goPrev( event ){\n event.preventDefault();\n go( revOffset + 1 );\n return false;\n }", "function goToPrevSlide()\n\t{\n\t\tif($currentSlide.prev().length)\n\t\t{\n\t\t\tgoToSlide($currentSlide.prev());\n\t\t}\n\t}", "function previousSong() {\n const currentSongIndex = songs.findIndex((s) => s.id === currentSong.id)\n\n if (currentSongIndex !== 0) {\n setCurrentSongId(songs[currentSongIndex - 1].id)\n } else {\n setCurrentSongId(songs[songs.length - 1].id)\n }\n }", "_previous(event){\t\t\n\t\tif(this.currentContribution > 0){\n\t\t\tthis.currentContribution--;\n\t\t}else{\n\t\t\tthis.currentContribution = this.contributions.length - 1;\n\t\t}\n\n\t\tevent.target.firstClick = false;\n\t\tthis._updateContent(this._diff());\n\t}", "function goToPrevSlide()\n {\n if($currentSlide.prev().length)\n {\n goToSlide($currentSlide.prev());\n }\n }", "selectPrevResult() {\n this.selectedResultIndex -= 1;\n if (this.selectedResultIndex < 0) {\n this.selectedResultIndex = this.results.length - 1;\n }\n }", "function previousPage(){\n if (page > 1)\n {\n setPage(page - 1);\n }\n else {\n // do nothing\n }\n }", "prev() {\n\n if (this.currStep > -1) {\n\n this.prevStep();\n\n } else {\n\n this.prevSlide();\n\n }\n\n }", "function selectPreviousItem(){\n var items = document.getElementById('searchresults').childNodes;\n var l = items.length;\n selectIndex((selectedSearchIndex + l - 1) % l);\n }", "function previousTab() {\n if (menuIsNotOpening()) {\n var selected = $ionicTabsDelegate.selectedIndex();\n if (selected !== -1) {\n $ionicTabsDelegate.select(selected + 1);\n }\n }\n }", "function prev_step() {\n\t//close the active modal\n\tdocument.getElementById(\"modal\"+parseInt(step+1)).style.display = 'none';\n\tstep--;\n\tsave();\n\tpopup();\n}", "moveToPreviousLine() {\n this.moveUp();\n }", "function goBack(){\n var parentTgrp = tgrp_position + 1;\n \n dataTabsFrame.selectTab(\"page3-\" + parentTgrp);\n}", "_previous() {\n if (this._page === 1) return;\n\n this._page--;\n this._loadCurrentPage();\n }", "function goBack() {\n PathStore.pop();\n}", "activatePreviousTab() {\n const current = this._currentTabBar();\n if (!current) {\n return;\n }\n const ci = current.currentIndex;\n if (ci === -1) {\n return;\n }\n if (ci > 0) {\n current.currentIndex -= 1;\n if (current.currentTitle) {\n current.currentTitle.owner.activate();\n }\n return;\n }\n if (ci === 0) {\n const prevBar = this._adjacentBar('previous');\n if (prevBar) {\n const len = prevBar.titles.length;\n prevBar.currentIndex = len - 1;\n if (prevBar.currentTitle) {\n prevBar.currentTitle.owner.activate();\n }\n }\n }\n }", "function previous() {\n if ($scope.options.index > 0) {\n $scope.options.index--;\n }\n }", "function goToPreviousPage() {\n\t\tif ( canPreviousPage() ) {\n\t\t\tgoToPage( currentPage() - 1 );\n\t\t}\n\t}", "goToPrevBattle(e){\n e.preventDefault();\n let index = this.state.activeIndex;\n let battles = this.state.battles;\n let battlesLength = battles.length;\n if (index < 1) {\n index = battlesLength;\n }\n --index;\n this.setState({\n activeIndex: index\n });\n }", "selectPreviousTab() {\n const selectedTab = this.selectedTab;\n const tabs = this.tabs;\n const length = tabs.get('length');\n\n let idx = selectedTab.get('index');\n let tab;\n\n do {\n idx--;\n // Previous from the first tab should select the last tab.\n if (idx < 0) {\n idx = length - 1;\n }\n // This would only happen if there are no tabs, so stay at 0.\n if (idx < 0) {\n idx = 0;\n }\n\n tab = tabs.objectAt(idx);\n } while (tab && tab.isDestroying && tab !== selectedTab);\n\n if (tab) {\n tab.select();\n }\n }", "function previous() {\n\n if (hasPrevious()) {\n\n currentVideo--;\n changeSource(currentVideo);\n tableUIUpdate();\n\n }\n\n }", "function previousPage() {\n\t\tsetCurrentPage((page) => page - 1);\n\t}", "function prevScene () {\n\tif (currentSceneIndex > 0)\n\t\tsetScene(currentSceneIndex - 1);\n}", "movePreviousPosition() {\n if (isNullOrUndefined(this.start)) {\n return;\n }\n if (this.isEmpty) {\n this.start.movePreviousPosition();\n this.end.setPositionInternal(this.start);\n }\n this.updateBackwardSelection();\n this.upDownSelectionLength = this.start.location.x;\n this.fireSelectionChanged(true);\n }", "onMoveUp() {\n if (this.state.selectedIndex > 0) {\n this.selectIndex(--this.state.selectedIndex);\n\n // User is at the start of the list. Should we cycle back to the end again?\n } else if (this.props.cycleAtEndsOfList) {\n this.selectIndex(this.state.items.length-1);\n }\n }", "function previous(){\n var goToPage = parseInt(pager.data(\"curr\")) - 1;\n goTo(goToPage);\n }", "function gotoPrevPage(){\n\tvar current_pagenum = getCurrentPagenum();\n\t\n\tif(checkPrevPages(current_pagenum) === true){\n\t\tvar isStartOfPagegroup = checkIsStartOfPagegroup(current_pagenum);\n\t\tvar prev_pagenum = current_pagenum - 1;\n\t\t\n\t\tif(isStartOfPagegroup === true){\n\t\t\tdecrementPagegroup();\n\t\t}\n\t\t\n\t\tgotoTargetPage(prev_pagenum);\n\t\t\n\t\t$('div#conceptcode_pagination_holder > ul.pagination').trigger(\"gotoPrevPageComplete.c2s_ui.pagination\", {oldPagenum: current_pagenum});\n\t}\n}", "function resetSubunit()\n {\n my.current.state = my.STATE.READY\n my.current.errors = 0\n my.html.input.value = ''\n\n log('state', my.current.state.toUpperCase(),\n 'unit', my.current.unitNo + '.' + my.current.subunitNo,\n 'type', my.settings.unit)\n\n updatePracticePaneState()\n updatePracticePane()\n clearAdvice()\n clearResultTooltips()\n }", "function prevSong(){\n songIndex--\n if(songIndex<0)\n {\n songIndex=songs.length-1\n }\n PickSong(songs[songIndex]);\n playSong()\n}", "function goToUnitPage() {\n history.push(\"/selectunit\");\n }", "function prev() {\n\t\t\treturn go(current-1);\n\t\t}", "previous(){\n let targetItem = this._currentItem - 1;\n let previousItem = targetItem < 0 ? this._itemCount - 1 : targetItem;\n this._changeActive_keepPlayState(previousItem);\n }", "function goPrevious() {\n //console.log(\"goPrevious: \" + options.currentPage);\n if (options.currentPage != 1) {\n var p = options.currentPage - 1;\n loadData(p);\n setCurrentPage(p);\n options.currentPage = p;\n pageInfo();\n }\n }", "goBackToPreviousPage() {\n this.location.back();\n }", "goBackToPreviousPage() {\n this.location.back();\n }", "function goPrevious() {\n if (pageNum <= 1)\n return;\n pageNum--;\n renderPage(pageNum);\n }", "_navigatePrevious() {\n this._navigate(this.previous.id, 'endpoint');\n }", "function prevEntry() {\n selectEntry(g_cur_entry - 1, true);\n}", "function previous() {\n $scope.$parent.$parent.$parent.$parent.$parent.$parent.activeTab.value = 0;\n }", "selectPreviousOption() {\n if (!this.disabled && this.selectedIndex > 0) {\n this.selectedIndex = this.selectedIndex - 1;\n }\n }", "function moveToPrevious() {\n currentItem = currentItem - 1;\n if (currentItem < 0) currentItem = slideNum - 1;\n\n slideDisplay();\n}", "prev () {\n if (this._items.length < 2 || this._isMoving) {\n return\n }\n\n var currentIndex = this._items.indexOf(this._current);\n var prevIndex = this._items[currentIndex - 1] !== undefined \n ? currentIndex - 1 : this._items.length;\n this._to(prevIndex);\n }", "function previousSteps() {\n\tcurrent_step = current_step - 1;\n\tnext_step = next_step - 1;\n}", "gotoPrevFrame() {\n var prevFramePlayheadPosition = this.playheadPosition - 1;\n\n if (prevFramePlayheadPosition <= 0) {\n prevFramePlayheadPosition = this.length;\n }\n\n this.gotoFrame(prevFramePlayheadPosition);\n }", "previousPage() {\n if (this.getCurrentIndex() === 0) {\n if (this.isScrollLoop() && this.__pages.length > 1) {\n this._doScrollLoop();\n }\n } else {\n this.setCurrentIndex(this.getCurrentIndex() - 1);\n }\n }", "function goPrevious() {\n\tif (pageNum <= 1)\n\t\treturn;\n\tpageNum--;\n\trenderPage(pageNum);\n}", "goBack() {\n this._goBack().catch(Cu.reportError);\n }", "function restorePrevious() {\n\t\t\tif (hasSnapshot()) {\n\t\t\t\tsnap.history.pop();\n\t\t\t\tdoRollback();\n\t\t\t}\n\t\t}", "function Previous() {\n currentIndex = (currentIndex <= 0) ? currentIndex : (currentIndex - 1);\n // Call function to display the beer informations\n displayBeers();\n}", "function _previousQuestion() {\n var previousQuestion = vm.questionSelected.Id;\n previousQuestion--;\n console.log(previousQuestion);\n // run function to get question \n _getQuestion(previousQuestion);\n }", "selectPreviousOption() {\n if (!this.disabled && this.selectedIndex > 0) {\n this.selectedIndex = this.selectedIndex - 1;\n }\n }" ]
[ "0.6854732", "0.6815929", "0.658525", "0.64508104", "0.640415", "0.63642716", "0.63620764", "0.63244075", "0.63183886", "0.62671536", "0.62564474", "0.6256289", "0.62429714", "0.6223968", "0.62040365", "0.61888427", "0.6183852", "0.61303896", "0.6111446", "0.60822654", "0.60807467", "0.60804945", "0.60690904", "0.6052097", "0.60289294", "0.60287344", "0.6027386", "0.6019147", "0.6016408", "0.6011942", "0.6011942", "0.6011942", "0.6011942", "0.6011942", "0.6008426", "0.6005419", "0.6002705", "0.59936523", "0.5983375", "0.59789574", "0.5961699", "0.5960102", "0.5957317", "0.5953569", "0.5943906", "0.5940631", "0.5926015", "0.59259886", "0.5915324", "0.59073025", "0.5899068", "0.58556765", "0.58426845", "0.58398575", "0.5833234", "0.5826911", "0.58062047", "0.58049184", "0.5799509", "0.57966924", "0.5787933", "0.5782274", "0.57795805", "0.57778287", "0.57744765", "0.5773565", "0.5769778", "0.57680345", "0.576649", "0.57627857", "0.57589716", "0.5757643", "0.57527226", "0.5751647", "0.57502824", "0.5741591", "0.5731819", "0.57310283", "0.5730857", "0.5719728", "0.57133585", "0.5699794", "0.5693432", "0.5693432", "0.5691627", "0.56859916", "0.5683789", "0.56829447", "0.5672345", "0.5666169", "0.56631285", "0.56614244", "0.5657305", "0.5644682", "0.56393236", "0.5633262", "0.5625969", "0.5625337", "0.56235176", "0.56231034" ]
0.8497916
0
Go to next subunit. Do nothing if the user is already at the last subunit of the last unit.
function nextSubunit() { var m = my.current.unitNo var n = my.current.subunitNo if (!currentSubunitIsTheLastSubunit()) { if (n == my.current.subunitTitles.length) { // If the user is at unit M.L where L is the last // subunit of unit M, then go to unit (M + 1).1. m++ n = 1 } else { // If the user is at unit M.N, then go to unit M.(N + 1). n++ } } window.location.href = unitHref(m, n) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function previousSubunit()\n {\n var m = my.current.unitNo\n var n = my.current.subunitNo\n\n if (!currentSubunitIsTheFirstSubunit()) {\n if (n == 1) {\n // If the user is at unit M.1, go to unit (M - 1).L\n // where L is the last subunit of the previous unit.\n previousUnit = unit(m - 1)\n var previousSubunitTitles = []\n for (var subunitTitle in previousUnit.subunits) {\n previousSubunitTitles.push(subunitTitle)\n }\n\n m--\n n = previousSubunitTitles.length\n } else {\n // If the user is at unit M.N, go to unit M.(N - 1)\n n--\n }\n }\n\n window.location.href = unitHref(m, n)\n }", "function currentSubunitIsTheFirstSubunit()\n {\n return my.current.unitNo == 1 && my.current.subunitNo == 1\n }", "function currentSubunitIsTheLastSubunit()\n {\n return my.current.unitNo == Units.main.length &&\n my.current.subunitNo == my.current.subunitTitles.length\n }", "function currentSubunit()\n {\n var m = my.current.unitNo\n var n = my.current.subunitNo\n\n window.location.href = unitHref(m, n)\n }", "function gotoNext() {\n var currentIndex = findCurrentIndexInList();\n if (currentIndex == -1)\n return;\n var nextIndex = currentIndex + 1;\n // If next is == length then loop to zero\n if (nextIndex == exports.activeList.members.length) {\n nextIndex = 0;\n }\n var next = exports.activeList.members[nextIndex];\n gotoLine(next.filePath, next.line, next.col, exports.activeList);\n}", "function nextStep() {\n if (enemyCount < enemyData.length-1) {\n enemyCount++;\n setsunaNoMikiri();\n }\n}", "next(){\r\n (this.position == this.testimonial.length - 1) ? this.position = 0 : this.position++\r\n }", "function moveToNext(Calvin){\n\t// console.log(\"MNext: \" + currElement);\n\t// console.log(\"Element Array Length: \" + elementIdArray.length);\n\tif(currElement>0 && currElement<elementIdArray.length){\n\t\tletThereBeLight(currElement,Calvin);\n\t\tcurrElement++;\n\t}\n\telse if(firstIteration == 0){\n\t\tletThereBeLight(currElement,Calvin);\n\t\tfirstIteration++;\n\t\tcurrElement++;\n\n\t}\n\telse if(currElement >= elementIdArray.length-1){\n\t\talert(\"You have reached the end of this guided tour! Thanks for joining us!\");\n\t\tCalvin.eraseTourGuide();\n\t\tremoveDarkness();\n\t\tcurrElement =0;\n\t\tfirstIteration=0;\n\t}\n}", "gotoNextStep() {\n this.gotoStep(this.currentStep + 1);\n }", "function gotoNext() {\n\tif(typeof nextInventory !== 'undefined') {\n\t\tpreviousInventory = currentInventory;\n\t\tcurrentInventory = nextInventory;\n\t\tnextInventory = undefined;\n\t}\n}", "function next() {\n\t\t\tif (aTests.length) {\n\t\t\t\trunTest(aTests.shift());\n\t\t\t} else if (!iRunningTests) {\n\t\t\t\toTotal.element.classList.remove(\"hidden\");\n\t\t\t\toTotal.element.firstChild.classList.add(\"running\");\n\t\t\t\tsummary(Date.now() - iStart);\n\t\t\t\tsaveLastRun(mLastRun);\n\t\t\t\tif (oFirstFailedTest) {\n\t\t\t\t\tselect(oFirstFailedTest);\n\t\t\t\t}\n\t\t\t}\n\t\t}", "function nextPhase() {\n var index = phases.indexOf(currentPhase);\n if (index < phases.length - 1) {\n setPhase(phases[index + 1]);\n }\n }", "function next() {\n\t\t\tif (aTests.length) {\n\t\t\t\treturn runTest(aTests.shift());\n\t\t\t} else if (!iRunningTests) {\n\t\t\t\toTotal.element.classList.remove(\"hidden\");\n\t\t\t\toTotal.element.firstChild.classList.add(\"running\");\n\t\t\t\tsummary(Date.now() - iStart);\n\t\t\t\tif (oFirstFailedTest) {\n\t\t\t\t\tselect(oFirstFailedTest);\n\t\t\t\t}\n\t\t\t}\n\t\t}", "function goToNext() {\n var nextId = getNextLocationIndex();\n if (nextId != null) {\n setCurrentLocation(nextId);\n }\n }", "next(){\n let next = this.currentId + 1;\n if(next >= this.list.length){\n next = this.list.length;\n }\n this.goto(next);\n }", "next() {\n // $(this.parentElement).data(\"obj\").select_fwd();\n $(this.parentElement).data(\"obj\").update_idx(1);\n return false;\n }", "function _next() {\n\t\t\ttry {\n\t\t\t\tif (_model.playlist[0].levels[0].file.length > 0) {\n\t\t\t\t\tif (_model.item + 1 == _model.playlist.length) {\n\t\t\t\t\t\treturn _item(0);\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn _item(_model.item + 1);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t} catch (err) {\n\t\t\t\t_eventDispatcher.sendEvent(jwplayer.api.events.JWPLAYER_ERROR, err);\n\t\t\t}\n\t\t\treturn false;\n\t\t}", "function selectNextEnemy() {\n if (hasRunInit) {\n for (var i = 0; i < allCPUS.length; i++) {\n if (cpuInfoDiv.textContent === allCPUS[i][0]) {\n cpuBattle = allCPUS[i + 1];\n upNext = allCPUS[i + 2];\n previous = allCPUS[i];\n buildEnemyCycle(previous, upNext);\n }\n else if (cpuInfoDiv.textContent === allCPUS[allCPUS.length - 1][0]) {\n location.assign(\"/\");\n }\n }\n }\n}", "function selectNextItem(){\n var items = document.getElementById('searchresults').childNodes;\n selectIndex((selectedSearchIndex + 1) % items.length);\n }", "nextStep() {\n\n if (this.slides[this.currSlide].steps.length - 1 > this.currStep) {\n\n this.goTo(this.currSlide, this.currStep + 1);\n\n }\n\n }", "function setSubunit(m, n)\n {\n my.current.unitNo = m\n my.current.subunitNo = n\n\n my.current.unit = unit(m)\n\n my.current.subunitTitles.length = 0\n for (var subunitTitle in my.current.unit.subunits) {\n my.current.subunitTitles.push(subunitTitle)\n }\n\n var subunitTitle = my.current.subunitTitles[n - 1]\n my.current.subunitText = my.current.unit.subunits[subunitTitle]\n }", "__nextStep() {\n this.openNextStep();\n }", "function userNextSong() {\n\t// check if we have another song\n\tif (songs.length <= 1) {\n\t\talert('Please add another song before skipping.');\n\t} else {\n\t\tnextSong();\n\t}\n}", "selectNext() {\n const children = Array.from(this.children);\n if (!children || children.length === 0) {\n return;\n }\n const selectedItem = this.selectedItem;\n const prevIndex = children.indexOf(selectedItem);\n const nextIndex = prevIndex + 1 >= children.length ? 0 : prevIndex + 1;\n this.selected = nextIndex;\n }", "next() {\n this.selectedIndex = Math.min(this._selectedIndex + 1, this.steps.length - 1);\n }", "nextLevel() {\n this.subLevel = 0;\n this.changeTagLevel(this.level);\n this.illuminateSequence();\n this.addButtonListener();\n }", "function goToNextSlide() {\n if (getCurrentSubSlide() != -1 && getNumberOfSubSlides() > getCurrentSubSlide()+1) {\n goToSlide(getCurrentMainSlide(), getCurrentSubSlide() + 1);\n return true;\n }\n if (getNumberOfMainSlides() > getCurrentMainSlide() + 1) {\n goToSlide(getCurrentMainSlide()+1);\n return true;\n }\n return false;\n}", "function goToNextStep(){\n unhighlightArrow(currStepId, numberToString[currStepId]);\n currStepId+=1;\n replaceStep();\n highlightArrow(currStepId, numberToString[currStepId]); \n}", "nextLevel(){\n this.levelSpawner.level++;\n\n // if we get to the end set player to the first level and bring up the main menu\n if(this.levelSpawner.level >= this.levelSpawner.levels.length)\n {\n this.scene.switch(\"menuscene\");\n this.scene.stop(\"levelcompletescene\");\n this.scene.stop(\"maingame\");\n\n } else{\n this.levelSpawner.setCurrentLevel();\n this.triggerLevelLoad();\n this.activateControllerInput();\n }\n\n }", "function next() {\n\t\t\treturn go(current+1);\n\t\t}", "function findTheNextOne() {\n do {\n var currentelem = allelements[currentelem_index];\n currentelem_index++;\n\n if(currentelem_index>100) {\n break;\n }\n } while(!doesItSpeak(currentelem));\n\n speakMe(currentelem); \n}", "next() {\n if (this.index < this.plans.length - 1) {\n this.index++;\n }\n else {\n this.index = 0;\n }\n }", "function goNext(){\n var childTgrp = tgrp_position - 1;\n dataTabsFrame.selectTab(\"page3-\" + childTgrp);\n}", "function nextQuestion() {\n /* set variable isQuestionOver to the value of the two variable, triviaQuestions.length\n and currentQuestion, being equal*/\n var isQuestionOver = (triviaQuestions.length - 1) === currentQuestion;\n // if isQuestionOver true, run displayResults function\n if (isQuestionOver) {\n displayResults();\n\n // else add 1 to currentQuestion and run loadQuestion function.\n } else {\n currentQuestion++;\n loadQuestion();\n }\n }", "function nextTrans() {\r\n ++trIdx;\r\n const tr = transactions[trIdx];\r\n if (!tr) { return --trIdx; }\r\n renderTransaction(tr, false);\r\n if ((trIdx === START_OF_PITCHES || trIdx === BANKRUPCY_START || trIdx === BANKRUPCY_END) && interval) {\r\n clearInterval(interval);\r\n interval = undefined;\r\n console.log('PRESS SPACE TO CONTINUE...');\r\n }\r\n }", "levelUp() {\n\t\tthis.getActiveUnits().forEach(unit => {\n\t\t\tunit.levelUp();\n\t\t});\n\t}", "function moveNext() {\n if (currentPage == totalPages) return;\n loadTaskList(++currentPage);\n}", "function goToLastQuestion(){ \r\n\tcount--\r\n\tupdateItems();\r\n}", "function gotoNextPage(){\n\tvar current_pagenum = getCurrentPagenum();\n\t\n\tif(checkNextPages(current_pagenum) === true){\n\t\tvar isEndOfPagegroup = checkIsEndOfPagegroup(current_pagenum);\n\t\tvar next_pagenum = current_pagenum + 1;\n\t\t\n\t\tif(isEndOfPagegroup === true){\n\t\t\tincrementPagegroup();\n\t\t}\n\t\t\n\t\tgotoTargetPage(next_pagenum);\n\t\t\n\t\t$('div#conceptcode_pagination_holder > ul.pagination').trigger(\"gotoNextPageComplete.c2s_ui.pagination\", {oldPagenum: current_pagenum});\n\t}\n}", "function next() {\n $ctrl.index++;\n\n // Move on if all players have been shown\n if ($ctrl.index === $ctrl.players.length) {\n $state.go('play');\n }\n // Otherwise show next role\n else {\n showRole();\n }\n }", "function goNext( event ){\n event.preventDefault();\n go( revOffset - 1 );\n return false;\n }", "function nextItem() {\n\tif (letter === \"X\") {\n\t\tletter = \"O\";\n\t\tplayerTurn();\n\t\tcheckWin();\n\t}else {\n\tletter = \"X\";\n\tplayerTurn();\n\tcheckWin();\n\t}\n}", "function next() {\n subject = context.stack.tail.head;\n index = 0;\n test( subject );\n }", "traverseNextQuestion() {\r\n this.curr = this.curr.next;\r\n }", "nextSection() {\n const sections = this.sections;\n const shouldLoopNavigation = this.getLoopNavigationAttribute(this.activeRegion);\n if (\n this.modalIsOpen ||\n this.popupIsOpen ||\n !sections ||\n !sections.length ||\n (!shouldLoopNavigation && this.activeSectionIndex === sections.length - 1)\n ) {\n return;\n }\n let newSection;\n if (this.activeSection && this.activeSectionIndex < sections.length - 1) {\n newSection = sections[this.activeSectionIndex + 1];\n } else {\n newSection = sections[0];\n }\n this.setActiveSection(newSection);\n this.setCurrentFocus();\n this.resetNavigation = true;\n }", "function nextSib(){\n endPos = $(selectedNode).parent().siblings('li').length;\n siblings = $(selectedNode).parent().parent().children('li').children('.node');\n\n if(sibPos != endPos){\n sibPos++;\n }else{\n log('Last sibling is selected - no more to right')\n }\n\n //style selected node\n selectedNode = siblings.eq(sibPos);\n $('.node').removeClass('selected');\n selectedNode.addClass('selected');\n}", "function nextSection() {\r\n // If the user is currently on step 2, the personal information input will be validated\r\n if (current == 1)\r\n {\r\n next.addEventListener(\"click\", validateInfo, false);\r\n if (!validateInfo())\r\n return;\r\n }\r\n // Increment current step by 1 and call function to display the new step\r\n current++;\r\n show(current);\r\n}", "onMoveUp() {\n if (this.state.selectedIndex > 0) {\n this.selectIndex(--this.state.selectedIndex);\n\n // User is at the start of the list. Should we cycle back to the end again?\n } else if (this.props.cycleAtEndsOfList) {\n this.selectIndex(this.state.items.length-1);\n }\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 nextStudent() {\n group.people.push(group.people.shift());\n selectGroup(true);\n saveNewOrder();\n}", "function nextLevel() {\n\tconsole.log(currLevel);\n\tif (currLevel < levels.length) {\n\t\treset();\n\t}\n\telse {\n\t\talert(\"You won! Play again?\");\n\t\tcurrLevel = 0;\n\t\treset();\n\t}\n}", "next() {\r\n this.active = (this.active < this.len - 1) ? this.active + 1 : 0\r\n this.move('->')\r\n }", "function nextQuestion() {\n const isQuestionOver = (triviaQuestions.length - 1) === currentQuestion;\n if (isQuestionOver) {\n displayResult();\n }else{\n currentQuestion++;\n loadQuestion();\n }\n\n }", "next() {\n const that = this,\n availableItems = that.dataSource.length;\n \n if (that.disabled || availableItems === 0) {\n return;\n }\n\n let nextItem = that._currentIndex;\n\n if(that.loop){\n nextItem = nextItem >= availableItems-1 ? 0 : nextItem + 1;\n }\n else {\n nextItem = nextItem >= availableItems-1 ? nextItem : nextItem + 1;\n }\n\n that._goToItem(nextItem);\n }", "function goToNextSlide()\n\t{\n\t\tif($currentSlide.next().length)\n\t\t{\n\t\t\tgoToSlide($currentSlide.next());\n\t\t}\n\t}", "function _nextStep() {\n\t\t\tvar $step = wizard.settings.steps[currentStep];\n\n\t\t\t_clearFutureSteps($step);\n\n\t\t\tif($step.isDependent) {\n\t\t\t\t$step = _getDependentStep($step);\n\t\t\t}\n\n\t\t\t// Updating the data regarding current step.\n\t\t\tif(!_recordStepData($step)) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// Checking if this is the last scene of the wizard.\n\t\t\tif(++currentStep >= wizard.settings.steps.length) {\n\t\t\t\tcurrentStep--;\n\t\t\t\t_finalStep(wizard);\n\t\t\t} else {\n\t\t\t\t// There is no problem, passing to the next step.\n\t\t\t\tif(currentStep > passedStepTracker)\n\t\t\t\t\tpassedStepTracker++;\n\t\t\t\t_syncStep(wizard);\n\t\t\t\twizard.settings.onNextStep();\n\t\t\t}\n\t\t\treturn true;\n\t\t}", "function resetSubunit()\n {\n my.current.state = my.STATE.READY\n my.current.errors = 0\n my.html.input.value = ''\n\n log('state', my.current.state.toUpperCase(),\n 'unit', my.current.unitNo + '.' + my.current.subunitNo,\n 'type', my.settings.unit)\n\n updatePracticePaneState()\n updatePracticePane()\n clearAdvice()\n clearResultTooltips()\n }", "openNextStep() {\n if (this.activeStep._nestedValidate() && this.activeStep.validate()) {\n this.activeStep.saveStep();\n // set the value to and from the the transition effect.\n this.__fromStep = this.activeStep;\n this.__toStep = this.nextStep;\n // toggle the step\n this.activeStep.toggleStep();\n this.removeActiveStep();\n if (this.nextStep !== null) this.nextStep.toggleStep();\n } else {\n this.activeStep.fireInvalidStep();\n }\n }", "function walkUnitDown(unitIndex, fn) {\n while (unitIndex >= 0) {\n if (fn(DateUnits[unitIndex], unitIndex) === false) {\n break;\n }\n unitIndex = getLowerUnitIndex(unitIndex);\n }\n }", "function next(){\n\n\tvar currentActive = -1;\n\tif(selected_idx_list.length > 0){\n\t\tvar selected = selected_idx_list[0];\n\t\tif(activeList[selected]){\n\t\t\tcurrentActive = selected;\n\t\t}else{\n\t\t\tconsole.log('warning: somehow an item was clicked thats not on the active list');\n\t\t}\n\t}else{\n\t\tconsole.log('couldnt find a selected one, so placing on the first');\n\t\tvar firstActive = 0;\n\t\tfor(var i = 0; i<activeList.length; i++){\n\t\t\tif(activeList[i] && !firstActive){\n\t\t\t\tfirstActive = 1;\n\t\t\t\tcurrentActive = i;\n\t\t\t}\n\t\t}\n\t}\n\n\t//console.log(\"currentActive: \" + i);\n\n\t//find the next legal thing\n\tvar nextActive = currentActive;\n\tvar found = 0;\n\tvar firstFound = 0;\n\tvar firstActive = -5;\n\tfor(var i = 0; i<activeList.length; i++){\n\t\tif(activeList[i] && !found){\n\n\t\t\tif(!firstFound){\n\t\t\t\tfirstFound = 1;\n\t\t\t\tfirstActive = i;\n\t\t\t}\n\n\t\t\tif(i>currentActive){\n\t\t\t\tfound = 1;\n\t\t\t\tnextActive = i;\t\t\t\t\n\t\t\t}\n\n\t\t}\n\t}\n\tif(!found){\n\t\tnextActive = firstActive;\n\t}\n\n\t//click next active:\n\n\tconsole.log('clicking on next Active: ' + nextActive);\n\tvar e = document.createEvent('UIEvents');\n\te.initUIEvent('click', true, true, /* ... */);\n\tbox_list[nextActive].node().dispatchEvent(e);\n}", "function next() {\n state.index += 1;\n if (state.index >= state.quiz.questions.length) {\n state.stage = stages.FINISHED;\n }\n}", "function next_song(){\r\n if(index_no<All_song.length - 1){ //Verifica que el indice no sea mayor que el largo de la lista\r\n index_no+=1;//Cambia el indice en 1 al siguiente indice\r\n load_track(index_no);//Carga la canción\r\n playsong();//Reproduce la cancion\r\n }else{\r\n index_no = 0;//Cuando el indice supera la longitud de la lista se vuelve 0\r\n load_track(index_no);//Carga la canción\r\n playsong();//Reproduce la cancion\r\n }\r\n }", "function moveToNextLevel() {\n document.getElementById('next-level-alert').style.display = \"none\"\n level++\n document.getElementById('level-box').innerHTML = 'Level: ' + level\n setUpLevels()\n newQA()\n}", "nextStep(){\n this.search.shift()\n this.search = this.children.concat(this.search)\n\n if( this.search.length == 0){\n this.finished = true\n }\n else{\n this.state = this.search[0]\n this.children = []\n\n // If it is a final state\n if( this.blockInPath(this.state, this.maze.getFinish()) && this.state.length < this.cost){\n this.bestPath = this.state\n this.cost = this.state.length\n }\n // Branch and Bound: Examine the following paths only if they are better than the current best\n else if(this.state.length + 1 < this.cost){\n // Get the children paths with no repeating nodes\n this.children = this.getChildren(this.state).filter( child => !this.blockInPath(this.state, child[child.length - 1]) )\n \n }\n }\n \n }", "selectNextTab() {\n const selectedTab = this.selectedTab;\n const tabs = this.tabs;\n const length = tabs.get('length');\n\n let idx = selectedTab.get('index');\n let tab;\n\n do {\n idx++;\n // Next from the last tab should select the first tab.\n if (idx === length) {\n idx = 0;\n }\n\n tab = tabs.objectAt(idx);\n } while (tab && tab.isDestroying && tab !== selectedTab);\n\n if (tab) {\n tab.select();\n }\n }", "fetchNext() {\n if (!this.busy && !this.complete && this.models.length) {\n let nextStart = this.models[this.models.length - 1].get('parent');\n\n if (nextStart === '') {\n this.complete = true;\n } else {\n this.options.start = nextStart;\n\n this.fetch({\n remove: false,\n success: () => this.busy = false\n });\n }\n }\n }", "function updateCurrentNextToGoCandidate(item) {\n item.nextToGo = true;\n}", "function _nextQuestion() {\n var nextQuestion = vm.questionSelected.Id;\n nextQuestion++;\n console.log(nextQuestion);\n // run function to get question \n _getQuestion(nextQuestion);\n }", "goToNext () {\n\t\t\tif (this.canGoToNext) {\n\t\t\t\tthis.goTo(this.currentSlide + 1)\n\t\t\t}\n\t\t}", "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 }", "function nextStep(id) {\n //first we need to get the new item from the list of instructions\n var instruction = getItem(instructions, id);\n\n //then we need to update the screen with the main description\n updateElement('title', instruction.title);\n updateElement('description', instruction.description);\n\n //then get the items for choice1 and 2 from the list\n var choice1 = getItem(instructions, instruction.choices.first);\n var choice2 = getItem(instructions, instruction.choices.second);\n\n //check to see if they are endpoints\n\n //if endpoints then end the game\n\n\n //if not update those sections on the screen with the choiceText\n updateElement('choiceOne', choice1.choiceText);\n updateElement('choiceTwo', choice2.choiceText);\n updateButton('buttonOne', choice1.id);\n updateButton('buttonTwo', choice2.id);\n //check to see if the story is at the end\n end(instruction);\n}", "function nextResult(){\n currentRestaurant += 1;\n if (currentRestaurant === shortList.length){\n document.getElementById(\"next\").disabled = true;\n pageScroll('section5');\n } else {\n print();\n }\n}", "function nextItem() {\n\t\tstopSlideshow();\n\t\tchangeItem(current + 1);\n\t}", "getActiveUnit() {\n console.log(\"getActiveUnit\");\n let {book} = this.props;\n let userProg = this.props.userProgress.currentUser.user_progress;\n // set initial value jic\n let lastUnlockedUnit = book[0];\n let finalUnitIndex;\n // 1. iterate through all units - if no value in userProg, post one.\n\n for (let i = 0; i < book.length; i++) {\n let curUnitId = book[i].id;\n\n // @TODO handle this\n if (!userProg[curUnitId]) {\n // console.log(\"this unit does not exist in userProgress\");\n // a. post it to userProgress\n // b. fetch userProgress\n // c. call getActiveUnit()\n }\n // console.log(\"getActiveUnit set\", userProg, curUnitId)\n let curUnitProg = userProg[curUnitId];\n // console.log(\"curUnitProg\", curUnitProg)\n if (curUnitProg.unitLocked === false) {\n // this is potentially the correct unit = save the last one\n lastUnlockedUnit = book[i];\n finalUnitIndex = i;\n }\n }\n // 2. set the first unit where isCompleted != true to currentActiveUnitObj & currentActiveUnit\n this.props.setCurrentValues(\"currentUnitObj\", lastUnlockedUnit);\n this.props.setCurrentValues(\"currentUnit\", finalUnitIndex)\n this.props.setCurrentValues(\"active\", lastUnlockedUnit.id);\n // now that we have a unit, lets get the lesson\n this.getActiveLesson(lastUnlockedUnit, lastUnlockedUnit.id);\n }", "selectNextOption() {\n if (!this.disabled &&\n this.options &&\n this.selectedIndex < this.options.length - 1) {\n this.selectedIndex += 1;\n }\n }", "function nextText() {\n document.getElementById(currOrder).remove();\n currOrder++;\n putText(curr.text, currOrder);\n currentRoom.removeEventListener(\"click\", nextText);\n }", "next() {\n const that = this;\n\n that.navigateTo(that.pageIndex + 1);\n }", "function advanceTests(){\n if ( !advancing ) {\n advancing = true;\n data.totalAssertCount += totalAssertCount;\n data.passedAssertCount += passedAssertCount;\n data.currentTestIndex += 1;\n save(); \n var should_advance = data.currentTestIndex < allTests.length;\n if ( should_advance ) {\n nav();\n } else {\n data.status = 2;\n save();\n callback();\n }\n }\n }", "function moveToNext(isAuto) {\n if (isAuto && !auto) return;\n currentItem = (currentItem + 1) % slideNum;\n\n slideDisplay();\n}", "function checkIfNextScene (){\n\n if(currentScene === `scene1`){\n displayItemsLeft(itemChecklist.scene1Checklist);\n if(itemChecklist.scene1Checklist >=4){\n currentState = `cutscene`;\n currentScene = `scene1Transition_1`;\n generateDialogue(cutsceneDialogues.scene1TransitionDialogues_1);\n currentdialogueNbr ++;\n }\n }\n}", "function goToNextSlide()\n {\n if($currentSlide.next().length)\n {\n goToSlide($currentSlide.next());\n }\n }", "function nextEntry() {\n selectEntry(g_cur_entry + 1, true);\n}", "_nextItem() {\n if (this.newItemNumber === \"review\") {\n this.set('looped.all', true);\n }\n this.set('route.path', '/' + this.newItemNumber);\n this.set('looped.last', this.itemNumber);\n }", "moveNextPosition() {\n if (isNullOrUndefined(this.start)) {\n return;\n }\n if (this.isEmpty) {\n this.start.moveNextPosition();\n this.end.setPositionInternal(this.start);\n }\n this.updateForwardSelection();\n this.upDownSelectionLength = this.start.location.x;\n this.fireSelectionChanged(true);\n }", "function goToNextPage() {\n\t\tif ( canNextPage() ) {\n\t\t\tgoToPage( currentPage() + 1 );\n\t\t}\n\t}", "function intGoNext(){\n goNext(0);\n }", "next() {\n this.index++;\n }", "selectNextOption() {\n if (!this.disabled && this.selectedIndex < this.options.length - 1) {\n this.selectedIndex += 1;\n }\n }", "function unitChange(units,changeRequired){//recursive unit change could use further refactoring\n let changeCounter=0; //counter for a particular unit\n while(true){\n const nextIncrementTest = (changeCounter+1)*units[0][1]\n const changeFullfilled = nextIncrementTest > changeRequired;\n const availableReached = nextIncrementTest > units[0][2];\n if(changeFullfilled||availableReached){\n if(changeCounter*units[0][1]!=0){\n builtChange.push([units[0][0],changeCounter*units[0][1]]);\n }\n //compute change remaining after allocating previous unit\n let changeRemaining = fullChangeRequired -registerTotal(builtChange);\n changeRemaining=Math.round(changeRemaining*100)/100;\n if(changeRemaining>0){//still more change required\n const newUnits = [...units];\n newUnits.shift();//remove active unit and go to next\n return unitChange(newUnits,changeRemaining);//call recursive function again\n }\n else{//no more change required\n break;\n }\n }\n else{//more room to collect the unit change\n changeCounter++;\n }\n }\n }", "function goToStep(step){//because steps starts with zero\nthis._currentStep=step-2;if(typeof this._introItems!==\"undefined\"){nextStep.call(this);}}", "function goToNextStep() {\n\tnextSteps();\n\tupdateStepsText();\n\tconsole.log(\"hi\");\n}", "function nextQuestion(){\n var questionOver = (questions.length -1) === currentQuestion\n if (questionOver) {\n resultDisplay()\n } else {\n currentQuestion++;\n loadQuestions();\n }\n}", "nextTo(level) {\n if(!this.nextTriggered) {\n this.nextCallback(level);\n this.nextTriggered = true;\n }\n }", "function nextSong() {\r\n if (index_no < All_songs.length - 1) {\r\n index_no += 1;\r\n loadTrack(index_no);\r\n playSong();\r\n } else {\r\n index_no = 0;\r\n loadTrack(index_no);\r\n playSong();\r\n }\r\n}", "function updateNavigationLinks()\n {\n if (currentSubunitIsTheFirstSubunit()) {\n my.html.previousLink.style.visibility = 'hidden'\n my.html.nextLink.style.visibility = 'visible'\n } else if (currentSubunitIsTheLastSubunit()) {\n my.html.previousLink.style.visibility = 'visible'\n my.html.nextLink.style.visibility = 'hidden'\n } else {\n my.html.previousLink.style.visibility = 'visible'\n my.html.nextLink.style.visibility = 'visible'\n }\n }", "selectNextResult() {\n this.selectedResultIndex += 1;\n // Wrap around as needed\n if (this.selectedResultIndex === this.results.length) {\n this.selectedResultIndex = 0;\n }\n }", "function nextQuestion(){\n global_index++;\n askQuestion(global_index);\n uncheck();\n }", "function nextQuestion(){\n var isQuestionOver= (quizQuestions.length - 1) === currentQuestion;\n if (isQuestionOver){\n console.log(\"game is over\");\n displayResult();\n } \n \n else{\n currentQuestion++;\n loadQuestion();\n }\n \n}", "function nextQuestion() {\n const isQuestionOver = (quizQuestions.length - 1) === currentQuestion;\n if (isQuestionOver) {\n console.log('Game has ended.');\n displayResult();\n } else {\n currentQuestion++;\n loadQuestion();\n }\n\n}", "function nextItem(items, elem){\n\t\t//your code is here\n\t\tfor(var i=0; i<items.length;i++){\n\t\t\t\n\t\t\tif(items[i]===elem){\n\t\t\t\treturn items[i+1];\n\t\t\t}\n\t\t\telse if (elem===items[items.length-1]){\n\t\t\t\treturn \"it is the last character!!\"\n\t\t\t}}\n\t\t\t\n\t\t\t\treturn \"the \"+elem+\" does not exist\"\n\t\t\t\n\t\t\n\t}" ]
[ "0.7028668", "0.6967198", "0.6539519", "0.6401484", "0.5965367", "0.5732943", "0.5724467", "0.5700484", "0.5699314", "0.5635313", "0.5633174", "0.55105114", "0.545854", "0.54373163", "0.54054415", "0.5392803", "0.5353802", "0.53360796", "0.53306997", "0.53289", "0.53122544", "0.5297138", "0.5286168", "0.5264657", "0.52605283", "0.5258688", "0.5243193", "0.5240092", "0.52234066", "0.52050996", "0.5201465", "0.5195646", "0.519389", "0.51650476", "0.5158239", "0.51570475", "0.513158", "0.51231694", "0.5120528", "0.51168257", "0.5115385", "0.5111881", "0.510686", "0.5103414", "0.50922745", "0.5088577", "0.5082166", "0.5077835", "0.50777656", "0.50717014", "0.5067281", "0.5064181", "0.5059493", "0.5059254", "0.5053034", "0.50463754", "0.5040363", "0.5034932", "0.503082", "0.502849", "0.5027082", "0.5014096", "0.49935594", "0.4989246", "0.49879533", "0.49758318", "0.49744302", "0.4973376", "0.49686998", "0.49671307", "0.49601716", "0.49594167", "0.49585906", "0.49541795", "0.49442062", "0.4940639", "0.4939339", "0.49333304", "0.49248636", "0.49177718", "0.4917567", "0.49125233", "0.49114072", "0.4905681", "0.49029472", "0.48966032", "0.4892043", "0.4889268", "0.4886447", "0.48732662", "0.4867636", "0.4867212", "0.48632824", "0.48629075", "0.48557314", "0.48520085", "0.48503816", "0.48435974", "0.48420426", "0.48419732" ]
0.8740801
0
Hide typing guide if it is already displayed. Show typing guide if it is hidden.
function toggleGuide() { if (guide.style.display == 'none') { return showGuide() } else { return hideGuide() } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function hide_hint() {\n if ($scope.game_phase != 'not_yet_started') {\n var e = document.getElementById(\"hint_place\");\n e.style.lineHeight = \"18px\";\n e.innerHTML = '<font size=\"4px\" color=\"silver\"><p style=\"margin-bottom:5px;\">Spell a word that stands for following meaning</font><br/></p><font size=\"5px\" color=\"white\">' + $scope.words[$scope.current_word_index].mean + '</font><font color=\"#e1e1e1\" size=\"4px\"><br/><div id=\"show_hint_div class=\"show_word_box\"> <button id=\"show_word_box\" type=\"button\" class=\"btn btn-warning btn-lg show_word_box\" onclick=\"show_hint_up(1.5);\" onmouseover=\"show_hint_up(1.5);\"><font size=\"4px><span class=\"glyphicon glyphicon-info-sign\" ></span><font color=\"#2E2E2E\">Find your word here...</font></font></button></div>';\n $scope.flip(e, \"hint\");\n\n }\n }", "function autocompleteHideShow(input) {\n if (input.length > 0) {\n if (autocomplete.classList.contains(\"hidden\")) {\n autocomplete.classList.remove(\"hidden\");\n }\n } else {\n autocomplete.classList.add(\"hidden\");\n }\n }", "function unmuteAndHideHint() {\n const player = playerRef.current;\n if (player) {\n player.muted(false);\n if (player.volume() === 0) {\n player.volume(1.0);\n }\n }\n showTapButton(TAP.NONE);\n }", "function showSuggest(suggester, show) {\n\n \n\n if (show === false) {\n\n \n\n HawkSearch.SuggesterGlobal.items.forEach(function (item) {\n\n \n\n $(item.settings.globalDiv).hide();\n\n \n\n });\n\n \n\n $(\"body\").off(\"click\", hideSuggest);\n\n \n\n } else {\n\n \n\n var suggestDisplay = getSuggestDiv(suggester);\n\n \n\n suggestDisplay.show();\n\n \n\n $(\"body\").on(\"click\", hideSuggest);\n\n \n\n };\n\n \n\n }", "function hideSuggestions()\n{\nvar oScroll = document.getElementById(\"scroll\");\noScroll.style.visibility = \"hidden\";\n}", "hideAnnotation() {\n chrome.input.ime.setCandidateWindowProperties({\n engineID: InputController.IME_ENGINE_ID,\n properties: {visible: false}\n });\n }", "function hide() {\n toogle = 'hide'\n\n }", "function resetDisplay() {\n // Change display\n typing.style.display = 0;\n textbox.style.opacity = 1;\n}", "function dontShowInput1H(){\n document.getElementById(\"hard-block\").style.display = \"none\";\n }", "function _hideTpGuides(view_id) {\n\t// hide timepoint guides\n\td3.select(\"#\" + view_id).selectAll(\".tpGuide\")\n\t\t.attr(\"stroke\", \"white\")\n\t\t.attr(\"stroke-opacity\", 0.4);\n\n}", "function hideElements() {\n\tlet scroll = document.getElementById(\"convertTypes\");\n\tif (scroll.options[scroll.selectedIndex].value === \"disem\") {\n\t\tdocument.getElementById(\"mnemonicOptions\").style.display = \"none\";\n\t\tdocument.getElementById(\"secondWrapper\").style.display = \"none\";\n\t} else {\n\t\tdocument.getElementById(\"mnemonicOptions\").style.display = \"inline-block\";\n\t\tdocument.getElementById(\"secondWrapper\").style.display = \"inline-block\";\n\t}\n}", "function suggestions() \n{\n let connections = document.getElementById('connections');\n let suggestions = document.getElementById('suggestions');\n\n connections.style.display = 'none';\n if (suggestions.style.display == 'block')\n suggestions.style.display = 'none';\n else\n suggestions.style.display = 'block';\n}", "function dontShowInput1E(){\n document.getElementById(\"easy-block\").style.display = \"none\";\n }", "function hide() {\n Onyx.set(ONYXKEYS.IS_CHAT_SWITCHER_ACTIVE, false);\n}", "function typeIt() {\n clearCanvas();\n disableCanvas();\n $(settings.typed, context).show();\n $(settings.drawIt, context).bind('click.signaturepad', function (e) {\n e.preventDefault();\n drawIt();\n });\n $(settings.typeIt, context).unbind('click.signaturepad');\n $(settings.typeIt, context).bind('click.signaturepad', function (e) {\n e.preventDefault();\n });\n $(settings.output, context).val('');\n $(settings.drawIt, context).removeClass(settings.currentClass);\n $(settings.typeIt, context).addClass(settings.currentClass);\n $(settings.sig, context).removeClass(settings.currentClass);\n $(settings.drawItDesc, context).hide();\n $(settings.clear, context).hide();\n $(settings.typeItDesc, context).show();\n }", "function hideAutoCompleteDiv(){\n\t\t\tif(document.getElementById(\"auto-complete-container\" + elementIdOfComponentInstanceWrapper))\n\t\t\t\tdocument.getElementById(\"auto-complete-container\" + elementIdOfComponentInstanceWrapper).style.display = \"none\";\n\t\t}", "_showHidePlaceholder() {\n\t\tshowHide(this._exported.placeholder, !this._value);\n\t}", "function hideSuggestionBox() {\n $suggestionBox.scrollTop(0);\n\n if (options.fadeOut) {\n $suggestionBox.fadeOut();\n } else {\n $suggestionBox.css('display', 'none');\n }\n resetSelection();\n\n if (options.adjustBorderRadius) {\n context.css('border-bottom-left-radius', searchBoxBorderRadius.bottomLeft);\n context.css('border-bottom-right-radius', searchBoxBorderRadius.bottomRight);\n }\n\n options.onHide()\n }", "function updateKeyboardQHelp(isVisible) {\n if(isVisible) {\n $(\"#skeyhelp\").show();\n } else {\n $(\"#skeyhelp\").hide();\n }\n}", "function setVisibility() {\n\n self.element.querySelector( '.captions_start' ).style.display = getInputElementByName( 'start_button' ).checked ? 'block' : 'none';\n self.element.querySelector( '.captions_submit' ).style.display = getInputElementByName( 'feedback' ).value !== 'none' ? 'block' : 'none';\n self.element.querySelector( '.captions_finish' ).style.display = getInputElementByName( 'onfinish.restart' ).checked ? 'block' : 'none';\n getInputElementByName( 'manually' ).style.display = getInputElementByName( 'keywords' ).value === 'manually' ? 'block' : 'none';\n function getInputElementByName( name ) { return self.element.querySelector( '[name=\"' + name + '\"]' ); }\n\n }", "function textVisible() {\n if(guessText.style.visibility === \"hidden\" && lastGuessWas.style.visibility === \"hidden\") {\n guessText.style.visibility = \"visible\";\n lastGuessWas.style.visibility = \"visible\";\n } else {\n guessText.style.visibility = \"hidden\";\n lastGuessWas.style.visibility = \"hidden\";\n }\n}", "function stopGivingGreatHints() {\n\t\t$(\"#showman\").hide();\n\t\tsoundActive = 0;\n\t\tplayAudio();\n\t}", "function showHiddenAnswer() {\n document.querySelector(\".ans.disable\").style.visibility = \"visible\";\n document.querySelector(\".ans.disable\").classList.remove(\"disable\");\n document.querySelector(\".ans.disable\").style.visibility = \"visible\";\n document.querySelector(\".ans.disable\").classList.remove(\"disable\");\n}", "hide()\n\t{\n\t\t// hide the decorations:\n\t\tsuper.hide();\n\n\t\t// hide the stimuli:\n\t\tif (typeof this._items !== \"undefined\")\n\t\t{\n\t\t\tfor (let i = 0; i < this._items.length; ++i)\n\t\t\t{\n\t\t\t\tif (this._visual.visibles[i])\n\t\t\t\t{\n\t\t\t\t\tconst textStim = this._visual.textStims[i];\n\t\t\t\t\ttextStim.hide();\n\n\t\t\t\t\tconst responseStim = this._visual.responseStims[i];\n\t\t\t\t\tif (responseStim)\n\t\t\t\t\t{\n\t\t\t\t\t\tresponseStim.hide();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// hide the scrollbar:\n\t\t\tthis._scrollbar.hide();\n\t\t}\n\t}", "function typing() {\n let options = {\n strings: [\"Hello, Adventurer... ^1000\", \"Shall we begin?\"],\n loop: false,\n smartBackspace: true,\n backSpeed: 50,\n typeSpeed: 100,\n showCursor: false\n }\n let typed = new Typed(\".type-intro\", options);\n \n setTimeout(function(){\n $(\".formy\").fadeIn(8000);\n }, 5000)\n}", "display() {\n this.editorNode.style.visibility = \"visible\";\n this.focusInput();\n }", "function invisible(){\n feedback.style.visibility = 'hidden';\n}", "function setVisibility() {\n\n self.element.querySelector( '.captions_start' ).style.display = getInputElementByName( 'start_button' ).checked ? 'block' : 'none';\n self.element.querySelector( '.captions_submit' ).style.display = getInputElementByName( 'feedback' ).value !== 'none' ? 'block' : 'none';\n // self.element.querySelector( '.captions_cancel' ).style.display = getInputElementByName( 'cancel_button' ).checked ? 'block' : 'none';\n self.element.querySelector( '.captions_finish' ).style.display = getInputElementByName( 'onfinish.restart' ).checked ? 'block' : 'none';\n getInputElementByName( 'manually' ).style.display = getInputElementByName( 'keywords' ).value === 'manually' ? 'block' : 'none';\n function getInputElementByName( name ) { return self.element.querySelector( '[name=\"' + name + '\"]' ); }\n\n }", "hide(){\r\n this.greeting.hide();\r\n this.input.hide();\r\n this.button.hide();\r\n }", "checkForCursorVisibility() {\n this.showCaret();\n }", "HIDE(){\r\n\r\n this.input.hide();\r\n this.button.hide();\r\n this.Greeting.hide();\r\n\r\n}", "hideWrapUp() {\n this.showWrapUp = false;\n }", "hide() {\n this.isVisible = false;\n }", "checkTyping() {\n const self = this;\n\n const typingTimer = (new Date()).getTime();\n const duration = typingTimer - self.lastTypingTime;\n if (self.didReachTypingTimeout(duration, self.typingTimeout, self.isTyping)) {\n self.isTyping = false;\n }\n }", "animateHideHint_() {\n this.hint_.classList.add('i-amphtml-image-slider-hint-hidden');\n this.isHintHidden_ = true;\n }", "function initVisibility() {\n\tvar storage = globalStorage[window.location.hostname];\n\n\tvar page = window.pageName.replace(/\\W/g,'_');\n\tvar show = storage.getItem( 'infoboxshow-' + page );\n\n\tif( show == 'false' ) {\n\t\tinfoboxToggle();\n\t}\n\n\tvar hidables = getElementsByClass( 'hidable' );\n\n\tfor( var i = 0; i < hidables.length; i++ ) {\n\t\tshow = storage.getItem( 'hidableshow-' + i + '_' + page );\n\n\t\tif( show == 'false' ) {\n\t\t\tvar content = getElementsByClass( 'hidable-content', hidables[i] );\n\t\t\tvar button = getElementsByClass( 'hidable-button', hidables[i] );\n\n\t\t\tif(\n\t\t\t\tcontent != null && content.length > 0 &&\n\t\t\t\tbutton != null && button.length > 0 &&\n\t\t\t\tcontent[0].style.display != 'none'\n\t\t\t) {\n\t\t\t\tbutton[0].onclick( 'bypass' );\n\t\t\t}\n\t\t} else if( show == 'true' ) {\n\t\t\tvar content = getElementsByClass( 'hidable-content', hidables[i] );\n\t\t\tvar button = getElementsByClass( 'hidable-button', hidables[i] );\n\n\t\t\tif(\n\t\t\t\tcontent != null && content.length > 0 &&\n\t\t\t\tbutton != null && button.length > 0 &&\n\t\t\t\tcontent[0].style.display == 'none'\n\t\t\t) {\n\t\t\t\tbutton[0].onclick( 'bypass' );\n\t\t\t}\n\t\t}\n\t}\n}", "function displayHints() {\n hintBox.innerHTML = '';\n if(hints == false){\n const ulElem = document.createElement('ul');\n hintBox.appendChild(ulElem);\n\n for(let i = 0; i < hintArray.length; i++){\n const liElem = document.createElement('li');\n liElem.textContent = hintArray[i];\n ulElem.appendChild(liElem);\n }\n hints = true;\n }\n else{\n hints = false;\n }\n }", "get isHidden() {\n return this._label === TAU;\n }", "function hideButtonsAndText() {\n $(\"sport-btn\").classList.add(\"hidden\");\n qs(\"textarea\").classList.add(\"hidden\");\n $(\"player-btn\").classList.add(\"hidden\");\n $(\"back-btn\").classList.remove(\"hidden\");\n }", "hide() {\n this.elem.classList.add(\"hiding\");\n setTimeout(() => this.elem.classList.add(\"noDisplay\"), 184);\n this.isHidden = true;\n }", "function hideAutoComplete(){\n document.getElementById(\"autocomplete-div\").style.display = 'none';\n}", "function checkHint(){\n $(\"#swipeHint\").remove();\n }", "function hideAttemptText() {\n attemptTracker.style.visibility = \"hidden\";\n}", "function closeHint()\r\n{\r\n hintText.style.visibility=\"hidden\";\r\n}", "function showOrHide() {\r\n let checkType = document.getElementById(\"password\");\r\n if (checkType.type === \"password\") {\r\n checkType.type = \"text\";\r\n } else {\r\n checkType.type = \"password\";\r\n }\r\n}", "hideViewer() {\n this.quote.style.display = '';\n this.viewer.style.display = 'none';\n }", "function initVisibility() {\n\tvar page = window.pageName.replace(/\\W/g,'_');\n\tvar show = localStorage.getItem('infoboxshow-' + page);\n\n\tif( show == 'false' ) {\n\t\tinfoboxToggle();\n\t}\n\n\tvar hidables = getElementsByClass('hidable');\n\n\tfor(var i = 0; i < hidables.length; i++) {\n\t\tshow = localStorage.getItem('hidableshow-' + i + '_' + page);\n\n\t\tif( show == 'false' ) {\n\t\t\tvar content = getElementsByClass('hidable-content', hidables[i]);\n\t\t\tvar button = getElementsByClass('hidable-button', hidables[i]);\n\n\t\t\tif( content != null && content.length > 0 &&\n\t\t\t\tbutton != null && button.length > 0 && content[0].style.display != 'none' )\n\t\t\t{\n\t\t\t\tbutton[0].onclick('bypass');\n\t\t\t}\n\t\t} else if( show == 'true' ) {\n\t\t\tvar content = getElementsByClass('hidable-content', hidables[i]);\n\t\t\tvar button = getElementsByClass('hidable-button', hidables[i]);\n\n\t\t\tif( content != null && content.length > 0 &&\n\t\t\t\tbutton != null && button.length > 0 && content[0].style.display == 'none' )\n\t\t\t{\n\t\t\t\tbutton[0].onclick('bypass');\n\t\t\t}\n\t\t}\n\t}\n}", "function hide() {\n\t\t\tdiv.hide();\n\t\t\tEvent.stopObserving(div, 'mouseover', onMouseMove);\n\t\t\tEvent.stopObserving(div, 'click', onClick);\n\t\t\tEvent.stopObserving(document, 'click', hide);\n\t\t\tEvent.stopObserving(textarea, 'click', hide);\n\t\t\tEvent.stopObserving(textarea, 'keydown', onKeyDown);\n\t\t\tvisible = false;\n\t\t}", "function toggleYouthExplanationHide() {\n let youthDisplay = document.getElementById(\"toggle-please-explain\");\n youthDisplay.style.display = \"none\";\n}", "function hideCarets() {\n TweenMax.to(leftcaret, 1, {opacity: 0});\n TweenMax.to(rightcaret, 1, {opacity: 0});\n }", "function unhelp(){\n $(\"#main\").show();\n $(\"#logout\").show();\n $(\"#help\").show();\n let info= document.getElementById(\"info\");\n info.style.visibility=\"hidden\";\n \n }", "hide() {\n this.editorNode.style.visibility = \"hidden\";\n }", "showToScreenReader() {\n this.adapter_.removeAttr(strings.ARIA_HIDDEN);\n }", "showToScreenReader() {\n this.adapter_.removeAttr(strings$17.ARIA_HIDDEN);\n }", "hide() {\n if (this[$visible]) {\n this[$visible] = false;\n this[$updateVisibility]({ notify: true });\n }\n }", "function hide(){\n\t\tif(pluginPresent()){\n\t\t\tcordova.plugins.Keyboard.close();\n\t\t}else{\n\t\t\tconsole.info(\"hiding the native keyboard\");\n\t\t}\n\t}", "function hide(){\n\t\tif(pluginPresent()){\n\t\t\tcordova.plugins.Keyboard.close();\n\t\t}else{\n\t\t\tconsole.info(\"hiding the native keyboard\");\n\t\t}\n\t}", "function cancelConfirmDefineWord () {\n if (document.getElementById('confirmDefineWord').style.display === \"block\") {\n document.getElementById('confirmDefineWord').style.display = \"none\";\n if (document.getElementById('toolbar').style.display === \"none\") {\t\n $(\"#toolbar\").show(\"blind\", { direction: \"down\" }, \"slow\");\n } else {\n $(\"#toolbar\").hide(\"blind\", { direction: \"down\" }, \"slow\");\n }\n }\n}", "hide() {\n this._$mountPoint.hide();\n }", "_hidePrompt() {\n const that = this,\n regex = new RegExp(that.promptChar, 'g');\n\n if (that.disabled || !that.hidePromptOnLeave || that.mask.length === 0) {\n return;\n }\n\n that.$.input.value = that.$.input.value.replace(regex, ' ');\n that._promptHidden = true;\n }", "toggleTypeFields () {\n const prevElement = this.shadowRoot.querySelector('.fedex-ab-create__type > div:not(.fedex-hidden)');\n if (prevElement) {\n prevElement.classList.add('fedex-hidden');\n }\n this.shadowRoot.querySelector(`.fedex-ab-create__type > div.fedex-ab-create__${this.input.type.value}`).classList.remove('fedex-hidden');\n }", "function AutoComplete_isVisible(id)\r\n {\r\n return __AutoComplete[id]['dropdown'].style.display == 'block';\r\n }", "showToScreenReader() {\n this.adapter_.removeAttr(strings$f.ARIA_HIDDEN);\n }", "function updateVisibility() {\n if (player.tech_ && player.tech_.featuresVolumeControl === false) {\n this.addClass('vjs-hidden');\n } else {\n this.removeClass('vjs-hidden');\n }\n }", "function updateVisibility() {\n if (player.tech_ && player.tech_.featuresVolumeControl === false) {\n this.addClass('vjs-hidden');\n } else {\n this.removeClass('vjs-hidden');\n }\n }", "function toggleWithDown() {\r\n if (guideContainer[this.id].style.display === \"block\") {\r\n guideContainer[this.id].style.display = \"none\";\r\n detail[this.id].style.display = \"block\";\r\n } else {\r\n guideContainer[this.id].style.display = \"block\";\r\n detail[this.id].style.display = \"none\";\r\n }\r\n}", "function showClearButton() {\n console.log('CHECKING SHOW CLEAR', transcript)\n if (!transcript.length) {\n clearButton.style.visibility = 'hidden'\n } else {\n clearButton.style.visibility = 'visible'\n }\n}", "function hiddenPositionFinger(textCheck, listPositionFinger) {\n let positionFinger\n // get index of list include character have key input\n const map = listPositionFinger.map(text => text.indexOf(textCheck))\n let indexInList = map.findIndex(number => {\n return number !== -1\n })\n if (indexInList === 4) {\n const positionFingerSpace = document.getElementsByClassName('position-finger')[5]\n positionFingerSpace.setAttribute('style', 'visibility: hidden;')\n }\n // check user input keyboard then show position finger\n positionFinger = document.getElementsByClassName('position-finger')[indexInList]\n if (positionFinger) {\n positionFinger.setAttribute('style', 'visibility: hidden;')\n } else {\n console.log('thaycacac')\n }\n}", "function removeGuide() {\n let guidePane = document.getElementById(\"guideContent\");\n guidePane.setAttribute(\"visible\",false);\n let popupBtn = document.getElementById(\"popupBtn\");\n if (popupBtn !== null) {\n popupBtn.parentNode.removeChild(popupBtn);\n }\n}", "function dontShowInput1M(){\n document.getElementById(\"medium-block\").style.display = \"none\";\n }", "function initVisibility() {\n\tvar storage = globalStorage[window.location.hostname];\n \n\tvar page = window.pageName.replace(/\\W/g,'_');\n\tvar show = storage.getItem('infoboxshow-' + page);\n \n\tif( show == 'false' ) {\n\t\tinfoboxToggle();\n\t}\n \n\tvar hidables = getElementsByClass('hidable');\n \n\tfor(var i = 0; i < hidables.length; i++) {\n\t\tshow = storage.getItem('hidableshow-' + i + '_' + page);\n \n\t\tif( show == 'false' ) {\n\t\t\tvar content = getElementsByClass('hidable-content', hidables[i]);\n\t\t\tvar button = getElementsByClass('hidable-button', hidables[i]);\n \n\t\t\tif( content != null && content.length > 0 &&\n\t\t\t\tbutton != null && button.length > 0 && content[0].style.display != 'none' )\n\t\t\t{\n\t\t\t\tbutton[0].onclick('bypass');\n\t\t\t}\n\t\t} else if( show == 'true' ) {\n\t\t\tvar content = getElementsByClass('hidable-content', hidables[i]);\n\t\t\tvar button = getElementsByClass('hidable-button', hidables[i]);\n \n\t\t\tif( content != null && content.length > 0 &&\n\t\t\t\tbutton != null && button.length > 0 && content[0].style.display == 'none' )\n\t\t\t{\n\t\t\t\tbutton[0].onclick('bypass');\n\t\t\t}\n\t\t}\n\t}\n}", "toggleAdvanced() {\n if (this.$advanced.is(':hidden')) {\n this.$advanced.show();\n const value = this.summaryInput.getValue();\n const match = value.match(/^.+?\\*\\/ */);\n\n // This is needed due to a bug in Firefox 56.\n focusInput(this.summaryInput);\n\n this.summaryInput.selectRange(match ? match[0].length : 0, value.length);\n } else {\n this.$advanced.hide();\n focusInput(this.commentInput);\n }\n }", "isHidden() {\n return false;\n }", "function setAttemptTextVisible() {\n attemptTracker.style.visibility = \"visible\";\n}", "function setupSpeechBubble(){\n\tdocument.getElementById(\"speechbubble\").style.visibility = \"visible\";\n\n}", "hideSpellContextItems() {\n if (this.spellContextItems.length > 0) {\n for (let i = 0; i < this.spellContextItems.length; i++) {\n let item = document.getElementById(this.viewer.owner.element.id + this.spellContextItems[i].id);\n if (!isNullOrUndefined(item)) {\n item.style.display = 'none';\n }\n }\n }\n }", "toggleHelpers() {\n if (this.helper) {\n this.helper = false;\n $(document.getElementsByClassName('help')[0]).css('color', 'white');\n this.els.rhymes.hidden = true;\n this.els.rhymes_below.hidden = true; \n }\n else if (this.definition) {\n console.log(this.definition); \n this.helper = true;\n this.els.rhymes.textContent = this.word[4];\n $(document.getElementsByClassName('help')[0]).css('color', '#FF5722');\n this.els.rhymes.hidden = !this.els.rhymes.hidden;\n } else {\n this.helper = true;\n this.els.rhymes_below.textContent = this.word[4];\n this.els.rhymes_below.hidden = !this.els.rhymes_below.hidden; \n $(document.getElementsByClassName('help')[0]).css('color', '#FF5722');\n \n }\n }", "toggleDefinition() {\n if (this.definition) {\n this.definition = false;\n $(document.getElementsByClassName('define')[0]).css('color', 'white');\n //this.timeout = setTimeout(() => { this.changeWord(); }, this.wordTimer);\n }\n else {\n this.definition = true; \n this.els.definition.textContent = `\"${this.word[3]}\"`;\n $(document.getElementsByClassName('define')[0]).css('color', '#FF5722');\n\n if (this.helper) {\n this.els.rhymes.hidden = !this.els.rhymes.hidden; \n this.els.rhymes_below.hidden = !this.els.rhymes_below.hidden;\n }\n }\n this.els.definition.hidden = !this.els.definition.hidden; \n }", "function toggleYouthExplanationShow() {\n let youthDisplay = document.getElementById(\"toggle-please-explain\");\n youthDisplay.style.display = \"block\";\n}", "function showTextInputOverlay () {\n document.getElementById('js-accessory-overlay').style.display = \"block\";\n document.getElementById(\"js-overlay-text-chat\").style.display = \"block\";\n}", "function hideTrivia () {\n $('#question').hide();\n $('#a1').hide();\n $('#a2').hide();\n $('#a3').hide();\n $('#a4').hide();\n $('#timer').hide();\n $('#scores').hide();\n }", "get DontShow() {}", "show_prompt( text, type ) {\n\t\tif ( 'password' === type ) {\n\t\t\t$( '#passwordField' ).val( '' );\n\t\t\t$( '#passwordArea' ).show();\n\t\t\t$( '#passwordField' ).focus();\n\t\t}\n\t}", "function displayNone(gtp) {\n gtp.style.display = \"none\";\n}", "showHideNewPassword() {\n this.showHideNew = this.showHideNew === false;\n }", "hide() {\n if (this.facingCamera || !this.initialized) {\n this.updateVisibility(false);\n }\n }", "_showTextInput() {\n\n if (this.state.showTextInput == false) {\n this.setState({ showTextInput: true })\n } else {\n this.setState({ showTextInput: false })\n }\n }", "hide(){\n this.chatEl.classList.remove(\"visible\");\n this.chatEl.classList.add(\"hidden\");\n }", "function hideSuggest(e) {\n\n \n\n var updatedDisplay = false;\n\n \n\n if (!updatedDisplay && $(e.target).closest(\".hawk-searchQuery\").length <= 0) {\n\n \n\n showSuggest(null, false);\n\n \n\n updatedDisplay = true;\n\n \n\n };\n\n \n\n }", "hideExamples() {\r\n this.isExamplesDisplayed = false;\r\n this.exampleList.style.display = 'none';\r\n document.getElementsByClassName('wrapper')[0].style.width = '100%';\r\n\r\n if (this.parent.menuPG && this.parent.menuPG.isMobileVersion && document.getElementById('jsEditor').style.display == 'block') {} else this.fpsLabel.style.display = 'block';\r\n this.toggleExamplesButtons.call(this, false);\r\n }", "function showEverything() {\n\tdocument.getElementById('toolboxContainer').hidden = false;\n\tdocument.getElementById('playBtn').disabled = !hasLoadedBuffers;\n\tdocument.getElementById('stopBtn').disabled = !hasLoadedBuffers;\n}", "function hideDevOpts(hide = true) {\n if (hide) {\n $('#showcaymans')[0].style.display = 'none';\n $('#loggingEnabled')[0].style.display = 'none';\n $('#viewcache')[0].style.display = 'none';\n opt_showcaymans = false;\n GM_setValue(\"opt_showcaymans\", opt_showcaymans);\n } else {\n $('#showcaymans')[0].style.display = 'block';\n $('#loggingEnabled')[0].style.display = 'block';\n $('#viewcache')[0].style.display = 'block';\n }\n }", "function hide() {\n // First things first: we don't show it anymore.\n scope.tt_isOpen = false;\n\n //if tooltip is going to be shown after delay, we must cancel this\n $timeout.cancel(popupTimeout);\n removeTooltip();\n }", "function showOptions() {\n document.getElementById(\"controls\").hidden = !document.getElementById(\"controls\").hidden;\n}", "function madeVisible() {\n if (codeMirrorDirty) {\n codeMirrorDirty = false;\n // important we do it a bit later so things have had time to lay out\n setTimeout(function () {\n codeMirror.refresh();\n }, 1);\n }\n }", "function hideDialogue(){\n\tget(\"dialogue\").style.display = 'none';\n}", "function isMethodsOff()\n {\n var cursor = editor.getCursor();\n return (cursor.ch <= self.autoCompleteStart.ch);\n }", "function showTips() {\n $(\"#start-screen\").hide();\n $(\"#what-to-expect\").hide();\n $(\"#tips\").show();\n $(\"#question-display\").hide();\n $(\"#question-result-display\").hide();\n $(\"#test-result-display\").hide();\n }", "animateShowHint_() {\n this.hint_.classList.remove('i-amphtml-image-slider-hint-hidden');\n this.isHintHidden_ = false;\n }", "function hideHints(){\n\t\t\t\t$(\"#posibilidadescontainer\").fadeOut('slow');\n\t\t\t}" ]
[ "0.6340579", "0.6127379", "0.60292417", "0.5987002", "0.5872119", "0.586161", "0.5815526", "0.58124846", "0.5804741", "0.57497424", "0.57265455", "0.5712717", "0.570757", "0.56902885", "0.5660071", "0.5658868", "0.5631551", "0.5612249", "0.56083035", "0.55885494", "0.5577206", "0.55237734", "0.5522791", "0.55095017", "0.5499273", "0.5486933", "0.54726994", "0.54722446", "0.5472169", "0.5459911", "0.54565084", "0.5454451", "0.54348344", "0.54080963", "0.5395966", "0.5391497", "0.53758085", "0.53718925", "0.5367704", "0.53673106", "0.53621125", "0.53560764", "0.535588", "0.5351468", "0.5350103", "0.53431326", "0.5342934", "0.5337202", "0.5333614", "0.53334516", "0.5332072", "0.5324453", "0.5318868", "0.5316237", "0.5296799", "0.52875346", "0.52875346", "0.5282781", "0.52801067", "0.5270962", "0.5267096", "0.52651757", "0.5262633", "0.5262029", "0.5262029", "0.5261963", "0.5261541", "0.52562743", "0.52472556", "0.52416223", "0.5234989", "0.5223362", "0.5222127", "0.5221638", "0.5220712", "0.5214099", "0.52091366", "0.5208139", "0.52075166", "0.5206967", "0.5198779", "0.51930165", "0.5192518", "0.51920277", "0.5190582", "0.5186841", "0.5184784", "0.5183898", "0.518298", "0.5182702", "0.5178536", "0.5178364", "0.51782465", "0.51709646", "0.5170835", "0.51671773", "0.51642674", "0.51641715", "0.51639605", "0.5156168" ]
0.596534
4
Parse the current URL and determine the current unit and subunit numbers, and display the determined subunit. The fragment identifier in the URL may contain the current unit and subunit numbers in m.n format where m is the current unit number and n is the current subunit number. If the fragment identifier is absent, then the current unit is 1 and the current subunit is 1. If the fragment identifier is a single integer m only, then the current unit is m and the current subunit is 1. The following is a list of example URLs along with the unit number they translate to. Unit 1.1 Unit 5.1 Unit 5.1 Unit 5.2
function updateUnitFromURL() { // Default lesson is Unit 1.1 var unitNo = 1 var subunitNo = 1 // Parse the fragment identifier in the URL and determine the // unit if (window.location.hash.length > 0) { var fragmentID = window.location.hash.slice(1) var tokens = fragmentID.split('.') unitNo = parseInt(tokens[0]) if (tokens.length > 1) subunitNo = parseInt(tokens[1]) } // Default to unit 1 if unit number could not be parsed // correctly from the URL if (isNaN(unitNo)) { unitNo = 1 } // Default to subunit 1 if unit number could not be parsed // correctly from the URL if (isNaN(subunitNo)) { subunitNo = 1 } setSubunit(unitNo, subunitNo) displayUnitLinks() displaySubunitLinks() displayAlternateUnitLinks() updateNavigationLinks() updateProgressTooltip() displayUnitTitle() displayGuide() resetSubunit() }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function processURLChange()\n {\n switch(window.location.hash) {\n\n case '#restart':\n currentSubunit()\n break\n\n case '#previous':\n previousSubunit()\n break\n\n case '#next':\n nextSubunit()\n break\n\n default:\n updateUnitFromURL()\n }\n }", "function currentSubunit()\n {\n var m = my.current.unitNo\n var n = my.current.subunitNo\n\n window.location.href = unitHref(m, n)\n }", "function nextSubunit()\n {\n var m = my.current.unitNo\n var n = my.current.subunitNo\n\n if (!currentSubunitIsTheLastSubunit()) {\n if (n == my.current.subunitTitles.length) {\n // If the user is at unit M.L where L is the last\n // subunit of unit M, then go to unit (M + 1).1.\n m++\n n = 1\n } else {\n // If the user is at unit M.N, then go to unit M.(N + 1).\n n++\n }\n }\n\n window.location.href = unitHref(m, n)\n }", "function displaySubunitLinks()\n {\n // Delete all existing subunit links\n var linksDiv = my.html.subunitLinks\n while (linksDiv.firstChild &&\n linksDiv.firstChild.className != 'stretch') {\n\n linksDiv.removeChild(linksDiv.firstChild)\n }\n\n // Create new subunit links for the unit m\n var numberOfSubunits = my.current.subunitTitles.length\n for (var i = numberOfSubunits - 1; i >= 0; i--) {\n // Insert whitespaces between div elements, otherwise they\n // would not be justified\n var whitespace = document.createTextNode('\\n')\n linksDiv.insertBefore(whitespace, linksDiv.firstChild)\n\n var label = my.current.subunitTitles[i]\n var selected = (i + 1 == my.current.subunitNo)\n var href = unitHref(my.current.unitNo, i + 1)\n\n var subunitDiv = boxedLink(label, selected, href)\n subunitDiv.id = 'subunit' + (i + 1)\n subunitDiv.style.width = (95 / numberOfSubunits) + '%'\n\n linksDiv.insertBefore(subunitDiv, linksDiv.firstChild)\n }\n }", "parseUrl () {\r\n this.currentIndex = this.getParameter(\"index\");\r\n this.currentFolder = this.findSubnavFolderByIndex(this.currentIndex);\r\n\r\n const page = this.getParameter(\"page\");\r\n\r\n if (this.currentFolder) {\r\n const target = document.querySelector(`#${page}`);\r\n\r\n this.toggleActivePages(target);\r\n this.toggleActiveSubnav(this.currentIndex);\r\n } else {\r\n const target = document.querySelector(\"#flight-ops-home\");\r\n\r\n this.toggleActivePages(target);\r\n this.toggleActiveSubnav(0);\r\n }\r\n }", "function parseUrl() {\r\n var hash = window.location.hash.substr( 1 );\r\n var rez = hash.split( '-' );\r\n var index = rez.length > 1 && /^\\+?\\d+$/.test( rez[ rez.length - 1 ] ) ? parseInt( rez.pop( -1 ), 10 ) || 1 : 1;\r\n var gallery = rez.join( '-' );\r\n\r\n\t\t// Index is starting from 1\r\n\t\tif ( index < 1 ) {\r\n\t\t\tindex = 1;\r\n\t\t}\r\n\r\n return {\r\n hash : hash,\r\n index : index,\r\n gallery : gallery\r\n };\r\n }", "function parseUrl() {\n var hash = window.location.hash.substr( 1 );\n var rez = hash.split( '-' );\n var index = rez.length > 1 && /^\\+?\\d+$/.test( rez[ rez.length - 1 ] ) ? parseInt( rez.pop( -1 ), 10 ) || 1 : 1;\n var gallery = rez.join( '-' );\n\n // Index is starting from 1\n if ( index < 1 ) {\n index = 1;\n }\n\n return {\n hash : hash,\n index : index,\n gallery : gallery\n };\n }", "function parseUrl() {\n var hash = window.location.hash.substr( 1 );\n var rez = hash.split( '-' );\n var index = rez.length > 1 && /^\\+?\\d+$/.test( rez[ rez.length - 1 ] ) ? parseInt( rez.pop( -1 ), 10 ) || 1 : 1;\n var gallery = rez.join( '-' );\n\n\t\t// Index is starting from 1\n\t\tif ( index < 1 ) {\n\t\t\tindex = 1;\n\t\t}\n\n return {\n hash : hash,\n index : index,\n gallery : gallery\n };\n }", "function parseUrl() {\n var hash = window.location.hash.substr( 1 );\n var rez = hash.split( '-' );\n var index = rez.length > 1 && /^\\+?\\d+$/.test( rez[ rez.length - 1 ] ) ? parseInt( rez.pop( -1 ), 10 ) || 1 : 1;\n var gallery = rez.join( '-' );\n\n\t\t// Index is starting from 1\n\t\tif ( index < 1 ) {\n\t\t\tindex = 1;\n\t\t}\n\n return {\n hash : hash,\n index : index,\n gallery : gallery\n };\n }", "function parseUrl() {\n var hash = window.location.hash.substr( 1 );\n var rez = hash.split( '-' );\n var index = rez.length > 1 && /^\\+?\\d+$/.test( rez[ rez.length - 1 ] ) ? parseInt( rez.pop( -1 ), 10 ) || 1 : 1;\n var gallery = rez.join( '-' );\n\n\t\t// Index is starting from 1\n\t\tif ( index < 1 ) {\n\t\t\tindex = 1;\n\t\t}\n\n return {\n hash : hash,\n index : index,\n gallery : gallery\n };\n }", "function parseUrl() {\n var hash = window.location.hash.substr( 1 );\n var rez = hash.split( '-' );\n var index = rez.length > 1 && /^\\+?\\d+$/.test( rez[ rez.length - 1 ] ) ? parseInt( rez.pop( -1 ), 10 ) || 1 : 1;\n var gallery = rez.join( '-' );\n\n\t\t// Index is starting from 1\n\t\tif ( index < 1 ) {\n\t\t\tindex = 1;\n\t\t}\n\n return {\n hash : hash,\n index : index,\n gallery : gallery\n };\n }", "function parseUrl() {\r\n var hash = window.location.hash.substr(1),\r\n rez = hash.split(\"-\"),\r\n index = rez.length > 1 && /^\\+?\\d+$/.test(rez[rez.length - 1]) ? parseInt(rez.pop(-1), 10) || 1 : 1,\r\n gallery = rez.join(\"-\");\r\n\r\n return {\r\n hash: hash,\r\n /* Index is starting from 1 */\r\n index: index < 1 ? 1 : index,\r\n gallery: gallery\r\n };\r\n }", "function parseUrl() {\r\n var hash = window.location.hash.substr(1),\r\n rez = hash.split(\"-\"),\r\n index = rez.length > 1 && /^\\+?\\d+$/.test(rez[rez.length - 1]) ? parseInt(rez.pop(-1), 10) || 1 : 1,\r\n gallery = rez.join(\"-\");\r\n\r\n return {\r\n hash: hash,\r\n /* Index is starting from 1 */\r\n index: index < 1 ? 1 : index,\r\n gallery: gallery\r\n };\r\n }", "function parseUrl() {\n var hash = window.location.hash.substr(1),\n rez = hash.split(\"-\"),\n index = rez.length > 1 && /^\\+?\\d+$/.test(rez[rez.length - 1]) ? parseInt(rez.pop(-1), 10) || 1 : 1,\n gallery = rez.join(\"-\");\n\n return {\n hash: hash,\n /* Index is starting from 1 */\n index: index < 1 ? 1 : index,\n gallery: gallery\n };\n }", "function parseUrl(urlPart, name_size){\n let output = \"\"; \n let i = 3; \n for(i=5;i<name_size;i++){\n output = output.concat(urlPart[i])\n }\n return output; //returns city name \n}", "function parseUrl() {\n var hash = window.location.hash.substr(1),\n rez = hash.split(\"-\"),\n index = rez.length > 1 && /^\\+?\\d+$/.test(rez[rez.length - 1]) ? parseInt(rez.pop(-1), 10) || 1 : 1,\n gallery = rez.join(\"-\");\n\n return {\n hash: hash,\n /* Index is starting from 1 */\n index: index < 1 ? 1 : index,\n gallery: gallery\n };\n }", "function parseUrl() {\n var hash = window.location.hash.substr(1),\n rez = hash.split(\"-\"),\n index = rez.length > 1 && /^\\+?\\d+$/.test(rez[rez.length - 1]) ? parseInt(rez.pop(-1), 10) || 1 : 1,\n gallery = rez.join(\"-\");\n\n return {\n hash: hash,\n /* Index is starting from 1 */\n index: index < 1 ? 1 : index,\n gallery: gallery\n };\n }", "function parseUrl() {\n var hash = window.location.hash.substr(1),\n rez = hash.split(\"-\"),\n index = rez.length > 1 && /^\\+?\\d+$/.test(rez[rez.length - 1]) ? parseInt(rez.pop(-1), 10) || 1 : 1,\n gallery = rez.join(\"-\");\n\n return {\n hash: hash,\n /* Index is starting from 1 */\n index: index < 1 ? 1 : index,\n gallery: gallery\n };\n }", "function unitHref(m, n)\n {\n if (typeof m == 'undefined') {\n return ''\n } else if (typeof n == 'undefined') {\n return '#' + m\n } else {\n return '#' + m + '.' + n\n }\n }", "function previousSubunit()\n {\n var m = my.current.unitNo\n var n = my.current.subunitNo\n\n if (!currentSubunitIsTheFirstSubunit()) {\n if (n == 1) {\n // If the user is at unit M.1, go to unit (M - 1).L\n // where L is the last subunit of the previous unit.\n previousUnit = unit(m - 1)\n var previousSubunitTitles = []\n for (var subunitTitle in previousUnit.subunits) {\n previousSubunitTitles.push(subunitTitle)\n }\n\n m--\n n = previousSubunitTitles.length\n } else {\n // If the user is at unit M.N, go to unit M.(N - 1)\n n--\n }\n }\n\n window.location.href = unitHref(m, n)\n }", "function getSectionAndSubsectionFromURL () {\n let sectionId = (document.location.hash || '').split('#').pop();\n let subSectionElement = document.querySelector('section #' + sectionId);\n\n if (subSectionElement) {\n // locate section\n let subSectionId = sectionId;\n let sectionElement = subSectionElement;\n while (sectionElement && sectionElement.className.indexOf('container-info-topic') < 0) {\n sectionElement = sectionElement.parentNode;\n }\n\n return {\n sectionId: sectionElement.id,\n subSectionId\n };\n } else {\n return {\n sectionId: sectionId,\n subSectionId: null\n };\n }\n}", "function getSlideNumberFromUrlFragment() {\n var fragment = window.location.hash || ''\n\n currentSlideNumber = (parseInt(fragment.substr(1)) - 1) || 0\n}", "function getSlideNumberFromUrlFragment() {\n var fragment = window.location.hash || ''\n\n currentSlideNumber = (parseInt(fragment.substr(1)) - 1) || 0\n}", "function parseURLParentID(number) {\n let queryString = decodeURIComponent(window.location.search);\n let queries = queryString.split(\"?\");\n let searchQueries = queries[number];\n return searchQueries;\n}", "function get_subsection_url(html) {\r\n var friendId = null;\r\n var page_nums = [1]; //Start with one page of results\r\n //Look for anything like this:\r\n //http://friends.myspace.com/index.cfm?fuseaction=user.viewfriends&friendId=30920517&p=5\r\n var results = html.match(/index.cfm\\?fuseaction=user\\.viewfriends&friendId=(\\d+)/);\r\n if (results && results[1]) {\r\n friendId = results[1];\r\n }\r\n else {\r\n if (mydebug) alert('Could not find friendId');\r\n }\r\n results = html.match(/index.cfm\\?fuseaction=user\\.viewfriends&friendId=\\d+&p=\\d+\"/g);\r\n if (results) {\r\n for (i=0;i<results.length;i++) {\r\n //Get our friendId if we dont yet have it.\r\n var page_num = results[i].match(/(\\d+)\"$/);\r\n if (page_num) {\r\n page_nums.push(page_num[1]);\r\n }\r\n }\r\n }\r\n else {\r\n //Case where there is not enough friends for paging (like 11)\r\n return 'http://www.myspace.com/index.cfm?fuseaction=user.viewfriends&friendId=' + friendId;\r\n }\r\n\r\n var random_page = Math.floor(Math.random() * array_max(page_nums)) + 1;\r\n var ret = 'http://www.myspace.com/index.cfm?fuseaction=user.viewfriends&friendId=' + friendId + '&p=' + random_page;\r\n return ret;\r\n}", "function Main_ParseUrlParameters()\n{\n\t//create an url object\n\tvar url = {};\n\n\t//get the url string\n\tvar strURL = location.href;\n\t//search for first query\n\tvar nAmp = strURL.indexOf(\"?\");\n\tif (nAmp != -1)\n\t{\n\t\t//correct url\n\t\tstrURL = strURL.substr(nAmp + 1);\n\t\t//split into pairs\n\t\tstrURL = strURL.split(\"&\");\n\t\t//loop through them\n\t\tfor (var i = 0, c = strURL.length; i < c; i++)\n\t\t{\n\t\t\t//split this into the name/value pair\n\t\t\tvar pair = strURL[i].split(\"=\");\n\t\t\tif (pair.length == 2)\n\t\t\t{\n\t\t\t\t//add this\n\t\t\t\turl[pair[0].toLowerCase()] = pair[1];\n\t\t\t}\n\t\t}\n\t\t//we have a root?\n\t\tif (url.startid)\n\t\t{\n\t\t\t//add root\n\t\t\turl.StartStateId = url.startid;\n\t\t\t//has extension?\n\t\t\tif (url.StartStateId.indexOf(__NEMESIS_EXTENSION) != -1)\n\t\t\t{\n\t\t\t\t//remove it\n\t\t\t\turl.StartStateId.replace(__NEMESIS_EXTENSION, \"\");\n\t\t\t}\n\t\t}\n\t}\n\t//return it\n\treturn url;\n}", "function get_fragment( url ) {\n return url.replace( re_fragment, '$2' );\n }", "function setSubunit(m, n)\n {\n my.current.unitNo = m\n my.current.subunitNo = n\n\n my.current.unit = unit(m)\n\n my.current.subunitTitles.length = 0\n for (var subunitTitle in my.current.unit.subunits) {\n my.current.subunitTitles.push(subunitTitle)\n }\n\n var subunitTitle = my.current.subunitTitles[n - 1]\n my.current.subunitText = my.current.unit.subunits[subunitTitle]\n }", "resource(fullUrl){\n //Pega o caminho da URL ou seja a string que vem após a porta e antes das querys\n //protocolo://domínio:porta/RECURSO/.../RECURSO?query_string#fragmento\n let parsedUrl = url.parse(fullUrl).pathname\n return parsedUrl\n }", "loadUrl(fragment) {\n fragment = this.fragment = this.location.pathname\n this.onLoadUrl && this.onLoadUrl(fragment, this.location.search)\n }", "function get_fragment( url ) {\nurl = url || location.href;\nreturn '#' + url.replace( /^[^#]*#?(.*)$/, '$1' );\n}", "function pageURL(cur, total) {\n return cur;\n// if(cur==total){\n// return \"\"+cur;\n// }else{\n// var str = \"\"+cur;\n// var totStr = \"\"+total;\n// var pad = totStr.length - str.length;\n// for(var z=0;z<pad;z++){\n// str = \"0\"+str;\n// }\n// return str;\n// }\n}", "function getAlbumURI({ pageURL, albumNames }) {\n\n console.log(\"getAlbumURI\")\n console.log(\"pageURL\", pageURL)\n console.log(\"albumNames\", albumNames)\n\n // https://example.com/wildflowers/7/ ==> [\"example.com\", \"wildflowers\", \"7\"]\n // https://example.com/baking/a/3/ ==> [\"example.com\", \"baking\", \"a\", \"3\"]\n // https://example.com/baking/a/ ==> [\"example.com\", \"baking\", \"a\"]\n let urlArray = pageURL.split(\"://\").pop().split(\"?\").shift().split(\"/\").filter(bit => bit !== \"\");\n urlArray.shift(); // Remove the domain and port\n console.log(urlArray);\n\n let groupMatches = albumNames.filter(name => name === urlArray[0]);\n console.log(\"groupMatches\", groupMatches);\n let matches = albumNames.filter(name => name === urlArray.slice(0, urlArray.length - 1).join(\"/\"));\n console.log(\"matches\", matches);\n let strongMatches = albumNames.filter(name => name === urlArray.join(\"/\"));\n console.log(\"strongMatches\", strongMatches);\n\n if (strongMatches.length > 0) {\n return strongMatches[0]\n } else if (matches.length > 0) {\n return matches[0]\n } else if (groupMatches.length > 0) {\n return groupMatches[0]\n }\n}", "function set_url(fragment) {\n var baseurl = window.location.protocol+\"//\"+window.location.host+window.location.pathname\n var url = baseurl + fragment;\n $('span#cur_url').html(\"<a href='\"+url+\"'>\"+url+\"</a>\"); \n}", "function do_fragment_change() {\n var fragment = window.location.hash;\n set_url(fragment);\n\n if (fragment.match(/^#t=/)) {\n do_time_change(fragment);\n }\n else if (fragment.match(/^#!/)) {\n do_transcript_change(fragment);\n }\n}", "function parseTopURL() {\n let query = window.location.search.substring(1);\n let args = query.split('&');\n for(let i=0; i<args.length; i++) {\n let pair = args[i].split('=');\n if(pair[0] === 'id') {\n return pair[1]\n }\n }\n return undefined;\n}", "function get_fragment( url ) {\n url = url || loc.href;\n return url.replace( /^[^#]*#?(.*)$/, '$1' );\n }", "function retrieveTimeFragment(url) {\n offsettime = [];\n if (url.indexOf(\"#\") == -1) return [];\n var fragment = url.split(\"#\")[1];\n // first separate out the different components separated by \"&\"\n if (fragment == \"\" || fragment == null) return [];\n var components = [];\n if (fragment.indexOf(\"&\") == -1) {\n components[0] = fragment;\n } else {\n components = fragment.split(\"&\");\n }\n // then parse the component by separating name from value by \"=\"\n for (i=0; i<components.length; i++) {\n var name = components[i].split(\"=\")[0];\n var value = components[i].split(\"=\")[1];\n // then grab last \"t\" component and separate out start and end time\n if (name == \"t\") { // temporal URI\n if (value.indexOf(\"-\") == -1) {\n start = (1.0*value).toFixed(2);\n end = video.duration.toFixed(2);\n } else {\n start = (1.0*value.split(\"-\")[0]).toFixed(2);\n end = (1.0*value.split(\"-\")[1]).toFixed(2);\n }\n offsettime = [start,end];\n }\n }\n return offsettime;\n }", "function parseURI(){\n var uri = decodeURI(window.location.href);\n var loc = uri.indexOf('#') + 1;\n return parseInt(uri.substring(loc));\n}", "function getRouteData(sections, // Hash part of the URL, including the # character\nhash, // Should render a single section or component: pagePerSection option or isolated mode\npagePerSection) {\n if (pagePerSection === void 0) {\n pagePerSection = false;\n }\n\n var _getInfoFromHash = getInfoFromHash({\n sections: sections,\n hash: hash,\n pagePerSection: pagePerSection\n }),\n isolated = _getInfoFromHash.isolated,\n hashArray = _getInfoFromHash.hashArray,\n exampleIndex = _getInfoFromHash.exampleIndex;\n\n var filteredSections = filterSections({\n sections: sections,\n hashArray: hashArray\n });\n return {\n sections: filteredSections,\n isolated: isolated,\n exampleIndex: exampleIndex\n };\n}", "function loadTracks(responseText, url, currSearchCriteria, resultNumber)\r\n{\r\n\t// Decrement the result counter.\r\n\t//resultCounter--;\r\n\t\r\n\t/*\r\n\ttracks object:\r\n\ttracks.baseUrl\r\n\ttracks.indexName\r\n\ttracks.matchedTrack[].link\r\n\ttracks.matchedTrack[].name\r\n\ttracks.otherTrack[].link\r\n\ttracks.otherTrack[].name\r\n\t*/\r\n\t\r\n\t// Check that the URL isn't a request string.\r\n\tif (url.match(/\\?/))\r\n\t{\r\n\t\tupdateProgress(resultNumber, 1);\t// This result has finished.\r\n\t\trefreshResults();\r\n\t\treturn;\r\n\t}\r\n\t\r\n\t// Setup the tracks object.\r\n\tvar tracks = new Object();\r\n\ttracks.baseUrl = url;\r\n\t\r\n\t// Get the page title.\r\n\tvar titleRegEx = new RegExp(resultTitleSearchString, \"i\");\r\n\tvar titleMatch = titleRegEx.exec(responseText);\r\n\t//alert(\"Here \" + titleMatch + \" \" + responseText);\r\n\tif (titleMatch != null && titleMatch.length > 0)\r\n\t{\r\n\t\t// Page title has been found.\r\n\t\ttracks.indexName = titleMatch[1];\r\n\t\t//alert(\"Index \" + tracks.indexName);\r\n\t\t\r\n\t\t// Search for matching tracks.\r\n\t\t// Setup the MP3 search string.\r\n\t\tvar searchString = \"([^\\\\n|<]*\" + currSearchCriteria.replace(/\\s/g, \"[^\\\\n|<]*)|([^\\\\n|<]*\") + \"[^\\\\n|<]*)\";\r\n\t\tvar resultMP3SearchString = baseResultMP3SearchString.replace(/SEARCH_STRING/, searchString);\r\n\t\ttracks.matchedTrack = loadIndividualTracks(responseText, resultMP3SearchString, resultNumber, true);\r\n\t\t\r\n\t\t// Search for other tracks.\r\n\t\tresultMP3SearchString = baseResultMP3SearchString.replace(/SEARCH_STRING/, \"[^\\\\n|<]*\");\r\n\t\ttracks.otherTrack = loadIndividualTracks(responseText, resultMP3SearchString, resultNumber, false);\r\n\t\t\r\n\t\tif (tracks.matchedTrack != null && tracks.matchedTrack.length > 0 || tracks.otherTrack != null && tracks.otherTrack.length > 0)\r\n\t\t{\r\n\t\t\t// Add the result object to the array of results.\r\n\t\t\taddToResults(tracks);\r\n\t\t}\r\n\t}\r\n\t\r\n\tupdateProgress(resultNumber, 1);\t// This result has finished.\r\n\trefreshResults();\r\n}", "function displayUnitTestResult(req, num)\n{\n var unitTestId = 'unit-test-status-' + num;\n\n if(req.responseText.length < 512)\n {\n document.getElementById(unitTestId).innerHTML =\n req.responseText;\n }\n else\n {\n leadingZeros = \"\";\n if(num < 10)\n {\n leadingZeros = \"000\";\n }\n else if(num < 100)\n {\n leadingZeros = \"00\";\n }\n else if(num < 1000)\n {\n leadingZeros = \"000\";\n }\n else if(num < 10000)\n {\n leadingZeros = \"0\";\n }\n\n var formattedNum = leadingZeros + num;\n var baseTcUrl = getBaseTcUrl();\n var htmlUrl = baseTcUrl + formattedNum + \".xhtml\";\n var sparqlUrl = baseTcUrl + formattedNum + \".sparql\";\n var expectedResult = \"true\";\n\n document.getElementById(unitTestId).innerHTML =\n \"<a href=\\\"javascript:checkUnitTest(\" + num + \",'\" +\n htmlUrl + \"','\" + sparqlUrl + \"','\" + expectedResult +\n \"')\\\" style=\\\"font-weight: bold; color: #f00\\\">ERROR</a>\" ;\n }\n}", "function expand(url,params,variables){var tmpl=parse(url),expanded=tmpl.expand(params);if(variables){variables.push.apply(variables,tmpl.vars);}return expanded;}", "function expand(url,params,variables){var tmpl=parse(url),expanded=tmpl.expand(params);if(variables){variables.push.apply(variables,tmpl.vars);}return expanded;}", "function parse_imageId() {\n\t// URL is like http://emptysquare.net/photography/lower-east-side/#5/\n\t// fragment from http://benalman.com/code/projects/jquery-bbq/examples/fragment-basic/\n\tvar fragment = $.param.fragment();\n\tif (fragment.length) {\n\t\t// URL's image index is 1-based, our internal index is 0-based\n\t\timageId = parseInt(fragment.replace(/\\//g, '')) - 1;\n\t\tif (imageId < 0 || isNaN(imageId)) imageId = 0;\n\t} else {\n\t\timageId = 0;\n\t}\n}", "getUrlSection(segment) {\n\n if (segment != 0 && segment != 1) {\n return;\n }\n\n // default page is the first one in the list\n let default_page = \"\";\n\n if (this.appPages.length > 0) {\n default_page = this.appPages[0][\"name\"];\n }\n\n let curr_url = decodeURI(window.location.href);\n\n // has page defined\n if (curr_url.split(\"#\").length > 1) {\n return curr_url.split(\"#\")[segment];\n } else {\n window.location.href = encodeURI(window.location.href + \"#\" + default_page);\n return default_page;\n }\n }", "function get_fragment(url) {\n url = url || location.href;\n return '#' + url.replace(/^[^#]*#?(.*)$/, '$1');\n }", "function get_fragment(url) {\n url = url || location.href;\n return '#' + url.replace(/^[^#]*#?(.*)$/, '$1');\n }", "function handleUnit(unit) {\n switch(unit) {\n case \"MT\":\n return \"Minutes\";\n case \"HT\":\n return \"Hours\";\n case \"D\":\n return \"Days\";\n case \"M\":\n return \" Months\";\n default:\n return \"\";\n }\n}", "function jq_param_sub( is_fragment, get_func, url, params, merge_mode ) {\n var result,\n qs,\n matches,\n url_params,\n hash;\n \n if ( params !== undefined ) {\n // Build URL by merging params into url string.\n \n // matches[1] = url part that precedes params, not including trailing ?/#\n // matches[2] = params, not including leading ?/#\n // matches[3] = if in 'querystring' mode, hash including leading #, otherwise ''\n matches = url.match( is_fragment ? re_fragment : /^([^#?]*)\\??([^#]*)(#?.*)/ );\n \n // Get the hash if in 'querystring' mode, and it exists.\n hash = matches[3] || '';\n \n if ( merge_mode === 2 && is_string( params ) ) {\n // If merge_mode is 2 and params is a string, merge the fragment / query\n // string into the URL wholesale, without converting it into an object.\n qs = params.replace( is_fragment ? re_params_fragment : re_params_querystring, '' );\n \n } else {\n // Convert relevant params in url to object.\n url_params = jq_deparam( matches[2] );\n \n params = is_string( params )\n \n // Convert passed params string into object.\n ? jq_deparam[ is_fragment ? str_fragment : str_querystring ]( params )\n \n // Passed params object.\n : params;\n \n qs = merge_mode === 2 ? params // passed params replace url params\n : merge_mode === 1 ? $.extend( {}, params, url_params ) // url params override passed params\n : $.extend( {}, url_params, params ); // passed params override url params\n \n // Convert params object into a sorted params string.\n qs = jq_param_sorted( qs );\n \n // Unescape characters specified via $.param.noEscape. Since only hash-\n // history users have requested this feature, it's only enabled for\n // fragment-related params strings.\n if ( is_fragment ) {\n qs = qs.replace( re_no_escape, decode );\n }\n }\n \n // Build URL from the base url, querystring and hash. In 'querystring'\n // mode, ? is only added if a query string exists. In 'fragment' mode, #\n // is always added.\n result = matches[1] + ( is_fragment ? fragment_prefix : qs || !matches[1] ? '?' : '' ) + qs + hash;\n \n } else {\n // If URL was passed in, parse params from URL string, otherwise parse\n // params from window.location.href.\n result = get_func( url !== undefined ? url : location.href );\n }\n \n return result;\n }", "function showUnitTestDetails(num, html_url, sparql_url)\n{\n var rdfaExtractorUrl = getRdfaExtractorUrl();\n var n3ExtractorUrl = \"http://www.w3.org/2007/08/pyRdfa/extract?format=n3&uri=\";\n\n document.getElementById('unit-test-details-' + num).innerHTML =\n \"Retreiving information...\";\n sendRequest('test-details?id=' + num +\n '&xhtml=' + html_url +\n '&sparql=' + sparql_url +\n '&rdfa-extractor=' + escape(rdfaExtractorUrl) +\n '&n3-extractor=' + escape(n3ExtractorUrl),\n displayUnitTestDetailsResult, num)\n}", "function queryMostGranularFormatUnit(formatStr){var chunks=chunkFormatString(formatStr);var i;var chunk;var candidate;var best;for(i=0;i<chunks.length;i++){chunk=chunks[i];if(chunk.token){candidate=largeTokenMap[chunk.token.charAt(0)];if(candidate){if(!best||candidate.value>best.value){best=candidate;}}}}if(best){return best.unit;}return null;}", "parse(input, fragments, ranges) {\n let parse = this.startParse(input, fragments, ranges);\n for (;;) {\n let done = parse.advance();\n if (done)\n return done;\n }\n }", "function unitPerspective(unit, hierarchy, upstream, pathFromRootMap, unitMap, context) {\n var parentKey = hierarchy.snapshot.pathElements[0].relation.match(/[^.]+$/)[0];\n var parent = upstream[_.get(unit, [ 'snapshot', 'parents', parentKey, 'id' ])];\n var location = _.find(unit.snapshot.locations);\n var ean = _.get(unit, 'snapshot.ean', {});\n var emails = perspectiveUtil.emailCollection(unit, context);\n var ref = {\n Id: _.get(unit, 'id'),\n EksterntId: _.get(unit, 'snapshot.foreignIds.orgUnitId',\n _.get(unit, 'snapshot.foreignIds.departmentId',\n _.get(unit, 'snapshot.foreignIds.enhed'))),\n Navn: _.get(unit, 'snapshot.name'),\n OverordnetId: _.get(parent, 'Id'),\n OverordnetEksterntId: _.get(parent, 'EksterntId'),\n OverordnetNavn: _.get(parent, 'Navn'),\n StiFraRod: pathFromRootMap[unit.id],\n KortNavn: _.get(unit, 'snapshot.shortName'),\n EnhedstypeId: _.get(unit, 'snapshot.unitType.id'),\n EnhedstypeEksterntId: _.get(unit, 'snapshot.unitType.snapshot.foreignIds.opusId'),\n EnhedstypeNavn: _.get(unit, 'snapshot.unitType.snapshot.name'),\n Telefon: perspectiveUtil.toCommaList(_.get(unit, 'snapshot.phoneNumbers', {})),\n SENummer: _.get(unit, 'snapshot.seNr'),\n EanNummer: typeof ean === 'string' ? ean : perspectiveUtil.toCommaList(ean),\n Omkostningssteder: perspectiveUtil.toCommaList(_.get(unit, 'snapshot.costCenters', {})),\n Adresse: _.get(location, 'snapshot.address.snapshot.streetAddress'),\n Postnummer: _.get(location, 'snapshot.address.snapshot.postalCode'),\n By: _.get(location, 'snapshot.address.snapshot.city'),\n Land: _.get(location, 'snapshot.address.snapshot.country')\n };\n Object.assign(ref, emails.all || {});\n ref.AktivFra = util.asDanishDate(_.get(unit, 'snapshot.activeFrom')) || undefined;\n ref.AktivTil = util.asDanishDate(_.get(unit, 'snapshot.activeTo')) || undefined;\n upstream[unit.id] = ref;\n}", "function get_fragment( url ) {\n url = url || location.href;\n return '#' + url.replace( /^[^#]*#?(.*)$/, '$1' );\n }", "function get_fragment( url ) {\n url = url || location.href;\n return '#' + url.replace( /^[^#]*#?(.*)$/, '$1' );\n }", "function get_fragment( url ) {\n url = url || location.href;\n return '#' + url.replace( /^[^#]*#?(.*)$/, '$1' );\n }", "function processUrl(url){\n\tvar rawid = url.split(\"v=\")[1];\n\tif(rawid == null || rawid.length==0){\n\t\treturn false;\n\t}\n\tid = rawid.replace(/(&|#).+/g, \"\");\n\tvar time = -1;\n\tvar timeraw = url.split(\"t=\")[1];\n\tif(!(timeraw == null || timeraw.length==0)){\n\t\t//process time\n\t\ttimeraw = timeraw.replace(/(&|#).+/g, \"\");\n\t\tif(timeraw.match(/[0-9]+/gi) && timeraw > -1){\n\t\t\ttime = timeraw;\n\t\t}else{\n\t\t\tvar values = timeraw.match(/([0-9]+m)?([0-9]+(s)?){1}/gi);\n\t\t\tif(values != null){\n\t\t\t\tminutes = timeraw.split(\"m\")[0];\n\t\t\t\tif(minutes == timeraw || minutes == null || minutes.length == 0){\n\t\t\t\t\tminutes = 0;\n\t\t\t\t}\n\t\t\t\tseconds = timeraw.split(\"m\")[1];\n\t\t\t\tif(seconds == null || seconds.length == 0){\n\t\t\t\t\tseconds = timeraw;\n\t\t\t\t}\n\t\t\t\tseconds = seconds.replace(\"s\", \"\");\n\t\t\t\tif(minutes > -1 && seconds > -1){\n\t\t\t\t\ttime = 60*minutes + 1*seconds;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn {id: id, time: time};\n}", "function parseCurrentUrlParams () {\n\t\tme.urlParams = me.paramsToObject(window.location.search.substr(1));\n\t}", "function getIndexVonMitarbeiter() {\n var query = window.location.href\n console.log(query)\n var vars = query.split(\"/\");\n\n return vars[4]\n\n}", "function getInfoFromURL(){\r\n\r\n const info = location.href; //string\r\n const splittedURL = info.split('&');\r\n \r\n const splitOnceMore = splittedURL[0].split('?');\r\n const makeString = splitOnceMore[1].toString();\r\n\r\n const generalScoreDB = parseInt(makeString.slice(11, (makeString.length - 3)));\r\n const musicScoreDB = parseInt(splittedURL[1].slice(9, (splittedURL[1].length - 3)));\r\n const mathScoreDB = parseInt(splittedURL[2].slice(8, (splittedURL[2].length - 3)));\r\n const historyScoreDB = parseInt(splittedURL[3].slice(11, (splittedURL[3].length - 3)));\r\n const animalsScoreDB = parseInt(splittedURL[4].slice(11, (splittedURL[4].length - 3))); \r\n\r\n saveToLS(generalScoreDB, musicScoreDB, mathScoreDB, historyScoreDB, animalsScoreDB);\r\n\r\n }", "GetURLResource(url) {\r\n let parts = url.split('/');\r\n let lastSection = parts.pop() || parts.pop();\r\n if (lastSection) {\r\n return lastSection;\r\n }\r\n else {\r\n return \"unknown\";\r\n }\r\n }", "function parseURLParameters() {\n\tqueryString = window.location.search;\n\tif(typeof queryString !== 'undefined' && queryString && queryString.length > 2) {\n\t\tqueries = queryString.substring(1).split(\"&\");\n\t\tfor ( i = 0, l = queries.length; i < l; i++ ) {\n\t\t\tvar parts = queries[i].split('='), name = parts[0], val = decodeURIComponent(parts[1]);\n\t\t\t// console.log(\"Name=\"+name+\"Val=\"+val);\n\t\t\tswitch(name) {\n\t\t\tcase \"pv\":\n\t\t\t\tviewerVars.pvs.push(val); viewerVars.pvData[val] = {}; break;\n\t\t\tcase \"from\":\n\t\t\t\tviewerVars.start = new Date(val); break;\n\t\t\tcase \"to\":\n\t\t\t\tviewerVars.end = new Date(val); break;\n\t\t\tdefault:\n\t\t\t\tconsole.log(\"Unsupported parameter; adding it to the viewerVars anyways\" + name);\n\t\t\tviewerVars.name = val;\n\t\t\t}\n\t\t}\n\t}\n\t// QueryStart and QueryEnd are what we actually send to the server....\n\tviewerVars.queryStart = viewerVars.start;\n\tviewerVars.queryEnd = viewerVars.end;\n}", "static splitURI(uri) {\nvar matches, pattern;\n// lggr.trace? \"Splitting #{uri}\"\npattern = RegExp(\"^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\\\?([^#]*))?(#(.*))?\");\nmatches = uri.match(pattern);\nreturn {\nscheme: matches[2],\nauthority: matches[4],\npath: matches[5],\nquery: matches[7],\nfragment: matches[9]\n};\n}", "parse(url) {\n const p = new UrlParser(url);\n return new UrlTree(p.parseRootSegment(), p.parseQueryParams(), p.parseFragment());\n }", "function parse(url) {\n var l = url.split(\"/\");\n var start = l.indexOf(\"courses\");\n // url formats are of the form /courses/course_id/page_type/page_id\n\n var _l$slice = l.slice(start + 1, start + 3),\n _l$slice2 = _slicedToArray(_l$slice, 2),\n courseid = _l$slice2[0],\n pagetype = _l$slice2[1];\n\n return [courseid, pagetype];\n }", "function runWhenURLMet(){\n url = location.hash.slice(1).split(\"?\")[0];\n data = location.hash.slice(1).split(\"?\");\n \n setActive(url);\n\n if (url === \"home\"){\n list(\"products\", \"homeul\",true);\n }\n if (url === \"login\" || url === \"\"){\n document.getElementById(\"menu\").style.display = \"none\";\n document.getElementById(\"returnBtn\").style.display = \"none\";\n }\n if (url !== \"login\" && url !== \"\"){\n document.getElementById(\"menu\").style.display = \"flex\";\n document.getElementById(\"returnBtn\").style.display = \"block\";\n }\n if (url === \"detail\"){\n details(data[1]);\n }\n}", "function GetURLResource(url) {\n var parts = url.split('/');\n var lastSection = parts.pop() || parts.pop();\n if (lastSection) {\n return lastSection;\n }\n else {\n return \"unknown\";\n }\n }", "function displayUnitLinks()\n {\n // Delete all existing unit links\n var linksDiv = my.html.unitLinks\n Util.removeChildren(linksDiv)\n\n // Create new unit links\n for (var i = 0; i < Units.main.length; i++) {\n var label = 'སློབ་མཚན། ' + (i + 1)\n var selected = (i + 1 == my.current.unitNo)\n var href = unitHref(i + 1)\n\n var divElement = boxedLink(label, selected, href)\n divElement.id = 'unit' + (i + 1)\n divElement.title = unit(i + 1).title\n\n linksDiv.appendChild(divElement)\n }\n }", "parseUtmData () {\n if (!document.location.search || document.location.search == '') {\n this.debug ('UTM data not available');\n return null;\n }\n\n // parse the query strings\n const vars = document.location.search.substring (1).split ('&');\n const queryStrings = {};\n for (let i = 0; i < vars.length; i++) {\n let pair = vars[i].split ('=');\n let name = decodeURIComponent (pair[0]);\n\n if (name.indexOf ('utm_') !== -1) {\n // some cleanup stupp\n name = name.replace (/amp;|;/gi, '');\n const value = decodeURIComponent (pair[1]).replace (/amp;|;/gi, '');\n queryStrings[name] = value;\n }\n }\n\n if (Object.keys (queryStrings).length < 1) {\n return null;\n }\n\n return queryStrings;\n }", "function readFromUrl() {\n let urlGoTo = false; // modify current page if \"page\" not in URL\n\n const urlParams = new URLSearchParams(location.search);\n\n if (urlParams.get(\"page\") != null) {\n current_view_value = parseInt(urlParams.get(\"page\")) - 1;\n } else {\n current_view_value = 0;\n urlGoTo = true;\n }\n\n // make sure that a negative number was not provided\n if (current_view_value < 0) {\n current_view_value = 0;\n }\n\n if (urlParams.get(\"view\") != null) {\n current_view =\n urlParams.get(\"view\").slice(0, 1).toUpperCase() +\n urlParams.get(\"view\").slice(1);\n\n modifier = calculateModifier(current_view)\n }\n\n if (urlGoTo == true) {\n calculateDefaultView();\n }\n}", "function FormatTelephonyUrl(contentUrl) \r\n\t{\r\n\t\tif (contentUrl.lastIndexOf('.html') > -1) \r\n\t\t{\r\n\t\t\tcontentUrl = contentUrl.substring(0, contentUrl.lastIndexOf('/'));\r\n\t\t}\r\n\r\n\t\tif (contentUrl.indexOf('?') > -1)\r\n\t\t{\r\n\t\t\tcontentUrl = contentUrl.substring(0, contentUrl.indexOf('?'));\r\n\t\t}\r\n\r\n\t\tif (contentUrl.lastIndexOf('/') != contentUrl.length - 1) \r\n\t\t{\r\n\t\t\tcontentUrl += '/';\r\n\t\t}\r\n\r\n\t\treturn contentUrl;\r\n\t}", "function separateSections(foundSections, language, url, node) {\n\n //console.log(\" — — — \");\n //console.log(\"At node\", node.type, node.name, node.attribs);\n\n if (node.type != 'tag') {\n //console.log(\"Skipping \"+node.type+\" node\");\n return [];\n }\n\n if (node.children == []) {\n return [];\n }\n\n // Depth-first, reverse order recursion on this node's children\n for (var c = node.children.length - 1; c >= 0; c--) {\n let child = node.children[c];\n //console.log(\"Subnode\", child.name, child.attribs);\n separateSections(foundSections, language, url, child);\n }\n\n // Extract preamble nodes.\n if (node.attribs['id'] && node.attribs['id'].match(/^(preamble)$/)) {\n console.log(\" Found \" + node.attribs['id'] + \" special section\");\n\n // Add whole section to index, then remove this section.\n let text = extractText(node)\n\n const section = {\n language: language,\n text: text,\n title: 'Preamble',\n name: 'stem',\n url: url + '#' + node.attribs['id'],\n titles: []\n }\n\n foundSections.push(section);\n node.children = [];\n }\n\n // Extract sectN nodes.\n if (node.attribs['class'] && node.attribs['class'].match(/^sect[0-9]+$/)) {\n // The second child should be the header with an id\n // (The first child is a text node.)\n const heading = node.children[1];\n console.log(\" Found \" + node.attribs['class'] + \" with anchor \" + heading.attribs['id']);\n\n // Add whole section to index, then remove this section.\n let text = extractText(node)\n\n const section = {\n language: language,\n text: text,\n title: headingText(heading).trim(),\n name: 'stem',\n url: url + '#' + heading.attribs['id'],\n titles: [{text: headingText(heading).trim(), id: heading.attribs['id']}]\n }\n\n foundSections.push(section);\n node.children = [];\n }\n return foundSections\n}", "function parseName(_url) {\n return url.parse(_url).pathname;\n}", "function getPageNameMTL(delimiter, paramDelimiter, hashDelimiter) {\n//config\n//object : s\n//array : sc_pageNameParams\n//array : sc_pageNameHashes\n//string : s.dirIndexes\n//string : s.pageNameDomain\n//func : s.getQueryParam()\n//url param using for pageName\n\n\t//init config\n\tvar dirIn =(s.dirIndexes)?s.dirIndexes:\"index.html\";\n\tvar pnDmn =(s.pageNameDomain)?s.pageNameDomain:location.host;\n\tvar baseURL = pnDmn + sc_path;\n\tvar arrayURL;\n\tvar fileName;\n\tvar hashName = location.hash;\n\tvar pageName;\n\tif(typeof(delimiter) == \"undefined\"){delimiter =\"/\"};\n\tif(typeof(paramDelimiter) == \"undefined\"){paramDelimiter =\"?\"};\n\tif(typeof(hashDelimiter) == \"undefined\"){hashDelimiter =\"\"};\n\n\t//exclude params\n\tarrayURL = baseURL.split(\"#\")[0].split(\"?\")[0].split(\"/\");\n\tfileName = arrayURL[arrayURL.length-1];\n\tif(fileName ==\"\" || fileName.indexOf(\"index.\")>-1){\n\t\tarrayURL[arrayURL.length-1]=dirIn;\n\t}\n\tpageName =arrayURL.join(delimiter);\n\n\t//add params\n\tif(typeof(sc_pageNameParams) !=\"undefined\"){\n\t\tvar sep =paramDelimiter;\n\t\tfor (var sci in sc_pageNameParams){\n\t\t\tif(s.Util.getQueryParam(sc_pageNameParams[sci])){\n\t\t\t\tpageName += sep + sc_pageNameParams[sci]+\"=\"+s.Util.getQueryParam(sc_pageNameParams[sci]);\n\t\t\t\tsep = (paramDelimiter ==\"?\" || paramDelimiter ==\"&\" )?\"&\":paramDelimiter;\n\t\t\t}\n\t\t}\n\t}\n\t//add hashes\n\tif(typeof(sc_pageNameHashes) !=\"undefined\"){\n\t\tvar sep =hashDelimiter;\n\t\tfor (var sci in sc_pageNameHashes){\n\t\t\tif(hashName ==sc_pageNameHashes[sci]){\n\t\t\t\tpageName += sep + hashName;\n\t\t\t}\n\t\t}\n\t}\n\treturn pageName;\n}", "function getItemNum (url) {\n return url.substr (url.lastIndexOf('/')+1, url.length-1);\n}", "function CheckHashParam() {\n var s = location.hash;\n if (s) {\n // Remove #\n s = s.substring(1);\n if (s[0] == \"!\") {\n s = s.substring(1);\n }\n // console.log(s);\n }\n\n if (!s) {\n SetHashParam(\"1\");\n return;\n }\n //console.log(s);\n var pageNo = parseInt(s);\n // check that s parses to an integer\n if (isNaN(pageNo)) {\n SetHashParam(\"1\");\n return;\n }\n\n\n getCategoryStations(queryString, pageNo);\n\n }", "function parseQuery() {\n var searchUnparsed = document.location.search;\n if (searchUnparsed.includes(\"&\")) {\n searchParamsArr = searchUnparsed.split(\"&\");\n let query = searchParamsArr[0].split(\"=\");\n let type = searchParamsArr[1].split(\"=\");\n if (type[1] === \"name\") {\n searchByName(query[1]);\n } else if (type[1] === \"genre\") {\n let queryArr = query[1].split(\"+\");\n searchByGenre(queryArr[0], queryArr[1].split(\",\"));\n } else if (type[1] === \"esrb\") {\n searchByEsrb(query[1]);\n } else {\n // Show no results availble\n }\n }\n}", "function parseUrl (ast) {\n let [firstAgument] = ast.arguments;\n let rawUrl = firstAgument.raw;\n let url = rawUrl.replace(/^\\//, '').replace(/\\/$/, '').replace(/\\\\/g,'');\n assert(url);\n return url;\n }", "function extractQuerystring(url) {\r\n var queryStart = url.indexOf('?');\r\n if (!queryStart) {\r\n return '';\r\n }\r\n var fragmentStart = url.indexOf('#', queryStart);\r\n return url.substring(queryStart, fragmentStart > 0 ? fragmentStart : undefined);\r\n}", "function getUnit(input) {\n return String(input).match(/[\\d.\\-+]*\\s*(.*)/)[1] || '';\n} // Emulate the sass function \"unitless\"", "function getUnit(input) {\n return String(input).match(/[\\d.\\-+]*\\s*(.*)/)[1] || '';\n} // Emulate the sass function \"unitless\"", "function getUnit(input) {\n return String(input).match(/[\\d.\\-+]*\\s*(.*)/)[1] || '';\n} // Emulate the sass function \"unitless\"", "function getUnit(input) {\n return String(input).match(/[\\d.\\-+]*\\s*(.*)/)[1] || '';\n} // Emulate the sass function \"unitless\"", "function getUnit(input) {\n return String(input).match(/[\\d.\\-+]*\\s*(.*)/)[1] || '';\n} // Emulate the sass function \"unitless\"", "function getUnit(input) {\n return String(input).match(/[\\d.\\-+]*\\s*(.*)/)[1] || '';\n} // Emulate the sass function \"unitless\"", "function getUnit(input) {\n return String(input).match(/[\\d.\\-+]*\\s*(.*)/)[1] || '';\n} // Emulate the sass function \"unitless\"", "function getUnit(input) {\n return String(input).match(/[\\d.\\-+]*\\s*(.*)/)[1] || '';\n} // Emulate the sass function \"unitless\"", "function getUnit(input) {\n return String(input).match(/[\\d.\\-+]*\\s*(.*)/)[1] || '';\n} // Emulate the sass function \"unitless\"", "function getUnit(input) {\n return String(input).match(/[\\d.\\-+]*\\s*(.*)/)[1] || '';\n} // Emulate the sass function \"unitless\"", "function sb_writeSubsectionNav () {\n\tvar sHTML = \"\";\n\tvar currentLocation = location.href;\n\tcurrentLocation = currentLocation.slice(currentLocation.lastIndexOf(\"/\")+1);\n\tcurrentSection = -1;\n\tcurrentIndex = -1;\n\t\n\t//alert(\"currentIndex = \"+currentIndex);\n\t\n\tfor (i=0; (i<subsection.length) && (currentSection < 0); i++) {\n\t\tfor (j=0; (j<subsection[i].length) && (currentIndex < 0); j++) {\n\t\t\tif (subsection[i][j].indexOf(currentLocation) != -1) {\n\t\t\t\t//alert (\"index found at \"+j+\" - \"+i);\n\t\t\t\tcurrentIndex = j;\n\t\t\t\tcurrentSection = i;\n\t\t\t}\n\t\t}\n\t}\n\t\n\tsHTML += \"<table border=\\\"0\\\" cellspacing=\\\"0\\\" cellpadding=\\\"0\\\">\";\n\tsHTML += \"<tr>\";\n\tsHTML += \"<td><img src=\\\"/site_images/s.gif\\\" width=\\\"1\\\" height=\\\"10\\\" alt=\\\"\\\"/></td>\"\n\tsHTML += \"<td align=\\\"center\\\" valign=\\\"middle\\\" class=\\\"prevNext\\\" height=\\\"10\\\" nowrap>\";\n\t\n\tif ((currentIndex-1) < 0) {\n\t\tsHTML += \"<img src=\\\"/site_images/s.gif\\\" width=\\\"2\\\" height=\\\"1\\\" alt=\\\"\\\" /><span class=\\\"prevNextArrow\\\">&lt;</span><img src=\\\"/site_images/s.gif\\\" width=\\\"5\\\" height=\\\"1\\\" alt=\\\"\\\" />\" + prevText ;\n\t} else {\n\t\tsHTML += \"<img src=\\\"/site_images/s.gif\\\" width=\\\"2\\\" height=\\\"1\\\" alt=\\\"\\\" /><span class=\\\"prevNextArrow\\\">&lt;</span><img src=\\\"/site_images/s.gif\\\" width=\\\"5\\\" height=\\\"1\\\" alt=\\\"\\\" /><a href=\\\"\" + subsection[currentSection][currentIndex-1] + \"\\\" class=\\\"prevNextLink\\\">\" + prevText + \"</a>\";\n\t}\n\t\n\tif (subsectionIndex == \"\") {\n\t\tsHTML += \"<img src=\\\"/site_images/s.gif\\\" width=\\\"4\\\" height=\\\"1\\\" alt=\\\"\\\" />|<img src=\\\"/site_images/s.gif\\\" width=\\\"5\\\" height=\\\"1\\\" alt=\\\"\\\" />\";\n\t\tsHTML += \"Index\";\n\t\tsHTML += \"<img src=\\\"/site_images/s.gif\\\" width=\\\"4\\\" height=\\\"1\\\" alt=\\\"\\\" />|<img src=\\\"/site_images/s.gif\\\" width=\\\"5\\\" height=\\\"1\\\" alt=\\\"\\\" />\";\n\t} else {\n\t\tsHTML += \"<img src=\\\"/site_images/s.gif\\\" width=\\\"4\\\" height=\\\"1\\\" alt=\\\"\\\" />|<img src=\\\"/site_images/s.gif\\\" width=\\\"5\\\" height=\\\"1\\\" alt=\\\"\\\" />\";\n\t\tsHTML += \"<a href=\\\"\" + subsectionIndex + \"\\\" class=\\\"prevNextLink\\\">\" + indexText + \"</a>\";\n\t\tsHTML += \"<img src=\\\"/site_images/s.gif\\\" width=\\\"4\\\" height=\\\"1\\\" alt=\\\"\\\" />|<img src=\\\"/site_images/s.gif\\\" width=\\\"5\\\" height=\\\"1\\\" alt=\\\"\\\" />\";\n\t}\n\n\tif ( (currentIndex < 0) || (currentIndex > (subsection[currentSection].length - 2)) ) {\t\n\t\tsHTML += nextText + \"<img src=\\\"/site_images/s.gif\\\" width=\\\"4\\\" height=\\\"1\\\" alt=\\\"\\\" /><span class=\\\"prevNextArrow\\\">&gt;</span><img src=\\\"/site_images/s.gif\\\" width=\\\"3\\\" height=\\\"1\\\" alt=\\\"\\\" />\";\n\t} else {\n\t\tsHTML += \"<a href=\\\"\" + subsection[currentSection][currentIndex+1] + \"\\\" class=\\\"prevNextLink\\\">\" + nextText + \"</a><img src=\\\"/site_images/s.gif\\\" width=\\\"4\\\" height=\\\"1\\\" alt=\\\"\\\" /><span class=\\\"prevNextArrow\\\">&gt;</span><img src=\\\"/site_images/s.gif\\\" width=\\\"3\\\" height=\\\"1\\\" alt=\\\"\\\" />\";\n\t}\t\n\tsHTML += \"</td>\";\n\tsHTML += \"</tr>\";\n\tsHTML += \"</table>\";\n\n\t//alert(sHTML);\n\tdocument.write(sHTML);\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 internal_link() {\n var urlArray = window.location.href.split('#');\n if (urlArray.length == 2 && urlArray[1] != \"\") {\n switch (urlArray[1]) {\n case \"intro\": $('#tab-1-content').show(); break;\n case \"grants\": $('#tab-2-content').show(); break;\n case \"selectedpubs\": $('#tab-3-content').show(); break;\n case \"courses\": $('#tab-4-content').show(); break;\n case \"advising\": $('#tab-5-content').show(); break;\n case \"service\": $('#tab-6-content').show(); break;\n default: break;\n }\n }\n}", "function resolveURLSimple() {\n var docURL = document.URL;\n var theURLlen = docURL.length;\n var typeBegin = docURL.indexOf(\"?\");\n var typeEnd = docURL.indexOf(\"=\");\n if (typeBegin<1) {\n console.log(\"No parameters found in the URL.\");\n return;\n }\n else {\n var urlField = docURL.substring(typeBegin+1,typeEnd);\n var urlValue = docURL.substring(typeEnd+1,theURLlen).split(\",\");\n\n for (var i = 0; i < urlValue.length; i++) {\n urlValue[i] = urlValue[i].replace(\"_\", \" \");\n }\n\n for (var i = 0; i < urlValue.length; i++) {\n urlValue[i] = \"'\" + urlValue[i] + \"'\";\n }\n\n console.log(urlField,urlValue);\n return urlField, urlValue;\n }\n}", "function getValuesFromUrl() {\n var url_hash = window.location.hash.slice(1, window.location.hash.length).split('/');\n if (url_hash.length < 3 || parseFloat(url_hash[0]) === 'number') {\n url_hash = false;\n }\n return url_hash;\n }", "function expand(url, params, variables) {\n\n var tmpl = parse(url),\n expanded = tmpl.expand(params);\n\n if (variables) {\n variables.push.apply(variables, tmpl.vars);\n }\n\n return expanded;\n }", "function expand(url, params, variables) {\n\n var tmpl = parse(url),\n expanded = tmpl.expand(params);\n\n if (variables) {\n variables.push.apply(variables, tmpl.vars);\n }\n\n return expanded;\n }", "function getOutputUnit(){\n\t//Reference the form\n\tvar theForm = document.forms[\"conversion\"];\n\t//Reference the select box\n\tvar conv = theForm.elements[\"conversionType\"];\n\t//Get the value of the selection in the select box as a variable. \n\tvar unit = conv.value;\n\t//Set min and max of eventual substring funcion call\n\tvar max = unit.length;\n\tvar min = unit.length;\n\t//Loop decreases the min variable until it hits the hyphen\n\twhile( unit.substring( min, min + 1 ) != \"-\" ){\n\t\tmin = min - 1;\n\t}\n\t//Generate and return output.\n\tvar output = unit.substring( ( min + 1 ), max );\n\treturn output;\n}", "parse(url) {\n const p = new UrlParser(url);\n return new UrlTree(p.parseRootSegment(), p.parseQueryParams(), p.parseFragment());\n }", "parse(url) {\n const p = new UrlParser(url);\n return new UrlTree(p.parseRootSegment(), p.parseQueryParams(), p.parseFragment());\n }" ]
[ "0.57399017", "0.55339396", "0.55089235", "0.5478526", "0.5245436", "0.52014214", "0.51806206", "0.51796454", "0.51796454", "0.51796454", "0.51796454", "0.5109641", "0.5109641", "0.51018316", "0.5095522", "0.5089784", "0.5089784", "0.5089784", "0.50066376", "0.49780166", "0.49744242", "0.49657768", "0.49657768", "0.48233014", "0.4769604", "0.471231", "0.4682484", "0.46442086", "0.46416062", "0.45030606", "0.4479913", "0.44619983", "0.44595438", "0.44446138", "0.443503", "0.44133", "0.4401093", "0.4394325", "0.43767008", "0.4364666", "0.4352919", "0.4328304", "0.43271917", "0.43271917", "0.43238795", "0.43234828", "0.43142736", "0.43142736", "0.43039575", "0.43011785", "0.43000084", "0.4292686", "0.4287164", "0.428245", "0.42729932", "0.42729932", "0.42729932", "0.42485157", "0.42483798", "0.42471984", "0.4238664", "0.4233863", "0.42319813", "0.4224969", "0.42087647", "0.42050415", "0.4200028", "0.4191424", "0.4185576", "0.41850033", "0.4173712", "0.41706148", "0.41575468", "0.41409472", "0.41365203", "0.41278484", "0.41274357", "0.41268522", "0.41151682", "0.4109492", "0.40937763", "0.40937763", "0.40937763", "0.40937763", "0.40937763", "0.40937763", "0.40937763", "0.40937763", "0.40937763", "0.40937763", "0.40928033", "0.40863088", "0.408232", "0.407591", "0.4068528", "0.40668184", "0.40668184", "0.40642902", "0.40635705", "0.40635705" ]
0.7518052
0
Update the visibility of the navigation links to the previous and the next subunits. Hide the link to the previous subunit when the user is at the first subunit. Hide the link to the next subunit when the user is already at the last subunit. Display both links otherwise.
function updateNavigationLinks() { if (currentSubunitIsTheFirstSubunit()) { my.html.previousLink.style.visibility = 'hidden' my.html.nextLink.style.visibility = 'visible' } else if (currentSubunitIsTheLastSubunit()) { my.html.previousLink.style.visibility = 'visible' my.html.nextLink.style.visibility = 'hidden' } else { my.html.previousLink.style.visibility = 'visible' my.html.nextLink.style.visibility = 'visible' } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function displaySubunitLinks()\n {\n // Delete all existing subunit links\n var linksDiv = my.html.subunitLinks\n while (linksDiv.firstChild &&\n linksDiv.firstChild.className != 'stretch') {\n\n linksDiv.removeChild(linksDiv.firstChild)\n }\n\n // Create new subunit links for the unit m\n var numberOfSubunits = my.current.subunitTitles.length\n for (var i = numberOfSubunits - 1; i >= 0; i--) {\n // Insert whitespaces between div elements, otherwise they\n // would not be justified\n var whitespace = document.createTextNode('\\n')\n linksDiv.insertBefore(whitespace, linksDiv.firstChild)\n\n var label = my.current.subunitTitles[i]\n var selected = (i + 1 == my.current.subunitNo)\n var href = unitHref(my.current.unitNo, i + 1)\n\n var subunitDiv = boxedLink(label, selected, href)\n subunitDiv.id = 'subunit' + (i + 1)\n subunitDiv.style.width = (95 / numberOfSubunits) + '%'\n\n linksDiv.insertBefore(subunitDiv, linksDiv.firstChild)\n }\n }", "function displayAlternateUnitLinks()\n {\n // If alternate unit is not available for the current unit,\n // hide the alternate links element\n if (!alternateUnitAvailable(my.current.unitNo)) {\n alternateUnitLinks.style.visibility = 'hidden'\n return\n }\n\n // Delete all existing alternate unit links\n Util.removeChildren(alternateUnitLinks)\n\n // Create div elements for the main unit and alternate unit\n var mainUnitElement =\n boxedLink(Units.mainLabel,\n my.settings.unit == my.UNIT.MAIN,\n '#', toggleUnit)\n\n var alternateUnitElement =\n boxedLink(Units.alternateLabel,\n my.settings.unit == my.UNIT.ALTERNATE,\n '#', toggleUnit)\n\n alternateUnitLinks.appendChild(mainUnitElement)\n alternateUnitLinks.appendChild(alternateUnitElement)\n alternateUnitLinks.style.visibility = 'visible'\n }", "function updateNavVisibility(){if(!nav||navAsThumbnails){return;}getVisibleNavIndex();if(visibleNavIndexes!==visibleNavIndexesCached){forEachNodeList(navItems,function(el,i){if(visibleNavIndexes.indexOf(i)<0){hideElement(el);}else{showElement(el);}});// cache visible nav indexes\nvisibleNavIndexesCached=visibleNavIndexes;}}", "function updateNavigation() {\n\tif ($(document.body).hasClass('single-page')){\n\t\treturn;\n\t}\n\n\t$(\".toc .topic-link + ul\").hide();\n\n\tvar li = $(\".toc li\");\n\tvar next, prev;\n\t$.each(li, function(i, e){\n\t\tif ($(\".topic-link.active\").closest(\"li\").get(0) === this) {\n\t\t\tnext = $(li.get(i+1)).find(\".topic-link:first\");\n\t\t\tif (i>0){\n\t\t\t\tprev = $(li.get(i-1)).find(\".topic-link:first\");\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t});\n}", "function updateNavVisibility () {\n if (!nav || navAsThumbnails) { return; }\n\n if (pages !== pagesCached) {\n var min = pagesCached,\n max = pages,\n fn = showElement;\n\n if (pagesCached > pages) {\n min = pages;\n max = pagesCached;\n fn = hideElement;\n }\n\n while (min < max) {\n fn(navItems[min]);\n min++;\n }\n\n // cache pages\n pagesCached = pages;\n }\n }", "function updateNavigation()\r\n {\r\n $('#linkLogin').hide();\r\n $('#linkRegister').hide(); \r\n $('#linkListBooks').show();\r\n $('#linkCreateBook').show();\r\n $('#linkLogout').show();\r\n showPage('viewBooks');\r\n }", "function update(){\r\n if(currentIndex === 0){\r\n $nav.find(\".prev\").hide();\r\n }else{\r\n $nav.find(\".prev\").show();\r\n }\r\n\r\n\r\n\r\n if(currentIndex === $slides.length - 1 ){\r\n $nav.find(\".next\").hide();\r\n }else{\r\n $nav.find(\".next\").show();\r\n }\r\n }", "function toggleSubNav (listObjID, linkObj) {\n var listObj = document.getElementById(listObjID);\n // If sub nav items are hidden, show them\n if (listObj.style.display === \"none\") {\n listObj.style.display = \"block\";\n linkObj.querySelector(\".expandPlusSign\").style.display = \"none\";\n linkObj.querySelector(\".collapseMinusSign\").style.display = \"inline-block\";\n linkObj.querySelector(\".grayArrowLine\").style.display = \"block\";\n linkObj.setAttribute(\"aria-expanded\", true);\n }\n // If sub nav items are shown, hide them\n else {\n listObj.style.display = \"none\";\n linkObj.querySelector(\".expandPlusSign\").style.display = \"inline-block\";\n linkObj.querySelector(\".collapseMinusSign\").style.display = \"none\";\n linkObj.querySelector(\".grayArrowLine\").style.display = \"none\";\n linkObj.setAttribute(\"aria-expanded\", false);\n }\n}", "function displayUnitLinks()\n {\n // Delete all existing unit links\n var linksDiv = my.html.unitLinks\n Util.removeChildren(linksDiv)\n\n // Create new unit links\n for (var i = 0; i < Units.main.length; i++) {\n var label = 'སློབ་མཚན། ' + (i + 1)\n var selected = (i + 1 == my.current.unitNo)\n var href = unitHref(i + 1)\n\n var divElement = boxedLink(label, selected, href)\n divElement.id = 'unit' + (i + 1)\n divElement.title = unit(i + 1).title\n\n linksDiv.appendChild(divElement)\n }\n }", "setupSubLinks() {\n for (let subLink in this.subLinks) {\n this.subLinks[subLink].addEventListener(\"click\", (e) => {\n let linkID = e.target.id;\n if (linkID === \"\") {\n linkID = e.target.parentNode.id;\n }\n let subViewToShow = linkID.slice(0, -5);\n this.showSubView(subViewToShow);\n });\n }\n }", "function recalculateNavigationVisibility() {\r\n // TODO: Do this with a CSS class\r\n if (NUM_ACTIVE_REQUESTS > 0) {\r\n document.getElementsByClassName(\"comic-navigation\")[0].style.opacity = 0.5;\r\n } else {\r\n document.getElementsByClassName(\"comic-navigation\")[0].style.opacity = 1.0;\r\n }\r\n\r\n var page = getActivePageData()\r\n\r\n if (page === undefined) {\r\n // We're still loading\r\n return;\r\n }\r\n\r\n // TODO: Change these into CSS class for \"hidden\"\r\n if (page.slug === page.last) {\r\n document.getElementById(\"navigation-next\").style.display = \"none\";\r\n document.getElementById(\"navigation-last\").style.display = \"none\";\r\n } else {\r\n document.getElementById(\"navigation-next\").style.display = \"\";\r\n document.getElementById(\"navigation-last\").style.display = \"\";\r\n }\r\n if (page.slug === page.first) {\r\n document.getElementById(\"navigation-previous\").style.display = \"none\";\r\n document.getElementById(\"navigation-first\").style.display = \"none\";\r\n } else {\r\n document.getElementById(\"navigation-previous\").style.display = \"\";\r\n document.getElementById(\"navigation-first\").style.display = \"\";\r\n }\r\n\r\n document.getElementById(\"navigation-first\").blur();\r\n document.getElementById(\"navigation-previous\").blur();\r\n document.getElementById(\"navigation-next\").blur();\r\n document.getElementById(\"navigation-last\").blur();\r\n }", "function updateButtonDisplay () {\n\t\tvar isFirst = !!document.querySelector('.more-views .selected:first-child');\n\t\tvar isLast = !!document.querySelector('.more-views .selected:last-child');\n\n\t\tisLast ? nextButton.hide() : nextButton.show();\n\t\tisFirst ? previousButton.hide() : previousButton.show();;\n\t}", "function _updateThumbnailNavigation() {\n\t\tvar\n\t\t\tdiff = _safeWidth(thumbs.parent()) - _safeWidth(thumbs),\n\t\t\tpos = _getRTLPosition(thumbs);\n\t\tbtnScrollBack.toggleClass(CLASS_HIDDEN, pos >= 0);\n\t\tbtnScrollForward.toggleClass(CLASS_HIDDEN, diff > 0 || pos <= diff);\n\t}", "function setPageNavigation(list) {\n let liprev = document.getElementById('itemPage');\n let total = 0;\n if (list.length == 0) {\n document.getElementById('myPageNavigation').className = 'hide';\n } else {\n document.getElementById('myPageNavigation').className = 'd-flex justify-content-center';\n if (list.length % 10 == 0) {\n total = list.length / 10;\n totaltemp = total;\n } else {\n total = parseInt(list.length / 10) + 1;\n totaltemp = total;\n }\n liprev.innerHTML = '';\n for (let i = itemnavigate; i <= total; i++) {\n if (i >= itemnavigate && i <= itemnavigate + 4) {\n let li = document.createElement('li');\n let a = `<a class=\"page-link mylink\" href=\"#menuFeature\">${i}</a>`;\n li.innerHTML = a;\n liprev.appendChild(li);\n setEvenItemPageNavigate(li, list);\n if (i == itempage) {\n li.className = 'page-item textdecoration';\n li.setAttribute('id', 'active');\n } else {\n li.className = 'page-item';\n }\n }\n }\n if (total == 1) {\n document.getElementById('buttonprev').className = 'page-link mylink hide';\n document.getElementById('buttonnext').className = 'page-link mylink hide';\n } else {\n if (document.getElementById('active').firstChild.innerHTML == 1) {\n document.getElementById('buttonprev').className = 'page-link mylink hide';\n document.getElementById('buttonnext').className = 'page-link mylink show';\n } else if (document.getElementById('active').firstChild.innerHTML == total) {\n document.getElementById('buttonprev').className = 'page-link mylink show';\n document.getElementById('buttonnext').className = 'page-link mylink hide';\n } else {\n document.getElementById('buttonprev').className = 'page-link mylink show';\n document.getElementById('buttonnext').className = 'page-link mylink show';\n }\n }\n }\n}", "toggleChildren() {\n\t\tthis.setState({\n\t\t\tlinksVisible: !this.state.linksVisible\n\t\t});\n\t}", "function arrowVisibility () {\n if (thisEmployee.parent().next().length == 0) {\n $('#next').hide();\n } else {\n $('#next').show();\n }\n\n if (thisEmployee.parent().prev().length == 0) {\n $('#previous').hide();\n } else {\n $('#previous').show();\n }\n }", "function showMobileSubLInks(link){ \n let icon=link.children[1];\n let childUL=link.children[2];\n if(childUL.classList.contains('hide-mobile-sub-ul')){ \n $SC(icon, 'fa-angle-down', 'fa-angle-up');\n $SC(childUL, 'hide-mobile-sub-ul', 'show-mobile-sub-ul');\n } else{ \n $SC(icon, 'fa-angle-up', 'fa-angle-down');\n $SC(childUL, 'show-mobile-sub-ul', 'hide-mobile-sub-ul');\n }\n}", "function displayLinks (startIndex, numLinks) {\n\n for (let index = 0; index < linksToDisplay.length; index += 1) {\n if ((index >= startIndex) && (index < startIndex + numLinks)) {\n linksToDisplay[index].style.display = \"\";\n } else {\n linksToDisplay[index].style.display = \"none\";\n }\n }\n\n}", "function unitListVisible() {\n setVisible(!visible);\n }", "visibilityChanged()\n {\n super.visibilityChanged();\n\n if(!this.visibleRecursively)\n this.dropdownOpener.visible = false;\n }", "function recalculateNavigationVisibility() {\r\n // TODO: This might be re-rendering the page too often because it's messing with the style directly.\r\n // TODO: Do this with a CSS class\r\n if (NUM_ACTIVE_REQUESTS > 0) {\r\n setOpacity(\".navigation-wrapper\", 0.5);\r\n } else {\r\n setOpacity(\".navigation-wrapper\", 1);\r\n }\r\n\r\n const page = getActivePageData();\r\n\r\n if (page === undefined) {\r\n // We're still loading\r\n return;\r\n }\r\n\r\n // TODO: Change these into CSS class for \"hidden\"\r\n if (page.slug === page.last) {\r\n setOpacity(\".navigation-next, .navigation-last\", 0);\r\n } else {\r\n setOpacity(\".navigation-next, .navigation-last\", 1);\r\n }\r\n if (page.slug === page.first) {\r\n setOpacity(\".navigation-previous, .navigation-first\", 0);\r\n } else {\r\n setOpacity(\".navigation-previous, .navigation-first\", 1);\r\n }\r\n\r\n document.querySelectorAll(\".navigation-first, .navigation-previous, .navigation-next, .navigation-last\").forEach(function (e) {\r\n e.blur();\r\n });\r\n }", "function updateDirButtonsVisibility(){\r\n $magnifier.find('.button').show();\r\n if (current === 1 ){\r\n $magnifier.find('.button[data-dir=\"prev\"]').hide();\r\n } else if (current === numberOfImages){\r\n $magnifier.find('.button[data-dir=\"next\"]').hide();\r\n }\r\n }", "function toggleRels() {\n\tif($('#cont_rels').css('display') == 'none') {\n\t\t$('#cont_rels').css('display', 'block');\n\t\t$('#cont_rels_link').html('- Similar movies');\n\t} else {\n\t\t$('#cont_rels').css('display', 'none');\n\t\t$('#cont_rels_link').html('+ Similar movies');\n\t}\n}", "function conservationCon() {\n console.log(\"Links Changed\")\n document.getElementById(\"subLinks\").innerHTML = \"\";\n document.getElementById(\"subLinks\").innerHTML = \"<h3>Conservation</h3><ul><li><a href='#'><h4>Carolinian Canada</h4></a></li><li><a href='#'><h4>Friends of the Thames / Thames River Cleanup</h4></a></li><li><a href='#'><h4>Nature London</h4></a></li><li><a href='#'><h4>North Shore Steelhead Association</h4></a></li><li><a href='#'><h4>Ontario Streams</h4></a></li><li><a href='#'><h4>Ontario Federation of Anglers and Hunters</h4></a></li><li><a href='#'><h4>Trout Unlimited Canada</h4></a></li></ul>\";\n}", "function ShowNextPrevButtons(lastpage)\n{\n // Show Prev and Next buttons if there is more than 1 page.\n if (lastpage > 1)\n {\n $(\"#prev\").css(\"visibility\", \"visible\");\n $(\"#next\").css(\"visibility\", \"visible\");\n }\n else \n {\n $(\"#prev\").css(\"visibility\", \"hidden\");\n $(\"#next\").css(\"visibility\", \"hidden\"); \n } \n}", "updateMenuItemsDisplay () {\n const pg = this.page\n if (!pg) {\n // initial page load, header elements not yet attached but menu items\n // would already be hidden/displayed as appropriate.\n return\n }\n if (!this.user.authed) {\n Doc.hide(pg.noteMenuEntry, pg.walletsMenuEntry, pg.marketsMenuEntry, pg.profileMenuEntry)\n return\n }\n Doc.show(pg.noteMenuEntry, pg.walletsMenuEntry, pg.profileMenuEntry)\n if (Object.keys(this.user.exchanges).length > 0) {\n Doc.show(pg.marketsMenuEntry)\n } else {\n Doc.hide(pg.marketsMenuEntry)\n }\n }", "function showHidePanels() {\n // Show the next\n $('#banners ul li h2 a').not('li li').eq(currentNode).addClass('active');\n $('#banners li').not('li li').eq(currentNode).find('ul').slideDown();\n $('#banners li').not('li li').eq(currentNode).find('img').fadeIn();\n // Hide the previous\n $('#banners ul li h2 a').not('li li').eq(previousNode).removeClass('active');\n $('#banners li').not('li li').eq(previousNode).find('ul').slideUp();\n $('#banners li').not('li li').eq(previousNode).find('img').fadeOut();\n }", "function lijstSubMenuItem() {\n\n if ($mLess.text() == \"meer\") {\n $mLess.text(\"minder\")\n } else {\n $mLess.text(\"meer\");\n\n }\n $list.toggleClass('hidden')\n $resum.get(0).scrollIntoView('slow');\n event.preventDefault()\n }", "function _toggleButtons(){\n\n\t\t\t\tif($nav.children('.fn-previous-button').is(':hidden')){\n\t\t\t\t\t$nav.children('.fn-previous-button, .fn-next-button').show();\n\t\t\t\t \t$nav.children('.fn-close-button').hide();\n\t\t\t\t }\n\t\t\t\telse {\n\t\t\t\t\t$nav.children('.fn-previous-button, .fn-next-button').hide();\n\t\t\t\t \t$nav.children('.fn-close-button').show();\n\t\t\t\t}\n\t\t\t}", "function showNextSection(current, next) {\r\n document.getElementById(`rules-title`).style.display = `none`;\r\n document.getElementById(current).style.display = `none`;\r\n document.getElementById(next).style.display = `block`;\r\n}", "function showSubpages(subpage1, subpage2, subpage3, subpage4, subpage5, subpage6) {\n var subpages = [subpage1, subpage2, subpage3, subpage4, subpage5, subpage6];\n var i = 0;\n var x;\n for(var i = 0; i < subpages.length; i++) {\n if(subpages[i] == null) {\n break;\n }\n x = document.getElementById(subpages[i]);\n if (x.className === \"subpage-button\") {\n x.className += \" open\";\n }\n else {\n x.className = \"subpage-button\";\n }\n }\n}", "function UpdateLinks(Cont) {\n var ObjContainer = (Cont != undefined) ? Cont : MainMenu;\n // Do some init here.\n $(ObjContainer).children(\"ul\").find(\"li\").click(function (event) {\n var elem = $(this).children('a');\n if ($(MainContainer).find(\".menu\").filter(\":visible\").length > 1) {\n //console.log($(\".menu\").filter(\":visible\").length);\n return;\n }\n // Check if it has a child so we know if we execute the link or the child.\n event.preventDefault();\n event.stopPropagation();\n\n if (elem.data().smoothscroll) {\n if (!elem.data('onepage-section') && window.smoothScrollGetAnchors) {\n window.smoothScrollGetAnchors();\n }\n Visible = false;\n Self.Show(Visible);\n elem.trigger('click.onepage');\n return;\n }\n\n if (elem.parent().has(\"ul\").length) {\n Self.GoToSubmenu(\"\", elem);\n event.preventDefault();\n event.stopPropagation();\n } else {\n if (elem.length > 0 && elem.attr('href')) {\n window.location = elem.attr('href');\n }\n $(MenuButton).children(\"span.caption\").children(\"p.xtd_menu_ellipsis\").html(elem.children(\"p\").html());\n if (Visible) {\n Self.Show(Visible = !Visible);\n }\n }\n }\n ).on('touchstart', function () {\n $(this).addClass('clicked');\n }).on('touchend', function () {\n $(this).removeClass('clicked');\n }).on('touchmove', function () {\n $(this).removeClass('clicked');\n });\n }", "function processSubButton() {\n\tdocument.querySelector('#large-sub-list').classList.toggle(\"hidden\");\n\tdocument.querySelector('#small-sub-list').classList.toggle(\"hidden\");\t\n}", "function showSubUL(img, subUL){\n $SC(img, 'fa-angle-down', 'fa-angle-up' ); \n $SC(subUL, 'hide-sub-ul' , 'show-sub-ul' );\n}", "function showHideSubNav(i) {\n\t\t$(mainNavArr[i]).hover(function() {\n\t\t\t$(subNavArr[i]).addClass('active');\t\n\t\t});\n\t\t$(subNavArr[i]).hover(function() {\n\t\t\t$(subNavBlock).css('display', 'block');\n\t\t\t$(subNavArr[i]).addClass('active');\n\t\t\tclearTimeout(timer);\n\t\t},\n\t\t\tfunction() {\n\t\t \t$(subNavBlock).hide();\n\t\t \t$(subNavArr).removeClass('active');\n\t\t \thideNavArrow();\t\n\t\t});\n\t}", "redrawNavPanel()\n {\n \tlet self = this;\n \t\n \tlet b = 0;\n \tlet sect = false;\n \tfor( let a in self.sections )\n\t\t{\n\t\t\tif( a == self.activeSection )\n\t\t\t\tsect = self.sections[ a ];\n\t\t}\n\t\tif( !sect ) return;\n\t\t\n\t\t// Make next prev\n\t\tif( !this.#navbarAdded )\n\t\t{\n\t\t\tthis.#navbarAdded = true;\n\t\t\tlet str = '';\n\t\t\tstr += '<div class=\"Previous\"><span>Previous</span></div><div class=\"Pages\"></div><div class=\"Next\"><span>Next</span></div>';\n\t\t\tthis.navpanel.innerHTML = str;\n\t\t}\n\t\t\n\t\tthis.navpanel.querySelector( '.Pages' ).innerHTML = '';\n\t\tthis.navpanel.querySelector( '.Pages' ).classList.add( 'SmoothScrolling' );\n\t\t\n\t\tlet offset = 0;\n\t\t\n\t\tif( sect.pages )\n\t\t{\n\t\t\t// First pass, check active page\n\t\t\tif( !self.currentPage )\n\t\t\t{\n\t\t\t\tfor( let a = 0; a < sect.pages.length; a++ )\n\t\t\t\t{\n\t\t\t\t\tif( sect.pages[a].ID == self.storedActivePage || ( self.storedActivePage == -1 && a == 0 ) )\n\t\t\t\t\t{\n\t\t\t\t\t\tself.currentPage = a;\n\t\t\t\t\t\t//console.log( 'Found current page ' + a + ' where stored is ' + self.storedActivePage + ' and this page is ' + sect.pages[a].ID );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tlet activePage = false;\n\t\t\tfor( let a = 0; a < sect.pages.length; a++ )\n\t\t\t{\n\t\t\t\tlet p = document.createElement( 'div' );\n\t\t\t\tp.className = 'PageElement';\n\t\t\t\tp.style.left = ( ( a * 40 ) - offset ) + 'px';\n\t\t\t\tif( self.currentPage == a )\n\t\t\t\t{\n\t\t\t\t\tp.classList.add( 'ActivePage' );\n\t\t\t\t\tactivePage = p;\n\t\t\t\t}\n\t\t\t\tp.innerHTML = '<span>' + ( a + 1 ) + '</span>';\n\t\t\t\t( function( pag, num )\n\t\t\t\t{\n\t\t\t\t\tif( self.getCurrentSection().Navigation == '1' )\n \t\t\t\t{\n\t\t\t\t\t\tpag.onclick = function()\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif( self.completed ) return;\n\t\t\t\t\t\t\tself.currentPage = num;\n\t\t\t\t\t\t\tself.renderElements();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} )( p, a );\n\t\t\t\tthis.navpanel.querySelector( '.Pages' ).appendChild( p );\n\t\t\t}\n\t\t\t\n\t\t\tlet pid = sect.pages[ self.currentPage ].ID;\n\t\t\t\n\t\t\t//console.log( 'Setting current page: ', self.currentPage + ' ' + pid );\n\t\t\t\n\t\t\t// Set active page\n\t\t\tlet csid = this.#courseSessionId;\n\t\t\t\n\t\t\t// Scroll into view\n\t\t\tif( activePage )\n\t\t\t{\n\t\t\t\tactivePage.parentNode.scrollTo( activePage.offsetLeft - 100, 0 );\n\t\t\t}\n\t\t\t\n\t\t\t// Workaround on saving issue..\n\t\t\tsetTimeout( function()\n\t\t\t{\n\t\t\t\tlet mo = new Module( 'system' );\n\t\t\t\tmo.execute( 'appmodule', {\n\t\t\t\t\tappName: 'Courses',\n\t\t\t\t\tcommand: 'setsessioninfo',\n\t\t\t\t\tcurrentPageId: pid,\n\t\t\t\t\tcourseSessionId: csid\n\t\t\t\t} );\n\t\t\t}, 250 );\n\t\t}\n\t\t\n\t\t// Set active section\n\t\tlet m = new Module( 'system' );\n\t\tm.execute( 'appmodule', {\n\t\t\tappName: 'Courses',\n\t\t\tcommand: 'setsessioninfo',\n\t\t\tcurrentSectionId: self.getCurrentSection().ID,\n\t\t\tcourseSessionId: this.#courseSessionId\n\t\t} );\n\t\t\n\t\tthis.navpanel.querySelector( '.Previous' ).onclick = function()\n\t\t{\n\t\t\tif( self.completed ) return;\n\t\t\tif( self.getCurrentSection().Navigation == '1' )\n\t\t\t{\n\t\t\t\tself.currentPage--;\n\t\t\t\tif( self.currentPage < 0 ) \n\t\t\t\t{\n\t\t\t\t\tself.currentPage = 0;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tself.renderElements();\n\t\t\t}\n\t\t}\n \t\t\n\t\tthis.navpanel.querySelector( '.Next' ).onclick = function()\n\t\t{\n\t\t\tif( self.completed ) return;\n\t\t\tif( self.pageCompleted() )\n\t\t\t{\n\t\t\t\tself.currentPage++;\n\t\t\t\tif( self.currentPage >= self.sections[ self.activeSection ].pages.length )\n\t\t\t\t{\n\t\t\t\t\t// Check if there's a next section\n\t\t\t\t\tlet b = 0;\n\t\t\t\t\tlet current = 0;\n\t\t\t\t\tfor( let a in self.sections )\n\t\t\t\t\t{\n\t\t\t\t\t\tif( a == self.activeSection )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcurrent = b;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tb++;\n\t\t\t\t\t}\n\t\t\t\t\tb = 0;\n\t\t\t\t\tfor( let a in self.sections )\n\t\t\t\t\t{\n\t\t\t\t\t\t// This is the next section\n\t\t\t\t\t\tif( b == current + 1 )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tself.activeSection = a;\n\t\t\t\t\t\t\tself.currentPage = 0;\n\t\t\t\t\t\t\tself.refreshStructure();\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tb++;\n\t\t\t\t\t}\n\t\t\t\t\tself.currentPage--;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tself.renderElements();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tconsole.log( 'This page is not solved.' );\n\t\t\t}\n\t\t}\n }", "function pageVisibility() {\n //affichage de la pagination si le contenu est suffisant\n if (globalData.length > 15){\n document.getElementById(\"pg\").innerHTML = page+1;\n console.log(\"display\");\n document.getElementById(\"pagination\").style.display = \"block\";\n console.log(document.getElementById(\"pagination\").style.display);\n }\n else{\n //pagination invisible\n document.getElementById(\"pagination\").style.display = \"none\";\n }\n\n //premiére page \n if (page == 0 ) {\n // rendre la page précedente non clickable\n var leftArrow = document.getElementById(\"la\");\n leftArrow.classList.add(\"nonClickable\");\n leftArrow.style.color = \"grey\";\n }\n\n //derniére page \n if ((page+1) * 15 > globalData.length) {\n // rendre la page suivante non clickable\n var rightArrow = document.getElementById(\"ra\");\n rightArrow.classList.add(\"nonClickable\");\n rightArrow.style.color = \"grey\"; \n \n } else{\n\n var rightArrow = document.getElementById(\"ra\");\n rightArrow.classList.remove(\"nonClickable\");\n rightArrow.style.color = \"black\"; \n }\n\n // toutes les pages sauf la premiére\n if (page > 0) {\n var leftArrow = document.getElementById(\"la\");\n leftArrow.classList.remove(\"nonClickable\");\n leftArrow.style.color = \"black\";\n }\n\n}", "function updateNavButtons() {\n const prevButton = document.getElementById('modal-prev');\n const nextButton = document.getElementById('modal-next');\n\n if (currentEmployeeIndex === 0) {\n prevButton.disabled = true;\n } else {\n prevButton.disabled = false;\n }\n\n if (currentEmployeeIndex === displayedEmployees.length - 1) {\n nextButton.disabled = true;\n } else {\n nextButton.disabled = false;\n }\n}", "function showpages_sub(page){\n var p1 = document.getElementById(page).getAttribute(\"id\");\n if (p1==\"page1-sub\"){\t\n document.getElementById(\"page1-sub\").style.display='block';\t\n document.getElementById(\"page2-sub\").style.display='none'; \t\n }\n else if (p1==\"page2-sub\"){\n document.getElementById(\"page1-sub\").style.display='none';\t\n document.getElementById(\"page2-sub\").style.display='block'; \t \n }\n}", "_toggleNavigationElementsVisibility() {\n const that = this,\n numberOfTabs = that._tabs.length;\n let action;\n\n if (numberOfTabs === 0) {\n action = 'addClass';\n }\n else if (numberOfTabs === 1) {\n action = 'removeClass';\n }\n else {\n return;\n }\n\n if (that.tabLayout === 'scroll' && that.overflow === 'scroll') {\n that.$scrollButtonNear[action]('jqx-hidden');\n that.$scrollButtonFar[action]('jqx-hidden');\n }\n else if (that.tabLayout === 'dropDown') {\n that.$dropDownButton[action]('jqx-hidden');\n }\n }", "function hideNextPrev(el) {\n var lastIsVisible = (($(el).children('li').last().offset().left + $(el).children('li').last().outerWidth(true) - $(el).parent().offset().left) <= $(el).parent().outerWidth(true));\n if (lastIsVisible) {\n $(el).parent().find(\"a.move-next\").hide();\n }\n else {\n $(el).parent().find(\"a.move-next\").show();\n }\n\n var firstIsVisible = (($(el).children('li').first().offset().left - $(el).parent().offset().left) >= 0);\n if (firstIsVisible) {\n $(el).parent().find(\"a.move-prev\").hide();\n }\n else {\n $(el).parent().find(\"a.move-prev\").show();\n }\n }", "function show()\r\n{\r\n // show the sub menu\r\n this.getElementsByTagName('ul')[0].style['visibility'] = 'visible';\r\n var currentNode=this;\r\n while(currentNode)\r\n {\r\n if( currentNode.nodeName=='LI')\r\n {\r\n currentNode.getElementsByTagName('a')[0].className = 'linkOver';\r\n }\r\n currentNode=currentNode.parentNode;\r\n }\r\n // clear the timeout\r\n eval ( \"clearTimeout( timeout\"+ this.id +\");\" );\r\n hideAllOthersUls( this );\r\n}", "function hideLinks (numCurrMatches) {\n\n // Loops through all of the pagination buttons and hides them if not needed\n for (let index = 0; index < paginationLinks.length; index += 1) {\n\n // Makes it so a button is displayed for every page of 10 people\n if (index*10 < numCurrMatches) {\n paginationLinks[index].style.display = \"\";\n }\n\n // Hides unneeded buttons\n else {\n paginationLinks[index].style.display = \"none\";\n }\n }\n\n}", "showNext() {\n if (this.visibleIndex === (this.parts.length - 1)) {\n return;\n }\n this.parts[++this.visibleIndex].setVisible(true);\n }", "function setSubsectionState() {\n if ($target.attr(\"aria-hidden\") == \"true\") {\n $subsection.removeClass('is-open');\n $subsection.addClass('is-closed');\n }\n else {\n $subsection.removeClass('is-closed');\n $subsection.addClass('is-open');\n }\n }", "function Link1(){\n $('#nav2,#nav3,#nav4').hide();\n $('#nav1').show('slow');\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 displayRightPagination(){\n\tvar ul,li=[],pagesHidden,nextToDisplay=1;\n\tvar pagination = document.getElementById(\"customPagination\");\n\tif(pagination){\n\t\t ul = document.getElementById(\"ulPagination\");\n\t\tif(ul){\n\t\t\tli = ul.getElementsByClassName(\"customLink\");\n\t\t}\n\t}\n\tfor(i=0;i<li.length;i++){\n\t\tif(li[i].style.display==\"\"){\n\t\t\tpagesHidden = i;\n\t\t\tli[i].style.display=\"none\"\n\t\t}\n\t}\n\tif(pagesHidden>=0){\n document.getElementById(\"prev\").style.display=\"\";\n\t}\n\tfor(i=pagesHidden;i<li.length;i++){\n\t\tif(nextToDisplay <= 3){\n\t\tif(li[i].style.display==\"none\"){\n\t\t\tnextToDisplay = nextToDisplay+1;\n\t\t\tli[i].style.display=\"\";\n\t\t}\n\t\t}\n\t}\n}", "function buttonDisplay() {\n var firstButton = gAppState.checkId(\"firstBtnID\", \"firstBtnID2\");\n var nextButton = gAppState.checkId(\"nextBtnID\", \"nextBtnID2\");\n var prevButton = gAppState.checkId(\"prevBtnID\", \"prevBtnID2\");\n var lastButton = gAppState.checkId(\"lastBtnID\", \"lastBtnID2\");\n var remainder = tableSize - limit;\n\n if (offset < remainder) { // if there is a next page\n if (nextButton.classList.contains('disabled')) { // show next button\n nextButton.classList.remove('disabled');\n }\n if (lastButton.classList.contains('disabled')) { // show last button\n lastButton.classList.remove('disabled');\n }\n } else { // if there is not a next page\n if (!nextButton.classList.contains('disabled')) { // hide next button\n nextButton.classList.add('disabled');\n }\n if (!lastButton.classList.contains('disabled')) { // hide last button\n lastButton.classList.add('disabled');\n }\n }\n\n if (offset > 0) { // if there is a previous page\n if (prevButton.classList.contains('disabled')) { // show prev button\n prevButton.classList.remove('disabled');\n }\n if (firstButton.classList.contains('disabled')) { // show first button\n firstButton.classList.remove('disabled');\n }\n } else { // if there is not a previous page\n if (!prevButton.classList.contains('disabled')) { // hide prev button\n prevButton.classList.add('disabled');\n }\n if (!firstButton.classList.contains('disabled')) { // hide first button\n firstButton.classList.add('disabled');\n }\n }\n}", "function Link2(){\n $('#nav1,#nav3,#nav4').hide();\n $('#nav2').show('slow');\n}", "function showSubMenu(link){ \n let img=link.children[1];\n const subUL=link.children[2];\n \n if(subUL.classList.contains('hide-sub-ul')){\n showSubUL(img, subUL);\n } else {\n hideSubUL(img, subUL);\n }\n}", "function createPaginationLinks () {\n // Calculates the amount of paginated links based on length of the visibleStudents[] array\n const pageCount = visibleStudents.length / 10.0;\n\n // Removes any current paginated links that may exist on the page already\n if (document.getElementsByClassName('pagination')[0] != null) {\n document.getElementsByClassName('pagination')[0].remove();\n }\n\n // Adds a <div> tag to hold paginated list <ul> tag and page link <li> tags\n // Adds a DOM Element Reference to the newly created <div> tag\n let newPaginationDiv = document.createElement('div');\n newPaginationDiv.className = 'pagination';\n page[0].appendChild(newPaginationDiv);\n const paginationDiv = document.getElementsByClassName('pagination')[0];\n\n // Adds a paginated list <ul> tag to hold page link <li> tags\n // Adds a DOM Element Reference to the newly created <ul> tag\n let newPaginationUl = document.createElement('ul');\n paginationDiv.appendChild(newPaginationUl);\n const paginationUl = paginationDiv.children[0];\n\n // For loop to add page link <li> and nested link <a> tags to paginated list <ul> tag\n // Event Listener is added to each page link <li> nested <a> tag on click to change the set of displayed students\n for (let i = 0; i <= pageCount; i++) {\n let newPaginationLi = document.createElement('li');\n paginationUl.appendChild(newPaginationLi);\n \n let paginationLi = paginationUl.children[i];\n \n let newPaginationLink = document.createElement('a');\n newPaginationLink.href = '#';\n newPaginationLink.textContent = i + 1;\n paginationLi.appendChild(newPaginationLink);\n\n let paginationLink = paginationLi.children[0];\n paginationLink.addEventListener('click', (e) => {\n studentVisibility(parseInt(e.target.textContent));\n }, false);\n }\n\n // Sets the first pagination link to to active once the createPaginationLinks() Function is called\n document.querySelector('a').className = 'active';\n}", "function createNav(page, isLast) {\n var pageNum = parseInt(page);\n var next = pageNum - 1;\n var prev = pageNum + 1;\n \n if(pageNum == 0) {\n document.getElementById(\"next\").style.display = \"none\";\n }\n \n if(isLast) {\n document.getElementById(\"prev\").style.display = \"none\";\n }\n \n document.getElementById(\"next\").innerHTML = \"<a class='nav-link' href='./?=\" + next + \"'><span class='nav-text'>Next</span> →</a>\";\n document.getElementById(\"prev\").innerHTML = \"<a class='nav-link' href='./?=\" + prev + \"'>← <span class='nav-text'>Prev</span></a>\";\n}", "function hideSubs() {\n\t\tfor (var i = displayedSubmenuSelector.length - 1; i >= 0; i--) {\n\t\t\tdisplayedSubmenuSelector[i].setAttribute('style', 'display:none');\n\t\t}\n\n\t\t// clearing our temporary array\n\t\tdisplayedSubmenuSelector = [];\n\t\tconsole.log('hide subs!');\n\t}", "function hideNav() {\r\n if (isNavVisible === true) {\r\n noNav();\r\n\r\n } else {\r\n yesNav();\r\n }\r\n}", "function sb_writeSubsectionNav () {\n\tvar sHTML = \"\";\n\tvar currentLocation = location.href;\n\tcurrentLocation = currentLocation.slice(currentLocation.lastIndexOf(\"/\")+1);\n\tcurrentSection = -1;\n\tcurrentIndex = -1;\n\t\n\t//alert(\"currentIndex = \"+currentIndex);\n\t\n\tfor (i=0; (i<subsection.length) && (currentSection < 0); i++) {\n\t\tfor (j=0; (j<subsection[i].length) && (currentIndex < 0); j++) {\n\t\t\tif (subsection[i][j].indexOf(currentLocation) != -1) {\n\t\t\t\t//alert (\"index found at \"+j+\" - \"+i);\n\t\t\t\tcurrentIndex = j;\n\t\t\t\tcurrentSection = i;\n\t\t\t}\n\t\t}\n\t}\n\t\n\tsHTML += \"<table border=\\\"0\\\" cellspacing=\\\"0\\\" cellpadding=\\\"0\\\">\";\n\tsHTML += \"<tr>\";\n\tsHTML += \"<td><img src=\\\"/site_images/s.gif\\\" width=\\\"1\\\" height=\\\"10\\\" alt=\\\"\\\"/></td>\"\n\tsHTML += \"<td align=\\\"center\\\" valign=\\\"middle\\\" class=\\\"prevNext\\\" height=\\\"10\\\" nowrap>\";\n\t\n\tif ((currentIndex-1) < 0) {\n\t\tsHTML += \"<img src=\\\"/site_images/s.gif\\\" width=\\\"2\\\" height=\\\"1\\\" alt=\\\"\\\" /><span class=\\\"prevNextArrow\\\">&lt;</span><img src=\\\"/site_images/s.gif\\\" width=\\\"5\\\" height=\\\"1\\\" alt=\\\"\\\" />\" + prevText ;\n\t} else {\n\t\tsHTML += \"<img src=\\\"/site_images/s.gif\\\" width=\\\"2\\\" height=\\\"1\\\" alt=\\\"\\\" /><span class=\\\"prevNextArrow\\\">&lt;</span><img src=\\\"/site_images/s.gif\\\" width=\\\"5\\\" height=\\\"1\\\" alt=\\\"\\\" /><a href=\\\"\" + subsection[currentSection][currentIndex-1] + \"\\\" class=\\\"prevNextLink\\\">\" + prevText + \"</a>\";\n\t}\n\t\n\tif (subsectionIndex == \"\") {\n\t\tsHTML += \"<img src=\\\"/site_images/s.gif\\\" width=\\\"4\\\" height=\\\"1\\\" alt=\\\"\\\" />|<img src=\\\"/site_images/s.gif\\\" width=\\\"5\\\" height=\\\"1\\\" alt=\\\"\\\" />\";\n\t\tsHTML += \"Index\";\n\t\tsHTML += \"<img src=\\\"/site_images/s.gif\\\" width=\\\"4\\\" height=\\\"1\\\" alt=\\\"\\\" />|<img src=\\\"/site_images/s.gif\\\" width=\\\"5\\\" height=\\\"1\\\" alt=\\\"\\\" />\";\n\t} else {\n\t\tsHTML += \"<img src=\\\"/site_images/s.gif\\\" width=\\\"4\\\" height=\\\"1\\\" alt=\\\"\\\" />|<img src=\\\"/site_images/s.gif\\\" width=\\\"5\\\" height=\\\"1\\\" alt=\\\"\\\" />\";\n\t\tsHTML += \"<a href=\\\"\" + subsectionIndex + \"\\\" class=\\\"prevNextLink\\\">\" + indexText + \"</a>\";\n\t\tsHTML += \"<img src=\\\"/site_images/s.gif\\\" width=\\\"4\\\" height=\\\"1\\\" alt=\\\"\\\" />|<img src=\\\"/site_images/s.gif\\\" width=\\\"5\\\" height=\\\"1\\\" alt=\\\"\\\" />\";\n\t}\n\n\tif ( (currentIndex < 0) || (currentIndex > (subsection[currentSection].length - 2)) ) {\t\n\t\tsHTML += nextText + \"<img src=\\\"/site_images/s.gif\\\" width=\\\"4\\\" height=\\\"1\\\" alt=\\\"\\\" /><span class=\\\"prevNextArrow\\\">&gt;</span><img src=\\\"/site_images/s.gif\\\" width=\\\"3\\\" height=\\\"1\\\" alt=\\\"\\\" />\";\n\t} else {\n\t\tsHTML += \"<a href=\\\"\" + subsection[currentSection][currentIndex+1] + \"\\\" class=\\\"prevNextLink\\\">\" + nextText + \"</a><img src=\\\"/site_images/s.gif\\\" width=\\\"4\\\" height=\\\"1\\\" alt=\\\"\\\" /><span class=\\\"prevNextArrow\\\">&gt;</span><img src=\\\"/site_images/s.gif\\\" width=\\\"3\\\" height=\\\"1\\\" alt=\\\"\\\" />\";\n\t}\t\n\tsHTML += \"</td>\";\n\tsHTML += \"</tr>\";\n\tsHTML += \"</table>\";\n\n\t//alert(sHTML);\n\tdocument.write(sHTML);\n}", "function previousSubunit()\n {\n var m = my.current.unitNo\n var n = my.current.subunitNo\n\n if (!currentSubunitIsTheFirstSubunit()) {\n if (n == 1) {\n // If the user is at unit M.1, go to unit (M - 1).L\n // where L is the last subunit of the previous unit.\n previousUnit = unit(m - 1)\n var previousSubunitTitles = []\n for (var subunitTitle in previousUnit.subunits) {\n previousSubunitTitles.push(subunitTitle)\n }\n\n m--\n n = previousSubunitTitles.length\n } else {\n // If the user is at unit M.N, go to unit M.(N - 1)\n n--\n }\n }\n\n window.location.href = unitHref(m, n)\n }", "function checkActiveClass(){\n\tvar ul,li=[],pagesHidden,nextToDisplay=1;\n\tvar pagination = document.getElementById(\"customPagination\");\n\tif(pagination){\n\t\t ul = document.getElementById(\"ulPagination\");\n\t\tif(ul){\n\t\t\tli = ul.getElementsByClassName(\"customLink\");\n\t\t}\n\t}\n\t\n\tvar isActive = false;\n\tfor(i=0;i<li.length;i++){\n\t\tif(!(li[i].classList.contains(\"active\"))){\n\t\t\tli[i].style.display=\"none\"\n\t\t\t\t document.getElementById(\"prev\").style.display=\"\";\n\t\t} else{\n\t\t\tif(li[i].style.display=\"none\"){\n\t\t\t\tli[i].style.display=\"\";\n\t\t\t}\n\t\t\tif(li[i-1] != undefined){\n\t\t\t\tli[i-1].style.display=\"\";\n\t\t\t} else if(li[i+1] != undefined){\n\t\t\t\tli[i+1].style.display=\"\";\n\t\t\t}\n\t\t\t\n\t\t\tif(li[i+1] != undefined){\n\t\t\t\tli[i+1].style.display=\"\";\n\t\t\t} else if(li[i-1] != undefined){\n\t\t\t\tli[i-1].style.display=\"\";\n\t\t\t\tli[i-2].style.display=\"\";\n\t\t\t}\n\t\t\tisActive = true;\n\t\t}\n\t\n\t\t\n\t\tif(isActive == true){ break; }\n}\n\tif(li[0].style.display==\"\"){\n\t\tdocument.getElementById(\"prev\").style.display=\"none\";\n\t} \n\tif(li[li.length-1].style.display==\"\"){\n\t\tdocument.getElementById(\"next\").style.display=\"none\";\n\t}\n}", "function agregarPaginacionListaOrganizaciones(){\n $('#navListaOrganizaciones').html('');\n $('.listaOrganizaciones').after('<div id=\"navListaOrganizaciones\"></div>');\n let organizacion = document.querySelectorAll('.cardOrganizacion')\n let filasMostradas = 2;\n let filasTotales = organizacion.length;\n\n let numPaginas = filasTotales/filasMostradas;\n for(i = 0; i < numPaginas; i++) {\n let numPag = i + 1;\n $('#navListaOrganizaciones').append('<a href=\"javascript:void(0);\" rel=\"' + i + '\">' + numPag + '</a> ');\n }\n $( organizacion ).hide();\n $( organizacion ).slice(0, filasMostradas).show();\n $('#navListaOrganizaciones a:first').addClass('active');\n $('#navListaOrganizaciones a').bind('click', function(){\n $('#navListaOrganizaciones a').removeClass('active');\n $(this).addClass('active');\n let pagActual = $(this).attr('rel');\n let primerItem = pagActual * filasMostradas;\n let ultimoItem = primerItem + filasMostradas;\n $( organizacion ).css('opacity','0.0').hide().slice(primerItem, ultimoItem).\n css('display','block').animate({opacity:1}, 300);\n });\n}", "function update() {\n\n // calculate the x,y coordinates of the currentRoot\n tree(currentRoot);\n\n // create KV for simple access\n var currentRootKV = currentRoot.descendants().reduce(function(kv, el) {kv[el.data.id] = el; return kv},{});\n\n // the currentRoot contains the correct XY positions for all the nodes\n // minus the ones that need to be hidden. We don't want to limit the\n // number of nodes for our data elements, since that causes text and lines to\n // `jump` around. So we need to make sure we have the same amount of elements\n // and hide rendering the hidden ones.\n var toRender = root.descendants().map(function(el) {\n if (currentRootKV[el.data.id]) {\n var newNode = currentRootKV[el.data.id];\n return newNode;\n } else {\n // if the child is not in the KV map, it is hidden. We\n // now need to set its position to the calculated position of\n // the first visible parent. In other words, the first one\n // which is in the currentRootKV map.\n var fromRoot = _.cloneDeep(el);\n var parent = fromRoot.parent;\n while (!currentRootKV[parent.data.id]) {\n parent = parent.parent;\n }\n var newParent = currentRootKV[parent.data.id];\n\n fromRoot.hidden = true;\n fromRoot.x = newParent.x;\n fromRoot.y = newParent.y;\n\n // we also set the parents x,y since the lines need to\n // be drawn from this position.\n fromRoot.parent.x = newParent.x;\n fromRoot.parent.y = newParent.y;\n\n return fromRoot;\n }\n });\n\n // now that we have to correct data, create the links\n var links = chart.selectAll(\".link\")\n .data(toRender.slice(1));\n\n var linksEnter = links.enter().append(\"path\")\n .attr(\"class\", \"link\")\n .attr(\"d\", diagonal({x:0, y:0, parent: {x:0, y:0}}))\n .style(\"stroke\", function(d) {return colorScale(d.data.group)});\n\n links.merge(linksEnter)\n .transition().duration(2000).attr(\"d\", diagonal);\n\n // create the groups that hold the circle and the text elements\n var nodes = chart.selectAll(\".node\").data(toRender);\n\n var nodesEnter = nodes.enter().append(\"g\")\n .attr(\"class\", \"node\")\n .on(\"click\", click)\n\n nodesEnter.append(\"circle\")\n .attr(\"r\", 2.5)\n .style(\"fill\", function(d) {return colorScale(d.data.group)});\n\n nodesEnter.append(\"text\")\n .attr(\"dy\", \".31em\")\n\n // combine the updated and new nodes\n var nodesUpdate = nodes.merge(nodesEnter);\n\n // transition the nodes (circles & text)\n nodesUpdate.transition().duration(2000)\n .attr(\"transform\", function(d) { return \"translate(\" + project(d.x, d.y) + \")\"; })\n .style(\"opacity\", function(d) { return !d.hidden ? 1 : 0} )\n .on(\"end\", function(d) {d.hidden ? d3.select(this).attr(\"display\", \"none\"): \"\"})\n .on(\"start\", function(d) {!d.hidden ? d3.select(this).attr(\"display\", \"\"): \"\"});\n\n nodesUpdate.select(\"text\")\n .attr(\"x\", function(d) { return d.x < 180 === !d.children ? 6 : -6; })\n .text(function(d) {return d.data.name; })\n // we could also tween the anchor see chapter 2\n .style(\"text-anchor\", function(d) {\n // for the right side\n if (d.x < 180 && d.children) return \"end\"\n else if (d.x < 180 && !d.children) return \"start\"\n // for the left side\n else if (d.x >= 180 && !d.children) return \"end\"\n else if (d.x >= 180 && d.children) return \"start\"\n })\n .transition().duration(2000)\n .attr(\"transform\", function(d) {\n // called once to determine the target value, and tween the values\n return \"rotate(\" + (d.x < 180 ? d.x - 90 : d.x + 90) + \")\";\n })\n }", "function nextSubunit()\n {\n var m = my.current.unitNo\n var n = my.current.subunitNo\n\n if (!currentSubunitIsTheLastSubunit()) {\n if (n == my.current.subunitTitles.length) {\n // If the user is at unit M.L where L is the last\n // subunit of unit M, then go to unit (M + 1).1.\n m++\n n = 1\n } else {\n // If the user is at unit M.N, then go to unit M.(N + 1).\n n++\n }\n }\n\n window.location.href = unitHref(m, n)\n }", "function handleNavBar() {\n //goal nav link\n $('#goals-nav').click(function() {\n $('.stretch-goals-completed-display').html(\n \" \");\n $('.quarterly-goals-completed-display').html(\n \" \");\n $('.weekly-goals-completed-display').html(\n \" \");\n $('.goals-page').show();\n $('.stretch-goal-dispay').show();\n $('.quarterly-goal-display').show();\n $('.weekly-goal-display').show();\n $('.landing-page').hide();\n $('.daily-page').hide();\n //hide show to start the page\n $('.stretch-goals-completed-display').hide();\n $('.quarterly-goals-completed-display').hide();\n $('.weekly-goals-completed-display').hide();\n $('.stretch-edit-button').hide();\n $('.stretch-delete-button').hide();\n $('.stretch-complete-button').hide();\n $('.stretch-edit-go-button').hide();\n $('.quarterly-edit-button').hide();\n $('.quarterly-delete-button').hide();\n $('.quarterly-complete-button').hide();\n $('.weekly-edit-button').hide();\n $('.weekly-delete-button').hide();\n $('.weekly-complete-button').hide();\n getStrechGoalsData();\n getQuarterlyData();\n getWeeklyData();\n });\n //show completed goals\n $('#completed-goals-nav').click(function() {\n $('.goals-page').show();\n $('.stretch-goals-completed-display').html(\n \" \");\n $('.quarterly-goals-completed-display').html(\n \" \");\n $('.weekly-goals-completed-display').html(\n \" \");\n $('.stretch-goals-completed-display').show();\n $('.quarterly-goals-completed-display').show();\n $('.weekly-goals-completed-display').show();\n $('.stretch-goal-dispay').hide();\n $('.quarterly-goal-display').hide();\n $('.weekly-goal-display').hide();\n $('.landing-page').hide();\n $('.daily-page').hide();\n displayCompletedStretchGoals();\n displayCompletedQuarterlyGoals();\n displayCompletedWeeklyGoals();\n });\n}", "function process_navigation() {\r\n\tlet html = \"<ul class='navtree'>\";\r\n\tfunction open(linkName, signature, level) {\r\n\t\thtml += \"<li>\";\r\n\t\thtml += \"<i class='fa fa-angle-right accordion-toggle'></i>\";\r\n\t\tif (signature)\t\r\n\t\t\thtml += `<a class='navlink navlink--lvl${level}' page='${signature}'>${escape_html(linkName)}</a>`;\r\n\t\telse\r\n\t\t\thtml += `<span class='navlink navlink--lvl${level}'>${escape_html(linkName)}</span>`;\r\n\t\thtml += \"<ul class='accordion'>\";\r\n\t\treturn html;\r\n\t}\r\n\t\r\n\tfunction close() {\r\n\t\thtml += \"</ul>\";\r\n\t\thtml += \"</li>\";\r\n\t}\r\n\t\r\n\tfunction build(member) {\r\n\t\tif (member.childcount === 0) {\r\n\t\t\thtml += `<li>\r\n\t\t\t\t\t\t<a class='navlink navlink--lvl3' page='${member.signature}'>\r\n\t\t\t\t\t\t\t${escape_html(member.name)}\r\n\t\t\t\t\t\t</a>\r\n\t\t\t\t\t</li>`;\r\n\t\t} else {\r\n\t\t\topen(member.name, member.signature, 3);\r\n\t\t\tconst childs = findChilds(member);\r\n\t\t\tfor (const type of Object.keys(childs)) {\r\n\t\t\t\topen(SECTION_NAMES[type], null, 3);\r\n\t\t\t\tfor (const child of childs[type])\r\n\t\t\t\t\tbuild(child);\r\n\t\t\t\tclose();\r\n\t\t\t}\r\n\t\t\tclose();\r\n\t\t}\r\n\t}\r\n\t\r\n\tfor (const member of ROOT_MEMBERS) {\r\n\t\tbuild(member);\r\n\t\thtml += \"<hr/>\";\r\n\t}\t\r\n\thtml += \"</ul>\";\r\n\t\r\n\tconst navigation = $('#navigation');\r\n\tnavigation.html(html);\r\n\t\r\n\tprocess_accordions(navigation);\r\n\tprocess_links(navigation);\r\n}", "show() {\n for (let node of this.nodes) {\n node.show();\n node.showLinks();\n }\n }", "function render_navigation_controls(){\n\tvar nav_panel = $('<div class=\"explanation-navigation\">');\n\tvar forward = $('<div class=\"explanation-navigation-forward hidden\">>></div>');\n\tvar backward = $('<div class=\"explanation-navigation-backward hidden\"><<</div>');\n\tforward.click(function(){\n\t\tnavigationCounter++;\n\t\tvar explanationModel = kbAPI.explanations.getRecord('<explanationInstanceID'+navigationCounter+'>');\n\t\tvar explanation = explanationBuilder.construct_explanation(explanationModel);\t\n\t\t$('.explanation-block').empty();\n\t\t$('.explanation-block').append(explanation);\n\t\tif(navigationCounter == explanationInstanceIDcounter){\n\t\t\t$(this).removeClass('show');\n\t\t\t$(this).addClass('hidden');\n\t\t}\n\t\tif(navigationCounter > 1){\n\t\t\t$('.explanation-navigation-backward').removeClass('hidden');\n\t\t\t$('.explanation-navigation-backward').addClass('show');\n\t\t}\n\t});\n\tbackward.click(function(){\n\t\tnavigationCounter--;\n\t\tvar explanationModel = kbAPI.explanations.getRecord('<explanationInstanceID'+navigationCounter+'>');\n\t\tvar explanation = explanationBuilder.construct_explanation(explanationModel);\t\n\t\t$('.explanation-block').empty();\n\t\t$('.explanation-block').append(explanation);\n\t\tif(navigationCounter == 1){\n\t\t\t$(this).removeClass('show');\n\t\t\t$(this).addClass('hidden');\n\t\t}\n\t\tif(navigationCounter < explanationInstanceIDcounter){\n\t\t\t$('.explanation-navigation-forward').removeClass('hidden');\n\t\t\t$('.explanation-navigation-forward').addClass('show');\n\t\t}\n\t});\n\tnav_panel.append(backward);\n\tnav_panel.append(forward);\n\treturn nav_panel;\n}", "function next() {\n if (slide != 3) {\n document.getElementById(\"previousButton\").style.visibility = \"visible\";\n slide++;\n update(slide);\n }\n if (slide == 3) {\n document.getElementById(\"nextButton\").style.visibility = \"hidden\";\n document.getElementById(\"carDropdown\").style.visibility = \"visible\";\n } else {\n document.getElementById(\"nextButton\").style.visibility = \"visible\";\n }\n}", "function buttonNavUrl(pPrev, pNext) {\n buttons[0].removeAttribute('disabled')\n buttons[0].style.visibility = 'visible'\n buttons[1].removeAttribute('disabled')\n buttons[1].style.visibility = 'visible'\n\n buttons[0].dataset.url = pPrev;\n buttons[1].dataset.url = pNext;\n\n if (pPrev === null) {\n buttons[0].setAttribute('disabled', true)\n buttons[0].style.visibility = 'hidden'\n }\n if (pNext === null) {\n buttons[1].setAttribute('disabled', true)\n buttons[1].style.visibility = 'hidden'\n }\n}", "function hideNav() {\n if(isNavVisible === true) {\n noNav();\n\n } else {\n yesNav();\n }\n}", "_updateNavigationButtons()\n {\n let isCurrentMoveTheLastMove = this._numberOfCurrentMoveInView === this._game.numberOfMoves();\n let isCurrentMoveBeforeTheFirstMove = this._numberOfCurrentMoveInView === 0;\n\n this._nextMoveButton.disabled = isCurrentMoveTheLastMove;\n this._followMovesButton.disabled = isCurrentMoveTheLastMove;\n this._previousMoveButton.disabled = isCurrentMoveBeforeTheFirstMove;\n\n this._nextMoveButton.classList.toggle('disabled', isCurrentMoveTheLastMove);\n this._followMovesButton.classList.toggle('disabled', isCurrentMoveTheLastMove);\n this._previousMoveButton.classList.toggle('disabled', isCurrentMoveBeforeTheFirstMove);\n\n // Remove flashing if the user follow the moves.\n if (isCurrentMoveTheLastMove) {\n this._followMovesButton.classList.remove('button--yellow');\n this._followMovesButton.classList.remove('button--flash');\n }\n }", "function displayNavigationControl(event, isLookupVisible) {\n\n var retValue = false;\n\n var source = sourceCtrl;\n\n var id = \"#\" + $(source).attr(\"id\");\n\n var visible = isLookupVisible;\n var clickedCaret = $(event.target).hasClass(\"ds-bc-nav-lu-caret\");\n var clickedOnBC = $(id + \" .ds-bc-nav-lu\").is(event.target);\n\n\n\n //We will change the > caret to point down. For this we first remove all caret classes and add only the right ones.\n //This is the default state.\n $(id + \" .fa-caret-down\").removeClass(\"fa-caret-down fa-caret-right ds-bc-nav-lu-caret-expand\").addClass(\"fa-caret-right\");\n\n //For the clicked caret - remove the right caret, and add the down caret.\n if (clickedCaret) {\n $(event.target).removeClass(\"fa-caret-right\");\n $(event.target).addClass(\"fa-caret-down ds-bc-nav-lu-caret-expand\");\n }\n\n\n //First we check if the look up control is visible. If it is not visible it should only be displayed if we click ont he breadcrumb or the caret.\n //If the look up is visible we need to display it again if the caret is clicked otherwise we should hide it.\n\n if (!visible) {\n if (clickedOnBC || clickedCaret)\n retValue = true;\n else\n retValue = false;\n } else {\n if (clickedCaret)\n retValue = true;\n else\n retValue = false;\n }\n\n\n return retValue;\n }", "function switchPanel (lastPage, nextPage) {\r\n $(lastPage).hide();\r\n $(nextPage).show();\r\n }", "function updateNavOnLogout() {\n $navLogin.show();\n $navLogOut.hide();\n $userNavLinks.hide();\n\n}", "function nextSection(currentSection, nextSection) { \n document.querySelector('#' + currentSection).style.display = \"none\";\n document.querySelector('#' + nextSection).style.display = \"block\";\n}", "function showButtons()\n{\n\tpageNavButton.style.display = 'inherit';\n\tpageNavButton.style.display = 'inline-block';\n\t\n\tinformationButton.style.display = 'inherit';\n\tinformationButton.style.display = 'inline-block';\n\t\n\tfor(var i = 0; i < collectionOfButtons.length; i++)\n\t{\n\t\tcollectionOfButtons[i].style.display = 'inherit';\n\t\tcollectionOfButtons[i].style.display = 'inline-block';\n\t}\n\t\n\tfor(var k = 0; k < collectionOfButtons2.length; k++)\n\t{\n\t\tcollectionOfButtons2[k].style.display = 'inherit';\n\t\tcollectionOfButtons2[k].style.display = 'inline-block';\n\t}\n}", "function subCate_github_folder(){\n var folderShow = document.getElementById('github_sub_folder_show');\n var arrow = document.getElementById('down-arrow-github');\n if(folderShow.style.display == \"none\"){\n folderShow.style.display = \"flex\";\n arrow.style.transform = 'rotate(180deg)';\n } else{\n folderShow.style.display = \"none\";\n arrow.style.transform = 'rotate(0deg)';\n }\n}", "function updatePageNavigation() {\n const Navigation = MonitoringConsole.Model.Settings.Navigation;\n let panelConsole = $('#console');\n if (Navigation.isCollapsed()) {\n panelConsole.removeClass('state-show-nav');\n } else {\n if (!panelConsole.hasClass('state-show-nav')) {\n panelConsole.addClass('state-show-nav'); \n }\n }\n $('#NavSidebar').replaceWith(Components.createNavSidebar(createNavSidebarModel()));\n }", "function showLinks (delay) {\n // Show links\n\n // This is kind of redundant, but as long as the link arrows have not been\n // moved to user control layer, keep calling the modeSwitchWalkClick()\n // to bring arrows to the top layer. Once loaded, move svLinkArrowsLoaded to true.\n if (!status.svLinkArrowsLoaded) {\n var numPath = $divViewControlLayer.find(\"path\").length;\n if (numPath === 0) {\n makeLinksClickable();\n } else {\n status.svLinkArrowsLoaded = true;\n }\n }\n\n if (status.hideNonavailablePanoLinks &&\n status.availablePanoIds) {\n $.each($('path'), function (i, v) {\n if ($(v).attr('pano')) {\n var panoId = $(v).attr('pano');\n var idx = status.availablePanoIds.indexOf(panoId);\n\n if (idx === -1) {\n $(v).prev().prev().remove();\n $(v).prev().remove();\n $(v).remove();\n } else {\n //if (properties.browser === 'chrome') {\n // Somehow chrome does not allow me to select path\n // and fadeOut. Instead, I'm just manipulating path's style\n // and making it hidden.\n $(v).prev().prev().css('visibility', 'visible');\n $(v).prev().css('visibility', 'visible');\n $(v).css('visibility', 'visible');\n }\n }\n });\n } else {\n if (properties.browser === 'chrome') {\n // Somehow chrome does not allow me to select path\n // and fadeOut. Instead, I'm just manipulating path's style\n // and making it hidden.\n $('path').css('visibility', 'visible');\n } else {\n if (!delay) {\n delay = 0;\n }\n // $('path').show();\n $('path').css('visibility', 'visible');\n }\n }\n }", "function showHideNavigation(item) {\n taskSet = document.getElementById(\"child_\"+item);\n taskImg = document.getElementById(\"img_\"+item);\n if (taskSet.style.display == \"block\") {\n taskSet.style.display = \"none\";\n taskImg.src = \"/ibm/console/images/arrow_collapsed.gif\";\n } else {\n taskSet.style.display = \"block\";\n taskImg.src = \"/ibm/console/images/arrow_expanded.gif\";\n }\n}", "function showNav() {\n if (noOpenContent()) {\n document.getElementById('search').style.display = 'block';\n document.getElementById('page_number').style.display = 'initial';\n document.getElementById('tags_nav').style.display = 'initial';\n document.getElementById('categories_nav').style.display = 'initial';\n checkPosition();\n }\n\n /** We only want the previous/next buttons if they do something */\n function checkPosition() {\n const maxPosts =\n document.getElementsByClassName('single_post_container').length;\n if (maxPosts > (postsStartPosition+10)) {\n document.getElementById('next_page').style.display = 'initial';\n } else {\n document.getElementById('next_page').style.display = 'none';\n }\n\n if (postsStartPosition > 0) {\n document.getElementById('previous_page').style.display = 'initial';\n } else {\n document.getElementById('previous_page').style.display = 'none';\n }\n }\n}", "function display() { \n if (browserVersion == 1) \n this.navObj.style.display = \"block\" \n else \n this.navObj.visibility = \"show\" \n}", "function showPage(pageId){\n document.querySelectorAll('.subpage').forEach( item => {\n item.style.display = \"none\"\n })\n document.getElementById(pageId).style.display=\"block\"\n}", "function setNavLink() {\r\n \r\n\tvar separator = newNode('div');\r\n separator.innerHTML = '<br>';\r\n\t\r\n //Reader Link in #nav \r\n var navReaderLink = newNode('div');\r\n navReaderLink.className = 'nl';\r\n navReaderLink.innerHTML = '<span id=\"navReaderLink\" class=\"lk\"><b>Reader <span id=\"unreadCount\"></span></b></span>';\r\n \r\n //Insert BEFORE Contacts Link\r\n var contNode = getNode('cont');\r\n contNode.parentNode.parentNode.insertBefore(separator, contNode.parentNode);\r\n contNode.parentNode.parentNode.insertBefore(navReaderLink, contNode.parentNode);\r\n \r\n //Event to Show|Hide Reader\r\n navReaderLink.addEventListener('click', setReaderVisibility, false); \r\n \r\n //Gmail Show|Hide Link \r\n var GmailToggle = newNode ('div');\r\n GmailToggle.className = 'nl';\r\n GmailToggle.innerHTML = '<span id=\"GmailToggle\" class=\"lk\">Collapse Gmail</span>';\r\n \r\n //Insert AFTER Trash Link\r\n var navNode = getNode('nds');\r\n navNode.parentNode.insertBefore(GmailToggle, navNode.nextSibling);\r\n \r\n //Event to Show|Hide Gmail\r\n GmailToggle.addEventListener('click', setGmailVisibility, false);\r\n //Event to Show Gmail on clicking any link in #nds\r\n getNode('nds').addEventListener('click', showGmail, false);\r\n \r\n}", "function toggleHideEmptySubs() {\n config.hideEmptySubs = !config.hideEmptySubs;\n loadingProgress(1);\n saveConfig().then(() => { loadingProgress(-1); });\n subs.forEach((sub, i) => {\n subs[i].handleVisibility();\n });\n $(\"#ytbsp-hideEmptySubsCb\", mainDiv).prop(\"checked\", config.hideEmptySubs);\n}", "function handleFlashMenu(main, sub) {\n\t\telemParams.currentPage = 0;\n\n\t\tif (locParams.gloPre) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tmain = main-1;\n\t\tfor (var i = 0; i < theSitetree.length && i <= main; i++) {\n\t\t\tif (theSitetree[i][POS_ISNAVIGATION] == 'false')\n\t\t\t\tmain++;\n\t\t}\n\t\tif (theSitetree && main < theSitetree.length) {\n\n\t\t\telemParams.currentPage = main;\n\n\t\t\tif (sub == 0) {\n\t\t\t\t// Kein Untermenu ausgewaehlt\n\t\t\t\tinternalShowPage(theSitetree[main]);\n\t\t\t} else {\n\t\t\t\tsub = sub-1;\n\t\t\t\tvar childpages = theSitetree[main][POS_CHILDS];\n\t\t\t\t//no more existing sub page\n\t\t\t\tif ( sub >= childpages.length) {\n \thandleNonExistingPage();\n }\n\n\t\t\t\tfor (var j = 0; j < childpages.length && j <= sub; j++) {\n\t\t\t\t\tif (childpages[j][POS_ISNAVIGATION] == 'false')\n\t\t\t\t\t\tsub++;\n\t\t\t\t}\n\n\t\t\t\tinternalShowPage(childpages[sub]);\n\t\t\t}\n\t\t} else {\n\t\t\thandleNonExistingPage();\n\t\t}\n\t}", "function createSubNavigation() {\n\tvar yearSelect = g_year_html; // defined in init.js\n\n\tif (g_data_type == 'hhr') {\n\t\tvar limitSelect = '<table><tr><td class=\"right\">Begrenzen nach <select size=\"1\" name=\"nav_limit_by\"><option value=\"7\" selected=\"selected\">Ist-Betrag</option><option value=\"8\">Haushaltsbetrag</option><option value=\"9\">Differenz</option><option value=\"10\">Rechnung-Ist</option><option value=\"11\">Gesamtsoll</option><option value=\"12\">mehr/weniger</option></select></td></tr><tr><td class=\"right\">ab Betrag <input type=\"text\" size=\"10\" name=\"nav_limit_from\" value=\"\"/></td></tr></table>';\n\t\tvar typeSelect = '';\n\t} else if (g_data_type == 'zr') {\n\t\tvar limitSelect = '<table><tr><td class=\"right\">Auswertung nach Ist-Betrag</td></tr><tr><td class=\"left\">ab Betrag <input type=\"text\" size=\"10\" name=\"nav_limit_from\" value=\"\"/></td></tr></table>';\n\t\tvar typeSelect = '';\n\t} else {\n\t\tvar limitSelect = '<table><tr><td class=\"right\">Begrenzen nach <select size=\"1\" name=\"nav_limit_by\" id=\"nav_limit_by\"><option value=\"7\" selected=\"selected\">Ansatz Neu</option><option value=\"8\">Ansatz Alt</option><option value=\"9\">Differenz</option><option value=\"11\">Ist</option></select></td></tr><tr><td class=\"right\">ab Betrag <input type=\"text\" size=\"10\" name=\"nav_limit_from\" value=\"\"/></td></tr></table>';\n\t\tvar typeSelect = 'Typ <select size=\"1\" name=\"type_limit\" onchange=\"onChangeType(this.value)\"><option value=\"TIT\">TIT</option><option value=\"VE\">VE</option></select>';\n\t}\n\n\tvar showOptions = '<table><tr><td><input type=\"radio\" name=\"nav_show\" value=\"1\"/> mit Detailzeilen</td></tr><tr><td><input type=\"radio\" name=\"nav_show\" value=\"2\" checked=\"checked\"/> nur Summenzeilen</td></tr></table>';\n\n\treturn '<div id=\"subnavigation\"><table><tr><td class=\"year\">' + yearSelect + '</td><td>' + limitSelect + '</td><td>' + typeSelect + '</td><td>' + showOptions + '</td></tr></table></div>';\n}", "function show(shown) {\n // Resets every selection in the profile forms\n $(\"#formcards form\").each(function () {\n $(this)[0].reset();\n });\n /* Hide navbar navigation links in login view & have the brand show the login page.\n Else show the links and have the brand navigate to the translation table. */\n if (shown === \"login\") {\n $(\"#brand-nav\").attr('onclick', \"show('login')\");\n $(\"#navbarResponsive ul\").addClass('hidden');\n } else {\n $(\"#brand-nav\").attr('onclick', \"show('page1')\");\n $(\"#navbarResponsive ul\").removeClass('hidden');\n }\n // Loop through each div marked as main content\n $(\"div[role='main']\").each(function(i) {\n // Make a string to find the page's link in the navbar\n var id = $(this).attr('id');\n var str = \".navbar-nav.ml-auto #nav-\" + id;\n if (id === shown) {\n // Make the page visible\n $(this).removeClass('hidden');\n // Make the corresponding item in the navbar active\n $(str).addClass('active');\n // Add info for screen readers about which page is selected\n $(str + \" a\").append('<span class=\"sr-only\">(current)</span>');\n } else {\n // Other pages and their alerts are hidden\n $(this).addClass('hidden');\n $(this).find('.alert').each(function() {\n $(this).addClass('hidden');\n });\n // And their navbar info is removed\n $(str).removeClass('active');\n $(str + \" a span\").remove();\n }\n });\n}", "function setContinuedNavigation(data){\n var setPrevBtn = data._links.prev || \"\";\n var setNextBtn = data._links.next || \"\";\n //set current page number\n var pg = data._links.self.substring(data._links.self.indexOf(\"offset=\")+7, data._links.self.indexOf(\"&q\"));\n document.getElementById('currentPageNumber').innerHTML = Math.floor(pg/10);\n\n //set navagation buttons\n if(setPrevBtn === \"\"){\n //no more prev (on page 0)\n document.getElementById('prevPageButton').onclick = \"\";\n document.getElementById('nextPageButton').onclick = setTwitchDataCallback(setNextBtn);\n } else if(Math.floor(data._total/10)*10 <= parseInt(data._links.self.substring(data._links.self.indexOf(\"offset=\")+7, data._links.self.indexOf(\"&q\")))){\n //no more foward (on last page)\n document.getElementById('prevPageButton').onclick = setTwitchDataCallback(setPrevBtn);\n document.getElementById('nextPageButton').onclick = \"\";\n } else{\n document.getElementById('prevPageButton').onclick = setTwitchDataCallback(setPrevBtn);\n document.getElementById('nextPageButton').onclick = setTwitchDataCallback(setNextBtn);\n }\n}", "toggleVisible(previousProp, nextProp) {\n if (!isShallowEqual(previousProp, nextProp)) {\n if (nextProp === true) this.marker.show();\n if (nextProp === false) this.marker.hide();\n }\n }", "function nextDiv(){ \r\n var x = document.getElementsByClassName(\"subDivMTN\"); \r\n for ( var i = 0; i < x.length; i++) {\r\n x[i].style.display = 'none';\r\n}\r\n\r\n var y = document.getElementById(\"subDiv6\");\r\n y.style.display = 'block';\r\n}", "function checkWhichNavigationToDisplay() {\n\t\t\tvar nonStatusUpdates$ = jContainer.find(\".ASWidgetActionDropdown li:not(.ASWidgetStatusUpdatesNaviPoint)\"),\n\t\t\t\tstatusUpdates$ = jContainer.find(\".ASWidgetActionDropdown li.ASWidgetStatusUpdatesNaviPoint\");\n\t\t\tif (jContainer.find(\".ASWidgetstatusUpdates.active\").length) {\n\n\t\t\t\tif (!isCommunityMode()) {\n\t\t\t\t\tnonStatusUpdates$.hide();\n\t\t\t\t\tstatusUpdates$.show();\n\t\t\t\t} else {\n\t\t\t\t\tstatusUpdates$.hide();\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tnonStatusUpdates$.show();\n\t\t\t\tstatusUpdates$.hide();\n\t\t\t}\n\t\t}", "function subNav_slideToggle() {\n $(this).toggleClass('nav__item--show-sub');\n }", "function navigation() {\n\t\n\t/* @TODO: reverse li und stelle angemeldet als nach oben */\n\t//$$('#account ul').insert( $$('#account ul li').reverse() );\n}", "function display( offset ){\n\t\t\tvar prevbtn = $( '.datapagination .dataprev' ),\n\t\t\t\tnextvbtn = $( '.datapagination .datapnext' );\n\t\t\t\n\t\t\tvar prevdisplay = ( offset != 0 ) ? 'block' : 'none',\n\t\t\t\tnextdisplay = ( offset == 100 ) ? 'none' : 'block';\n\t\t\t\n\t\t\tprevbtn.css({'display':prevdisplay});\n\t\t\tnextvbtn.css({'display':nextdisplay});\n\t\t}", "function showSubMenu() {\n\tvar objThis = this;\t\n\tfor (var i = 0; i < objThis.childNodes.length; i++) {\n\t\tif (objThis.childNodes.item(i).nodeName == \"UL\")\t{\t\t\t\t\t\t\t\n\t\t\tobjThis.childNodes.item(i).style.display = \"block\";\n\t\t}\t\t\n\t}\t\n}", "function togglePreviousLocations() {\n\tfor(i = 0; i < previousLocations.length; i++) {\n\t\tpreviousLocations[i].setVisible(!previousLocations[i].getVisible());\n\t}\n}", "function activeLinks() {\n // Disable prev button if on first slide\n if (count === 0) {\n prev.style.opacity = .5\n prev.removeAttribute('href', '#')\n } else {\n prev.setAttribute('href', '#')\n prev.style.opacity = 1\n }\n // Disable next button if on last slide\n if (count === (div.length - 1)) {\n next.style.opacity = .5\n next.removeAttribute('href', '#')\n } else {\n next.setAttribute('href', '#')\n next.style.opacity = 1\n }\n }", "function showPage(listOfStudents, paginationPageSelected) {\r\n //if the first paginatinon button is selected the last index = 9, if the second pagination button is selected the last index = 19 etc\r\n const lastIndexToDisplay = (paginationPageSelected*10)-1;\r\n const firstIndexToDisplay = lastIndexToDisplay - 9;\r\n //make list items are hidden\r\n for(let i=0; i < list.length; i+=1) {\r\n document.querySelector('ul.student-list').children[i].style.display = 'none'//hides all\r\n }\r\n // of the matchedList, make sure that the onces within the selected index are revealed\r\n for(let i=0; i < listOfStudents.length; i+=1) {\r\n if(i >= firstIndexToDisplay && i <= lastIndexToDisplay) {\r\n // if the index of the matchedList is in the required range, reveal it!!!\r\n listOfStudents[i].style.display= '';\r\n }\r\n }\r\n}", "function relatedConcepts() {\n var nextRelated = document.getElementById(\"relatedRightArrow\");\n var prevRelated = document.getElementById(\"relatedLeftArrow\");\n\n nextRelated.onclick = function () {\n //console.log(nextRelated);\n var all = document.querySelectorAll(\".related_items\");\n for (i = 0; i < all.length - 3; i++) {\n if (all[i].classList.contains(\"relatedShow\")) {\n if (\n screen.width < 770 &&\n screen.width > 500 &&\n all[i + 3].id == \"non_ipad\"\n ) {\n console.log(\"ipad\");\n continue;\n } else if (\n screen.width < 500 &&\n (all[i + 3].id == \"non_ipad\" || all[i + 3].id == \"non_phone\")\n ) {\n continue;\n }\n all[i].classList.remove(\"relatedShow\");\n all[i].classList.add(\"relatedHide\");\n all[i + 3].classList.remove(\"relatedHide\");\n all[i + 3].classList.add(\"relatedShow\");\n break;\n }\n }\n };\n\n prevRelated.onclick = function () {\n //console.log(prevRelated);\n var all = document.querySelectorAll(\".related_items\");\n //console.log(all);\n for (i = all.length - 1; i > 2; i--) {\n if (all[i].classList.contains(\"relatedShow\")) {\n all[i].classList.remove(\"relatedShow\");\n all[i].classList.add(\"relatedHide\");\n all[i - 3].classList.remove(\"relatedHide\");\n all[i - 3].classList.add(\"relatedShow\");\n break;\n }\n }\n };\n}", "function toggleDisplay() {\n $('.grpCat')\n .not('#' + slctCat)\n .hide(); //selects and hides all subcategories (i.e. Category = Gender and subcategory = Gender > Male or Female; identifies it by class 'i.e. btype, gender, etc.')\n $('#' + slctCat).show(); // only shows the Subcategory dropdown menu\n //Hiding NTA Maps & Ratio Groups when a new category is selected\n $('.grpMap, .grpMet').show();\n $('.grpNTAMap, .grpNTARatio').hide();\n\n //resets category dropdown\n \n //resets metric dropdowns\n $('.grpCat .selected').attr('value', '').text('Please Select');\n $('.grpMet .selected').attr('value', '').text('Please Select');\n $('.grpMap .selected').attr('value', '').text('Please Select');\n $('.grpNTAMap .selected').attr('value', '').text('Please Select');\n $('.grpNTARatio .selected').attr('value', '').text('Please Select');\n slctAttr = '';\n slctMet = '';\n slctMap = '';\n slctNTARatio = '';\n slctNTAMap = '';\n }", "function subCate_more_options(){\n var folderShow = document.getElementById('more-sub-option');\n if(folderShow.style.display == \"none\"){\n folderShow.style.display = \"block\";\n } else{\n folderShow.style.display = \"none\";\n }\n}" ]
[ "0.6815112", "0.6497733", "0.6421594", "0.63802665", "0.6369621", "0.6159566", "0.59982234", "0.5988072", "0.5962577", "0.5941914", "0.59193903", "0.57708377", "0.5681644", "0.56591916", "0.5647338", "0.5598288", "0.55446005", "0.5538505", "0.5519809", "0.5513127", "0.5512945", "0.5487881", "0.54627854", "0.5452651", "0.54026324", "0.53968394", "0.538439", "0.5358553", "0.5341277", "0.5335947", "0.53270495", "0.5324869", "0.5312062", "0.5311944", "0.5311711", "0.53111786", "0.5301836", "0.5291837", "0.5286446", "0.5279688", "0.5278155", "0.5269944", "0.52649343", "0.52635294", "0.52572006", "0.52517015", "0.5244432", "0.523947", "0.52378637", "0.5227972", "0.52146757", "0.52064437", "0.52027476", "0.5188861", "0.5185401", "0.5182654", "0.51710767", "0.51696044", "0.5157086", "0.5154609", "0.5152582", "0.5150609", "0.51499075", "0.5143415", "0.514139", "0.5130271", "0.5130077", "0.51276934", "0.51273686", "0.5123188", "0.51176286", "0.5113814", "0.51134044", "0.5106713", "0.51029646", "0.5102698", "0.5101017", "0.5100364", "0.5100248", "0.5095712", "0.50941366", "0.5090134", "0.5085738", "0.5085322", "0.50745314", "0.5065897", "0.50454754", "0.50346285", "0.5034391", "0.50339675", "0.5031922", "0.5025327", "0.5012615", "0.5010818", "0.5002465", "0.49974084", "0.49968502", "0.49967003", "0.49957156", "0.4990005" ]
0.8930255
0
Display the number of characters in the current lesson as a tooltip for progress bar and progress percent.
function updateProgressTooltip() { my.html.progress.title = 'This lesson contains ' + my.current.subunitText.length + ' characters.' }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getText()\n\t{\n\t\tif (that.showUsed)\n\t\t\treturn \"Tries used: \" + that.current;\n\t\telse\n\t\t\treturn \"Tries left: \" + (that.maximum - that.current);\n\t}", "function progressCounter() {\n return document.getElementById(\"counter\").innerHTML =\n `Score: ${questionCount}/12`;\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 }", "stats() {\n let timeLeft = parseInt(document.getElementById(\"time-remaining\").innerHTML);\n let totalTime = 100 - timeLeft;\n let flipCount = parseInt(document.getElementById(\"flips\").innerHTML);\n document.getElementById(\"victory-p\").innerHTML = `You took ${totalTime} seconds and ${flipCount} flips!`;\n }", "function showQuestionCounter(questionNumber) {\n return \"Question \" + (questionNumber) + \" of \" + questionAnswersOptions.length;\n}", "function setResultTooltips()\n {\n var textLength = my.current.subunitText.length\n var charNoun = textLength == 1 ? 'character' : 'characters'\n\n // Speed tooltip\n my.html.speed.title =\n 'You have typed ' + textLength + ' ' + charNoun +\n ' in\\n' +\n Util.prettyTime(my.current.timeElapsed) + '.\\n\\n' +\n 'Your typing speed is\\n' +\n my.current.wpm + ' words per minute, or\\n' +\n my.current.cpm + ' characters per minute.'\n\n\n // Error rate tooltip\n var errorRateTooltip\n var accuracyTooltip\n\n // Update error rate\n if (my.current.errorRate == Number.POSITIVE_INFINITY) {\n errorRateTooltip = '\\u221e'\n accuracyTooltip = 0\n } else {\n errorRateTooltip = parseFloat(my.current.errorRate.toFixed(1))\n accuracyTooltip = 100 - errorRateTooltip\n }\n\n var errorNoun = my.current.errors == 1 ? 'error' : 'errors'\n\n var title =\n 'You have typed ' + textLength + ' ' + charNoun +\n '.\\n' +\n 'You have made ' + my.current.errors + ' ' +\n errorNoun + '.\\n' +\n 'Your error rate is ' + errorRateTooltip + '%.\\n' +\n 'Your accuracy is ' + accuracyTooltip + '%.\\n'\n\n my.html.error.title = title\n }", "function questionNumber() {\n var currentQuestionNumber = quiz.questionIndex + 1;\n var element = document.getElementById(\"progress\");\n element.innerHTML = \"Question \" + currentQuestionNumber + \" of \" + quiz.questions.length;\n \n}", "function showProgress() {\n var currentQuestionNumber = quiz.questionIndex + 1;\n var element = document.getElementById(\"progress\");\n element.innerHTML = \"Question \" + currentQuestionNumber + \" of \" + quiz.questions.length;\n}", "function showProgress(){\r\n var currentQuestionNumber = quiz.questionIndex + 1;\r\n var element = document.getElementById(\"progress\");\r\n element.innerHTML = \"Question \" + currentQuestionNumber + \" of \" + quiz.questions.length;\r\n}", "function charCount() {\n\n\tif (this.about_me.value.length <= 140) {\n\t\tvar x = document.getElementById(\"characters\");\n\t\tx.innerHTML = '<p>' + this.about_me.value.length + '</p>';\n\t} else {\n\t\tvar x = document.getElementById(\"characters\");\n\t\tx.innerHTML = '<p style=\"color:red;\">' + (140 - this.about_me.value.length) + '</p>';\n\t}\n\n\n}", "function displayAbilityPointsTotal() {\n document.getElementById(\"remainingPoints\").innerHTML = \"<b>Remaining Points: \" + (20 - character.getUserPointsTotal());\n}", "function getStatusHtml() { \n return `<div class='status_bar'>\n <span>Question ${getCurrentNum() + 1} / ${DATA_SOURCE.length}</span>\n <span>Score ${getRightCnt()}</span>\n </div>`;\n}", "function display_tip() {\n if (pause_on_tile === true) {\n g.paused = true;\n }\n\n show_description(g.progress); //description.js\n\n g.progress = g.progress + 1;\n}", "function showProgress(quiz) {\n var currentQuestionNumber = quiz.questionIndex + 1;\n var element = document.getElementById(\"progress\");\n element.innerHTML = \"Question \" + currentQuestionNumber + \" of \" + quiz.questions.length;\n}", "function countTitle(str) {\r\n\tvar length = str.length;\r\n\tif(length > 50){\r\n\t\tdocument.getElementById(\"count-title\").classList.add(\"text-danger\");\r\n\t\tdocument.getElementById(\"count-title\").classList.remove(\"text-secondary\");\r\n\t} else{\r\n\t\tdocument.getElementById(\"count-title\").classList.add(\"text-secondary\");\r\n\t\tdocument.getElementById(\"count-title\").classList.remove(\"text-danger\");\r\n\t}\r\n\tdocument.getElementById(\"count-title\").innerHTML = length + '/50';\r\n}", "function showProgress() {\n var currentQuestionNumber = quiz.questionIndex + 1;\n $('#progress').html(\"Question \" + currentQuestionNumber + \" of \" + quiz.questions.length);\n}", "function progress(piece, nbPieces, page, nbPages, doc, nbDocs) {\n var percent = (piece/nbPieces)*100;\n $(\"#progress .progress-bar\").attr('aria-valuenow', percent).attr('style','width:'+percent.toFixed(2)+'%').find(\"span\").html(percent.toFixed(0) + \"%)\");\n $(\"#progressPiece\").html(\"Piece \" + piece + \"/\" + nbPieces);\n $(\"#progressPage\").html((page && nbPages) ? \"Page \" + page + \"/\" + nbPages : \"\");\n $(\"#progressDoc\").html((doc && nbDocs) ? \"Document \" + doc + \"/\" + nbDocs : \"\");\n}", "function updateChar() {\n tweet1Count.textContent = tweet1.textLength;\n}", "function showProgress() {\n console.log(quiz)\n var currentQuestionNumber = quiz.qindex;\n var element = document.getElementById(\"progress\");\n element.innerHTML = \"Question\" + currentQuestionNumber + \"of \" + quiz.questions.length;\n}", "function toolTipHTML() {\n return \"100\";\n }", "function showDataPointCount() {\n $('.dataPoints').html('<span class=\"bold\">' + dataPointCounter + ' p/s</span>');\n dataPointCounter = 0;\n}", "function questionNum() {\n $(\".questionNum\").text(\"Question \" + questionCounter + \" of 10\");\n }", "getTooltipText(){\n\t\t\n\t\tconst isConsumable = this.isConsumable(),\n\t\t\tisBreakable = ~this.slots.indexOf(Asset.Slots.upperBody) || ~this.slots.indexOf(Asset.Slots.lowerBody)\n\t\t;\n\t\tlet html = '';\n\t\t// Usable items shows the action tooltip instead\n\t\tif( isConsumable && !this.iuad )\n\t\t\treturn this.use_action.getTooltipText(true, this.rarity);\n\n\t\tlet apCost = this.equipped ? Game.UNEQUIP_COST : Game.EQUIP_COST;\n\n\n\t\thtml += '<strong class=\"'+(Asset.RarityNames[this.rarity])+'\">'+esc(this.name)+'</strong><br />';\n\t\t// Low level indicator (only affects upper/lowerbody since they're the only ones that give protection\n\t\tif( \n\t\t\tthis.isLowLevel() && \n\t\t\t(this.slots.includes(Asset.Slots.upperBody) || this.slots.includes(Asset.Slots.lowerBody)) \n\t\t){\n\n\t\t\tif( this.durability )\n\t\t\t\thtml += '<em style=\"color:#FAA\">Low level, armor reduced</em><br />';\n\t\t\telse\n\t\t\t\thtml += '<em style=\"color:#FAA\">Broken!</em><br />';\n\n\t\t}\n\t\t\n\t\thtml += '<em class=\"sub\">';\n\t\tif( game.battle_active && this.parent )\n\t\t\thtml += '[<span style=\"color:'+(this.parent.ap >= apCost ? '#DFD' : '#FDD')+'\">'+\n\t\t\t\tapCost+' AP to '+(this.equipped ? 'take off' : 'equip')+\n\t\t\t'</span>]<br />';\n\n\t\tif( this.equippable() ){\n\n\t\t\tlet lv = this.getLevel() || 0;\n\t\t\tif( lv < 0 )\n\t\t\t\tlv = game.getAveragePlayerLevel()+Math.abs(lv)-1;\n\t\t\t\n\t\t\thtml += 'Lv '+lv+' | ';\n\t\t\t\n\t\t\tif( this.isDamageable() )\n\t\t\t\thtml += (+this.durability)+'/'+this.getMaxDurability()+' Durability | ';\n\n\t\t}\n\t\thtml += this.getWeightReadable()+' ';\n\t\tif( this.equippable() ){\n\t\t\thtml += '| ';\n\t\t\tif(this.slots.length && !this.equipped)\n\t\t\t\thtml+= '<strong>'+this.slots.map(el => el.toUpperCase()).join(' + ')+'</strong>';\n\t\t\telse if(this.slots.length)\n\t\t\t\thtml+= 'Equipped <strong>'+this.slots.map(el => el.toUpperCase()).join(' + ')+'</strong>';\n\t\t}\n\t\thtml += '</em><br />';\n\n\t\t\n\t\t// Special tags:\n\t\t/*\n\t\t\t%TOD - Approximate time of day\n\t\t*/\n\t\tlet aDesc = this.description\n\t\t\t.split('%TOD').join(game.getApproxTimeOfDay())\n\t\t;\n\t\t\n\t\thtml += esc(aDesc);\n\n\t\thtml += '<div class=\"assetWrappers\">';\n\t\tfor( let wrapper of this.wrappers ){\n\n\t\t\tif( wrapper.description ){\n\t\t\t\t\n\t\t\t\tlet color = '#FAA';\n\t\t\t\tif( wrapper.rarity > 0 )\n\t\t\t\t\tcolor = Asset.RarityColors[wrapper.rarity];\n\t\t\t\tlet desc = wrapper.description;\n\n\t\t\t\thtml += '<br /><span style=\"color:'+color+'\">'+esc(desc)+'</span>';\n\n\t\t\t}\n\t\t}\n\t\thtml += '</div>';\n\n\t\treturn html;\n\t}", "updateDisplayString() {\n this.displayString = 'Increase ' + this.name + ' by ' + this.value + ' ' + this.measuringUnit;\n }", "function setAttemptText() {\n attemptTracker.innerHTML = \"You can select \" + attemptsLeft + \" more tile(s).\";\n}", "function showProgress()\n\t{\n var progress = document.getElementById(\"questionIndex\");\n progress.innerHTML = \"Question \" + indexNumber + \" of \" + total;\n\t indexNumber++;\n\t}", "function showProgress() {\n $(\".questionNumber\").text(questionNumber);\n console.log('showing progress');\n}", "function showProgress() {\n var currentQuestionNumber = quiz.triviaQuestionIndex + i;\n var element = document.getElementById(\"#progress\");\n element.innerHTML = \"Question \" + currentQuestionNumber + \"of \" + quiz.triviaQuestions.length;\n}", "showDescription(tempVal) {\r\n return (h(\"g\", { class: \"description-container sc-dxp-progressbar-0\", transform: ((this.dir && this.dir === 'rtl') ? 'scale(-1, 1) translate(-100, 0)' : ''), \"transform-origin\": \"center\" },\r\n h(\"text\", { x: \"50\", y: this.showPercentage ? '50' : '45', class: \"svg-stats sc-dxp-progressbar-0\", \"alignment-baseline\": \"middle\", \"text-anchor\": \"middle\" }, tempVal),\r\n h(\"text\", { x: \"50\", y: this.showPercentage ? '67' : '60', class: \"svg-description sc-dxp-progressbar-0\", \"alignment-baseline\": \"middle\", \"text-anchor\": \"middle\" }, this.progressDescription)));\r\n }", "function drawLabel() {\n p.text(`Trials: ${p.props.playedGames}/${p.props.countOfGames}`, 20, p.wrapper.offsetHeight-20);\n }", "function displayGuide() {\n my.html.guide.innerHTML = my.current.unit.guide\n }", "function insertText(scope) {\n $(\".progress-percentage\").text(Math.round(global_settings.percent) + \"%\");\n }", "updateProgress() {\n const { inputLength, outputLength } = this.state.data;\n const progress = this.querySelector('.progress');\n progress.innerText = `${outputLength} out of ${inputLength} sequences processed`;\n }", "showTooltip(e) {\n /* here's the gist\n - retrieve the position from the beginning of the progress bar\n - compute the relative distance in the space of the progress bar\n - use this relative distance to find the correct time\n - update tooltipTime with this value\n */\n const { target: progressBar } = e;\n\n /* offsetLeft finds\n the space between the progress bar and its container\n the space between the container and the very outer edge of the page\n\n */\n const { clientWidth: width, offsetLeft: left } = progressBar;\n const { offsetLeft: leftParent } = progressBar.parentElement;\n const offsetLeft = left + leftParent;\n\n // pageX gives the coordinate of the cursor\n const { pageX: x } = e;\n // the difference between the cursor's horizontal coordinate and the horizontal offset gives the exact space from the beginning of the bar\n const location = x - offsetLeft;\n\n // progress computed relative to the width of the progress bar (rounding to 2 numbers after the decimal)\n const progress = Math.round(location / width * 100) / 100;\n\n // find the tooltip, show it by adding the appropriate class and position it according to the relative progress\n const tooltip = progressBar.querySelector('p');\n tooltip.classList.add('isTooltip');\n tooltip.style.left = `${progress * 100}%`;\n\n // for the tooltipTime, compute its value based on the total time, multiplied by the relative progress\n // ! do this if there is an episode in the state\n const episode = this.state.episodes[this.state.currentEpisode];\n if (episode) {\n const { duration } = episode;\n const tooltipTime = Math.round(duration * progress);\n\n this.setState({\n tooltipTime\n })\n }\n\n }", "function showLives() {\n var lifeMsg;\n // gLivesCount = num;\n // var elLife = document.querySelector('.life');\n if (gLivesCount === 1) lifeMsg = `${gLivesCount} LIFE LEFT `;\n else if (!gLivesCount) lifeMsg = `NO MORE LIVES `;\n else lifeMsg = `${gLivesCount} LIVES LEFT `;\n\n if (gNumOfHintsLeft === 1) lifeMsg += `| 1 HINT LEFT`\n else if (!gNumOfHintsLeft) lifeMsg += `| NO MORE HINTS`\n else lifeMsg += `| ${gNumOfHintsLeft} HINTS LEFT`\n return lifeMsg;\n}", "function stats() {\n\t$('.stats').show(); // show STATS\n\tnt += 1;\n\t$('.stats p span').text(nt);\n}", "updateDisplay() {\n $('#steps .value').text(this.stepCounter);\n }", "function summary() {\n resetTimer();\n TEXTAREA.setAttribute(\"disabled\", \"true\");\n var result = \"Misspelled words = \" + misspelledWordsCount + \" WPM = \" + wpm;\n SUMMARY.querySelector(\"#statistics\").innerHTML = result;\n SUMMARY.style.display = \"block\";\n}", "counter(){\n let numChars = this.$el.find(\"textarea\").val().length;\n this.$el.find(\".chars-left\").html(140 - numChars);\n }", "function printStatistics() {\n var textP;\n var defxo = 0.1, //default x offset\n defwo = 1, //default width offset\n wo = 0.8 //another width offset\n deftp = 0.05; // default text percentage\n textP = \"Statistics\";\n printText(0, 0.25, defwo, textP, deftp, \"center\");\n\n //Longest Time Alive Statistic\n textP = \"Longest time alive:\";\n printText(defxo, 0.35, defwo, textP, deftp, \"left\");\n textP = calculateLongestPlayerAliveTime() + \"s\";\n printText(defxo, 0.35, wo, textP, deftp, \"right\");\n\n //Number of Deaths Statistic\n textP = \"Number of deaths:\";\n printText(defxo, 0.45, defwo, textP, deftp, \"left\");\n textP = metrics.get(\"playerHit\");\n printText(defxo, 0.45, wo, textP, deftp, \"right\");\n\n //Enemies Destroyed Statistic\n textP = \"Enemies Destroyed:\";\n printText(defxo, 0.55, defwo, textP, deftp, \"left\");\n textP = metrics.get(\"enemiesKilled\");\n printText(defxo, 0.55, wo, textP, deftp, \"right\");\n\n //Bonuses Collected Statistic\n textP = \"Bonuses collected:\";\n printText(defxo, 0.65, defwo, textP, deftp, \"left\");\n textP = metrics.get(\"bonusCollected\");\n printText(defxo, 0.65, wo, textP, deftp, \"right\");\n\n //Final Score Statistic\n textP = \"Final Score:\";\n printText(defxo, 0.75, defwo, textP, deftp, \"left\");\n textP = Crafty(\"Score\")._score;\n printText(defxo, 0.75, wo, textP, deftp, \"right\");\n}", "function progress(step, nbSteps, stepLabel) {\n var percent = (step/(nbSteps+1))*100;\n $(\"#progress .progress-bar\").attr('aria-valuenow', step).attr('aria-valuemax', nbSteps+1).attr('style','width:'+percent.toFixed(2)+'%').find(\"span\").html(step + \"/\" + nbSteps);\n $(\"#progressStep\").html(stepLabel);\n}", "function statWindow (char) { //Display character stats during the fight\n return \"Health Point: \" + char.hp +\n \"<br />Strength: \" + char.str +\n \"<br />Agility: \" + char.agi +\n \"<br />Intelligence: \" + char.int;\n}", "function updateCounter() {\n var charCount = tweetBody().length;\n $('#counter').html(140 - charCount);\n }", "function charCount(char_count, value, max_length) {\n const lng = value.length;\n const remainingLengthInPercentage = lng / max_length * 100;\n\n char_count.hide();\n if (remainingLengthInPercentage > 80) {\n char_count.show();\n char_count.html(lng + ' van de 100 maximale karakters')\n }\n }", "function displayResults() {\n display.innerHTML = \"Character Count: \" + \"<strong>\" + charLength + \"</strong>\" + \"<br>\" + \"Word Count: \" + \"<strong>\" + wordCount + \"</strong>\";\n}", "displayPlayerChips() {\r\n utilFunctions.documents[utilFunctions.players.indexOf(this)].playerMoneyEl.textContent = `${this.name} has $${this.chips} chips available`\r\n }", "function countSteps() {\n\n steps += 1;\n document.getElementById(\"numberOfSteps\").innerHTML = \"Steps: \" + steps;\n}", "function $text(percent, font){\n\tlet percentage = $height(100) / 100 * percent;\n\treturn +percentage + \"px \" + font;\n}", "initPlayerScore()\n {\n $('#numberOfScore').text(`${playerScore}`);\n }", "function setCounter() {\n document.getElementById(\"counter\").innerText = \"Counter : \" + attempts_counter;\n}", "function displaycompteur() {\n $compteur.innerHTML = pattern.length;\n }", "function show_num_words() {\n\n // YOUR CODE GOES HERE\n}", "function _getProgress(){// Steps are 0 indexed\nvar currentStep=parseInt(this._currentStep+1,10);return currentStep/this._introItems.length*100;}", "updateExploreText(){\n console.log(this.isTome);\n if(this.board.isTome){\n return;\n }\n var text = \"\";\n if(this.board.game.gameData.gameMode == \"DOTS\"){\n text = \"path score: \" + this.hexesInPath.length + \" + \" + this.additionalHexes.size;\n\n }else{\n var loopModText = \"\";\n if(this.isLoop){\n if(this.hexesInPath.length>3){\n loopModText = \"+3\";\n }else{\n loopModText = \"+1\";\n }\n }\n var communityText = \"\";\n\n for(var i = 0; i<this.getNumDifferentInLoop(); i++){\n communityText+= \"+5\"\n }\n text = \"path score: \" + this.hexesInPath.length + loopModText + communityText;\n }\n\n this.board.exploreScoreText.setText(text);\n\n }", "function Title(i) {\n //adding title to progress bar\n document.getElementsByTagName(\"progress\")[i].title = levels[i];\n}", "function updateQuestionCounter() {\n\tquestionNumber++; \n\tquestionCounter.textContent = `Question ${questionNumber} of ${totalQuestion}`;\n}", "mainText() {\n return 'Long-Live *as* ' + this.fullName();\n }", "updateUI() {\n this.scoreText.setText(`Score ${this.bumperPoint}`);\n\n const emojis = [];\n for (let i = 0; i < this.healthPoint; i++) {\n emojis.push('❤');\n }\n let healthHearts = emojis.join().replace(/\\,/g, ' ');\n this.healthText.setText(`Health ${healthHearts}`);\n }", "function displayHowManyClasses() {\n const $numOfClassesDiv = $(\".num-classes-taught\");\n\n //minus 1 because last array item is always just trainers name.\n const classNumTaught = trainerClassInfo.length - 1;\n\n $numOfClassesDiv.html(`<b>${classNumTaught}</b>`);\n }", "function showProgress() {\n var bar = document.getElementById(\"bar\");\n var width = parseInt(bar.style.width = (6 + (totalClicks / 15 * 100)) + '%');\n bar.innerText = '';\n var percent = document.createElement('p');\n if (totalClicks == 15) {\n bar.style.width = '0%';\n var progress = document.getElementById(\"progress\");\n progress.style.width = '0%';\n } else {\n percent.innerText = width + '%';\n bar.appendChild(percent);\n }\n}", "function view(counter){\nreturn (`\\nCount: ${counter}\\nAdd(+)/Substract(-)/\"q\" to quit\\n`);\n}", "function updateCurrentText() {\n curEl.innerText = `${curActCd + 1}/${cardsEl.length}` \n}", "function updateToolTip(charData) {\n h = charData[\"name\"] + \"<br>\"\n + charData['title'] + \"<br>\"\n + charData['composure'] + \"<br>\"\n return h\n}", "function updateCharCount(input){\n var characters_left = 160 - input.val().length;\n $('#character-count').text(characters_left);\n }", "simpleProgress(styles) {\n if (this.props.questionCount > 1 && AssessmentStore.isPractice()) {\n return (\n <span\n style={styles.counter}\n aria-label={`You are on question ${this.props.currentIndex + 1} of ${this.props.questionCount}`}\n >\n {this.props.currentIndex + 1} of {this.props.questionCount}\n </span>\n );\n }\n }", "function movesCounterDisplay(counter){\n let mc = document.getElementsByClassName(\"moves\")[0];\n mc.textContent = counter;\n}", "function fnCounter() { $(\"#counter-\" + this.id).text(Math.abs(this.getAttribute(\"maxlength\") - sb.size(this.value))); }", "getShortTitle() {\n \n let showDetails = this.get('showDetails');\n // Good enough for two lines max\n let limit = showDetails ? 80 : 40;\n let title = this.get('taskCard.title');\n if(title.length < limit) {\n return title;\n }\n \n return `${title.slice(0, limit)}...`;\n }", "function writte() {\r\n\r\n setInterval(() => {\r\n if (words.length > 0) {\r\n p.innerText += words.shift();\r\n }\r\n owl.style.opacity = 1;\r\n }, 70);\r\n\r\n // if (p == \"...\") {\r\n setInterval(() => {\r\n\r\n if (count <= 99) {\r\n count++;\r\n counter.innerText = \" \" + count + \"%\";\r\n\r\n }\r\n\r\n }, 10);\r\n // }\r\n}", "function drawPercentage() {\n context.font = \"35px Times\";\n context.fillStyle = \"black\";\n context.textAlign = \"center\";\n context.fillText(scoreText, 120, 100);\n }", "function updateCharCount(target) {\n var length = target.value.length;\n displayMessage(length + \" characters\");\n}", "function generateTip() {\n\t\tvar tipIndex = generateNumber();\n\t\tvar tip = tipsArray[tipIndex];\n\n\t\t$('.tip-index').html(tipIndex + 1);\n\t\t$('.js-tip').html(tip);\n\n\t\tif (count === 1) {\n\t\t\t$('.plural').html('');\n\t\t} else {\n\t\t\t$('.plural').html('s');\n\t\t}\n\t\t$('.status').html(count);\n\t}", "function score() {\n\treturn `Human: ${playerPoints} Computer: ${computerPoints}`;\n}", "function numberSteps() {\n\tlet countPlay = numMove + 1; \n\tnumMove = document.getElementById('moveCount').innerHTML = countPlay;\n}", "function calculateCompletion() {\r\n $(\"#stepNo\").html(step);\r\n var percentCompleted = Math.round((step - 1) / (maxStep - 1) * 100 / 5) * 5;\r\n if (percentCompleted == 0) {\r\n percentCompleted += 5;\r\n }\r\n $(\"#percentCompleted\").html(percentCompleted);\r\n $(\"#percentMeter\").css('width', percentCompleted + '%');\r\n}", "function displayTestInfo() {\n $(\".questionAndScore\").html(`<li>Question: ${currentQuestionNumber}/5</li><li>Score: ${currentScore}/5</li>`);\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 progressBarContent(bar, text, max, value) {\n let meterContent = '';\n meterContent = `${text} ${value}/${max}`;\n let pad = ~~((bar.width / 2) - (meterContent.length / 2));\n bar.setContent(new Array(pad + 1).join(' ') + meterContent);\n bar.setProgress(value / max * 100);\n}", "function currentIntroProgress() {\n\t\tif (!speechBuffer || !me.speechTitleEnabled) {\n\t\t\treturn 1;\n\t\t}\n\n\t\tconst latestContextTime = playing ?\n\t\t\tcontext.currentTime :\n\t\t\tpauseTime;\n\n\t\tconst timeSinceStarted = latestContextTime - baselineTime;\n\t\tconst introDuration = speechBuffer.duration;\n\t\tconst progressSinceStarted = timeSinceStarted / introDuration;\n\t\treturn Math.max(0, Math.min(1, baselineIntroProgress + progressSinceStarted));\n\t}", "function drawStat(){\r\n\tctx.font = '25px Helvetica';\r\n\tctx.fillStyle = '#333';\r\n\r\n\tvar score = 'SCORE:' + heroScore;\r\n\tctx.fillText(score, 10, 35);\r\n\r\n\tvar heros = 'LIVES:' + heroCount;\r\n\tvar w = ctx.measureText(heros).width;\r\n\tctx.fillText(heros, canvasWidth-w-10, 35);\r\n}", "function updateSummary() {\n summary.innerHTML = `${summaryCountChecked} / ${summaryCountTotal} Completed`;\n}", "function countMoves () {\n textMove.innerHTML = `Moves: ${moves}`\n}", "function updateCharacterCount() {\n\ttry {\n\t\tvar content = $(\"#insightContent\").val();\n\t\tvar size = content.length;\n\t\tvar percent = size / MAX_CHARACTERS_INSIGHT * 100;\n\t\t$(\"#currentCaractersNumbers\").html(size);\n\t\t$( \"#progressbar\" ).progressbar({\n\t\t\tvalue: percent\n\t\t});\n\t\t\n\t\tif( size > MAX_CHARACTERS_INSIGHT ) {\n\t\t\t$(\"#caracterNumbers\").addClass(\"tooMuchCharacters\");\n\t\t} else {\n\t\t\t$(\"#caracterNumbers\").removeClass(\"tooMuchCharacters\");\n\t\t}\n\t} catch(e) {}\n}", "function displayTooltip(tooltipID, contentTitle, contentFooter, xPosition, yPosition, key, count, units) {\n if(key == '') {\n var label = ''\n } else {\n var label = key + ': '\n }\n\n d3.select(tooltipID)\n .style('left', xPosition + 'px')\n .style('top', yPosition + 'px')\n .select(contentTitle)\n .text(function() {\n if(units == '%' || units == '% Failed') {\n return label + count + units\n } else {\n return label + count + ' ' + units\n }\n })\n\n\n d3.select(tooltipID)\n .style('left', xPosition + 'px')\n .style('top', yPosition + 'px')\n\n d3.select(tooltipID).classed('hidden', false);\n}", "function overallScore() {\r\n return `\r\n <div class=\"current-score\">\r\n <p id=\"score\">\r\n Current Score: ${store.score} out of ${store.questions.length}\r\n </p>\r\n </div>\r\n `; \r\n}", "function calculateTip(total, tippercent=.2){\n let tip = tippercent * 100\n let amount = total * tippercent\n return `A ${tip}% on $${total} would be $${amount}`\n}", "title() {\n return `Number of live incidents: ${this.liveIncidents}`\n }", "GetTitleString() {\n\t\treturn this.Name + ' (' + Object.keys( this.Players ).length + ')';\n\t}", "setToolTipContent(element, item) {\n element.text('Unemployed: ' + Math.round(this.valueAccessor(item) * 100) +'%');\n }", "showStats(){\n console.log(\"Name:\", this.name, \"\\nStrength:\", this.strength, \"\\nSpeed:\", this.speed, \"\\nHealth:\", this.health);\n }", "function _getProgress() {\n // Steps are 0 indexed\n var currentStep = parseInt((this._currentStep + 1), 10);\n return ((currentStep / this._introItems.length) * 100);\n }", "function _getProgress() {\n // Steps are 0 indexed\n var currentStep = parseInt((this._currentStep + 1), 10);\n return ((currentStep / this._introItems.length) * 100);\n }", "function _getProgress() {\n // Steps are 0 indexed\n var currentStep = parseInt((this._currentStep + 1), 10);\n return ((currentStep / this._introItems.length) * 100);\n }", "function _getProgress() {\n // Steps are 0 indexed\n var currentStep = parseInt((this._currentStep + 1), 10);\n return ((currentStep / this._introItems.length) * 100);\n }", "function Pssbar(pr) {\n elem.style.width = pr + '%';\n elem.innerHTML = pr * 1 + '%';\n}", "function showQuestionNumber(){\n\t\t$(\"#question\").html((questionNumber+1)+\"/6\");\n\t}", "function update_character_count( txt ) {\n\n if( !txt )\n return;\n \n // trim whitespace and strip html tags\n txt = $.trim( txt.replace( /(<([^>]+)>)/ig, '' ) );\n\n // get the character count\n count = txt.length;\n \n // checkout count against max characters\n if( count > max_chars ) {\n \n // disable publish button\n $('#publishing-action').find('input[type=\"submit\"]').attr('disabled', 'disabled');\n \n // add class to highlight red\n $('#characters-remaining').addClass('over');\n $('#WBC3_guest_contributor_bio_ifr').addClass('over');\n\n // calculate diff\n diff = parseInt( count - max_chars );\n note = ' Over';\n \n } else {\n \n // reenable publish button\n $('#publishing-action').find('input[type=\"submit\"]').removeAttr('disabled');\n \n // remove class\n $('#characters-remaining').removeClass('over');\n $('#WBC3_guest_contributor_bio_ifr').removeClass('over');\n \n // calculate diff\n diff = parseInt( max_chars - count );\n note = ' Remaining';\n \n }\n\n // update count\n $('#characters-remaining').html( diff + note );\n }", "function changeProgressBar(qCount) {\n\n progress.innerHTML = \"Question \" + (qCount+1) + \" of 10\";\n tracker = id(\"num\" + (qCount+1));\n tracker.style.backgroundColor = \"orange\";\n\n}", "function drawStats() {\n\t\tterm.terminal.saveCursor();\n\t\tif (startIndex === 0) var scrollText = \"Scroll: 0% \";\n\t\telse var scrollText = \"Scroll: \" + ((startIndex / textLines.length) * 100).toFixed() + \"% \";\n\t\tvar linesText = \" Lines: \" + textLines.length;\n\t\tvar titleText = \"HzVelocity REPL | \" + hzDisp.queue.blocks.length + \" Coroutines \" + (paused ? \"Paused\" : \"Running\");\n\t\tvar spacesLen = Number(((process.stdout.columns - (scrollText.length + linesText.length + titleText.length)) / 2).toFixed());\n\t\tvar spaces = (new Array(spacesLen)).fill(\" \").join(\"\");\n\t\tvar text = linesText + spaces + titleText + spaces + scrollText;\n\t\tstatTextBuffer.setText(text);\n\t\tstatTextBuffer.setAttrRegion({\n\t\t\tbgColor: \"white\",\n\t\t\tcolor: \"black\"\n\t\t}, {\n\t\t\txmin: 0,\n\t\t\txmax: process.stdout.columns,\n\t\t\tymin: 0,\n\t\t\tymax: 1\n\t\t});\n\t\tstatTextBuffer.draw();\n\t\tstatScreenBuffer.draw();\n\t\tterm.terminal.restoreCursor();\n\t}", "function renderQNum(currentQuestion){\n currentQuestion.text((counter + 1) + ' of ' + quizLength);\n }" ]
[ "0.63974106", "0.63857794", "0.6294473", "0.608395", "0.60486114", "0.60395604", "0.60382754", "0.6016912", "0.6004261", "0.5978744", "0.59687585", "0.5904694", "0.589417", "0.5893446", "0.5883062", "0.58821046", "0.5881417", "0.58747065", "0.5828251", "0.5799645", "0.5796174", "0.5773258", "0.57575035", "0.5755384", "0.574395", "0.57376766", "0.5733984", "0.57333666", "0.5717199", "0.5702513", "0.56877935", "0.5676247", "0.5669258", "0.56641024", "0.56610817", "0.5657753", "0.56550795", "0.5638515", "0.56266147", "0.5625868", "0.5615771", "0.5590483", "0.55894256", "0.5572201", "0.55680925", "0.55669373", "0.5565599", "0.5552957", "0.5549118", "0.5542881", "0.5532982", "0.55312353", "0.55171746", "0.55042475", "0.5500525", "0.5500104", "0.5494082", "0.54875666", "0.5485646", "0.5483441", "0.548333", "0.54717296", "0.5469663", "0.546839", "0.5467009", "0.5460842", "0.5457189", "0.54557496", "0.5452124", "0.5449773", "0.5448353", "0.5447207", "0.5443375", "0.5442178", "0.5441838", "0.5425835", "0.5424932", "0.54226273", "0.54204386", "0.5416081", "0.54035276", "0.5400705", "0.54001653", "0.539629", "0.539197", "0.53848106", "0.538098", "0.5378261", "0.53751576", "0.5374091", "0.53733486", "0.53733486", "0.53733486", "0.53733486", "0.5361989", "0.5360421", "0.53554934", "0.5355116", "0.5354513", "0.53534293" ]
0.7974769
0
Display alternate unit links for units which alternate units are available. Display nothing otherwise.
function displayAlternateUnitLinks() { // If alternate unit is not available for the current unit, // hide the alternate links element if (!alternateUnitAvailable(my.current.unitNo)) { alternateUnitLinks.style.visibility = 'hidden' return } // Delete all existing alternate unit links Util.removeChildren(alternateUnitLinks) // Create div elements for the main unit and alternate unit var mainUnitElement = boxedLink(Units.mainLabel, my.settings.unit == my.UNIT.MAIN, '#', toggleUnit) var alternateUnitElement = boxedLink(Units.alternateLabel, my.settings.unit == my.UNIT.ALTERNATE, '#', toggleUnit) alternateUnitLinks.appendChild(mainUnitElement) alternateUnitLinks.appendChild(alternateUnitElement) alternateUnitLinks.style.visibility = 'visible' }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function displayUnitLinks()\n {\n // Delete all existing unit links\n var linksDiv = my.html.unitLinks\n Util.removeChildren(linksDiv)\n\n // Create new unit links\n for (var i = 0; i < Units.main.length; i++) {\n var label = 'སློབ་མཚན། ' + (i + 1)\n var selected = (i + 1 == my.current.unitNo)\n var href = unitHref(i + 1)\n\n var divElement = boxedLink(label, selected, href)\n divElement.id = 'unit' + (i + 1)\n divElement.title = unit(i + 1).title\n\n linksDiv.appendChild(divElement)\n }\n }", "function displaySubunitLinks()\n {\n // Delete all existing subunit links\n var linksDiv = my.html.subunitLinks\n while (linksDiv.firstChild &&\n linksDiv.firstChild.className != 'stretch') {\n\n linksDiv.removeChild(linksDiv.firstChild)\n }\n\n // Create new subunit links for the unit m\n var numberOfSubunits = my.current.subunitTitles.length\n for (var i = numberOfSubunits - 1; i >= 0; i--) {\n // Insert whitespaces between div elements, otherwise they\n // would not be justified\n var whitespace = document.createTextNode('\\n')\n linksDiv.insertBefore(whitespace, linksDiv.firstChild)\n\n var label = my.current.subunitTitles[i]\n var selected = (i + 1 == my.current.subunitNo)\n var href = unitHref(my.current.unitNo, i + 1)\n\n var subunitDiv = boxedLink(label, selected, href)\n subunitDiv.id = 'subunit' + (i + 1)\n subunitDiv.style.width = (95 / numberOfSubunits) + '%'\n\n linksDiv.insertBefore(subunitDiv, linksDiv.firstChild)\n }\n }", "function updateNavigationLinks()\n {\n if (currentSubunitIsTheFirstSubunit()) {\n my.html.previousLink.style.visibility = 'hidden'\n my.html.nextLink.style.visibility = 'visible'\n } else if (currentSubunitIsTheLastSubunit()) {\n my.html.previousLink.style.visibility = 'visible'\n my.html.nextLink.style.visibility = 'hidden'\n } else {\n my.html.previousLink.style.visibility = 'visible'\n my.html.nextLink.style.visibility = 'visible'\n }\n }", "function alternateUnitAvailable(m)\n {\n if (m >= Units.alternateStart &&\n m < Units.alternateStart + Units.alternate.length) {\n return true\n } else {\n return false\n }\n }", "function unitHref(m, n)\n {\n if (typeof m == 'undefined') {\n return ''\n } else if (typeof n == 'undefined') {\n return '#' + m\n } else {\n return '#' + m + '.' + n\n }\n }", "function displayUnitTitle() {\n\n // Parts of the unit title\n var unitNo = 'སློབ་མཚན། ' + my.current.unitNo +\n '.' + my.current.subunitNo\n var space = '\\u00a0\\u00a0'\n var title = '[' + my.current.unit.title + ']'\n\n Util.setChildren(my.html.unitTitle, unitNo, space, title)\n }", "function displayAlternativeSettings(){\n displaySettings();\n alternatives.showAlternative(alternativeList[1]);\n}", "function unit() {\n // Add more tests here.\n return linkUnit();\n}", "function nextSubunit()\n {\n var m = my.current.unitNo\n var n = my.current.subunitNo\n\n if (!currentSubunitIsTheLastSubunit()) {\n if (n == my.current.subunitTitles.length) {\n // If the user is at unit M.L where L is the last\n // subunit of unit M, then go to unit (M + 1).1.\n m++\n n = 1\n } else {\n // If the user is at unit M.N, then go to unit M.(N + 1).\n n++\n }\n }\n\n window.location.href = unitHref(m, n)\n }", "function renderUnit(unit) {\n return crel('li',\n crel('span', {'class':'naam'}, unit.naam), \n crel('span', {'class':'afkorting'}, unit.afkorting),\n crel('span', {'class':'wikilink'},\n crel ('a', {'href':unit.wikilink},unit.wikilink)),\n crel('span', {'class':'wow'}, unit.wieofwat),\n crel('span', {'class':'foto'}, \n crel ('img', {'src': unit.foto})),\n )\n }", "function showUnits() {\n console.log(\"showUnits()\");\n units.forEach(unit => {\n /*\n // add unit names to page\n var unitName = document.createElement(\"h1\");\n unitName.innerText = unit.fields.name;\n document.body.appendChild(unitName);\n\n // add unit location to page\n unitLocation = document.createElement(\"p\");\n unitLocation.innerText = unit.fields.location;\n document.body.appendChild(unitLocation);\n\n // add image to page\n var unitImage = document.createElement(\"img\");\n unitImage.src = unit.fields.image[0].url;\n document.body.appendChild(unitImage); */\n\n // creating a new div container, where our unit info will go\n var unitContainer = document.createElement(\"div\");\n unitContainer.classList.add(\"unit-container\");\n document.querySelector(\".container\").append(unitContainer);\n\n // add unit names to unit container\n var unitName = document.createElement(\"h2\");\n unitName.classList.add(\"unit-name\");\n unitName.innerText = unit.fields.name;\n unitContainer.append(unitName);\n\n // add location to unit container\n var unitLocation = document.createElement(\"h3\");\n unitLocation.classList.add(\"unit-location\");\n unitLocation.innerText = unit.fields.location;\n unitLocation.style.color = \"#5F5C4F\";\n unitContainer.append(unitLocation);\n\n // add description to container\n var unitDescription = document.createElement(\"p\");\n unitDescription.classList.add(\"unit-description\");\n unitDescription.innerText = unit.fields.description;\n unitContainer.append(unitDescription);\n\n // add image to container\n var unitImage = document.createElement(\"img\");\n unitImage.classList.add(\"unit-image\");\n unitImage.src = unit.fields.image[0].url;\n unitContainer.append(unitImage);\n\n // add event listener\n // when user clicks on unit container\n // image and description will appear or disappear\n unitContainer.addEventListener(\"click\", function() {\n unitDescription.classList.toggle(\"active\");\n unitImage.classList.toggle(\"active\");\n });\n\n // add to each container as a class\n var unitCh = unit.fields.chapter;\n console.log(unitCh);\n unitContainer.classList.add(unitCh);\n\n // filter by chapter 2\n var filterCh2 = document.querySelector(\".ch2\");\n filterCh2.addEventListener(\"click\", function(){\n if(unitContainer.classList.contains(\"chapter2\")){\n unitContainer.style.background = \"#D7D2B5\";\n }\n else{\n unitContainer.style.background = \"#9f9b86\";\n }\n })\n\n var filterCh3 = document.querySelector(\".ch3\");\n filterCh3.addEventListener(\"click\", function(){\n if(unitContainer.classList.contains(\"chapter3\")){\n unitContainer.style.background = \"#D7D2B5\";\n }\n else{\n unitContainer.style.background = \"#9f9b86\";\n }\n })\n\n var filterCh4 = document.querySelector(\".ch4\");\n filterCh4.addEventListener(\"click\", function(){\n if(unitContainer.classList.contains(\"chapter4\")){\n unitContainer.style.background = \"#D7D2B5\";\n }\n else{\n unitContainer.style.background = \"#9f9b86\";\n }\n })\n\n var filterCh5 = document.querySelector(\".ch5\");\n filterCh5.addEventListener(\"click\", function(){\n if(unitContainer.classList.contains(\"chapter5\")){\n unitContainer.style.background = \"#D7D2B5\";\n }\n else{\n unitContainer.style.background = \"#9f9b86\";\n }\n })\n\n var filterCh6 = document.querySelector(\".ch6\");\n filterCh6.addEventListener(\"click\", function(){\n if(unitContainer.classList.contains(\"chapter6\")){\n unitContainer.style.background = \"#D7D2B5\";\n }\n else{\n unitContainer.style.background = \"#9f9b86\";\n }\n })\n\n var filterCh9 = document.querySelector(\".ch9\");\n filterCh9.addEventListener(\"click\", function(){\n if(unitContainer.classList.contains(\"chapter9\")){\n unitContainer.style.background = \"#D7D2B5\";\n }\n else{\n unitContainer.style.background = \"#9f9b86\";\n }\n })\n\n var filterCh13 = document.querySelector(\".ch13\");\n filterCh13.addEventListener(\"click\", function(){\n if(unitContainer.classList.contains(\"chapter13\")){\n unitContainer.style.background = \"#D7D2B5\";\n }\n else{\n unitContainer.style.background = \"#9f9b86\";\n }\n })\n\n var filterCh14 = document.querySelector(\".ch14\");\n filterCh14.addEventListener(\"click\", function(){\n if(unitContainer.classList.contains(\"chapter14\")){\n unitContainer.style.background = \"#D7D2B5\";\n }\n else{\n unitContainer.style.background = \"#9f9b86\";\n }\n })\n\n var filterCh17 = document.querySelector(\".ch17\");\n filterCh17.addEventListener(\"click\", function(){\n if(unitContainer.classList.contains(\"chapter17\")){\n unitContainer.style.background = \"#D7D2B5\";\n }\n else{\n unitContainer.style.background = \"#9f9b86\";\n }\n })\n\n var reset = document.querySelector(\".reset\");\n reset.addEventListener(\"click\", function(){\n unitContainer.style.background = \"#9f9b86\";\n })\n });\n}", "function unit(m)\n {\n if (alternateUnitAvailable(m) &&\n my.settings.unit == my.UNIT.ALTERNATE) {\n return Units.alternate[m - Units.alternateStart]\n } else {\n return Units.main[m - 1]\n }\n }", "function displayGuide() {\n my.html.guide.innerHTML = my.current.unit.guide\n }", "function unitListVisible() {\n setVisible(!visible);\n }", "show() {\n for (let node of this.nodes) {\n node.show();\n node.showLinks();\n }\n }", "function eLink(db,nm) {\n\tdbs = new Array(\"http://us.battle.net/wow/en/search?f=wowitem&q=\",\"http://www.wowhead.com/?search=\");\n\tdbTs = new Array(\"Armory\",\"Wowhead\");\n\tdbHs = new Array(\"&real; \",\"&omega; \");\n\tel = '<a href=\"'+ dbs[db]+nm + '\" target=\"_blank\" title=\"'+ dbTs[db] +'\">'+ dbHs[db] + '</a>';\n\treturn el;\n}", "function showLinks() {\n var imageEl = document.getElementById('image');\n var voiceEl = document.getElementById('voice');\n for (var i = 0; i < visibleLinks.length; ++i) {\n if(RegExp('jpg|jpeg|png|gif').test(visibleLinks[i])){\n imageEl.dataset.url = visibleLinks[i];\n imageEl.style.display = null;\n } else if(RegExp('wav|mp3').test(visibleLinks[i])) {\n voiceEl.dataset.url = visibleLinks[i];\n voiceEl.style.display = null;\n }\n }\n}", "function showLinkLabel(e) {\n var label = e.subject.findObject(\"LABEL\");\n if (label !== null) label.visible = (e.subject.fromNode.data.figure === \"Diamond\");\n }", "function showItineraryInfo(){\n\tif(directionsDisplay){\n\t\tvar html = '';\n\t\thtml += '<div id=\"intinerary\"><ul>Your Itinerary:';\n\t\tvar letter = 'A';\n\t\tfor(var i=0;i<itinerary.length;i++){\n\t\t\thtml += '<li>'+letter+': '+results[itinerary[i]].name+'</li>';\n\t\t\tletter = String.fromCharCode(letter.charCodeAt(0) + 1);\n\t\t}\n\t\thtml += '</ul></div>';\n\t\t\n\t\titineraryContainer.innerHTML = html;\n\t\tdirectionsDisplay.setPanel(document.getElementById('intinerary'));\n\t}\n}", "function displaySongsByArtist(targetdiv,linker,grouplinker) {\n var route = \"/songs\";\n if (searchstring !== \"\") route += \"?search=\"+searchstring;\n getServerData(route, function(songs) {\n var artists = {};\n songs.forEach(function(song) {\n if (typeof artists[song.artist] === 'undefined') artists[song.artist] = [];\n artists[song.artist].push(song);\n });\n\n targetdiv.innerHTML = \"\";\n var artistid = 0;\n for (artistname in artists) {\n targetdiv.appendChild(\n createAccordionNode(targetdiv,artistid++, artistname, artists[artistname],\"artist\",linker,grouplinker)\n );\n }\n });\n}", "function toggleUnit()\n {\n var newUnit\n var confirmMessage\n\n if (my.settings.unit == my.UNIT.MAIN) {\n newUnit = my.UNIT.ALTERNATE\n confirmMessage = Units.alternateConfirmMessage\n } else {\n newUnit = my.UNIT.MAIN\n confirmMessage = Units.mainConfirmMessage\n }\n\n if (!confirm(confirmMessage)) {\n return false\n }\n\n localStorage.unit = newUnit\n loadSettings()\n updateUnitFromURL()\n return false\n }", "function displayLinks (startIndex, numLinks) {\n\n for (let index = 0; index < linksToDisplay.length; index += 1) {\n if ((index >= startIndex) && (index < startIndex + numLinks)) {\n linksToDisplay[index].style.display = \"\";\n } else {\n linksToDisplay[index].style.display = \"none\";\n }\n }\n\n}", "function currentSubunit()\n {\n var m = my.current.unitNo\n var n = my.current.subunitNo\n\n window.location.href = unitHref(m, n)\n }", "function updateDisplay(ensembles)\n{\n\tif(ensembles == undefined){\n\t\t$(\"alsoModule\").style.display = \"none\";\n\t\t$(\"outfit_link\").style.display = \"none\";\n\t\treturn;\n\t}\n\tif (ensembles.length <= 0 ) {\n\t\t$(\"alsoModule\").style.display = \"none\";\n\t\t$(\"outfit_link\").style.display = \"none\";\n\t\treturn;\n\t}\n\tvar out = document.getElementById(\"thumbs\");\n\tout.innerHTML = \"\";\n\tulElement = createTag('ul', 'alsoModuleContent', 'thumbs clearfix');\n\tfor (var i = 0; i < ensembles.length; i++) {\n\t\tvar image = ensembles[i].img;\n\t\tvar ensemble_id = ensembles[i].id;\n\t\tvar name = ensembles[i].name;\n\t\tvar imgElement = createDOM('img', {'src':'' + image});\n var bodyClassName = document.body.className;\n var aElement;\n if (bodyClassName.match('STANDALONE-PRODUCT-PAGE')){\n var ensembleUrl = getBaseURL() + '/catalog/product.jsp?ensembleId=' + ensemble_id;\n var ebCMCatInfo = $(\"ebCM_CATEGORY_INFO\");\n var categoryInfo = null;\n if (ebCMCatInfo !== null) {\n \tcategoryInfo = $(\"ebCM_CATEGORY_INFO\").value;\n } \n if(categoryInfo == null || categoryInfo == \"null\"){\n \t aElement = createDOM('a', {'href':ensembleUrl, 'alt':'' + name});\n }\n else {\n \t aElement = createDOM('a', {'href':ensembleUrl+categoryInfo, 'alt':'' + name});\n }\n } else {\n aElement = createDOM('a', {'href':'javascript:YAHOO.ebauer.productUtils.completer(\\'' + ensemble_id + '\\')' , 'alt':'' + name});\n }\n aElement.appendChild(imgElement);\n\t\t//var aElement = createDOM('a', {'href':'javascript:YAHOO.ebauer.productUtils.completer(\\'' + ensemble_id + '\\')' , 'alt':'' + name});\n\n\n\t\tvar liElement = '';\n\t\tif (ensemble_id == shownEnsembleId) {\n\t\t\tliElement = createTag('li', 'alsoThumb' + i, 'hot', aElement);\n\t\t} else {\n\t\t\tliElement = createTag('li', 'alsoThumb' + i, 'not', aElement);\n\t\t}\n\t\tulElement.appendChild(liElement);\n\t}\n\tout.appendChild(ulElement);\n}", "function show_mainUnit(){\n $(\".bg-model2,.bg-model3,.bg-model4,.bg-model5,.bg-model6,.bg-model7,.bg-model8\").css('display', 'none');\n $(\".bg-model\").css('display', 'flex');\n }", "function setDisplayUnits(units) {\n if (units === 'nautical') {\n localStorage['displayUnits'] = \"nautical\";\n } else if (units === 'metric') {\n localStorage['displayUnits'] = \"metric\";\n } else if (units === 'imperial') {\n localStorage['displayUnits'] = \"imperial\";\n }\n onDisplayUnitsChanged();\n}", "populateUnitMenus() {\n\t\tlet category = this.m_catMenu.value;\n\t\tthis.m_unitAMenu.innerHTML = \"\";\n\t\tCONFIG[category].forEach(function(item) {\n\t\t\tGUI.m_unitAMenu.innerHTML += \"<option value=\\\"\" + item[0] + \"\\\">\" + item[1] + \"</option>\";\n\t\t});\n\t\t\n\t\tthis.m_unitBMenu.innerHTML = \"\";\n\t\tCONFIG[category].forEach(function(item) {\n\t\t\tGUI.m_unitBMenu.innerHTML += \"<option value=\\\"\" + item[0] + \"\\\">\" + item[1] + \"</option>\";\n\t\t});\n\t}", "function atLinks() {\n linklist = [\"239MTG\", \"affinityforartifacts\", \"alliesmtg\", \"AllStandards\", \"Alphabetter\", \"Amonkhet\", \"architectMTG\", \"ArclightPhoenixMTG\", \"aristocratsMTG\", \"BadMTGCombos\", \"basementboardgames\", \"BaSE_MtG\", \"BudgetBrews\", \"budgetdecks\", \"BulkMagic\", \"cardsphere\", \"casualmtg\", \"CatsPlayingMTG\", \"CircuitContest\", \"cocomtg\", \"CompetitiveEDH\", \"custommagic\", \"DeckbuildingPrompts\", \"edh\", \"EDHug\", \"EggsMTG\", \"ElvesMTG\", \"enchantress\", \"EsperMagic\", \"findmycard\", \"fishmtg\", \"FlickerMTG\", \"freemagic\", \"goblinsMTG\", \"HamiltonMTG\", \"HardenedScales\", \"humansmtg\", \"infect\", \"johnnys\", \"kikichord\", \"lanternmtg\", \"lavaspike\", \"locketstorm\", \"lrcast\", \"magicarena\", \"Magicdeckbuilding\", \"MagicDuels\", \"magicTCG\", \"magicTCG101\", \"MakingMagic\", \"marchesatheblackrose\", \"marduMTG\", \"MentalMentalMagic\", \"millMTG\", \"ModernLoam\", \"modernmagic\", \"ModernRecMTG\", \"modernspikes\", \"ModernZombies\", \"monobluemagic\", \"mtg\", \"MTGAngels\", \"mtgbattlebox\", \"mtgbracket\", \"mtgbrawl\", \"mtgbudgetmodern\", \"mtgcardfetcher\", \"mtgcube\", \"MTGDredge\", \"mtgfinalfrontier\", \"mtgfinance\", \"mtgfrontier\", \"mtglegacy\", \"MTGManalessDredge\", \"MTGMaverick\", \"mtgmel\", \"mtgrules\", \"mtgspirits\", \"mtgtreefolk\", \"mtgvorthos\", \"neobrand\", \"nicfitmtg\", \"oathbreaker_mtg\", \"oldschoolmtg\", \"pauper\", \"PauperArena\", \"PauperEDH\", \"peasantcube\", \"PennyDreadfulMTG\", \"PioneerMTG\", \"planeshiftmtg\", \"ponzamtg\", \"RatsMTG\", \"RealLifeMTG\", \"RecklessBrewery\", \"rpg_brasil\", \"scapeshift\", \"shittyjudgequestions\", \"sistersmtg\", \"skredred\", \"Sligh\", \"spikes\", \"stoneblade\", \"StrangeBrewEDH\", \"SuperUltraBudgetEDH\", \"therandomclub\", \"Thoptersword\", \"threecardblind\", \"TinyLeaders\", \"TronMTG\", \"UBFaeries\", \"uwcontrol\", \"xmage\", \"reddit.com/message\", \"reddit.com/user/MTGCardFetcher\"]\n\n for (j = 0; j < linklist.length; j++) {\n if (location.href.toLowerCase().includes(linklist[j].toLowerCase()))\n return true;\n }\n return false;\n}", "function displayArtEuropeana(data) {\n for (let i = 0; i < data.items.length; i++) {\n const art = document.querySelector(\".art-div\");\n\n const artLink = document.createElement(\"a\");\n const artImage = document.createElement(\"img\");\n\n artLink.appendChild(artImage);\n artLink.href = data.items[i].guid;\n artLink.setAttribute(\"target\", \"_blank\");\n artLink.classList.add(\"flex-item\");\n \n artImage.src = data.items[i].edmIsShownBy[0];\n artImage.alt = data.items[i].title;\n art.appendChild(artLink);\n }\n}", "function frmPatientSummary_showSegUnits() {\n searchPatient_closeSearchList();\n kony.print(\"------frmPatientSummary_showSegUnits---->>\");\n if(frmPatientSummary.fcunitslist.isVisible) {\n frmPatientSummary.fcunitslist.setVisibility(false);\n } else {\n frmPatientSummary.fcunitslist.setVisibility(true);\n }\n frmPatientSummary.fcwoundslist.setVisibility(false);\n frmPatientSummary.forceLayout();\n}", "renderArrow(goBackward) {\n var allLessons = this.props.unit.lessons;\n var lessonIndex = this.props.lessonIndex;\n var nextIndex = goBackward ? (lessonIndex - 1) : (lessonIndex + 1);\n var vizClass = \"\";\n if (nextIndex < 0 || nextIndex >= allLessons.length) {\n // we don't want to render it but make the layout easy\n nextIndex = lessonIndex;\n vizClass = \"transparent\"; \n }\n var dirClass = goBackward ? \"left\" : \"right\";\n var nextLesson = allLessons[nextIndex];\n var icon = goBackward ? \"chevron-left\" : \"chevron-right\";\n /* lessonNumber 1-indexed */\n var pathFromIdx = (lIdx) => (this.props.pathGenerator ?\n this.props.pathGenerator(this.props.unit.name, lIdx + 1) :\n (\"/unit/\" + this.props.unit.name + \"/lesson/\" + (lIdx + 1))\n );\n return(\n <div className={\"arrow-block \" + vizClass + \" \" + dirClass}>\n <Link to={{pathname: pathFromIdx(nextIndex)}} >\n <Icon name={icon} />\n </Link>\n <div className=\"next-lesson hidden-on-mobile hidden-on-phablet\">\n Lesson {nextLesson.number}: <br/>\n {nextLesson.name}\n </div>\n </div>\n );\n }", "function updateUnitFromURL()\n {\n // Default lesson is Unit 1.1\n var unitNo = 1\n var subunitNo = 1\n\n // Parse the fragment identifier in the URL and determine the\n // unit\n if (window.location.hash.length > 0) {\n var fragmentID = window.location.hash.slice(1)\n var tokens = fragmentID.split('.')\n unitNo = parseInt(tokens[0])\n if (tokens.length > 1)\n subunitNo = parseInt(tokens[1])\n }\n\n // Default to unit 1 if unit number could not be parsed\n // correctly from the URL\n if (isNaN(unitNo)) {\n unitNo = 1\n }\n\n // Default to subunit 1 if unit number could not be parsed\n // correctly from the URL\n if (isNaN(subunitNo)) {\n subunitNo = 1\n }\n\n setSubunit(unitNo, subunitNo)\n\n displayUnitLinks()\n displaySubunitLinks()\n displayAlternateUnitLinks()\n updateNavigationLinks()\n updateProgressTooltip()\n\n displayUnitTitle()\n displayGuide()\n\n resetSubunit()\n }", "function showLinks (delay) {\n // Show links\n\n // This is kind of redundant, but as long as the link arrows have not been\n // moved to user control layer, keep calling the modeSwitchWalkClick()\n // to bring arrows to the top layer. Once loaded, move svLinkArrowsLoaded to true.\n if (!status.svLinkArrowsLoaded) {\n var numPath = $divViewControlLayer.find(\"path\").length;\n if (numPath === 0) {\n makeLinksClickable();\n } else {\n status.svLinkArrowsLoaded = true;\n }\n }\n\n if (status.hideNonavailablePanoLinks &&\n status.availablePanoIds) {\n $.each($('path'), function (i, v) {\n if ($(v).attr('pano')) {\n var panoId = $(v).attr('pano');\n var idx = status.availablePanoIds.indexOf(panoId);\n\n if (idx === -1) {\n $(v).prev().prev().remove();\n $(v).prev().remove();\n $(v).remove();\n } else {\n //if (properties.browser === 'chrome') {\n // Somehow chrome does not allow me to select path\n // and fadeOut. Instead, I'm just manipulating path's style\n // and making it hidden.\n $(v).prev().prev().css('visibility', 'visible');\n $(v).prev().css('visibility', 'visible');\n $(v).css('visibility', 'visible');\n }\n }\n });\n } else {\n if (properties.browser === 'chrome') {\n // Somehow chrome does not allow me to select path\n // and fadeOut. Instead, I'm just manipulating path's style\n // and making it hidden.\n $('path').css('visibility', 'visible');\n } else {\n if (!delay) {\n delay = 0;\n }\n // $('path').show();\n $('path').css('visibility', 'visible');\n }\n }\n }", "function initialDisplay() {\n \tcountLinks();\n \tgetDropDowns();\n \tgetList(\"id\");\n }", "function gotAllUnits(err) {\n console.log(\"gotAllUnits()\");\n\n // report an error, you'd want to do something better than this in production\n if (err) {\n console.log(\"error loading units\");\n console.error(err);\n return;\n }\n\n // call functions to log and show the units\n consoleLogUnits();\n showUnits();\n}", "function toggleAbstract(elementId) {\n var a = document.getElementById(elementId);\n var aLink = document.getElementById(elementId + \"-link\");\n if (a.style.display == \"none\") {\n a.style.display = \"block\";\n aLink.text = \"Hide Abstract\";\n } else {\n a.style.display = \"none\";\n aLink.text = \"Show Abstract\";\n }\n}", "function showLocation(loc,alternateDescription,alternateImage){\n \n // Use alteranate descriptions and image if the exist\n // else use the normal ones provided for the location\n var image = alternateImage || loc.image;\n var description = alternateDescription || loc.description;\n\n // Write to elements\n $('.big-image').attr(\"src\",\"imgs/\" + image + \".jpg\");\n $('.description').html(description);\n \n // If a location is not an info page then change the memories\n // holding the last location and last description\n if(!loc.infopage){\n lastLocation = loc;\n lastDescription = description;\n }\n \n // Show bag content, update progress bars and build the menu\n showBag();\n updateProgressBars();\n buildMenu(loc.choices);\n\n}", "_unitsChanged() {\n\t\tthis.linkedDisabled = true;\n\n\t\tthis._resetOptions();\n\n\t\tsetTimeout( () => {\n\t\t\tthis.linkedDisabled = false;\n\t\t} );\n\t}", "function displayAdvice()\n {\n // Calculate error rate (in percent)\n var error = Math.round(my.current.errorRate)\n\n var repeatSubunit = error > 0\n\n // Update remark and advice\n var anchorElement = document.createElement('a')\n if (repeatSubunit) {\n Util.addChildren(my.html.remark, 'Reduce error')\n my.html.remark.title = 'Your error rate should not ' +\n 'exceed 0%.'\n\n Util.addChildren(anchorElement, 'Try again')\n anchorElement.href = '#restart'\n anchorElement.title = 'Please practice this lesson again.'\n } else {\n Util.addChildren(my.html.remark, 'Well done!')\n my.html.remark.title = 'You have satisfactorily ' +\n 'completed this lesson.'\n\n Util.addChildren(anchorElement, 'Next lesson')\n anchorElement.href = '#next'\n anchorElement.title = 'Please proceed with the next lesson.'\n }\n\n // Do not display 'Next lesson' advice if the user is at the\n // last subunit; display advice otherwise\n if (repeatSubunit || !currentSubunitIsTheLastSubunit()) {\n my.html.advice.appendChild(anchorElement)\n anchorElement.focus()\n }\n }", "function getDetailUnits() {\n setLoading(true);\n setDetailUnits(detailBoxesFromCategory);\n setLoading(false);\n }", "function toggleUnits() {\n if (countryUnits === 'metric') { // check if currently set to imperial or metric.\n tempSymbol = 'F';\n windSymbol = 'miles/hour';\n countryUnits = 'imperial';\n pressureSymbol = 'mb';\n button.innerHTML = 'Use Metric Units';\n temperature = Math.round((temperature * 9 / 5) + 32); // convert temperature to 'fahrenheit'.\n $(\"#temperature\").html(temperature);\n $(\"#degreeSymbol\").html(\" &deg;\" + tempSymbol);\n windSpeed = Math.round(windSpeed / 1.609344); // convert wind speed to 'miles/hr'.\n $(\"#winds\").html(\"Winds \" + windDirection + \" \" + windSpeed + \" \" + windSymbol);\n pressure = pressure * 10; // convert pressure to 'mb'.\n $(\"#pressure\").html(\"Barometric Pressure: \" + pressure + \" \" + pressureSymbol);\n } else {\n tempSymbol = 'C';\n countryUnits = 'metric';\n windSymbol = 'km/hour';\n pressureSymbol = 'kPa';\n button.innerHTML = 'Use Imperial Units';\n temperature = Math.round((temperature - 32) * 5 / 9); // convert temperature to 'celsius'.\n $(\"#temperature\").html(temperature);\n $(\"#degreeSymbol\").html(\" &deg;\" + tempSymbol);\n windSpeed = Math.round(windSpeed * 1.609344); // convert wind speed to 'Km/h'.\n $(\"#winds\").html(\"Winds \" + windDirection + \" \" + windSpeed + \" \" + windSymbol);\n pressure = pressure / 10; // convert pressure to'KPa'.\n $(\"#pressure\").html(\"Barometric Pressure: \" + pressure + \" \" + pressureSymbol);\n }\n }", "function getDisplayOtherEditionsInfoFunction(stubDiv) {\n\n return function(allEdUrl) {\n\t\tclearText(stubDiv);\n\t\n\t\tif(!allEdUrl) {\n\t \tinsertText(stubDiv, 'Alternate editions unavailable at ' + libraryName + ' library.', 'libraryUnavailable');\n\t \treturn;\n\t\t}\n\t\n\t\tinsertText(stubDiv, '<a href=\"'+allEdUrl+'\" title=\"Amazon.com all editions page\">Other editions</a> available at ' + libraryName + ' library.', 'libraryAvailable');\n }\n}", "function showMobileSubLInks(link){ \n let icon=link.children[1];\n let childUL=link.children[2];\n if(childUL.classList.contains('hide-mobile-sub-ul')){ \n $SC(icon, 'fa-angle-down', 'fa-angle-up');\n $SC(childUL, 'hide-mobile-sub-ul', 'show-mobile-sub-ul');\n } else{ \n $SC(icon, 'fa-angle-up', 'fa-angle-down');\n $SC(childUL, 'show-mobile-sub-ul', 'hide-mobile-sub-ul');\n }\n}", "function showWeaponALL(index,target){\n let arma_actual =orderStats[index];\n let nombreArma = Object.entries(arma_actual)[89];\n let nombreImg = Object.entries(arma_actual)[89][1];\n nombreImg = nombreImg.split(\" \");\n \n let atts = nombreImg[nombreImg.length -1 ];\n let ending = nombreImg[nombreImg.length -1 ];\n \n nombreImg = CreateImgName(nombreImg,ending);\n showImg(nombreImg,atts,target);\n \n // Clear divs & show weapon name at footer\n title.innerHTML = \"\" ;\n weapon_stats_0.innerHTML = \"\";\n if(target == 1){\n weapon_stats_1.innerHTML = \"\";\n weapon1.innerHTML = \"<h2>\" + nombreArma[1] + \"&nbsp;&nbsp;VS.&nbsp;&nbsp;</h2>\" ;\n }else\n if(target == 2){\n weapon_stats_2.innerHTML = \"\"; \n weapon2.innerHTML = \"<h2>\" + nombreArma[1] + \"&nbsp;&nbsp;</h2>\" ;\n }\n //Populate divs with stats names & values\n Object.entries(arma_actual).slice(0).forEach(function(stat , index) {\n weapon_stats_0.insertAdjacentHTML('beforeend', \"<span class='s0'><div class='stat_name'>\"+stat[0]+\"</div>\"+ \"</span>\");\n if(target == \"1\"){\n weapon_stats_1.insertAdjacentHTML('beforeend', \"<span class='s1'><div class='stat_value'>\"+stat[1]+\"</div>\"+\"</span>\");\n stats1Array[index] = stat[1];\n }else\n if(target == \"2\"){\n weapon_stats_2.insertAdjacentHTML('beforeend', \"<span class='s2'><div class='stat_value'>\"+stat[1]+\"</div>\"+\"</span>\");\n stats2Array[index] = stat[1];\n }\n });\n compareStats(target);\n}", "function _displayAvailableShows() {\n try {\n state.shows.map((show, index) => {\n console.log(`${index + 1}. ${show.name}`);\n })\n } catch (e) {\n console.log('Failed to list shows');\n }\n }", "function showAllDetails( altHide ) {\n // show descriptions\n $( \".citationDetails\" ).show( function() {\n resizeFrame();\n }\n );\n\n // show proper toggle icon\n $( \".toggleIcon\" ).each( function() {\n this.src = \"/library/image/sakai/collapse.gif?panel=Main\";\n this.alt = altHide;\n } );\n}", "generateLink() {\n return `\n <a href='https://en.wikipedia.org/wiki/${encodeURI(this.options[0])}' property='rdf:seeAlso'>\n ${this.options[0]}\n </a>&nbsp;\n `;\n }", "render() {\n const { classes, renderings } = this.props;\n\n return (\n <React.Fragment>\n <Typography variant=\"h3\" className={classes.h3}>Other download options</Typography>\n <List>\n {renderings.map(rendering => (\n <RenderingDownloadLink rendering={rendering} key={rendering.id} />\n ))}\n </List>\n </React.Fragment>\n );\n }", "function showUnitTestDetails(num, html_url, sparql_url)\n{\n var rdfaExtractorUrl = getRdfaExtractorUrl();\n var n3ExtractorUrl = \"http://www.w3.org/2007/08/pyRdfa/extract?format=n3&uri=\";\n\n document.getElementById('unit-test-details-' + num).innerHTML =\n \"Retreiving information...\";\n sendRequest('test-details?id=' + num +\n '&xhtml=' + html_url +\n '&sparql=' + sparql_url +\n '&rdfa-extractor=' + escape(rdfaExtractorUrl) +\n '&n3-extractor=' + escape(n3ExtractorUrl),\n displayUnitTestDetailsResult, num)\n}", "function showUSGSLinks(evt){\n\t//check to see if there is already an existing linksDiv so that it is not build additional linksDiv. Unlikely to occur since the usgsLinks div is being destroyed on mouseleave.\n\tif (!dojo.byId('usgsLinks')){\n\t\t//create linksDiv\n\t\tvar linksDiv = dojo.doc.createElement(\"div\");\n\t\tlinksDiv.id = 'usgsLinks';\n\t\t//LINKS BOX HEADER TITLE HERE\n\t\tlinksDiv.innerHTML = '<div class=\"usgsLinksHeader\"><b>USGS Links</b></div>';\n\t\t//USGS LINKS GO HERE\n\t\tlinksDiv.innerHTML += '<p>';\n\t\tlinksDiv.innerHTML += '<a style=\"color:white\" target=\"_blank\" href=\"http://www.usgs.gov/\">USGS Home</a><br />';\n\t\tlinksDiv.innerHTML += '<a style=\"color:white\" target=\"_blank\" href=\"http://www.usgs.gov/ask/\">Contact USGS</a><br />';\n\t\tlinksDiv.innerHTML += '<a style=\"color:white\" target=\"_blank\" href=\"http://search.usgs.gov/\">Search USGS</a><br />';\n\t\tlinksDiv.innerHTML += '<a style=\"color:white\" target=\"_blank\" href=\"http://www.usgs.gov/laws/accessibility.html\">Accessibility</a><br />';\n\t\tlinksDiv.innerHTML += '<a style=\"color:white\" target=\"_blank\" href=\"http://www.usgs.gov/foia/\">FOIA</a><br />';\n\t\tlinksDiv.innerHTML += '<a style=\"color:white\" target=\"_blank\" href=\"http://www.usgs.gov/laws/privacy.html\">Privacy</a><br />';\n\t\tlinksDiv.innerHTML += '<a style=\"color:white\" target=\"_blank\" href=\"http://www.usgs.gov/laws/policies_notices.html\">Policies and Notices</a></p>';\n\t\t\n\t\t//place the new div at the click point minus 5px so the mouse cursor is within the div\n\t\tlinksDiv.style.top = evt.clientY-5 + 'px';\n\t\tlinksDiv.style.left = evt.clientX-5 + 'px';\n\t\t\n\t\t//add the div to the document\n\t\tdojo.byId('map').appendChild(linksDiv);\n\t\t//on mouse leave, call the removeLinks function\n\t\tdojo.connect(dojo.byId(\"usgsLinks\"), \"onmouseleave\", removeLinks);\n\n\t}\n}", "function showhideliveicon(unit, statushow) {\r\n\r\n\t//ignore args\r\n\r\n\t//Go through all icons hide/show as needed depending on checkbox status\r\n\tplaceliveicons();\r\n\r\n}", "function eLink(db,nm) {\ndbs = new Array(\"http://us.battle.net/wow/en/search?q=\",\"http://www.wowhead.com/?search=\",\"http://db.mmo-champion.com/search/all/\",\"http://www.wowdb.com/search?search=\");\ndbTs = new Array(\"Armory\",\"Wowhead\",\"DB MMO-Champion\",\"WoWDB\");\ndbHs = new Array(\"&real; \",\"&omega; \",\"&delta; \",\"&piv; \");\nel = '<a href=\"'+ dbs[db]+nm + '\" target=\"_blank\" title=\"'+ dbTs[db] +'\">'+ dbHs[db] + '</a>';\nreturn el;\n}", "function formatWomiAside() {\n\tvar asides = document.getElementsByClassName(\"womi-aside\");\n\tfor(var i=0; i<asides.length; i++) {\n\t\tvar aside = asides[i];\n\t\tvar captions = aside.getElementsByClassName(\"pdf\")[0].getElementsByClassName(\"womi-caption\");\n\n\t\t//check if womi caption is empty\n\t\tif(captions.length>0 && captions[0].textContent.length==0) {\n\t\t\tcaptions[0].style.display = \"none\";\n\t\t}\n\t}\n}", "function linkRendererEquipment(val, metadata, record, rowIndex, colIndex, store) {\r\n\tif (val != \"\" && val != null) {\r\n\t\t return '<a href=\"#\" onClick = \"setTimeout(function() {getOrderSummaryDetailsEquipment();}, 300);\" style=\"\">'+val+'</a>';\r\n\t}\r\n}", "function alternateMarkup(text, href, index){\n return(\n <div className={text} key={index}>\n <a href={href}>&nbsp;{text}</a>\n </div>\n )\n }", "function displayResults() {\n\tif (h2hSelectors.player1 && h2hSelectors.player2) {\n\t\tdocument.getElementById(\"h2hWrapper\").classList.remove(\"hidden\");\n\t\tdc.renderAll(\"matchUp\");\n\t}\n}", "function display() {\n\treturn {\n\t\tdisplayStores: function() {\n\t\t\tfor (var i = 0; i < stores.length; i++) {\n\t\t\t\t$('<a class=\"storeLink\"></a>').appendTo('#mainDiv').append($('<img>').attr('src', stores[i].src))\n\t\t\t}\n\n\t\t\t$('.storeLink').click(function() {\n\t\t\t\tnewPage();\n\t\t\t\t\tfor (var i = 0; i < products.length; i++) {\n\t\t\t\t\t\t$('#mainDiv').append($('<a id=\"productLink\"></a>')\n\t\t\t\t\t\t.append($('<img>').attr('src', products[i].src))).append(products[i].name + '\\n' + products[i].price + '\\n' + products[i].size, $('<input type=\"checkbox\">').attr('id',i))\n\t\t\t\t\t}\n\n\t\t\t\t$('#mainDiv').append(\n\t\t\t\t buttons()\n\t\t\t\t)\n\t\t\t});\n\t\t},\n\n\t\tdisplayMen: function() {\n\t\t\tnewPage();\n\t\t\tfor (var i = 0; i < products.length; i++) {\n\t\t\t\tif (products[i].cat === 'men') {\n\t\t\t\t\tconsole.log(i)\n\t\t\t\t\t$('#mainDiv').append($('<a id=\"productLink\"></a>')\n\t\t\t\t\t.append($('<img>').attr('src', products[i].src))).append(products[i].name + '\\n' + products[i].price + '\\n' +products[i].size)\n\t\t\t\t\t.append($('<input type=\"checkbox\">').attr('id', i))\n\t\t\t\t\t.append(buttons());\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\tdisplayWomen: function() {\n\t\t\tnewPage();\n\t\t\tfor (var i = 0; i < products.length; i++) {\n\t\t\t\tif (products[i].cat === 'women') {\n\t\t\t\t\t$('#mainDiv').append($('<a id=\"productLink\"></a>')\n\t\t\t\t\t.append($('<img>').attr('src', products[i].src))).append(products[i].name + '\\n' + products[i].price + '\\n' +products[i].size)\n\t\t\t\t\t.append($('<input type=\"checkbox\">').attr('id', i))\n\t\t\t\t\t.append(buttons());\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\tdisplayKids: function() {\n\t\t\tnewPage();\n\t\t\tfor (var i = 0; i < products.length; i++) {\n\t\t\t\tif (products[i].cat === 'kids') {\n\t\t\t\t\t$('#mainDiv').append($('<a id=\"productLink\"></a>')\n\t\t\t\t\t.append($('<img>').attr('src', products[i].src))).append(products[i].name + '\\n' + products[i].price + '\\n' +products[i].size)\n\t\t\t\t\t.append($('<input type=\"checkbox\">').attr('id', i))\n\t\t\t\t\t.append(buttons());\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}", "function showInstructions() {\n\t\t\tclear();\n\t\t\tdiv.update('<span style=\"color: grey; font-style: italic;\">' + lang.instructions + '</span>');\n\t\t}", "function hideAllDetails( altShow ) {\n // hide descriptions\n $( \".citationDetails\" ).hide( function() {\n resizeFrame();\n }\n );\n \n // show proper toggle icon\n $( \".toggleIcon\" ).each( function() {\n this.src = \"/library/image/sakai/expand.gif?panel=Main\";\n this.alt = altShow;\n } );\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 printLanguageToDisplay(language_items) {\n\tvar first_language_to_display = document.getElementById(\"language-main\");\n\tvar first_element = \"<img src=\\\"\" + language_items[0].img + \"\\\" class=\\\"icon-flag mr-2 img-fluid\\\" alt=\\\"Language Item\\\"/>\"\n\tfirst_element = first_element + language_items[0].country + \" - \" + language_items[0].language;\n\t\n\tfirst_language_to_display.innerHTML = first_element;\n}", "function checkAllUnitsLoaded() {\n if (unitsReady >= UNITS_TO_LOAD) {\n document.getElementById('loggedInUI')\n .setAttribute('style', 'display: visible');\n }\n}", "function showArtistDeets (artist) {\n console.log(artist);\n\n let artistDisplay = '';\n\n for (let i = 0; i < artist.results.length; i++) {\n\n let artistResults = artist.results[i];\n // display search results\n let artistCode = `\n <div class=\"track-info\" data-song-url=\"${artistResults.previewUrl}\">\n <img src=\"${artistResults.artworkUrl100}\" class=\"track-image\">\n <h4 class=\"song-name\">${artistResults.trackName}</h4>\n <h3 class=\"artist-name\">${artistResults.artistName}</h3>\n </div>\n `;\n artistDisplay += artistCode;\n\n // play song\n songToPlay = artistResults.previewUrl;\n\n // display song to play\n }\n results.innerHTML = artistDisplay;\n}", "function ShowLinks(linkId) { console.log(\"sellwood_px: ShowLinks called; this function is not defined in px.\"); }", "function showLinkLabel(e) {\n var label = e.subject.findObject('LABEL');\n if (label !== null) {\n label.visible = (e.subject.fromNode.data.category === 'Conditional');\n }\n }", "function renderMealResults(mealDetails) {\n $('#mealResults').html(\n `<a href=\"${mealDetails.strYoutube}\">\n <img src=\"${mealDetails.strMealThumb}\" alt=\"meal\" />\n <div class=\"card-content\">\n <h2>${mealDetails.strMeal}</h2>\n <p>${mealDetails.strInstructions}</p>\n </div>\n </a>`\n );\n}", "function htUnit(){\n\tvar chk = document.getElementById('htChk');\n\tvar f1 = document.getElementById('htDropF');\n\tvar f2 = document.getElementById('htDropF2');\n\tvar m = document.getElementById('htDropM');\n\tvar lbl = document.getElementById('htLbl');\n\t\n\tif(chk.checked == true){\n\t\tf1.style.display = \"block\";\n\t\tf2.style.display = \"block\";\n\t\tm.style.display = \"none\";\t\n\t\tlbl.innerHTML = \"Feet <i class='glyphicon glyphicon-sort'></i>\";\n\n\t}else if(chk.checked == false){\n\t\tf1.style.display = \"none\";\n\t\tf2.style.display = \"none\";\n\t\tm.style.display = \"block\";\t\n\t\tlbl.innerHTML = \"cm <i class='glyphicon glyphicon-sort'></i>\";\n\t}\t\n}", "function displayInitialOrientation() {\n if (firstVertDisplay === false) {\n for (var i = 0; i < horizontalShipsList.length; i++) {\n id = '#' + horizontalShipsList[i];\n $(id).css('display', 'block');\n }\n for (var i = 0; i < verticalShipsList.length; i++) {\n id = '#' + verticalShipsList[i];\n $(id).css('display', 'none');\n }\n }\n else {\n for (var i = 0; i < horizontalShipsList.length; i++) {\n id = '#' + horizontalShipsList[i];\n $(id).css('display', 'none');\n }\n for (var i = 0; i < verticalShipsList.length; i++) {\n id = '#' + verticalShipsList[i];\n $(id).css('display', 'block');\n }\n }\n}", "function setup_metacpan_links() {\n $('a[href^=\"/dist/overview/\"]').each(\n function() {\n var module = this.href.match('/dist/overview/(.*)$')[1].replace('-', '::', 'g');\n console.log(\"module = \" + module);\n $(this).after('&nbsp;' + '<a href=\"http://metacpan.org/module/' + module + '\">' + metacpan_img + '</a>');\n });\n}", "function displayResults() {\n if (lyric === \"\") {\n lyric = \"Couldn't find any lyrics from this track\"\n }\n id(\"lyric\").innerText = lyric;\n id(\"song-name\").innerText = trackName;\n id(\"artist-name\").innerText = artistName;\n qs(\"blockquote\").classList.remove(\"hidden\");\n qs(\"#quote\").classList.remove(\"hidden\");\n id(\"tracking\").src = tracking;\n let error = id(\"error\");\n error.innerText = \"\";\n }", "function toggleAddReferent(unit) {\n if (unit == null) { // exiting addRef mode.\n\tdocument.getElementById('bodyDiv').style.cursor = 'default';\n \n\trefAdd = null;\n\t$('.refAdd').removeClass('refAdd');\n $('#LRUruler').hide();\n $('#collapseImg').hide();\n $('#expandImg').show();\n $('#unitsLRUDiv').hide();\n\n deselect();\n\tchangeFocus(refCurPointerUnit);\n } else if (remoteAdd == null && unit.parent != null && unit.parent.parent != null\n\t && (unit.display || unit.isUnitGroup)) { // entering addRef mode.\n\tdocument.getElementById('bodyDiv').style.cursor = \"crosshair\";\n \n\trefAdd = unit;\n $('#LRUruler').show();\n $('#collapseImg').hide();\n $('#expandImg').show();\n\n\tif (selectedUnits.length == 0) {\n\t if (unit.isUnitGroup) {\n\t\ttoggleSelect(unit.parts[0].units[0]);\n\t } else {\n\t\ttoggleSelect(unit.units[0]);\n\t }\n\t}\n\trefCurPointerUnit = pointerUnit;\n\t$('.unitSpan' + unit.id).addClass('refAdd');\n }\n}", "function displayReferent(unit) {\n if (unit.referent == null) {\n return;\n }\n unitSentDiv = document.getElementById('sentDiv'+unit.id);\n \n refImg = document.createElement('img');\n refImg.setAttribute('class', 'ref' + unit.id);\n refImg.setAttribute('src', 'gif/ref_arrow.gif');\n refImg.setAttribute('style', 'vertical-align: middle; height: 1em; width: 2em; margin-left: 2em; display: inline;');\n refImg.setAttribute('title', 'press to remove reference');\n refImg.setAttribute('onclick', 'removeReference('+unit.id+'); toggleAddReferent(null);');\n \n refDiv = document.createElement('span');\n refDiv.setAttribute('class', 'refUnit '+active_display_class+' ref'+unit.id);\n refDiv.setAttribute('id', 'refDiv'+unit.id);\n refDiv.setAttribute('title', 'CONTEXT: '+ unit.referent.parent.toString());\n\n refDiv.innerHTML = unit.referent.toString();\n \n unitSentDiv.appendChild(refImg);\n unitSentDiv.appendChild(refDiv);\n\n $('#refDiv'+unit.id).click(function() {\n edit(unit.referent);\n jump(unit.referent.id);\n });\n\n}", "function showResults()\n{\n\n\tvar perviousTitle = '',\n\tresultsToShow = getSortedResults(), \n\tunits = localStorage[BG_UNITS_LOCAL_STORAGE];\n\t\n\tresetList();\n\t\n\tfor(i in resultsToShow)\n\t{\n\t\tvar title = resultsToShow[i].groupingdate;\n\t\t\n\t\tif(perviousTitle != title)\n\t\t{\n\t\t\tvar seperator = '<li class=\"sep\">'+title+'</li>';\n\t\t\tvar seperatorItem = $(seperator);\n\t\t\t$('#resultslist').append(seperatorItem);\n\t\t\tperviousTitle = title;\n\t\t}\n\t\t\n\t\tvar result = '<li class=\"arrow\"><a href=\"#edit\" id=\"result\">'+resultsToShow[i].sugar+' '+units+'<small>'+resultsToShow[i].displaytime +'</small></a></li>';\n\t\tvar resultItem = $(result);\n\t\tresultItem.bind('click',{IdForResult:resultsToShow[i].id},showResultForEditing);\n\t\t\n\t\t$('#resultslist').append(resultItem);\n\t\t\n\t}\n}", "function updateDisplayNoAnimate() {\n \"use strict\";\n /* Update the options cards. */\n\n var player = g.player,\n inventory = g.inventory;\n currentOptionCards().forEach(function (c) {\n return c.remove();\n });\n player.getOptions().forEach(function (o) {\n return addOptionCard(o);\n });\n\n /* Update the inventory items. */\n inventory.updateAll();\n\n /* Update the location information, description and page title. */\n updateLocation();\n}", "function showDescription(i) {\n document.querySelector('#description').style.opacity = 1;\n document.querySelector('.name').innerHTML = description(i)[0];\n document.querySelector('.artist').innerHTML = description(i)[1];\n item = \".tooltiptext\" + i\n document.querySelector(item).innerHTML = description(i)[2];\n \n}", "function displayDocuManager() {\n\n\t// clear\n\t$(\".controlContentBlock[id=compare-manage] > ol\").empty();\n\n\t// show each corpus\n\tfor (let corpusName in _dataset) {\n\t\tif (typeof _dataset[corpusName] !== 'object') continue;\n\t\tlet manageItem = \"<li name=\\\"\" + corpusName + \"\\\">\" + corpusName + \"</li>\";\n\t\tlet className = (_dataset[corpusName].isShow) ?\"glyphicon-eye-open\" :\"glyphicon-eye-close\";\n\t\tlet hideBtn = \"<span class=\\\"glyphicon \" + className + \"\\\" name=\\\"\" + corpusName + \"\\\" onclick=\\\"hideOrShowCorpus(this, '\"+corpusName+\"')\\\"></span>\";\n\t\tlet deleteBtn = \"<span class=\\\"glyphicon glyphicon-trash\\\" name=\\\"\" + corpusName + \"\\\" onclick=\\\"deleteCorpus('\" + corpusName + \"')\\\"></span>\";\n\t\t$(\".controlContentBlock[id=compare-manage] > ol\").append(manageItem + hideBtn + deleteBtn);\n\t}\n}", "setupSubLinks() {\n for (let subLink in this.subLinks) {\n this.subLinks[subLink].addEventListener(\"click\", (e) => {\n let linkID = e.target.id;\n if (linkID === \"\") {\n linkID = e.target.parentNode.id;\n }\n let subViewToShow = linkID.slice(0, -5);\n this.showSubView(subViewToShow);\n });\n }\n }", "function showAns(show){\n if (display.innerText === '0'){\n ans.textContent = 'Ans = 0';\n } \n else if (show === 'first'){\n ans.textContent = `${calculator.numA} ${calculator.operator} ${calculator.numB} =`;\n }\n else if (show === 'second'){\n ans.textContent = `Ans = ${calculator.result}`;\n }\n}", "function showExampleSongs() {\n\tvar acousticnessExamples = ['7ef4DlsgrMEH11cDZd32M6','64Tp4KN5U5rtqrasP5a7FH','3U4isOIWM3VvDubwSI3y7a'];\n\tvar danceabilityExamples = ['6hUbZBdGn909BiTsv70HP6','7DFNE7NO0raLIUbgzY2rzm','7qiZfU4dY1lWllzX7mPBI3'];\n\tvar energyExamples = ['3xXBsjrbG1xQIm1xv1cKOt','40riOy7x9W7GXjyGp4pjAv','0EYOdF5FCkgOJJla8DI2Md'];\n\tvar instrumentalnessExamples = ['2374M0fQpWi3dLnB54qaLX','0q6LuUqGLUiCPP1cbdwFs3','5pT4qRIpNb7cASsnMfE1Hc'];\n\tvar tempoExamples = ['3d9DChrdc6BOeFsbrZ3Is0','0ofHAoxe9vBkTCp2UQIavz','3GXhz5PnLdkG4DEWNzL8z8'];\n\tvar valenceExamples = ['6b2oQwSGFkzsMtQruIWm2p','6Qyc6fS4DsZjB2mRW9DsQs','1KsI8NEeAna8ZIdojI3FiT'];\n\n\n\tgetExampleSongs(acousticnessExamples, 'acousticness');\n\tgetExampleSongs(danceabilityExamples, 'danceability');\n\tgetExampleSongs(energyExamples, 'energy');\n\tgetExampleSongs(instrumentalnessExamples, 'instrumentalness');\n\tgetExampleSongs(tempoExamples, 'tempo');\n\tgetExampleSongs(valenceExamples, 'valence');\n}", "function getAdministrativeUnits(){\n $scope.load = true;\n\n var params = {\n schoolSuperior: $scope.SystemRecipient.AdministrativeUnitSuperior[0],\n groupSid: $scope.VisionSystem.Id\n };\n\n HttpServices.getListUnitAdministrative(params,\n function(data){\n $scope.AdministrativeUnits = data;\n if($scope.AdministrativeUnits && $scope.AdministrativeUnits.length > 0) {\n $scope.showFilter.showDRE = false;\n $scope.showFilter.showShool = true;\n }else if($scope.AdministrativeUnits && $scope.AdministrativeUnits.listGroups == 0){\n toastr.warning(\"Não existe nenhuma lista de unidades administrativas cadastrada!\");\n }\n $scope.load = false;\n });\n }", "function linkDisplay (numLinks,urlList) {\r\n let i = 0;\r\n console.log(urlList);\r\n while( i < numLinks ) {\r\n let link = 'link:'+(i+1);\r\n let url = urlList[i];\r\n let linkLocation = document.getElementById(link);\r\n linkLocation.innerHTML = url;\r\n linkLocation.setAttribute('href',url);\r\n linkLocation.setAttribute('target','_blank');\r\n i++;\r\n }\r\n}", "doClick( evt ) {\n if( evt.altKey ) {\n let alternate = new CustomEvent( Thermometer.ALTERNATE, {\n detail: {\n status: this.status()\n }\n } );\n this.root.dispatchEvent( alternate );\n } else {\n // Toggle units\n if( this.display == Thermometer.FAHRENHEIT ) {\n this.display = Thermometer.CELCIUS;\n } else {\n this.display = Thermometer.FAHRENHEIT;\n }\n\n // Update display\n this.update();\n }\n }", "function showNextSection(current, next) {\r\n document.getElementById(`rules-title`).style.display = `none`;\r\n document.getElementById(current).style.display = `none`;\r\n document.getElementById(next).style.display = `block`;\r\n}", "function showRound1Or2Table() {\n hideAllTables();\n document.getElementById(\"game-table\").style.display = \"inline-table\";\n}", "displayOrHideArrows() {\n if (this.directed)\n this.svgsManager.arrowManager.displayArrows();\n else\n this.svgsManager.arrowManager.hideArrows();\n }", "function updateSitemap() {\n\tfor(let i = 0; i < units.length; i++) {\n\t\tfor(let j = 0; j < units[i].apts.length; j++) {\n\t\t\tfor(let k = 0; k < sitemapLayers.length; k++) {\n\t\t\t\tfor(let l = 0; l < sitemapLayers[k].length; l++) {\n\t\t\t\t\tlet aptNum = sitemapLayers[k][l].querySelector('.res-map-data').dataset.apt;\n\t\t\t\t\tif(units[i].apts[j].name == aptNum) {\n\t\t\t\t\t\tlet avaiSVG = sitemapLayers[k][l].querySelector(\".res-map-svg.avai\");\n\t\t\t\t\t\tif(units[i].apts[j].hidden) {avaiSVG.style.display = \"none\"}\n\t\t\t\t\t\telse {avaiSVG.style.display = \"inline-block\"}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}", "function ls_showAll(lang_element_hash) {\n for (var n in lang_element_hash) {\n if (lang_element_hash[n].style.display) {\n lang_element_hash[n].style.display = '';\n }\n }\n}", "function showOverview() {\n var links = [];\n $.each(noteSelf.paragraphs, function(index, paragraph) {\n if (paragraph.paragraphClient.getDependencies != undefined) {\n var dependencies = paragraph.paragraphClient.getDependencies();\n $.each(dependencies.inputTables, function(index, inputTable) {\n links.push({ source: inputTable, target: dependencies.name });\n });\n $.each(dependencies.outputTables, function(index, outputTable) {\n links.push({ source: dependencies.name, target: outputTable });\n });\n }\n });\n\n utils.showModalPopup('Overview', utils.generateDirectedGraph(links), $());\n }", "function displayAll() {\n\n\t// get information\n\tvar firstCorpus = getFirstCorpus();\n\tvar firstAlignType = getFirstAlignType();\n\tif (firstCorpus === 'error') console.log(\"[Error] 存取文獻集名稱錯誤,系統上已無文本。\");\n\tif (firstAlignType === 'error') console.log(\"[Error] 存取段落對讀設定錯誤,系統上已無文本。\");\n\n\t// para setting\n\t_para['metadata'] = 'filename';\n\t_para['aligntype'] = firstAlignType;\n\t_para['corpus'] = firstCorpus;\n\t_para['mode'] = 'DocOrder';\n\n\t// display\n\tdisplayDocuManager();\n\tdisplayMetadataList(_para['metadata']);\n\tdisplayAlignTypeList(_para['aligntype']);\n\tdisplaySearchCorpus(_para['corpus']);\n\tdisplaySearchMode(_para['mode']);\n\tdisplayCompareContent(_para['metadata'], _para['aligntype']);\n}", "function showUrl(short, full){ \n shortenUrl.style.display = 'block'\n let originalAddress = document.querySelector('#address')\n let shortenAdresss = document.querySelector('#short')\n\n originalAddress.innerHTML = `${full}`\n shortenAdresss.innerHTML = `${short}`\n}", "function DisplayModeFunctions() {\r\n hideAnchorImages();\r\n youtubeLinkReplace();\r\n replaceAudioLinkWithEmbed();\r\n replaceEmbedContainerWithCode();\r\n}", "renderActiveGestures() {\n // For every gesture, return a card with its information\n const items = this.props.active_gestures.map( gesture => {\n \n return {\n header: \"Gesture Title\",\n meta: \"Description\",\n description: (\n \n // Wildcard address is used in route.js\n <Link route={`/gestures/${gesture}`}>\n <a>View Gesture</a>\n </Link>\n ),\n fluid: true,\n extra: (\n <Button floated=\"left\" \n content=\"Deactivate\" \n icon=\"minus circle\" \n color=\"red\"\n labelPosition=\"left\" />\n )\n }\n });\n\n // Displays a group of all gestures\n return <Card.Group \n items={items} \n style={{ width: '40vw', overflowWrap: 'break-word' }} \n />;\n }", "function setupDataAndDisplay() {\n // Key stations by abbr\n var stationsMappedByAbbr = {};\n\n // Get all stations\n getAllStations()\n .then((stationList) => {\n console.log(\"Populating stations map...\");\n stationList.forEach((station) => {\n stationsMappedByAbbr[station.abbr] = {\n ...station,\n };\n });\n console.log(\"Done population stations map\");\n return;\n })\n .then(() => {\n return getAllETDs();\n })\n .then((stationList) => {\n console.log(\"Adding ETD data...\");\n if (!stationList) {\n return;\n }\n stationList.forEach((station) => {\n if (station.etd) {\n stationsMappedByAbbr[station.abbr] = {\n ...stationsMappedByAbbr[station.abbr],\n nextArrivals: station.etd,\n };\n }\n });\n console.log(\"Done adding ETD data\");\n\n stationsList = Object.values(stationsMappedByAbbr);\n\n // Default current station shown to first one returned from API\n currentStationAbbr = stationsList[0].abbr;\n currentStationIndex = 0;\n\n return;\n })\n .then(() => updateDisplay());\n}", "function displayShows() {\n var results = arguments;\n\n //Iterates through arguments by 2 as two consecutive elements in the array\n //belong to one show (first is show information, second is cast information)\n for (var i = 0; i < results.length; i+=2) {\n var show = results[i][0];\n var cast = results[i+1][0];\n\n var castText = '';\n\n //Iterates through cast\n for (var j = 0; j < cast.length; j++) {\n castText += (cast[j].person.name + '; ');\n }\n\n var table = $('table');\n table.append('<tr>' +\n '<td>' + show.name + '</td>' +\n '<td><a href=\"' + show.url + '\">'+ show.url +'</a></td>' +\n '<td>' + show.summary + '</td>' +\n '<td>' + castText + '</td>' +\n '<td>' + randomizeShowClip(show.name) + '</td>' +\n '</tr>'\n );\n }\n}", "function showArrows(index, arrows) {\n arrows[index].display();\n}", "function displaySongInfo() {\n songs.forEach(function(song) {\n $(\"#songs\").append(`<p>${song}</p>`);\n });\n images.forEach(function(image) {\n $(\"#images\").append(`<img src=\"${image}\">`);\n });\n artists.forEach(function(artist) {\n $(\"#artists\").append(`<p>${artist}</p>`);\n });\n lengths.forEach(function(length) {\n $(\"#lengths\").append(`<p>${length}</p>`);\n });\n links.forEach(function(link) {\n $(\"#links\").append(`<a href=${link}>Youtube Link</a>`);\n });\n}", "function alternate_display_tablerow_id(id) {\n var element = document.getElementById(id);\n if(element.style.display == 'none') {\n element.style.display = 'table-row';\n } else {\n element.style.display = 'none';\n }\n}", "function hoverInstructions(id_name, option)\n{\n//if mobile or hover disabled don't display the hover help instructions\n\tif (mobile || hoverDisabled)\n\t\treturn;\n\n\tif (option == \"2\")\n\t{\n\t\tif (document.getElementById(id_name) != null) {\n\t\t\tdocument.getElementById(id_name).style.display = \"none\";\n\t\t}\n\t}\n\telse\n\t{\n\t\tif (document.getElementById(id_name) != null) {\n\t\t\tdocument.getElementById(id_name).style.display = \"block\";\n\t\t}\n\t}\n\n}", "function FootNotes() {\n return (\n <>\n {/* <div className=\"tiny\">\n Want to <Link to=\"/unsubscribe/send_reset\">Unsubscribe</Link>?\n </div> */}\n <div className=\"tiny\">Icons made by <a href=\"https://www.freepik.com\" title=\"Freepik\">Freepik</a> from <a href=\"https://www.flaticon.com/\" title=\"Flaticon\">www.flaticon.com</a>\n </div>\n </>\n )\n}", "function showSurroundings() {\n mallSurroundings.forEach(function(el) {\n el.classList.remove('mallnav--hidden');\n });\n }" ]
[ "0.77809185", "0.7369583", "0.58161587", "0.5763911", "0.56235474", "0.55743605", "0.54173905", "0.51850575", "0.5181195", "0.51405776", "0.5051855", "0.49769798", "0.4955198", "0.49350837", "0.48927215", "0.4863896", "0.48422644", "0.4814439", "0.48136592", "0.48125017", "0.4800615", "0.47920805", "0.47880828", "0.47842285", "0.4765942", "0.47552675", "0.47155598", "0.46939862", "0.4693005", "0.46923605", "0.46811044", "0.46766764", "0.46755812", "0.46712515", "0.46645352", "0.46469536", "0.46461442", "0.46110803", "0.4606052", "0.46050072", "0.46012506", "0.46006685", "0.45969272", "0.45801696", "0.4571044", "0.45680088", "0.45666432", "0.45567062", "0.45547774", "0.45544997", "0.45452827", "0.4535762", "0.45262897", "0.4521273", "0.45203683", "0.45190275", "0.4518532", "0.45016518", "0.44991693", "0.44860914", "0.44841245", "0.44756332", "0.44741005", "0.44705495", "0.446678", "0.445171", "0.44494104", "0.44449285", "0.4439553", "0.44387195", "0.44361812", "0.44357944", "0.44307494", "0.44296262", "0.4428528", "0.4425195", "0.4423744", "0.4423267", "0.44202587", "0.4417413", "0.44141158", "0.44037938", "0.439903", "0.43981248", "0.43957722", "0.43948486", "0.43896344", "0.43887702", "0.43874347", "0.43874174", "0.43830207", "0.43782884", "0.43748656", "0.43737683", "0.43704382", "0.43656826", "0.43607974", "0.4350801", "0.43491697", "0.43472084" ]
0.8933749
0
Toggle between main unit and alternate unit
function toggleUnit() { var newUnit var confirmMessage if (my.settings.unit == my.UNIT.MAIN) { newUnit = my.UNIT.ALTERNATE confirmMessage = Units.alternateConfirmMessage } else { newUnit = my.UNIT.MAIN confirmMessage = Units.mainConfirmMessage } if (!confirm(confirmMessage)) { return false } localStorage.unit = newUnit loadSettings() updateUnitFromURL() return false }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "toggle(){this.off=!this.off}", "toggle4() {\r\n }", "doClick( evt ) {\n if( evt.altKey ) {\n let alternate = new CustomEvent( Thermometer.ALTERNATE, {\n detail: {\n status: this.status()\n }\n } );\n this.root.dispatchEvent( alternate );\n } else {\n // Toggle units\n if( this.display == Thermometer.FAHRENHEIT ) {\n this.display = Thermometer.CELCIUS;\n } else {\n this.display = Thermometer.FAHRENHEIT;\n }\n\n // Update display\n this.update();\n }\n }", "modeBtnAction() {\n console.log('Toggling scale mode/unit')\n this._unit = trickler.TricklerUnits.GRAINS === this._unit ? trickler.TricklerUnits.GRAMS : trickler.TricklerUnits.GRAINS\n }", "static toggle() {\n if (this.isLight()) {\n this.dark()\n } else {\n this.light()\n }\n }", "function simpleSwitcherToggle() {\n \"use strict\";\n $(\"#switcher-head .button\").toggle(function() {\n $(\"#style-switcher\").animate({\n left: 0\n }, 500);\n }, function() {\n $(\"#style-switcher\").animate({\n left: -263\n }, 500);\n });\n }", "function togglePlaySimulation(){\n playing = !playing;\n sPlanetIndex = -1;\n atStart = false;\n}", "function toggleLight() {\n setLit(!islit);\n }", "function toggle(t) {\n\tt.reversed() ? t.play() : t.reverse();\n\t\n}", "function toggle()\n{\n\tif(speed == 0) \n\t{\n\t\tspeed = 3; //start snake and set button to stop\n\t\tdocument.getElementById(\"toggle\").value = \"Stop\";\n\t}\n\telse \n\t{\n\t\tspeed = 0; //stop the snake and set button to start\n\t\tdocument.getElementById(\"toggle\").value = \"Start\";\n\t}\n}", "function toggleMeasurement() {\n let currentUnit = document.querySelector('#unit-wrapper').getAttribute('data-measure');\n if(currentUnit == 'imperial') {\n // Metric\n measureUpdate('metric');\n document.querySelector('#unit-wrapper').setAttribute('data-measure', 'metric');\n writeCookie('canitube_Settings_Unit Measure', 'metric', 10000000);\n } else {\n // Imperial\n measureUpdate('imperial');\n document.querySelector('#unit-wrapper').setAttribute('data-measure', 'imperial');\n writeCookie('canitube_Settings_Unit Measure', 'imperial', 10000000);\n }\n\n}", "animateTV () {\r\n if (this.tvpower === \"off\") {\r\n this.tvleft.anims.play('leftscreenon', true);\r\n this.tvright.anims.play('rightscreenon', true);\r\n this.tvpower = \"on\";\r\n }\r\n else {\r\n this.tvleft.anims.play('leftscreenoff');\r\n this.tvright.anims.play('rightscreenoff');\r\n this.tvpower = \"off\";\r\n }\r\n }", "toggleAsset() {\n if (this.direction === Constants.RHINO_DIRECTIONS.LEFT) {\n this.setDirection(Constants.RHINO_DIRECTIONS.LEFT_2);\n } else {\n this.setDirection(Constants.RHINO_DIRECTIONS.LEFT);\n }\n }", "function toggleState() {\n runBest = !runBest;\n // Show the best bird\n if (runBest) {\n resetGame();\n runBestButton.html('continue training');\n if(playing)togglePlay()\n // Go train some more\n } else {\n nextGeneration();\n runBestButton.html('run pre-trained bird');\n }\n}", "function toggles(e){\n switch(e){\n case 49: //1\n lightsOn[0] = !lightsOn[0];\n break;\n case 50: //2\n lightsOn[1] = !lightsOn[1];\n break;\n case 51: //3\n lightsOn[2] = !lightsOn[2];\n break;\n case 52: //4\n lightsOn[3] = !lightsOn[3];\n break;\n case 80: //p\n isDisco=!isDisco;\n break;\n case 79: //o\n fanOn=!fanOn;\n break;\n case 72:\n controlsShown ? (document.getElementById(\"overlay\").style.display = \"none\", controlsShown = !1) : (document.getElementById(\"overlay\").style.display = \"block\", controlsShown = !0);\n break;\n case 73: //i\n self.noclip=!self.noclip;\n break;\n case 32: //space\n if(!self.noclip){\n \tif(self.canJump){\n \tself.velocity[1] = 3.5;\n \tself.canJump=false;\n }\n }\n break;\n case 69: //e\n doorOpen=!doorOpen;\n break;\n case 81: //q\n spawnEntity(types[Math.floor(Math.random()*(types.length))]);\n break;\n }\n}", "function tutup() {\r\n document.getElementById(\"drop2\").classList.toggle(\"tampil\");\r\n document.getElementById(\"down2\").classList.toggle(\"on\");\r\n}", "function toggleTemps(){\n\n if (temperatureUnit.textContent === \"F\"){\n \n temperatureUnit.textContent = \"C\";\n temperatureDegree.textContent = celsius.toFixed(1);\n \n } else {\n \n temperatureUnit.textContent = \"F\";\n temperatureDegree.textContent = temperature\n }\n }", "function switchmanual() {\n var div1 = document.getElementById(\"toatom\");\n var div2 = document.getElementById(\"tomanual\");\n if (div2.style.display === \"none\") {\n div2.style.display = \"block\";\n div1.style.display = \"none\";\n } else {\n div2.style.display = \"none\";\n div1.style.display = \"block\";\n }\n}", "function switchwater() {\n clearTimeout(timeout);\n if (this.value === \"on\") {\n showpies()\n d3.select(\".waterswitchlabel\").text(\"hide\");\n }else if(this.value === \"off\"){\n hidepies()\n d3.select(\".waterswitchlabel\").text(\"show\");\n }\n }", "function switchmanual() { \r\n var div1 = document.getElementById(\"toatom\");\r\n var div2 = document.getElementById(\"tomanual\");\r\n if (div2.style.display === \"none\") {\r\n div2.style.display = \"block\";\r\n div1.style.display = \"none\";\r\n } else {\r\n div2.style.display = \"none\";\r\n div1.style.display = \"block\";\r\n } \r\n}", "toggle() {\n this.enabled = !this.enabled;\n }", "switchIlumination() {\n\n if (!this.typeBasic)\n //colocamos o material (Phong ou Lambert) como sendo Basic\n this.material = this.materials[0];\n\n else\n //colocamos o material Basic como sendo o anterior a ser mudado para Basic\n this.material = this.materials[this.currMaterial];\n\n this.typeBasic = !this.typeBasic;\n }", "function animation() {\r\n switchOn();\r\n switchOff();\r\n}", "function toggleTrain() {\n\tif(dead)loop();\n\tstate = TRAINING;\n\tnextGeneration();\n}", "onToggle() {}", "function specToggle() {\r\n var spec = makeObject();\r\n vert = spec.vertex;\r\n flatNormz = spec.flatN;\r\n smoothNormz = spec.smoothN;\r\n ind = spec.index;\r\n var tempF = spec.fcolor;\r\n var tempS = spec.scolor;\r\n \r\n if (specular === true) {\r\n specular = false;\r\n flatColor = tempF;\r\n smoothColor = tempS;\r\n gl = main();\r\n if (buttonE){drawObjects();}\r\n else {drawSOR(gl); drawLights(gl);}\r\n }else if (specular === false){\r\n specular = true;\r\n flatColor = tempF;\r\n smoothColor = tempF;\r\n if (flatShaded){flatColor = specularLighting(flatNormz);}\r\n else{smoothColor = specularLighting(smoothNormz);}\r\n gl = main();\r\n if (buttonE){drawObjects();}\r\n else{drawSOR(gl); drawLights(gl);}\r\n flatColor=tempF;\r\n smoothColor=tempS;\r\n }\r\n}", "void turnOff() {\r\n isOn = false;\r\n System.out.println(\"Light on? \" + isOn);\r\n }", "switchIlumination() {\n if (this.typeBasic)\n //colocamos o material como sendo Basic\n this.material = this.materials[1];\n\n else\n //colocamos o material Basic como sendo Phong\n this.material = this.materials[0];\n\n this.typeBasic = !this.typeBasic;\n }", "function toggleAlien() {\r\n\t(document.getElementById(\"alien\").checked === false) ? totalPwrLvl -= 250 : totalPwrLvl += 250;\r\n\tpwrlvlSide.innerHTML = \"#\" + totalPwrLvl;\r\n}", "function switchToggle() {\n\t\t\t\t\t$scope.isToggleOn = !$scope.isToggleOn;\n\t\t\t\t}", "toggle() {\n if(this.state.active) {\n if(this.state.iAmWinner) {\n this.exit_flag = true;\n this.iWin()\n } else {\n this.deactivate();\n }\n\n } else {\n this.activate();\n }\n\n }", "changeMode() {\n this.attendBooths = !this.attendBooths;\n }", "function show_mainUnit(){\n $(\".bg-model2,.bg-model3,.bg-model4,.bg-model5,.bg-model6,.bg-model7,.bg-model8\").css('display', 'none');\n $(\".bg-model\").css('display', 'flex');\n }", "switchOff() {\n this.setState({\n color : \"grey\",\n toggler : null,\n active : false,\n iAmWinner : this.iAmWinner\n })\n //this.toggle_flag = false;\n }", "function toggleSpecial(which)\n{\n\n\tswitch(which) {\n case true:\nspecials.addLayer(specialLayer);\nspecialLayer.bringToFront()\n\t$(\"#btSpecial\").addClass(\"on\")\n\n break;\n case false:\nspecials.removeLayer(specialLayer);\n\t$(\"#btSpecial\").removeClass(\"on\")\n break;\n default:\n // default code block\n}\n\n}", "function toggleSpecial(which)\n{\n\n\tswitch(which) {\n case true:\nspecials.addLayer(specialLayer);\nspecialLayer.bringToFront()\n\t$(\"#btSpecial\").addClass(\"on\")\n\n break;\n case false:\nspecials.removeLayer(specialLayer);\n\t$(\"#btSpecial\").removeClass(\"on\")\n break;\n default:\n // default code block\n}\n\n}", "toggleGo() {\n this.go = this.go == 'w' ? 'b' : 'w';\n }", "function toggler(){\n if (currentState === 'passenger') {\n hideDiv(\"get_ride_div\");\n currentState = 'driver';\n enterDriverMode();\n\n \n } else { \n showDiv(\"get_ride_div\");\n currentState = 'passenger';\n enterPassengerMode(); \n }\n }", "function toggle_speed() {\n step = 0;\n can_poll = true;\n can_update = false;\n NUM_STEPS = NUM_STEPS == SLOW_NUM_STEPS ? FAST_NUM_STEPS : SLOW_NUM_STEPS;\n}", "onToggle() {\r\n this.toggle = !this.toggle;\r\n }", "function toggleUnits(){\n if(weather.temperature.value === undefined){ \n //if the value is undefined then simply come out of the fuction\n return;\n }\n if(weather.temperature.unit === 'celsius'){\n let fahrenheit = Math.floor(celsiusToFahrenheit(weather.temperature.value));\n tempElement.innerHTML = `${fahrenheit}<span>°F</span>`;\n weather.temperature.unit = 'fahrenheit';\n } else {\n tempElement.innerHTML = `${weather.temperature.value}<span>°c</span>`;\n weather.temperature.unit = 'celsius';\n } \n}", "toggle() {\n if (this.timeoutID) this.stop()\n else if (this.steps === 0) this.reset()\n else this.start()\n }", "function toggleUnits() {\n if (countryUnits === 'metric') { // check if currently set to imperial or metric.\n tempSymbol = 'F';\n windSymbol = 'miles/hour';\n countryUnits = 'imperial';\n pressureSymbol = 'mb';\n button.innerHTML = 'Use Metric Units';\n temperature = Math.round((temperature * 9 / 5) + 32); // convert temperature to 'fahrenheit'.\n $(\"#temperature\").html(temperature);\n $(\"#degreeSymbol\").html(\" &deg;\" + tempSymbol);\n windSpeed = Math.round(windSpeed / 1.609344); // convert wind speed to 'miles/hr'.\n $(\"#winds\").html(\"Winds \" + windDirection + \" \" + windSpeed + \" \" + windSymbol);\n pressure = pressure * 10; // convert pressure to 'mb'.\n $(\"#pressure\").html(\"Barometric Pressure: \" + pressure + \" \" + pressureSymbol);\n } else {\n tempSymbol = 'C';\n countryUnits = 'metric';\n windSymbol = 'km/hour';\n pressureSymbol = 'kPa';\n button.innerHTML = 'Use Imperial Units';\n temperature = Math.round((temperature - 32) * 5 / 9); // convert temperature to 'celsius'.\n $(\"#temperature\").html(temperature);\n $(\"#degreeSymbol\").html(\" &deg;\" + tempSymbol);\n windSpeed = Math.round(windSpeed * 1.609344); // convert wind speed to 'Km/h'.\n $(\"#winds\").html(\"Winds \" + windDirection + \" \" + windSpeed + \" \" + windSymbol);\n pressure = pressure / 10; // convert pressure to'KPa'.\n $(\"#pressure\").html(\"Barometric Pressure: \" + pressure + \" \" + pressureSymbol);\n }\n }", "function switchatom() {\n var div1 = document.getElementById(\"toatom\");\n var div2 = document.getElementById(\"tomanual\");\n var div3 = document.getElementById(\"enatom\");\n if (div3.value == \"Enable\") {\n div1.style.display = \"block\";\n div2.style.display = \"none\";\n } else {\n div1.style.display = \"none\";\n div2.style.display = \"block\";\n }\n}", "function toggleMode() {\n\tif (overviewMode === \"graph\") {\n\t\tmatrixContainer.style.display = \"flex\";\n\t\tgraphContainer.style.display = \"none\";\n\t\toverviewMode = \"matrix\";\n\t\ticonMode.src = \"img/hash.svg\";\n\t} else if (overviewMode === \"matrix\") {\n\t\tmatrixContainer.style.display = \"none\";\n\t\tgraphContainer.style.display = \"flex\";\n\t\toverviewMode = \"graph\";\n\t\ticonMode.src = \"img/git-branch.svg\";\n\t}\n}", "function toggleTurn(t){ // returns the opposite of t... Note: Do not update the current t\n\tif (t==\"X\") {\n\t\treturn \"O\";\n\t}\n\telse {\n\t\treturn \"X\";\n\t}\n}", "function switchatom() { \r\n var div1 = document.getElementById(\"toatom\");\r\n var div2 = document.getElementById(\"tomanual\");\r\n var div3 = document.getElementById(\"enatom\");\r\n if (div3.value == \"Enable\") {\r\n div1.style.display = \"block\";\r\n div2.style.display = \"none\";\r\n } else {\r\n div1.style.display = \"none\";\r\n div2.style.display = \"block\";\r\n } \r\n}", "function awToggle(data){\n if (awState) {\n behaviourOscClient.send('/ambientWaves/display', 0);\n console.log( Date(Date.now()) + 'turning aw arrow off');\n awState = false;\n }\n else{\n behaviourOscClient.send('/ambientWaves/display', 1);\n console.log( Date(Date.now()) + 'turning aw arrow on');\n awState = true;\n }\n\n socket.broadcast.emit('awToggle', awState);\n }", "toggleMovementDisabled(){\n if (this.movementDisabled) {\n this.movementDisabled = false;\n }\n else{\n this.movementDisabled = true;\n }\n console.log(\"toggle movement\", this.movementDisabled);\n }", "function biDirection() {\n\n /* isBidrectional is a boolean variable which denotes if true then user wants bi-directionality otherwise not */\n isBirectional = !isBirectional; /* Each time we click the button this variable is switch from on to off or vice versa */\n if (isBirectional) { /* if true then change the button content to Bi-Directional denoting Bi-directionality is onn */\n document.getElementById(\"directions\").innerHTML = \"Bi-Directional\";\n } else { /* Otherwise mark the button content as Single-Directional denoting Bi-Directional is off */\n document.getElementById(\"directions\").innerHTML = \"Single-Directional\";\n }\n}", "switchCaseStatus() {\n // console.log(\"111\");\n this.isShowCaseloadTrend = false;\n if (this.isShowCaseStatus == false) {\n this.isShowCaseStatus = true;\n } else {\n this.isShowCaseStatus = false;\n }\n }", "function turnSwitchOff() {\n $(this)\n .parent()\n .parent()\n .addClass(\"off\");\n\n switchCounter--;\n calculateSwitchCount();\n}", "function togglePause() {\n\n ball.body.enable = ball.body.enable ? false: true;\n ball2.body.enable = ball2.body.enable ? false: true;\n\n pauseText.text === \"Pause\" ? pauseText.setText(\" Cont.\") : pauseText.setText(\"Pause\") ;\n}", "toggle(value = !this.onOff) {\r\n return this.operatePlug({ onOff: value });\r\n }", "function toggleMove(){ //Toggle between Viewing and Moving\n if(modeArray.viewingMode){ //Only runs if viewing is enabled\n if(!modeArray.movingMode){ //Swap to Moving\n modeArray.movingMode =true;\n document.getElementById(\"Mode\").innerText = \"Moving\"; //Update mode text\n document.getElementById(\"btnToggleMove\").innerText = \"Stop Moving\"; //Update toggle button text\n }\n else{\n modeArray.movingMode =false; //Swap back to Viewing\n document.getElementById(\"btnToggleMove\").innerText = \"Move Marker\"; //Update toggle button text\n document.getElementById(\"Mode\").innerText = \"Viewing\"; //Update mode text\n }\n }\n}", "function toggleLaser()\n {\n laser = !laser;\n updateGUI();\n }", "toggleActive() {\n\t\tif (this.active) {\n\t\t\tthis.deactivate();\n\t\t}\n\t\telse {\n\t\t\tthis.activate();\n\t\t}\n\t}", "function tornadoToggler(){\n if(tornadoToggle.className == \"glyphicon glyphicon-pause\" ){\n tornadoToggle.className = \"glyphicon glyphicon-play\"\n clearInterval(tornadoInterval);\n }\n else if(tornadoToggle.className == \"glyphicon glyphicon-play\" ){\n tornadoInterval = setInterval(function(){tornadoView(1)}, 7000);\n tornadoToggle.className = \"glyphicon glyphicon-pause\"\n }\n}", "function toggleSpeed(){\n\tspeedIndex++;\n\tif (speedIndex >= speeds.length)\n\t\tspeedIndex = 0;\n\tsecondsPerYear = speeds[speedIndex].speed;\n\tupdateControllerHtml();\n}", "function togglePause() {\r\n\r\n // Stop dispatching updates.\r\n toggleGameLoop();\r\n\r\n // Toggle the enemy spawner.\r\n toggleEnemySpawner();\r\n\r\n // Toggle the timer.\r\n toggleTimer();\r\n}", "function switchUnitsSides() {\n var topUnits = new Object();\n var bottomUnits = new Object();\n \n // get top units and add them to an object\n $(\"#simulator-army-top\").find(\".simulator-unit-holder.unit-visible\").each(function(){\n var key = $(this).find(\".unit\").attr(\"class\").replace(/ /g,\".\");\n if (!isNaN(parseInt($(this).find(\"input[class!='sim-castle']\").val()))) {\n topUnits[key] = parseInt($(this).find(\"input[class!='sim-castle']\").val())\n } else {\n topUnits[key] = \"\";\n }\n });\n // clear top side\n $(\"#simulator-army-top\").find(\".sim-remove\").click();\n \n // get bottom units and add them to an object\n $(\"#simulator-army-bottom\").find(\".simulator-unit-holder.unit-visible\").each(function(){\n var key = $(this).find(\".unit\").attr(\"class\").replace(/ /g,\".\");\n if (!isNaN(parseInt($(this).find(\"input[class!='sim-castle']\").val()))) {\n bottomUnits[key] = parseInt($(this).find(\"input[class!='sim-castle']\").val())\n } else {\n bottomUnits[key] = \"\";\n }\n if (!isNaN(parseInt($(this).find(\"input.sim-castle\").val()))) {\n bottomUnits[key] += parseInt($(this).find(\"input.sim-castle\").val());\n } \n });\n // clear bottom side\n $(\"#simulator-army-bottom\").find(\".sim-remove\").click();\n \n // load bottom units to top side\n $.each(bottomUnits,function(index,value){\n $(\"#simulator-army-top\").find(\".simulator-army\").find(\".\"+index).click();\n $(\"#simulator-army-top\").find(\".\"+index).parents(\".simulator-unit-holder\").children(\"input[class!='sim-castle']\").val(value);\n });\n \n // load top units to bottom side\n $.each(topUnits,function(index,value){\n $(\"#simulator-army-bottom\").find(\".simulator-army\").find(\".\"+index).click();\n $(\"#simulator-army-bottom\").find(\".\"+index).parents(\".simulator-unit-holder\").children(\"input[class!='sim-castle']\").val(value);\n });\n \n}", "toggleAudio() {\n this.audioOnOff = !this.audioOnOff;\n }", "function switchButton2 () {\n var st = bu2.state; // Momentaner Zustand\n if (st == 0) st = 1; // Falls Ausgangszustand, starten\n else st = 3-st; // Wechsel zwischen Animation und Unterbrechung\n setButton2State(st); // Neuen Zustand speichern, Text ändern\n }", "function switchButton2 () {\n var st = bu2.state; // Momentaner Zustand\n if (st == 0) st = 1; // Falls Ausgangszustand, starten\n else st = 3-st; // Wechsel zwischen Animation und Unterbrechung\n setButton2State(st); // Neuen Zustand speichern, Text ändern\n }", "function switchButton2 () {\n var st = bu2.state; // Momentaner Zustand\n if (st == 0) st = 1; // Falls Ausgangszustand, starten\n else st = 3-st; // Wechsel zwischen Animation und Unterbrechung\n setButton2State(st); // Neuen Zustand speichern, Text ändern\n }", "function toggleControlMobile() \n{ \n var control = drawControls['line'];\n \n if(!transectOn){\n \n control.activate();\n document.getElementById('lineToggle').innerHTML = 'Unselect Tool';\n $(\"#mobileLevel3\").css(\"z-index\",\"0\");\n } else {\n document.getElementById('lineToggle').innerHTML= 'Transect Tool';\n dlayer.destroy();\n \n control.deactivate();\n $(\"#mobileLevel3\").css(\"z-index\",\"1002\");\n }\n transectOn = !transectOn; \n}", "toggle() {\n this.selected = !this.selected;\n }", "toggle() {\n this.selected = !this.selected;\n }", "function toggle(obj) {\n if (obj !== bunny) {\n obj.factor = 1.0 - obj.factor;\n obj.tint = obj.factor ? 0xff0033 : 0x00ff00;\n }\n }", "deactivateHouse() {\r\n this.lightOn = false;\r\n this.light.visible = false;\r\n }", "function toggle() {\n setIsToggledOn(prev => !prev)\n }", "switchNightView(){\n this.state.appSettings.nightView = !this.state.appSettings.nightView;\n }", "function toggleTmiMode() {\n tmiModeExpanded = !tmiModeExpanded;\n\n $('collapse').style.display =\n tmiModeExpanded ? 'inline' : 'none';\n $('expand').style.display =\n tmiModeExpanded ? 'none' : 'inline';\n\n document.body.className =\n tmiModeExpanded ? 'show-tmi-mode' : 'hide-tmi-mode';\n\n browserProxy.saveShowDetailsToPrefs(tmiModeExpanded);\n}", "toggleAudio(){\n this._audioOnOff = !this._audioOnOff;\n }", "function toggleInstruction () {\r\n\tlet instructions = document.getElementById('instruction');\r\n\tlet instructionHeader = document.getElementById('instruction-header');\r\n\tinstructions.classList.toggle('instruction-show');\r\n\tinstructions.classList.toggle('instruction-hidden');\r\n}", "function animate(){\n document.getElementById(\"eY\").value=eulernum;\n document.getElementById(\"TeaeY\").value=TeaeulerY; \n if (document.getElementById(\"reflect\").checked){\n Toggle=1.0\n }\n else if(document.getElementById(\"refraction\").checked){\n Toggle =0.0\n }\n else {\n Toggle =0.5\n }\n}", "action() {\n\t\tthis.toggle();\n\t}", "action() {\n\t\tthis.toggle();\n\t}", "action() {\n\t\tthis.toggle();\n\t}", "function toggleMode(){\n if(mode == 3){\n mode = 2;\n console.log(\"RC mode : 2\");\n }else{\n mode = 3;\n console.log(\"RC mode : 3\");\n }\n }", "changeMainDispaly(none_block){\n if(none_block==='none'){\n document.getElementById(this.main).style.display = none_block\n document.getElementById(this.spinner).style.display = 'block'\n }else if(none_block==='block'){\n document.getElementById(this.spinner).style.display = 'none'\n document.getElementById(this.main).style.display = none_block\n }\n }", "function SwitchMeasurementUnits(){\n\tvar placeholderMm = '0.0';\n\tvar placeholderInches = '0.000';\n\t\t\n\t// Disable print view when switching between units\n\tEnablePrintView(false);\n\t\t\n\t// Flip the toggle\n\t_buttonState = !_buttonState;\n\t\n\t// Null out all current values when toggling between units\n\t// We don't wish to convert them\n\tjQuery('#item-length').val(null);\n\tjQuery('#item-width').val(null);\n\tjQuery('#item-height').val(null);\n\tjQuery('#item-length').attr(\"placeholder\", _buttonState ? placeholderMm : placeholderInches);\n\tjQuery('#item-width').attr(\"placeholder\", _buttonState ? placeholderMm : placeholderInches);\n\tjQuery('#item-height').attr(\"placeholder\", _buttonState ? placeholderMm : placeholderInches);\n\tjQuery('#plywood-thickness').val(null);\n\tjQuery('#frame-thickness').val(null);\n\tjQuery('#padding-thickness').val(null);\n\tjQuery('#plywood-thickness').attr(\"placeholder\", _buttonState ? \"9.5\" : \"0.375\");\n\tjQuery('#frame-thickness').attr(\"placeholder\", _buttonState ? \"38.0\" : \"1.500\");\n\tjQuery('#padding-thickness').attr(\"placeholder\", _buttonState ? \"25.4\" : \"1.000\");\n\n\tUpdatePageText();\n}", "function toggleSequence() {\n if (!isRandom) {\n isRandom = true;\n toggle_sequence.innerHTML = \"Random\";\n } else {\n isRandom = false;\n toggle_sequence.innerHTML = \"Sequential\";\n }\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 toggle() {\n setIsActive(!isActive);\n }", "switchSide() {\n this.player_side = this.player_side == PLAYER_1 ? PLAYER_2 : PLAYER_1;\n this.updateColor();\n }", "toggle () {\n this.opened = !this.opened;\n }", "toggle () {\n this.opened = !this.opened;\n }", "function leoToggleOn() {\n if ($(\"#custom\").text() === \"CUSTOM ON\"){\n switch (orbitToggle.leoP + orbitToggle.leoR + orbitToggle.leoD) {\n case 1:\n leoSatCustom.enabled = true;\n break;\n case 3:\n leoRocketCustom.enabled = true;\n break;\n case 5:\n leoDebrisCustom.enabled = true;\n break;\n case 4:\n leoSatCustom.enabled = true;\n leoRocketCustom.enabled = true;\n break;\n case 6:\n leoSatCustom.enabled = true;\n leoDebrisCustom.enabled = true;\n break;\n case 8:\n leoRocketCustom.enabled = true;\n leoDebrisCustom.enabled = true;\n break;\n case 9:\n leoSatCustom.enabled = true;\n leoRocketCustom.enabled = true;\n leoDebrisCustom.enabled = true;\n break;\n }\n } else {\n switch (orbitToggle.leoP + orbitToggle.leoR + orbitToggle.leoD) {\n case 1:\n leoSatLayer.enabled = true;\n break;\n case 3:\n leoRocketLayer.enabled = true;\n break;\n case 5:\n leoDebrisLayer.enabled = true;\n break;\n case 4:\n leoSatLayer.enabled = true;\n leoRocketLayer.enabled = true;\n break;\n case 6:\n leoSatLayer.enabled = true;\n leoDebrisLayer.enabled = true;\n break;\n case 8:\n leoRocketLayer.enabled = true;\n leoDebrisLayer.enabled = true;\n break;\n case 9:\n leoSatLayer.enabled = true;\n leoRocketLayer.enabled = true;\n leoDebrisLayer.enabled = true;\n break;\n }\n }\n }", "toggleDisplay(val) {\n\n let mainVisible = val\n\n this.props.toggleMain(mainVisible)\n }", "function switchTempUnit() {\r\n temperatureF = (temperatureC * 9 / 5 + 32).toFixed(2);\r\n var whatTemp = $(\"#tempUnit\").html();\r\n var whatTempCode = whatTemp.charCodeAt(0);\r\n $(\"#temp-display\").html(temperatureF);\r\n //If temperature is in celsius\r\n if (whatTempCode === 8451) {\r\n $(\"#temp-switch\").html('Switch to Celsius');\r\n $(\"#tempUnit\").html('&#8457');\r\n $(\"#temp-display\").html(temperatureF);\r\n tempUnit = '&#8457';\r\n tempType = 'imperial';\r\n } else {\r\n $(\"#temp-switch\").html('Switch to Farenheit');\r\n $(\"#tempUnit\").html('&#8451');\r\n $(\"#temp-display\").html(temperatureC);\r\n tempUnit = '&#8451';\r\n tempType = 'metric';\r\n }\r\n }", "function switchMainMenuMusic () { //Music OFF\n if (musicClick == 1) { //if i didn't click on the ON button yet so when musicClick equal is to 0 (0 = off with most of the things) then...\n audio.pause(); //Music on pause.\n STonOff.innerHTML = 'OFF'; //The text where ON stays now will be set to OFF so the player knows sound is off.\n musicClick = 0; //musicClick will now be set to 1 so the next time we click on ON or OFF this function will never activate because its not equal to 0 but to 1 now.\n }\n\n else if (musicClick == 0) { //Music ON || if the musicClick equal is to 1 then...\n audio.play(); //The music will start playing again.\n STonOff.innerHTML = 'ON'; //Text will be from OFF to ON now.\n musicClick = 1; //musicClick set to 0 so this function wont go on again.\n }\n}", "function optionSwitch() {\r\n\t//Standard banner - no extra options; no featured targets available, so desired result mode can't be used\r\n\tif (bannerTypes[0].checked) {\r\n\t\tsimTypes[1].disabled = \"disabled\";\r\n\t\tsimTypes[0].checked = \"checked\";\r\n\t\t\r\n\t\tguarantee4StarToggle.disabled = \"disabled\";\r\n\t\tguarantee5StarToggle.disabled = \"disabled\";\r\n\t\t\r\n\t\trealNonFeat4StarOdds.disabled = \"disabled\";\r\n\t\t\r\n\t\tfor (i=0; i < eventCharTargets.length; i++) {\r\n\t\t eventCharTargets[i].disabled = \"disabled\";\r\n\t }\r\n\t for (i=0; i < epitomizedPathOpts.length; i++) {\r\n\t\t epitomizedPathOpts[i].disabled = \"disabled\";\r\n\t }\r\n\t\tfatePointInput.disabled = \"disabled\";\r\n\t for (i=0; i < eventWeapTargets.length; i++) {\r\n\t\t eventWeapTargets[i].disabled = \"disabled\";\r\n\t }\r\n\t}\r\n\t//Event character banner - character to pursue, if desired result mode is on\r\n\telse if (bannerTypes[1].checked) {\r\n\t\tsimTypes[1].removeAttribute(\"disabled\");\r\n\t\t\r\n\t\tguarantee4StarToggle.removeAttribute(\"disabled\");\r\n\t\tguarantee5StarToggle.removeAttribute(\"disabled\");\r\n\t\t\r\n\t\trealNonFeat4StarOdds.removeAttribute(\"disabled\");\r\n\t\t\r\n\t\tif (simTypes[1].checked) {\r\n\t\t for (i=0; i < eventCharTargets.length; i++) {\r\n\t\t eventCharTargets[i].removeAttribute(\"disabled\");\r\n\t }\r\n\t\t}\r\n\t\telse {\r\n\t\t\tfor (i=0; i< eventCharTargets.length; i++) {\r\n\t\t\t\teventCharTargets[i].disabled = \"disabled\";\r\n\t\t\t}\r\n\t\t}\r\n\t for (i=0; i < epitomizedPathOpts.length; i++) {\r\n\t\t epitomizedPathOpts[i].disabled = \"disabled\";\r\n\t }\r\n\t\tfatePointInput.disabled = \"disabled\";\r\n\t for (i=0; i < eventWeapTargets.length; i++) {\r\n\t\t eventWeapTargets[i].disabled = \"disabled\";\r\n\t }\r\n\t}\r\n\t//Event weapon banner - Epitomized Path; character to pursue, if desired result mode is on\r\n\telse {\r\n\t\tsimTypes[1].removeAttribute(\"disabled\");\r\n\t\t\r\n\t\tguarantee4StarToggle.removeAttribute(\"disabled\");\r\n\t\tguarantee5StarToggle.removeAttribute(\"disabled\");\r\n\t\t\r\n\t\trealNonFeat4StarOdds.removeAttribute(\"disabled\");\r\n\t\t\r\n\t\tfor (i=0; i < eventCharTargets.length; i++) {\r\n\t\t eventCharTargets[i].disabled = \"disabled\";\r\n\t }\r\n\t for (i=0; i < epitomizedPathOpts.length; i++) {\r\n\t\t epitomizedPathOpts[i].removeAttribute(\"disabled\");\r\n\t }\r\n\t\tfatePointInput.removeAttribute(\"disabled\");\r\n\t\tif (simTypes[1].checked) {\r\n\t for (i=0; i < eventWeapTargets.length; i++) {\r\n\t\t eventWeapTargets[i].removeAttribute(\"disabled\");\r\n\t }\r\n\t\t}\r\n\t\telse {\r\n\t\t\tfor (i=0; i < eventWeapTargets.length; i++) {\r\n\t\t\t\teventWeapTargets[i].disabled = \"disabled\";\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}", "function toggleAuto(event) {\n if(autoSwitch.checked) {\n home.enableAutoOff();\n autoTemp.style.display = \"block\";\n }\n else {\n home.disableAutoOff();\n autoTemp.style.display = \"none\"; \n }\n}", "function ToggleScreen() {\n for (let z = 0; z <= 4; z++) {\n for (let a = 0; a <= 4; a++) {\n led.toggle(z, a)\n }\n }\n}", "function flipSwitch(){\n var id = this.id;\n if(this.checked){\n switch(id){\n case 'ambient':{\n gl.uniform1i( u_lights[0].enabled, 1 ); \n draw(); \n }\n break;\n case 'candles':{\n for (i = 1; i < 8; i++) {\n gl.uniform1i( u_lights[i].enabled, 1 );\n draw(); \n gl.uniform3f( u_material.emissiveColor,0,0, 0); \n } \n }\n break;\n case 'moon':{\n gl.uniform1i( u_lights[9].enabled, 1 );\n draw(); \n }\n break;\n case 'lamp':{\n gl.uniform1i( u_lights[8].enabled, 1 );\n draw(); \n }\n break;\n }\n }else{\n switch(id){\n \n case 'ambient':{\n gl.uniform1i( u_lights[0].enabled, 0 );\n gl.uniform3f( u_material.emissiveColor, 0, 0, 0 );\n draw(); \n }\n break;\n case 'candles':{\n for (i = 1; i < 8; i++) {\n gl.uniform1i( u_lights[i].enabled, 0 );\n gl.uniform3f( u_material.emissiveColor, 0, 0, 0 ); \n draw(); \n } \n }\n break;\n case 'moon':{\n gl.uniform1i( u_lights[9].enabled, 0 );\n gl.uniform3f( u_material.emissiveColor, 0, 0, 0 );\n draw(); \n }\n break;\n case 'lamp':{\n gl.uniform1i( u_lights[8].enabled, 0 );\n gl.uniform3f( u_material.emissiveColor, 0, 0, 0 );\n draw(); \n }\n break;\n }\n }\n}", "toggleDarkness() {\r\n if (this.state.darkness) {\r\n this.setAllVisible();\r\n this.setState({\r\n darkness: false\r\n })\r\n }\r\n else {\r\n this.checkVisible();\r\n this.setState({\r\n darkness: true\r\n })\r\n }\r\n }", "function displayAlternateUnitLinks()\n {\n // If alternate unit is not available for the current unit,\n // hide the alternate links element\n if (!alternateUnitAvailable(my.current.unitNo)) {\n alternateUnitLinks.style.visibility = 'hidden'\n return\n }\n\n // Delete all existing alternate unit links\n Util.removeChildren(alternateUnitLinks)\n\n // Create div elements for the main unit and alternate unit\n var mainUnitElement =\n boxedLink(Units.mainLabel,\n my.settings.unit == my.UNIT.MAIN,\n '#', toggleUnit)\n\n var alternateUnitElement =\n boxedLink(Units.alternateLabel,\n my.settings.unit == my.UNIT.ALTERNATE,\n '#', toggleUnit)\n\n alternateUnitLinks.appendChild(mainUnitElement)\n alternateUnitLinks.appendChild(alternateUnitElement)\n alternateUnitLinks.style.visibility = 'visible'\n }", "function changeBooleansToFalse() {\r\n demo = false;\r\n isLegalMovement = false;\r\n isBlackToolInsideJump = false;\r\n isWhiteToolInsideJump = false;\r\n isForcedJump = false;\r\n isToolTaken = false;\r\n isExtraForcedJump = false;\r\n}", "toggleTutorial() {\n if(this.wonGameStatus == false) {\n document.getElementById(\"dark-bg\").classList.toggle(\"d-none\");\n }\n }" ]
[ "0.6337465", "0.63069147", "0.62731224", "0.6251226", "0.6235556", "0.6194663", "0.6177884", "0.6143803", "0.608878", "0.6079503", "0.6077901", "0.602295", "0.5992622", "0.59773976", "0.5958581", "0.5950306", "0.5947523", "0.5947133", "0.59378153", "0.59265465", "0.5925762", "0.5912037", "0.5893966", "0.5893138", "0.5882677", "0.5880027", "0.5871889", "0.58697814", "0.5857058", "0.5849993", "0.5848524", "0.5828245", "0.58252174", "0.5820513", "0.58082527", "0.58082527", "0.57713234", "0.57624865", "0.5761577", "0.5757801", "0.5747443", "0.57305044", "0.57225525", "0.57212967", "0.5701917", "0.5698253", "0.5695288", "0.56747246", "0.5673473", "0.5671282", "0.5665335", "0.5665179", "0.56609315", "0.56545025", "0.5652263", "0.56508607", "0.5643977", "0.56181717", "0.56004965", "0.55983394", "0.55963206", "0.5589736", "0.5586119", "0.5586119", "0.5586119", "0.5585505", "0.5577521", "0.5577521", "0.5574243", "0.55697", "0.55670315", "0.5561993", "0.5552135", "0.55499476", "0.55459565", "0.55415154", "0.55356133", "0.55356133", "0.55356133", "0.5530445", "0.5527361", "0.5525533", "0.5519119", "0.55188745", "0.55132884", "0.55104125", "0.55096555", "0.55096555", "0.55057794", "0.5501035", "0.55009675", "0.5499631", "0.5499219", "0.5498385", "0.5497987", "0.5496414", "0.5494917", "0.5494315", "0.54902554", "0.5489717" ]
0.72000253
0